From 891b9e5822cabfc3fa3be51d23e63b4de11be4ec Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 24 Mar 2026 13:20:06 -0700 Subject: [PATCH] fix: show friendly map names on loading screen (Outland not Expansion01) Add mapDisplayName() with friendly names for continents: "Eastern Kingdoms", "Kalimdor", "Outland", "Northrend". The loading screen previously showed WDT directory names like "Expansion01" when Map.dbc's localized name field was empty or matched the internal name. --- include/core/application.hpp | 1 + src/core/application.cpp | 30 +++++++++++++++++++++++------- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/include/core/application.hpp b/include/core/application.hpp index a22a210e..9004ebe4 100644 --- a/include/core/application.hpp +++ b/include/core/application.hpp @@ -97,6 +97,7 @@ private: void spawnPlayerCharacter(); std::string getPlayerModelPath() const; static const char* mapIdToName(uint32_t mapId); + static const char* mapDisplayName(uint32_t mapId); void loadOnlineWorldTerrain(uint32_t mapId, float x, float y, float z); void buildFactionHostilityMap(uint8_t playerRace); pipeline::M2Model loadCreatureM2Sync(const std::string& m2Path); diff --git a/src/core/application.cpp b/src/core/application.cpp index 73ea9cb4..db1f99a0 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -87,6 +87,17 @@ bool envFlagEnabled(const char* key, bool defaultValue = false) { } // namespace +const char* Application::mapDisplayName(uint32_t mapId) { + // Friendly display names for the loading screen + switch (mapId) { + case 0: return "Eastern Kingdoms"; + case 1: return "Kalimdor"; + case 530: return "Outland"; + case 571: return "Northrend"; + default: return nullptr; + } +} + const char* Application::mapIdToName(uint32_t mapId) { // Fallback when Map.dbc is unavailable. Names must match WDT directory names // (case-insensitive — AssetManager lowercases all paths). @@ -4468,13 +4479,18 @@ void Application::loadOnlineWorldTerrain(uint32_t mapId, float x, float y, float window->swapBuffers(); }; - // Set zone name on loading screen from Map.dbc - if (gameHandler) { - std::string mapDisplayName = gameHandler->getMapName(mapId); - if (!mapDisplayName.empty()) - loadingScreen.setZoneName(mapDisplayName); - else - loadingScreen.setZoneName("Loading..."); + // Set zone name on loading screen — prefer friendly display name, then DBC + { + const char* friendly = mapDisplayName(mapId); + if (friendly) { + loadingScreen.setZoneName(friendly); + } else if (gameHandler) { + std::string dbcName = gameHandler->getMapName(mapId); + if (!dbcName.empty()) + loadingScreen.setZoneName(dbcName); + else + loadingScreen.setZoneName("Loading..."); + } } showProgress("Entering world...", 0.0f);