feat: show hearthstone bind zone name in tooltip instead of continent

This commit is contained in:
Kelsi 2026-03-13 10:18:31 -07:00
parent b03c326bcd
commit cc24597983
3 changed files with 20 additions and 7 deletions

View file

@ -218,6 +218,7 @@ public:
pos = homeBindPos_; pos = homeBindPos_;
return true; return true;
} }
uint32_t getHomeBindZoneId() const { return homeBindZoneId_; }
/** /**
* Send a movement packet * Send a movement packet
@ -2466,6 +2467,7 @@ private:
uint32_t currentMapId_ = 0; uint32_t currentMapId_ = 0;
bool hasHomeBind_ = false; bool hasHomeBind_ = false;
uint32_t homeBindMapId_ = 0; uint32_t homeBindMapId_ = 0;
uint32_t homeBindZoneId_ = 0;
glm::vec3 homeBindPos_{0.0f}; glm::vec3 homeBindPos_{0.0f};
// ---- Phase 1: Name caches ---- // ---- Phase 1: Name caches ----

View file

@ -3546,6 +3546,7 @@ void GameHandler::handlePacket(network::Packet& packet) {
bool wasSet = hasHomeBind_; bool wasSet = hasHomeBind_;
hasHomeBind_ = true; hasHomeBind_ = true;
homeBindMapId_ = data.mapId; homeBindMapId_ = data.mapId;
homeBindZoneId_ = data.zoneId;
homeBindPos_ = canonical; homeBindPos_ = canonical;
if (bindPointCallback_) { if (bindPointCallback_) {
bindPointCallback_(data.mapId, canonical.x, canonical.y, canonical.z); bindPointCallback_(data.mapId, canonical.x, canonical.y, canonical.z);

View file

@ -6815,14 +6815,24 @@ void GameScreen::renderActionBar(game::GameHandler& gameHandler) {
if (slot.id == 8690) { if (slot.id == 8690) {
uint32_t mapId = 0; glm::vec3 pos; uint32_t mapId = 0; glm::vec3 pos;
if (gameHandler.getHomeBind(mapId, pos)) { if (gameHandler.getHomeBind(mapId, pos)) {
const char* mapName = "Unknown"; std::string homeLocation;
switch (mapId) { // Zone name (from zoneId stored in bind point)
case 0: mapName = "Eastern Kingdoms"; break; uint32_t zoneId = gameHandler.getHomeBindZoneId();
case 1: mapName = "Kalimdor"; break; if (zoneId != 0) {
case 530: mapName = "Outland"; break; homeLocation = gameHandler.getWhoAreaName(zoneId);
case 571: mapName = "Northrend"; break;
} }
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) { if (outOfRange) {