mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
feat: show hearthstone bind zone name in tooltip instead of continent
This commit is contained in:
parent
b03c326bcd
commit
cc24597983
3 changed files with 20 additions and 7 deletions
|
|
@ -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 ----
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue