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