From d31c483944442fa37dea3d79510678b074b87f9b Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 11 Mar 2026 22:47:17 -0700 Subject: [PATCH] Add player position arrow to minimap Draws a yellow directional arrow at the minimap center showing the player's facing direction, with a white dot at the player's position. The arrow rotates with the camera in rotate-with-camera mode and always points in the player's current facing direction. --- src/ui/game_screen.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index a0cca663..852a5d00 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -10412,6 +10412,27 @@ void GameScreen::renderMinimapMarkers(game::GameHandler& gameHandler) { return true; }; + // Player position marker — always drawn at minimap center with a directional arrow. + { + // The player is always at centerX, centerY on the minimap. + // Draw a yellow arrow pointing in the player's facing direction. + glm::vec3 fwd = camera->getForward(); + float facing = std::atan2(-fwd.x, fwd.y); // bearing relative to north + float cosF = std::cos(facing - bearing); + float sinF = std::sin(facing - bearing); + float arrowLen = 8.0f; + float arrowW = 4.0f; + ImVec2 tip(centerX + sinF * arrowLen, centerY - cosF * arrowLen); + ImVec2 left(centerX - cosF * arrowW - sinF * arrowLen * 0.3f, + centerY - sinF * arrowW + cosF * arrowLen * 0.3f); + ImVec2 right(centerX + cosF * arrowW - sinF * arrowLen * 0.3f, + centerY + sinF * arrowW + cosF * arrowLen * 0.3f); + drawList->AddTriangleFilled(tip, left, right, IM_COL32(255, 220, 0, 255)); + drawList->AddTriangle(tip, left, right, IM_COL32(0, 0, 0, 180), 1.0f); + // White dot at player center + drawList->AddCircleFilled(ImVec2(centerX, centerY), 2.5f, IM_COL32(255, 255, 255, 220)); + } + // Optional base nearby NPC dots (independent of quest status packets). if (minimapNpcDots_) { for (const auto& [guid, entity] : gameHandler.getEntityManager().getEntities()) {