From 6317119d02897c13f3f90ade86446f110b852ed7 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 1 Feb 2025 22:22:21 +0500 Subject: feat: show selected tile --- src/editor.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/editor.cpp') diff --git a/src/editor.cpp b/src/editor.cpp index 65e9cf4..4b8396d 100644 --- a/src/editor.cpp +++ b/src/editor.cpp @@ -52,6 +52,24 @@ namespace silly::editor { ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar); + // --- SELECTED TILE --- + if (this->selectedTile.has_value()) { + TilesetTile *t = this->selectedTile->get(); + + if (t->id == TILE_FLOOR) { + ImGui::Text("FLOOR"); + } else if (t->id == TILE_WALL) { + ImGui::Text("WALL"); + } else { + ImGui::Text("UNKNOWN"); + } + + ImGui::Image(t->texture, sf::Vector2f(64, 64)); + } else { + ImGui::Text("NO TILE SELECTED!"); + ImGui::Dummy(ImVec2(64, 64)); + } + // --- TILE SELECTION --- ImGui::BeginChild("TileSelectionRegion", ImVec2(0, 400), ImGuiChildFlags_Border, -- cgit v1.2.3