From daa7c37d88d5ea7039d4fd6ce23a67bf8ea7cb6c Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sun, 2 Aug 2026 08:26:22 -0700 Subject: [PATCH] fix: the map's zoom buttons reach the map, and the player frame is told its own values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Minimap:SetZoom is the interface saying what it wants, not the map changing — the buttons moved a number on the frame and nothing acted on it. Five levels as WoW has them, zero furthest out, applied to the view radius the map actually draws with. Every UNIT_ event this client sends is a change notice: it fires when an update block carries a different number. That is right for keeping a frame current and useless for filling one in, because a frame built before the player existed has missed all of them and nothing will change health or level just because someone is looking. The original interface fills its unit frames on PLAYER_ENTERING_WORLD and reads the current values rather than the event's, so saying them again there is enough. The paperdoll's resistance and attribute frames join the takeover check, so the next run reports where they landed. --- src/core/application.cpp | 15 +++++++++++++++ src/game/game_handler_callbacks.cpp | 19 +++++++++++++++++++ src/ui/framexml_takeover.cpp | 4 +++- 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/core/application.cpp b/src/core/application.cpp index 8919256b..e3a4a9e1 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -2954,6 +2954,21 @@ void Application::render() { map->setScreenRect(mm->left * sc, io.DisplaySize.y - (mm->bottom + mm->rectH) * sc, mm->rectW * sc, mm->rectH * sc); + + // The zoom buttons move a number on the frame, and the + // map has to be told: Minimap:SetZoom is the interface + // saying what it wants, not the map changing. Five + // levels as WoW has them, zero furthest out. + static int appliedZoom = -1; + if (mm->zoomLevel != appliedZoom) { + appliedZoom = mm->zoomLevel; + static const float kRadius[5] = { + 800.0f, 620.0f, 460.0f, 320.0f, 200.0f + }; + const int lvl = (mm->zoomLevel < 0) ? 0 + : (mm->zoomLevel > 4 ? 4 : mm->zoomLevel); + map->setViewRadius(kRadius[lvl]); + } } else { map->clearScreenRect(); } diff --git a/src/game/game_handler_callbacks.cpp b/src/game/game_handler_callbacks.cpp index 2d3b2202..f9f753f8 100644 --- a/src/game/game_handler_callbacks.cpp +++ b/src/game/game_handler_callbacks.cpp @@ -926,6 +926,25 @@ void GameHandler::handleLoginVerifyWorld(network::Packet& packet) { if (initialWorldEntry) { fireAddonEvent("PLAYER_LOGIN", {}); } + + // The player's own values, said again now. + // + // Every UNIT_ event this client sends is a change notice: it fires when + // an update block carries a different number. That is right for keeping + // a frame current and useless for filling one in, because a frame built + // before the player existed has missed every one of them and nothing + // will change health or level just because someone is looking. The + // original interface fills its unit frames on PLAYER_ENTERING_WORLD for + // exactly this reason, and it reads the current values rather than the + // event's — so the event alone is enough, and this is where it belongs. + for (const char* what : {"UNIT_HEALTH", "UNIT_MAXHEALTH", "UNIT_LEVEL", + "UNIT_DISPLAYPOWER", "UNIT_MANA", "UNIT_MAXMANA", + "UNIT_RAGE", "UNIT_MAXRAGE", "UNIT_ENERGY", + "UNIT_MAXENERGY", "UNIT_FOCUS", "UNIT_MAXFOCUS", + "UNIT_NAME_UPDATE", "UNIT_FACTION"}) { + fireAddonEvent(what, {"player"}); + } + fireAddonEvent("PLAYER_XP_UPDATE", {"player"}); } } diff --git a/src/ui/framexml_takeover.cpp b/src/ui/framexml_takeover.cpp index cb14f8cb..d2d173d7 100644 --- a/src/ui/framexml_takeover.cpp +++ b/src/ui/framexml_takeover.cpp @@ -143,7 +143,9 @@ std::vector frameXmlCheckFrames() { {UiElement::WorldMap, "WorldMapFrame WorldMapDetailFrame WorldMapButton " "WorldMapZoneMinimapDropDown"}, {UiElement::CharacterFrame, "CharacterFrame PaperDollFrame CharacterModelFrame " - "CharacterNameText CharacterHeadSlot"}, + "CharacterNameText CharacterHeadSlot " + "CharacterResistanceFrame CharacterAttributesFrame " + "MagicResFrame1 CharacterMainHandSlot"}, {UiElement::Bags, "ContainerFrame1 ContainerFrame1Item1 " "ContainerFrame1Name"}, {UiElement::Spellbook, "SpellBookFrame SpellButton1 SpellBookSkillLineTab1"},