diff options
| author | ilotterytea <iltsu@alright.party> | 2025-02-01 22:22:21 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-02-01 22:22:21 +0500 |
| commit | 6317119d02897c13f3f90ade86446f110b852ed7 (patch) | |
| tree | 164bc9e817d6f242ed7c3df0fd01967929ace1e6 /src/editor.cpp | |
| parent | 860773932a67fa0a30c5943336bef6e0be0414a1 (diff) | |
feat: show selected tile
Diffstat (limited to 'src/editor.cpp')
| -rw-r--r-- | src/editor.cpp | 18 |
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, |
