43 const int world_start = (world == 0) ? 0 : ((world == 1) ? 0x40 : 0x80);
44 const int world_count = (world == 2) ? 32 : 64;
46 ImGui::Text(tr(
"Map Usage Grid (World %d)"), world);
49 if (ImGui::BeginTable(
51 ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit)) {
52 for (
int y = 0; y < 8; y++) {
53 ImGui::TableNextRow();
54 for (
int x = 0; x < 8; x++) {
55 ImGui::TableNextColumn();
56 const int local_id = y * 8 + x;
57 if (local_id >= world_count) {
58 ImGui::TextDisabled(
"--");
62 const int map_id = world_start + local_id;
65 ImGui::TextDisabled(
"??");
69 ImVec4 area_color = ImVec4(0.35f, 0.55f, 0.35f, 1.0f);
70 const char* area_label =
"Small";
71 switch (map->area_size()) {
73 area_color = ImVec4(0.65f, 0.52f, 0.28f, 1.0f);
77 area_color = ImVec4(0.30f, 0.50f, 0.72f, 1.0f);
81 area_color = ImVec4(0.55f, 0.40f, 0.72f, 1.0f);
89 const ImVec4 area_hover(area_color.x + 0.1f, area_color.y + 0.1f,
90 area_color.z + 0.1f, 1.0f);
91 const std::string button_id =
92 absl::StrFormat(
"%02X##usage_map_%d", map_id, map_id);
95 {{ImGuiCol_Button, area_color},
96 {ImGuiCol_ButtonHovered, area_hover},
97 {ImGuiCol_ButtonActive, area_color}});
98 ImGui::Button(button_id.c_str(), ImVec2(34.0f, 0.0f));
101 if (ImGui::IsItemHovered()) {
102 ImGui::BeginTooltip();
103 ImGui::Text(tr(
"Map %02X (%s)"), map_id, area_label);
104 ImGui::Text(tr(
"Parent: %02X"), map->parent());
105 ImGui::Text(tr(
"Quadrant: %d"), map->large_index());