fix: the map's zoom buttons reach the map, and the player frame is told its own values

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.
This commit is contained in:
Kelsi
2026-08-02 08:26:22 -07:00
parent cea84e573c
commit daa7c37d88
3 changed files with 37 additions and 1 deletions

View File

@@ -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();
}

View File

@@ -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"});
}
}

View File

@@ -143,7 +143,9 @@ std::vector<std::string> 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"},