diff --git a/crates/benilla-app/assets/ui/CharacterFrame.xml b/crates/benilla-app/assets/ui/CharacterFrame.xml index 5386e79d..41583285 100644 --- a/crates/benilla-app/assets/ui/CharacterFrame.xml +++ b/crates/benilla-app/assets/ui/CharacterFrame.xml @@ -76,7 +76,7 @@ forced-show path). A real forced-highlight affordance is a `benilla-ui` follow-up, not blocking this slice — `BenillaPaperDollSlot_LockHighlight`/`_UnlockHighlight` below tint the slot's Quickslot2 ring instead, flagged at their own definition. - - The relic slot: **restored, and this note used to be wrong** (decision 1785). It read + - The relic slot: **restored, and this note used to be wrong** (decision 1796). It read "`UnitHasRelicSlot` is vanilla-always-false (there is no relic slot in 1.12), so the ref's branches are DEAD CODE" — they are not. `ChrClasses.dbc` field 16 is set for Paladin, Shaman and Druid, and INVSLOT 17 doubles as their relic slot. All four of the @@ -527,7 +527,7 @@ -- ref PaperDollFrame_OnShow (l.568-585): SetGuild OMITTED (named deferral, this file's -- header). The relic branch (l.580-584) is transcribed verbatim — a relic class has no -- ranged weapon and therefore no ammo, so its ammo slot hides. This used to be dropped on - -- the belief that UnitHasRelicSlot is always false; decision 1785. + -- the belief that UnitHasRelicSlot is always false; decision 1796. function PaperDollFrame_OnShow() paintRows(paperDollRows) if UnitHasRelicSlot("player") then @@ -823,7 +823,7 @@ end -- ref PaperDollFrame_SetRangedAttack (l.419-466). `hasRelic` is transcribed (it used to - -- be dropped — decision 1785). It is the whole reason a paladin's ranged block reads + -- be dropped — decision 1796). It is the whole reason a paladin's ranged block reads -- "n/a" rather than the stats of the libram sitting in that slot: `noRanged` is set when -- there is no ranged texture OR the class has a relic slot, and `SetRangedDamage` / -- `SetRangedAttackPower` both read it (ref l.482 / l.552), so one flag blanks all three @@ -1020,7 +1020,7 @@ button.emptyTexture = texture -- `checkRelic` is the number 1 for the ranged slot alone (a property of the SLOT); the -- class half is `UnitHasRelicSlot`, and the ref reads the two as a conjunction. Both - -- halves are live — decision 1785. + -- halves are live — decision 1796. button.checkRelic = checkRelic button.icon = getglobal(button:GetName() .. "IconTexture") button.count = getglobal(button:GetName() .. "Count") @@ -1105,7 +1105,7 @@ else -- ref l.678-681: the empty ranged slot of a relic class shows the relic plate, -- not the bow plate. The art ships (`UI-PaperDoll-Slot-Relic.blp`, 3916 bytes, - -- patch.MPQ). Restored — decision 1785. + -- patch.MPQ). Restored — decision 1796. local emptyTexture = button.emptyTexture if button.checkRelic and UnitHasRelicSlot("player") then emptyTexture = "Interface\\Paperdoll\\UI-PaperDoll-Slot-Relic.blp" @@ -1145,7 +1145,7 @@ -- the doll popped a "Currently Equipped" 0/XX beside a template-full main tooltip). -- The ref's repair-mode branch (l.757-762) is INTERIM-omitted with the binding's -- repairCost. checkRelic (l.744-746) is transcribed — it was called TBC-flagged dead - -- weight here, which was wrong (decision 1785): a paladin hovering their empty ranged + -- weight here, which was wrong (decision 1796): a paladin hovering their empty ranged -- slot reads "Relic", not "Ranged". function BenillaPaperDollSlot_OnEnter(button) GameTooltip:SetOwner(button, "ANCHOR_RIGHT") diff --git a/crates/benilla-app/assets/ui/InspectFrame.xml b/crates/benilla-app/assets/ui/InspectFrame.xml index 028e21ec..d367391a 100644 --- a/crates/benilla-app/assets/ui/InspectFrame.xml +++ b/crates/benilla-app/assets/ui/InspectFrame.xml @@ -48,7 +48,7 @@ 1059/1060): ctrl previews the inspected item on your own body, shift posts its link. Nothing else happens on a click, which is still the reference's own shape. - `UnitHasRelicSlot` (ref l.123, l.22) — this note used to say "vanilla-always-false, so - the relic branch can never fire". **That is wrong** (decision 1785): the flag is set + the relic branch can never fire". **That is wrong** (decision 1796): the flag is set for Paladin, Shaman and Druid, and the binding now exists and answers for any token, with no `"player"` fast path — inspecting an enemy druid answers 1. The branch is still not transcribed here, but for a different and honest reason: 1.12's inspect pane diff --git a/crates/benilla-app/assets/ui/TextStatusBar.xml b/crates/benilla-app/assets/ui/TextStatusBar.xml deleted file mode 100644 index 5c37af0b..00000000 --- a/crates/benilla-app/assets/ui/TextStatusBar.xml +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - TextStatusBar_Initialize() - TextStatusBar_OnEvent(arg1, arg2) - - TextStatusBar_UpdateTextString() - ShowTextStatusBarText(this) - if this.tooltipTitle and GameTooltip_AddNewbieTip then - BenillaTooltip_AddNewbieTipFor(this, this.tooltipTitle, 1.0, 1.0, 1.0, this.tooltipText, 1) - end - - - HideTextStatusBarText(this) - if GameTooltip then GameTooltip:Hide() end - - TextStatusBar_OnValueChanged() - - - diff --git a/crates/benilla-app/assets/ui/UiPanels.xml b/crates/benilla-app/assets/ui/UiPanels.xml index 81a12d90..8c77189d 100644 --- a/crates/benilla-app/assets/ui/UiPanels.xml +++ b/crates/benilla-app/assets/ui/UiPanels.xml @@ -1025,10 +1025,24 @@ return "seconds" end - function StaticPopup_FindVisible(which) + -- ref StaticPopup.lua l.1414-1426, `data` included. Ours took `which` alone until 1793 + -- found the arity drift; the reference's second argument is what makes a `multiple` dialog + -- addressable, and dropping it is silent in both directions (Lua discards a surplus + -- argument without complaint). + -- + -- The `info.multiple` gate is the reference's own and is why `data` is not simply an + -- equality: a dialog kind declared `multiple` can have several instances up at once, so it + -- is matched by data; every other kind has at most one, so its data is not consulted at + -- all. An unknown `which` answers nil rather than scanning — the reference's own early out. + function StaticPopup_FindVisible(which, data) + local info = StaticPopupDialogs[which] + if not info then + return nil + end for index = 1, STATICPOPUP_NUMDIALOGS do local frame = getglobal("StaticPopup" .. index) - if frame:IsShown() and frame.which == which then + if frame:IsShown() and frame.which == which + and (not info.multiple or frame.data == data) then return frame end end @@ -1044,11 +1058,19 @@ return nil end - function StaticPopup_Hide(which) + -- ref StaticPopup.lua l.1703-1710, `data` included (1793). With a `data` the reference + -- hides only the instance carrying it; without one it hides every instance of the kind, + -- which is what every one-argument caller means and gets. + -- + -- Note the reference does NOT test `IsShown()` here, where `FindVisible` does — hiding an + -- already-hidden dialog is a no-op, and the missing test is not an oversight to correct: + -- `Hide()` on a hidden frame still runs nothing, and adding the guard would change which + -- frames the loop touches for no visible difference. Transcribed as it is. + function StaticPopup_Hide(which, data) for index = 1, STATICPOPUP_NUMDIALOGS do - local frame = getglobal("StaticPopup" .. index) - if frame:IsShown() and frame.which == which then - frame:Hide() + local dialog = getglobal("StaticPopup" .. index) + if dialog.which == which and (not data or data == dialog.data) then + dialog:Hide() end end end diff --git a/crates/benilla-app/assets/ui/UnitFrames.xml b/crates/benilla-app/assets/ui/UnitFrames.xml index 093d4691..d0e54321 100644 --- a/crates/benilla-app/assets/ui/UnitFrames.xml +++ b/crates/benilla-app/assets/ui/UnitFrames.xml @@ -277,9 +277,9 @@ -- and the only conditional here: 1.12 sets it on the player's two bars, the pet's two -- and the XP bar, and on nothing else, which is exactly why Status Bar Text pins your -- own numbers and your pet's but never the target's (decision 1143). - if TextStatusBar_Initialize then -- engine tests load file subsets - TextStatusBar_Initialize(frame.healthbar) - TextStatusBar_Initialize(frame.manabar) + -- `TextStatusBar_Initialize` is NOT called here any more — each bar calls it from its + -- own OnLoad, the reference's way (see the bar declarations below). + if SetTextStatusBarText then -- engine tests load file subsets SetTextStatusBarText(frame.healthbar, getglobal(name .. "HealthBarText")) SetTextStatusBarText(frame.manabar, getglobal(name .. "ManaBarText")) if unit == "player" then @@ -1265,6 +1265,13 @@ + + if TextStatusBar_Initialize then TextStatusBar_Initialize() end if TextStatusBar_OnEvent then TextStatusBar_OnEvent(arg1, arg2) end if TextStatusBar_OnValueChanged then TextStatusBar_OnValueChanged() end BenillaUnitFrameBar_OnEnter(self) @@ -1281,6 +1288,13 @@ + + if TextStatusBar_Initialize then TextStatusBar_Initialize() end if TextStatusBar_OnEvent then TextStatusBar_OnEvent(arg1, arg2) end if TextStatusBar_OnValueChanged then TextStatusBar_OnValueChanged() end BenillaUnitFrameBar_OnEnter(self) @@ -1609,6 +1623,13 @@ + + if TextStatusBar_Initialize then TextStatusBar_Initialize() end if TextStatusBar_OnEvent then TextStatusBar_OnEvent(arg1, arg2) end if TextStatusBar_OnValueChanged then TextStatusBar_OnValueChanged() end BenillaUnitFrameBar_OnEnter(self) @@ -1625,6 +1646,13 @@ + + if TextStatusBar_Initialize then TextStatusBar_Initialize() end if TextStatusBar_OnEvent then TextStatusBar_OnEvent(arg1, arg2) end if TextStatusBar_OnValueChanged then TextStatusBar_OnValueChanged() end BenillaUnitFrameBar_OnEnter(self) @@ -2265,9 +2293,9 @@ frame.healthbar:SetFrameLevel(level - 1) frame.manabar:SetFrameLevel(level - 1) -- The pet's numerals, textLockable like the ref's (PetFrame.xml l.139/164; 1143). - if TextStatusBar_Initialize then -- engine tests load file subsets - TextStatusBar_Initialize(frame.healthbar) - TextStatusBar_Initialize(frame.manabar) + -- `TextStatusBar_Initialize` is NOT called here any more — each bar calls it from its + -- own OnLoad, the reference's way (PetFrame.xml l.138/163). + if SetTextStatusBarText then -- engine tests load file subsets SetTextStatusBarText(frame.healthbar, PetFrameHealthBarText) SetTextStatusBarText(frame.manabar, PetFrameManaBarText) frame.healthbar.textLockable = 1 @@ -2574,6 +2602,13 @@ + + if TextStatusBar_Initialize then TextStatusBar_Initialize() end if TextStatusBar_OnEvent then TextStatusBar_OnEvent(arg1, arg2) end if TextStatusBar_OnValueChanged then TextStatusBar_OnValueChanged() end BenillaUnitFrameBar_OnEnter(self) @@ -2587,6 +2622,13 @@ + + if TextStatusBar_Initialize then TextStatusBar_Initialize() end if TextStatusBar_OnEvent then TextStatusBar_OnEvent(arg1, arg2) end if TextStatusBar_OnValueChanged then TextStatusBar_OnValueChanged() end BenillaUnitFrameBar_OnEnter(self) diff --git a/crates/benilla-app/assets/ui/WorldMapFrame.xml b/crates/benilla-app/assets/ui/WorldMapFrame.xml index 0f8a0211..20655b36 100644 --- a/crates/benilla-app/assets/ui/WorldMapFrame.xml +++ b/crates/benilla-app/assets/ui/WorldMapFrame.xml @@ -389,12 +389,22 @@ end -- Left click drills into whatever the host finds at that map position; every other button - -- is the zoom-out shortcut (ref WorldMapButton_OnClick — ours takes no button argument, - -- since nothing but the map button itself routes here). - function WorldMapButton_OnClick(mouseButton) + -- is the zoom-out shortcut. ref WorldMapFrame.lua l.277-296. The SECOND argument is the button the click landed on, + -- defaulting to `this` — restored in 1793's sweep, having been dropped in favour of naming + -- `WorldMapButton` directly. + -- + -- Equivalent for 1.12's own caller, which passes exactly that button + -- (`WorldMapFrame.lua:174`) — and not equivalent for anyone else, which is the whole + -- reason the reference takes it: a caller aiming the click at a different map surface was + -- silently redirected to the main one, because Lua discards a surplus argument without + -- complaint. + function WorldMapButton_OnClick(mouseButton, button) CloseDropDownMenus(); if ( mouseButton == "LeftButton" ) then - ProcessMapClick(cursorMapPosition(WorldMapButton)); + if ( not button ) then + button = this + end + ProcessMapClick(cursorMapPosition(button)); else WorldMapZoomOutButton_OnClick(); end diff --git a/crates/benilla-app/assets/ui/benilla.toc b/crates/benilla-app/assets/ui/benilla.toc index 186697b0..cff4963b 100644 --- a/crates/benilla-app/assets/ui/benilla.toc +++ b/crates/benilla-app/assets/ui/benilla.toc @@ -149,6 +149,14 @@ MoneyFrame.xml # `_SetCopper`/`_ClearFocus`/`_SetTextColor`/`_SetOnvalueChangedFunc` — six of the names below — # and neither can be sourced until they exist. (Trade still needs four ENGINE verbs beyond this: # `AddTradeMoney`, `GetCursorMoney`, `GetTradePlayerItemLink`, `GetTradeTargetItemLink`.) +# +# **TWO entries, and the `.lua` was missing.** This `.xml` declares only the template and does not +# source its `.lua`; the reference's toc lists both (l.11-12). Listing the `.xml` alone brought the +# template and none of the ten verbs — the header above has claimed otherwise since the day it was +# written, and a probe of a full manifest load answered `nil` for every one of them. Same shape as +# `TextStatusBar`, found by sweeping every chain entry for it once that one bit; +# `every_chain_xml_brings_its_own_lua` is now a gate so neither can recur. +Interface\FrameXML\MoneyInputFrame.lua Interface\FrameXML\MoneyInputFrame.xml # The UIPanel slot manager (decision 0084 §2): script-only, no frames of its own — must load # before any panel frame (Gossip/Merchant today) so ShowUIPanel/HideUIPanel already exist @@ -210,10 +218,24 @@ UnitPopup.xml # (`script/object/movable.rs`), so that note was stale too. Interface\FrameXML\ItemRef.xml # The shared status-bar numerals machinery (decision 1082): TextStatusBar_* + the opt-in -# template — before its customers (the XP bar in ActionBar.xml today; the unit-frame -# health/mana numerals are the ref's other users, when that slice lands). The ref's own TOC -# loads TextStatusBar right before its unit frames, same seat as here. -TextStatusBar.xml +# template. The ref's own TOC loads TextStatusBar right before its unit frames, same seat. +# +# ══ THE STATUS-BAR NUMERALS — the reference's own, off the player's chain (1751) ═══════════ +# `TextStatusBar_*` + the `TextStatusBar` template. The reference's own toc loads it right +# before its unit frames; this is the same seat. +# +# Nothing of ours inherits the template — it exists for the reference's windows, whose rows +# carry `inherits="TextStatusBar"` and would have found ours. What blocked the swap was a +# signature WE widened (`TextStatusBar_Initialize`), fixed by giving our own bars the OnLoad +# the reference's have. +# +# **TWO entries, because the reference has two** (its toc l.32-33). This `.xml` declares only the +# template and does NOT source its `.lua` — unlike most stock windows, whose `