From cc245979835ca6c88c90d00f5079193f579eafeb Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 13 Mar 2026 10:18:31 -0700 Subject: [PATCH] feat: show hearthstone bind zone name in tooltip instead of continent --- include/game/game_handler.hpp | 2 ++ src/game/game_handler.cpp | 1 + src/ui/game_screen.cpp | 24 +++++++++++++++++------- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/include/game/game_handler.hpp b/include/game/game_handler.hpp index 0f1320b4..325e3bb1 100644 --- a/include/game/game_handler.hpp +++ b/include/game/game_handler.hpp @@ -218,6 +218,7 @@ public: pos = homeBindPos_; return true; } + uint32_t getHomeBindZoneId() const { return homeBindZoneId_; } /** * Send a movement packet @@ -2466,6 +2467,7 @@ private: uint32_t currentMapId_ = 0; bool hasHomeBind_ = false; uint32_t homeBindMapId_ = 0; + uint32_t homeBindZoneId_ = 0; glm::vec3 homeBindPos_{0.0f}; // ---- Phase 1: Name caches ---- diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 8803257a..7a6dac2e 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -3546,6 +3546,7 @@ void GameHandler::handlePacket(network::Packet& packet) { bool wasSet = hasHomeBind_; hasHomeBind_ = true; homeBindMapId_ = data.mapId; + homeBindZoneId_ = data.zoneId; homeBindPos_ = canonical; if (bindPointCallback_) { bindPointCallback_(data.mapId, canonical.x, canonical.y, canonical.z); diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 9a462959..4208d833 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -6815,14 +6815,24 @@ void GameScreen::renderActionBar(game::GameHandler& gameHandler) { if (slot.id == 8690) { uint32_t mapId = 0; glm::vec3 pos; if (gameHandler.getHomeBind(mapId, pos)) { - const char* mapName = "Unknown"; - switch (mapId) { - case 0: mapName = "Eastern Kingdoms"; break; - case 1: mapName = "Kalimdor"; break; - case 530: mapName = "Outland"; break; - case 571: mapName = "Northrend"; break; + std::string homeLocation; + // Zone name (from zoneId stored in bind point) + uint32_t zoneId = gameHandler.getHomeBindZoneId(); + if (zoneId != 0) { + homeLocation = gameHandler.getWhoAreaName(zoneId); } - ImGui::TextColored(ImVec4(0.8f, 0.9f, 1.0f, 1.0f), "Home: %s", mapName); + // Fall back to continent name if zone unavailable + if (homeLocation.empty()) { + switch (mapId) { + case 0: homeLocation = "Eastern Kingdoms"; break; + case 1: homeLocation = "Kalimdor"; break; + case 530: homeLocation = "Outland"; break; + case 571: homeLocation = "Northrend"; break; + default: homeLocation = "Unknown"; break; + } + } + ImGui::TextColored(ImVec4(0.8f, 0.9f, 1.0f, 1.0f), + "Home: %s", homeLocation.c_str()); } } if (outOfRange) {