From feca23de3f68a5a48b95f9519e06e30f4da79f53 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 2 Sep 2026 17:01:18 +0700 Subject: [PATCH] the numerals kit goes stock, and a chat link is its own mouse target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - the status-bar numerals kit (`TextStatusBar.xml` + `.lua`) is the reference's own, and the attempt found a class of silent failure: `TextStatusBar_Initialize()` takes no argument in 1.12 and acts on `this`; ours took an optional bar, our unit frames passed one, and the reference's version ignores it — so the numerals would simply never appear, no error, nothing missing; seventeen of our signatures differ from the reference's that way (Lua drops a surplus argument in silence), written down before their files migrate, and the three "ours narrower" ones — `StaticPopup_Hide(which, data)`, `StaticPopup_FindVisible`, `WorldMapButton_OnClick(button, frame)` — closed now, because that direction bites when a STOCK file arrives and calls our version - a chat link needs no mouse on its frame: wow-re read the client's ctors as mouse-enabling Button, CheckButton, Slider, ColorSelect and EditBox and NOT the scroll frames; the objection ("something makes a 1.12 chat link clickable") resolved as the engine synthesising one mouse-enabled `CSimpleHyperlinkButton` per link span (`0x7a3240`) — so a link span is a hit-test candidate on its own, the chat window is inert everywhere else, and the wheel is its own predicate rather than a borrowed mouse bit; seven `*ScrollFrame` known divergences retire - the relic fit rule: `IsValidForSlot`'s slot-17 leg is an EQUALITY — `(InventoryType == RELIC) == hasRelicSlot` — so a relic lights the ranged slot for a druid and a bow does not, on the bag bar and the paper doll alike; closing it half-right would have lit the highlight for a druid dragging a bow - a chain `.xml` whose `.lua` never loaded: `MoneyInputFrame.xml` had been on the chain without its `.lua`, so the template loaded and all ten `MoneyInputFrame_*` verbs read nil, silently — a gate now fails any chain `.xml` whose `.lua` sibling is neither sourced nor listed; the gap report's LOAD column carries the probe's collision caveat, its fx column stops crying wolf (it follows ` - - - - - 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 `