From 84f93c47de43cd9ae0ccd4f17e80ea4f3dfbd78e Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 14 Aug 2026 19:03:34 +0700 Subject: [PATCH] Texture and FontString stop answering each other's methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - the one shared region table splits into the client's own maps: a Texture no longer answers SetText, a FontString no longer answers SetTexture, and feature-detecting addons see the true surface - CreateTitleRegion lands whole — object and drag — so an options window that is its own drag handle actually moves - font-object names resolve whatever their case, and the CursorUpdate/CursorOnUpdate pair arrives for the container-item templates - GetStringHeight is pruned (1.12 has no such method) and SetPortraitToTexture moves to the global it really is Co-Authored-By: Claude Fable 5 --- crates/benilla-app/assets/ui/BagFrame.xml | 10 +- .../assets/ui/ContainerFrameAdapters.xml | 3 +- crates/benilla-app/assets/ui/GossipFrame.xml | 2 +- crates/benilla-app/assets/ui/MicroMenu.xml | 23 +++ crates/benilla-app/assets/ui/QuestFrame.xml | 2 +- crates/benilla-app/assets/ui/UiPanels.xml | 30 +++ crates/benilla-app/assets/ui/UnitFrames.xml | 29 +++ .../benilla-app/src/ui_script/panel_tests.rs | 2 +- .../benilla-app/src/ui_script/quest_tests.rs | 2 +- .../src/ui_script/shipped_xml_tests.rs | 103 ++++++++++ crates/benilla-ui/src/loader/mod.rs | 4 +- crates/benilla-ui/src/loader/regions.rs | 9 + crates/benilla-ui/src/loader/tests.rs | 40 ++++ crates/benilla-ui/src/script/button.rs | 9 +- crates/benilla-ui/src/script/extract.rs | 11 +- crates/benilla-ui/src/script/font.rs | 16 +- crates/benilla-ui/src/script/font_block.rs | 4 +- crates/benilla-ui/src/script/mod.rs | 128 ++++++++++++- crates/benilla-ui/src/script/model.rs | 25 ++- crates/benilla-ui/src/script/object.rs | 2 +- .../src/script/object/events_regions.rs | 80 ++++++++ .../benilla-ui/src/script/object/movable.rs | 40 ++++ crates/benilla-ui/src/script/pointer.rs | 51 +++++ crates/benilla-ui/src/script/region.rs | 142 +++++++++++++- crates/benilla-ui/src/script/region/paint.rs | 20 -- crates/benilla-ui/src/script/region/text.rs | 16 +- crates/benilla-ui/src/script/tests/movable.rs | 176 ++++++++++++++++++ .../src/script/tests/reference_surface.rs | 65 ++++--- crates/benilla-ui/src/script/tests/regions.rs | 127 +++++++++++++ crates/benilla-ui/src/script/tooltip/mod.rs | 2 +- crates/benilla-ui/src/widget/kinds/mod.rs | 8 + crates/benilla-ui/src/widget/mod.rs | 8 + 32 files changed, 1109 insertions(+), 80 deletions(-) diff --git a/crates/benilla-app/assets/ui/BagFrame.xml b/crates/benilla-app/assets/ui/BagFrame.xml index 32593ff7..6ff3470f 100644 --- a/crates/benilla-app/assets/ui/BagFrame.xml +++ b/crates/benilla-app/assets/ui/BagFrame.xml @@ -306,10 +306,10 @@ -- Fixed art, again because there is no bag item: the keyring's own portrait -- (ref ContainerFrame.lua l.419) and its own background variant, snug-fitted to the -- level-gated slot count exactly like an equipped bag. - local portrait = getglobal(frame:GetName() .. "Portrait") - if portrait then - portrait:SetPortraitToTexture("Interface\\ContainerFrame\\KeyRing-Bag-Icon") - end + -- The GLOBAL form, which is the reference's own (ContainerFrame.lua l.419 + -- writes exactly this call) — 1.12 has no such Texture method. + SetPortraitToTexture(frame:GetName() .. "Portrait", + "Interface\\ContainerFrame\\KeyRing-Bag-Icon") local size = GetContainerNumSlots(bagId) if size > 0 then BenillaBagWindow_FitBackground(frame, size) end else @@ -331,7 +331,7 @@ -- The circular crop (the real SetBagPortaitTexture is C-side and masks the -- icon to the ring's inscribed circle): a raw square icon pokes its corners -- past the round rim — the director's bank-bag popout artifact. - portrait:SetPortraitToTexture(icon) + SetPortraitToTexture(frame:GetName() .. "Portrait", icon) else -- The backpack fallback art is authored round — no crop to apply. portrait:SetTexture("Interface\\Buttons\\Button-Backpack-Up") diff --git a/crates/benilla-app/assets/ui/ContainerFrameAdapters.xml b/crates/benilla-app/assets/ui/ContainerFrameAdapters.xml index 9eee5f11..6dbf4f00 100644 --- a/crates/benilla-app/assets/ui/ContainerFrameAdapters.xml +++ b/crates/benilla-app/assets/ui/ContainerFrameAdapters.xml @@ -24,7 +24,8 @@ slots, so it has to detour out of the container API to describe one. benilla's keyring is an ordinary container (id -2, decision 0765): its slots come through `GetContainerItemInfo` and `GameTooltip:SetBagItem` like every other bag's. So the detour is not merely unavailable here - (neither `KeyRingButtonIDToInvSlotID` nor `CursorUpdate` is a binding) — it is *wrong* here, + (`KeyRingButtonIDToInvSlotID` is not a binding here; `CursorUpdate` now is, transcribed from + UIParent.lua into UiPanels.xml, so only half the detour is missing) — it is *wrong* here, and supplying the two verbs would buy an empty tooltip, because our keyring items were never fed into the inventory-slot space it reads. diff --git a/crates/benilla-app/assets/ui/GossipFrame.xml b/crates/benilla-app/assets/ui/GossipFrame.xml index 8bd92818..2d444d76 100644 --- a/crates/benilla-app/assets/ui/GossipFrame.xml +++ b/crates/benilla-app/assets/ui/GossipFrame.xml @@ -115,7 +115,7 @@ -- has measured THIS text. A zero keeps the current height (never collapses the row) and -- the frame's OnUpdate below re-runs the fit until it settles. function BenillaGossipRow_Resize(button) - local h = button.label:GetStringHeight() + local h = button.label:GetHeight() if h <= 0 or button.benillaFitHeight == h then return end button.benillaFitHeight = h button:SetHeight(h + 2) diff --git a/crates/benilla-app/assets/ui/MicroMenu.xml b/crates/benilla-app/assets/ui/MicroMenu.xml index deb764f1..d68cbbd8 100644 --- a/crates/benilla-app/assets/ui/MicroMenu.xml +++ b/crates/benilla-app/assets/ui/MicroMenu.xml @@ -56,6 +56,29 @@ - The keyring button (ref KeyRingButton, `hidden="true"` by default) stays out with the keyring container itself. --> + + +