41 const int world_start = (world == 0) ? 0 : ((world == 1) ? 0x40 : 0x80);
42 const int world_count = (world == 2) ? 32 : 64;
44 ImGui::Text(
"Map Usage Grid (World %d)", world);
47 if (ImGui::BeginTable(
49 ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit)) {
50 for (
int y = 0; y < 8; y++) {
51 ImGui::TableNextRow();
52 for (
int x = 0; x < 8; x++) {
53 ImGui::TableNextColumn();
54 const int local_id = y * 8 + x;
55 if (local_id >= world_count) {
56 ImGui::TextDisabled(
"--");
60 const int map_id = world_start + local_id;
63 ImGui::TextDisabled(
"??");
67 ImVec4 area_color = ImVec4(0.35f, 0.55f, 0.35f, 1.0f);
68 const char* area_label =
"Small";
69 switch (map->area_size()) {
71 area_color = ImVec4(0.65f, 0.52f, 0.28f, 1.0f);
75 area_color = ImVec4(0.30f, 0.50f, 0.72f, 1.0f);
79 area_color = ImVec4(0.55f, 0.40f, 0.72f, 1.0f);
87 ImGui::PushStyleColor(ImGuiCol_Button, area_color);
88 ImGui::PushStyleColor(ImGuiCol_ButtonHovered,
89 ImVec4(area_color.x + 0.1f, area_color.y + 0.1f,
90 area_color.z + 0.1f, 1.0f));
91 ImGui::PushStyleColor(ImGuiCol_ButtonActive, area_color);
92 const std::string button_id =
93 absl::StrFormat(
"%02X##usage_map_%d", map_id, map_id);
94 ImGui::Button(button_id.c_str(), ImVec2(34.0f, 0.0f));
95 ImGui::PopStyleColor(3);
97 if (ImGui::IsItemHovered()) {
98 ImGui::BeginTooltip();
99 ImGui::Text(
"Map %02X (%s)", map_id, area_label);
100 ImGui::Text(
"Parent: %02X", map->parent());
101 ImGui::Text(
"Quadrant: %d", map->large_index());