From 92787901d8e86f9452ad48af21d62b7ccb31f941 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 5 May 2026 22:23:18 -0700 Subject: [PATCH] feat(editor): tile count button in ADT load dialog "Count" button next to "Find Tile" scans all 64x64 tile coordinates and shows how many ADT tiles exist for the selected map. Helps users understand the scope of a map before loading individual tiles. --- tools/editor/editor_ui.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/editor/editor_ui.cpp b/tools/editor/editor_ui.cpp index 1e13d491..351187b1 100644 --- a/tools/editor/editor_ui.cpp +++ b/tools/editor/editor_ui.cpp @@ -802,6 +802,21 @@ void EditorUI::renderLoadDialog(EditorApp& app) { if (!found) app.showToast("No ADT tiles found for this map"); } if (ImGui::IsItemHovered()) ImGui::SetTooltip("Auto-find first available tile"); + + // Count total tiles for this map + ImGui::SameLine(); + if (ImGui::SmallButton("Count")) { + int total = 0; + for (int x = 0; x < 64; x++) { + for (int y = 0; y < 64; y++) { + std::string tp = "world\\maps\\" + mapLower + "\\" + mapLower + "_" + + std::to_string(x) + "_" + std::to_string(y) + ".adt"; + if (app.getAssetManager()->getManifest().hasEntry(tp)) total++; + } + } + app.showToast(mapLower + ": " + std::to_string(total) + " tiles"); + } + if (ImGui::IsItemHovered()) ImGui::SetTooltip("Count total ADT tiles for this map"); } ImGui::Spacing();