summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-02-01 22:22:21 +0500
committerilotterytea <iltsu@alright.party>2025-02-01 22:22:21 +0500
commit6317119d02897c13f3f90ade86446f110b852ed7 (patch)
tree164bc9e817d6f242ed7c3df0fd01967929ace1e6 /src
parent860773932a67fa0a30c5943336bef6e0be0414a1 (diff)
feat: show selected tile
Diffstat (limited to 'src')
-rw-r--r--src/editor.cpp18
1 files changed, 18 insertions, 0 deletions
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,