From 7475a4fff3067be47ab2023d67ab23784b25d819 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 12 Mar 2026 04:27:26 -0700 Subject: [PATCH] feat: add persistent coordinate display below minimap Always-visible player coordinates (X, Y in canonical WoW space) rendered as warm-yellow text on a semi-transparent pill just below the minimap circle, eliminating the need to hover for position info. --- src/ui/game_screen.cpp | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 6b72c1ca..f634609e 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -12074,17 +12074,37 @@ void GameScreen::renderMinimapMarkers(game::GameHandler& gameHandler) { } } + // Persistent coordinate display below the minimap + { + glm::vec3 playerCanon = core::coords::renderToCanonical(playerRender); + char coordBuf[32]; + std::snprintf(coordBuf, sizeof(coordBuf), "%.1f, %.1f", playerCanon.x, playerCanon.y); + + ImFont* font = ImGui::GetFont(); + float fontSize = ImGui::GetFontSize(); + ImVec2 textSz = font->CalcTextSizeA(fontSize, FLT_MAX, 0.0f, coordBuf); + + float tx = centerX - textSz.x * 0.5f; + float ty = centerY + mapRadius + 3.0f; + + // Semi-transparent dark background pill + float pad = 3.0f; + drawList->AddRectFilled( + ImVec2(tx - pad, ty - pad), + ImVec2(tx + textSz.x + pad, ty + textSz.y + pad), + IM_COL32(0, 0, 0, 140), 4.0f); + // Coordinate text in warm yellow + drawList->AddText(font, fontSize, ImVec2(tx, ty), IM_COL32(230, 220, 140, 255), coordBuf); + } + // Hover tooltip: show player's WoW coordinates (canonical X=North, Y=West) { ImVec2 mouse = ImGui::GetMousePos(); float mdx = mouse.x - centerX; float mdy = mouse.y - centerY; if (mdx * mdx + mdy * mdy <= mapRadius * mapRadius) { - glm::vec3 playerCanon = core::coords::renderToCanonical(playerRender); ImGui::BeginTooltip(); - ImGui::TextColored(ImVec4(0.9f, 0.9f, 0.5f, 1.0f), - "%.1f, %.1f", playerCanon.x, playerCanon.y); - ImGui::TextDisabled("Ctrl+click to ping"); + ImGui::TextColored(ImVec4(0.9f, 0.9f, 0.5f, 1.0f), "Ctrl+click to ping"); ImGui::EndTooltip(); } }