From e96602b8cad9de3fae3ce8324b5fb5b467934213 Mon Sep 17 00:00:00 2001 From: scawful Date: Sun, 9 Jun 2024 19:13:02 -0400 Subject: [PATCH] add entrance metadata to usage stats --- src/app/editor/overworld_editor.cc | 15 +++++++++++++++ src/app/editor/overworld_editor.h | 1 - 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/app/editor/overworld_editor.cc b/src/app/editor/overworld_editor.cc index a4ce3581..9ea34576 100644 --- a/src/app/editor/overworld_editor.cc +++ b/src/app/editor/overworld_editor.cc @@ -1867,6 +1867,18 @@ absl::Status OverworldEditor::UpdateUsageStats() { selected_usage_map_ = overworld_.entrances().at(i).map_id_; properties_canvas_.set_highlight_tile_id(selected_usage_map_); } + if (ImGui::IsItemHovered()) { + ImGui::BeginTooltip(); + ImGui::Text("Entrance ID: %d", i); + ImGui::Text("Map ID: %d", overworld_.entrances().at(i).map_id_); + ImGui::Text("Entrance ID: %d", + overworld_.entrances().at(i).entrance_id_); + ImGui::Text("X: %d", overworld_.entrances().at(i).x_); + ImGui::Text("Y: %d", overworld_.entrances().at(i).y_); + ImGui::Text("Deleted? %s", + overworld_.entrances().at(i).deleted ? "Yes" : "No"); + ImGui::EndTooltip(); + } } ImGui::EndChild(); @@ -1886,6 +1898,9 @@ void OverworldEditor::CalculateUsageStats() { each_entrance.map_id_ >= (current_world_ * 0x40)) { entrance_usage[each_entrance.entrance_id_]++; } + + if (each_entrance.deleted == true) + unused_entrances_.push_back(each_entrance.entrance_id_); } } diff --git a/src/app/editor/overworld_editor.h b/src/app/editor/overworld_editor.h index e276a845..4a946d89 100644 --- a/src/app/editor/overworld_editor.h +++ b/src/app/editor/overworld_editor.h @@ -262,7 +262,6 @@ class OverworldEditor : public Editor, gfx::BitmapTable maps_bmp_; gfx::BitmapTable current_graphics_set_; gfx::BitmapTable sprite_previews_; - gfx::BitmapTable animated_maps_; gui::zeml::Node layout_node_;