feat: show zone and map names in character selection screen

Replace raw zone/map IDs with human-readable names via the existing
getWhoAreaName() and getMapName() DBC caches. The Zone column is also
widened from fixed 55px to a stretch column so names fit properly.
Falls back to numeric IDs gracefully when DBC data is unavailable.
This commit is contained in:
Kelsi 2026-03-13 08:43:11 -07:00
parent 2b79f9d121
commit 3e85c78790

View file

@ -184,7 +184,7 @@ void CharacterScreen::render(game::GameHandler& gameHandler) {
ImGui::TableSetupColumn("Level", ImGuiTableColumnFlags_WidthFixed, 45.0f);
ImGui::TableSetupColumn("Race", ImGuiTableColumnFlags_WidthStretch, 1.0f);
ImGui::TableSetupColumn("Class", ImGuiTableColumnFlags_WidthStretch, 1.2f);
ImGui::TableSetupColumn("Zone", ImGuiTableColumnFlags_WidthFixed, 55.0f);
ImGui::TableSetupColumn("Zone", ImGuiTableColumnFlags_WidthStretch, 1.5f);
ImGui::TableSetupScrollFreeze(0, 1);
ImGui::TableHeadersRow();
@ -227,7 +227,13 @@ void CharacterScreen::render(game::GameHandler& gameHandler) {
ImGui::Text("%s", game::getClassName(character.characterClass));
ImGui::TableSetColumnIndex(4);
ImGui::Text("%d", character.zoneId);
{
std::string zoneName = gameHandler.getWhoAreaName(character.zoneId);
if (!zoneName.empty())
ImGui::TextUnformatted(zoneName.c_str());
else
ImGui::Text("%u", character.zoneId);
}
}
ImGui::EndTable();
@ -328,7 +334,18 @@ void CharacterScreen::render(game::GameHandler& gameHandler) {
ImGui::Text("%s", game::getClassName(character.characterClass));
ImGui::Text("%s", game::getGenderName(character.gender));
ImGui::Spacing();
ImGui::Text("Map %d, Zone %d", character.mapId, character.zoneId);
{
std::string mapName = gameHandler.getMapName(character.mapId);
std::string zoneName = gameHandler.getWhoAreaName(character.zoneId);
if (!mapName.empty() && !zoneName.empty())
ImGui::Text("%s — %s", mapName.c_str(), zoneName.c_str());
else if (!mapName.empty())
ImGui::Text("%s (Zone %u)", mapName.c_str(), character.zoneId);
else if (!zoneName.empty())
ImGui::Text("Map %u — %s", character.mapId, zoneName.c_str());
else
ImGui::Text("Map %u, Zone %u", character.mapId, character.zoneId);
}
if (character.hasGuild()) {
ImGui::Text("Guild ID: %d", character.guildId);