feat: show zone name on loading screen during world transitions

Add setZoneName() to LoadingScreen and display the map name from Map.dbc
as large gold text with drop shadow above the progress bar. Shown in both
render() and renderOverlay() paths. Zone name is resolved from gameHandler's
getMapName(mapId) during world load. Improves feedback during zone transitions.
This commit is contained in:
Kelsi 2026-03-20 18:12:23 -07:00
parent ff1840415e
commit 71837ade19
3 changed files with 41 additions and 0 deletions

View file

@ -30,6 +30,7 @@ public:
void setProgress(float progress) { loadProgress = progress; }
void setStatus(const std::string& status) { statusText = status; }
void setZoneName(const std::string& name) { zoneName = name; }
// Must be set before initialize() for Vulkan texture upload
void setVkContext(VkContext* ctx) { vkCtx = ctx; }
@ -53,6 +54,7 @@ private:
float loadProgress = 0.0f;
std::string statusText = "Loading...";
std::string zoneName;
int imageWidth = 0;
int imageHeight = 0;

View file

@ -4286,6 +4286,15 @@ 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...");
}
showProgress("Entering world...", 0.0f);
// --- Clean up previous map's state on map change ---

View file

@ -261,6 +261,20 @@ void LoadingScreen::renderOverlay() {
ImVec2(0, 0), ImVec2(screenW, screenH));
}
// Zone name header
if (!zoneName.empty()) {
ImFont* font = ImGui::GetFont();
float zoneTextSize = 24.0f;
ImVec2 zoneSize = font->CalcTextSizeA(zoneTextSize, FLT_MAX, 0.0f, zoneName.c_str());
float zoneX = (screenW - zoneSize.x) * 0.5f;
float zoneY = screenH * 0.06f - 44.0f;
ImDrawList* dl = ImGui::GetWindowDrawList();
dl->AddText(font, zoneTextSize, ImVec2(zoneX + 2.0f, zoneY + 2.0f),
IM_COL32(0, 0, 0, 200), zoneName.c_str());
dl->AddText(font, zoneTextSize, ImVec2(zoneX, zoneY),
IM_COL32(255, 220, 120, 255), zoneName.c_str());
}
// Progress bar
{
const float barWidthFrac = 0.6f;
@ -332,6 +346,22 @@ void LoadingScreen::render() {
ImVec2(0, 0), ImVec2(screenW, screenH));
}
// Zone name header (large text centered above progress bar)
if (!zoneName.empty()) {
ImFont* font = ImGui::GetFont();
float zoneTextSize = 24.0f;
ImVec2 zoneSize = font->CalcTextSizeA(zoneTextSize, FLT_MAX, 0.0f, zoneName.c_str());
float zoneX = (screenW - zoneSize.x) * 0.5f;
float zoneY = screenH * 0.06f - 44.0f; // above percentage text
ImDrawList* dl = ImGui::GetWindowDrawList();
// Drop shadow
dl->AddText(font, zoneTextSize, ImVec2(zoneX + 2.0f, zoneY + 2.0f),
IM_COL32(0, 0, 0, 200), zoneName.c_str());
// Gold text
dl->AddText(font, zoneTextSize, ImVec2(zoneX, zoneY),
IM_COL32(255, 220, 120, 255), zoneName.c_str());
}
// Progress bar (top of screen)
{
const float barWidthFrac = 0.6f;