diff --git a/crates/benilla-app/assets/ui/ActionBar.xml b/crates/benilla-app/assets/ui/ActionBar.xml index 02243303..8ba4802f 100644 --- a/crates/benilla-app/assets/ui/ActionBar.xml +++ b/crates/benilla-app/assets/ui/ActionBar.xml @@ -62,6 +62,16 @@ ATTACK_BUTTON_FLASH_TIME = 0.4 TOOLTIP_UPDATE_TIME = 0.2 + -- "Lock ActionBars" (ref UIOptionsFrame.lua:102-103 — uvar LOCK_ACTIONBAR, default "0"). + -- The reference declares it in its options window; ours lives with the bar it locks, which + -- is this codebase's rule for every stock global (1128/1134): the assignment sits beside its + -- consumers, and the options row CAPTURES it rather than restating a default of its own. + -- Read by the drag guards below and by the pet bar's (PetActionBar.xml, the ref's own second + -- consumer at PetActionBarFrame.lua:270/278); driven by the Action Bars page and by the + -- TOGGLEACTIONBARLOCK binding the option's tooltip promises (decision 1136). + LOCK_ACTIONBAR = "0" + RegisterForSave("LOCK_ACTIONBAR") + -- CooldownFrame_SetTimer moved to Cooldown.xml (the ref's own file split) — the bag -- slots share it, so it loads before both consumers. @@ -253,8 +263,8 @@ -- by construction (OnClick/OnDragStart both call PickupAction; OnReceiveDrag calls -- PlaceAction — ref ActionBarFrame.xml:12-38). Both buttons drag, ref-verbatim too -- (l.108) — a started drag suppresses the click, so right-press-and-move relocates the - -- action while right-click-in-place still uses it. LOCK_ACTIONBAR stays the vanilla - -- default (unlocked), so unlike the ref's cvar guard, drag is always live here. + -- action while right-click-in-place still uses it. Both drag ends honour LOCK_ACTIONBAR + -- since 1136 — see the guards themselves for what the lock does and does not stop. button:RegisterForDrag("LeftButton", "RightButton") BenillaActionButton_Update(button) end @@ -271,12 +281,19 @@ BenillaActionButton_Update(button) end + -- The lock (ref ActionBarFrame.xml:23-38, both handlers wrapped in `if LOCK_ACTIONBAR ~= "1" + -- then … end`). Note what the reference does NOT guard, and neither do we: the shift-click + -- pick-up in OnClick above (its l.12-22 fork runs PickupAction unconditionally). So the lock + -- stops the *drag*, and shift-click stays the deliberate way to move an action with the bar + -- locked — which is what makes the setting usable rather than a wall. function BenillaActionButton_OnDragStart(button) + if LOCK_ACTIONBAR == "1" then return end PickupAction(BenillaActionButton_Action(button)) BenillaActionButton_Update(button) end function BenillaActionButton_OnReceiveDrag(button) + if LOCK_ACTIONBAR == "1" then return end PlaceAction(BenillaActionButton_Action(button)) BenillaActionButton_Update(button) end diff --git a/crates/benilla-app/assets/ui/BuffFrame.xml b/crates/benilla-app/assets/ui/BuffFrame.xml index 9f52772b..60377654 100644 --- a/crates/benilla-app/assets/ui/BuffFrame.xml +++ b/crates/benilla-app/assets/ui/BuffFrame.xml @@ -8,14 +8,21 @@ engine exposes the one Era aura function instead (decision 0068), so the handlers here read UnitBuff/UnitDebuff and the countdown rides GetTime(), exactly as the cast bar does. - SCOPE (decision 0255): the LOCAL PLAYER only, durations always visible. The reference's - temporary-weapon-enchant frame (TemporaryEnchantFrame / TempEnchant1-2) and the - SHOW_BUFF_DURATIONS CVar toggle are deliberately out — there is no weapon-enchant wire yet, - and the director's call is "durations visible, no setting". So the bar is hard-anchored to the - reference's *durations-shown, no-enchant* steady state: 16 buff buttons (two rows of 8) above 8 - debuff buttons, rows 45px apart (30px icon + a 15px duration gutter), right-aligned under the - minimap at UIParent TOPRIGHT (-175,-13) — the point the reference's BuffFrame snaps to when no - temp enchant is present (BuffFrame_Enchant_OnUpdate's no-enchant branch). + SCOPE (decision 0255): the LOCAL PLAYER only. The reference's temporary-weapon-enchant frame + (TemporaryEnchantFrame / TempEnchant1-2) is deliberately out — there is no weapon-enchant wire + yet — so the bar is anchored to the reference's *no-enchant* steady state: 16 buff buttons + (two rows of 8) above 8 debuff buttons, right-aligned under the minimap at UIParent TOPRIGHT + (-175,-13), the point the reference's BuffFrame snaps to when no temp enchant is present + (BuffFrame_Enchant_OnUpdate's no-enchant branch). + + DURATIONS ARE A SETTING NOW (decision 1139). 0255 shipped the durations-shown geometry + unconditionally — the director's call, and there was no panel to hang a switch on — and said + in as many words that "if a CVar system later arrives, the geometry is already the branch it + would select". It arrived, as the saved-variable store rather than a CVar (1134): the store + below is SHOW_BUFF_DURATIONS, the Interface page's Buff Durations row drives it, and BOTH of + the reference's geometries are live again — rows at y = 0/−45/−90 with timers, 0/−35/−70 + without (BenillaBuffButtons_UpdatePositions). Our default is "1", the reference's "0": the + director's look is what the bar comes up wearing, and what Defaults walks it back to. ORDER IS STATE. The list UnitBuff/UnitDebuff enumerate is the app's insertion-ordered display cache (crate::ui_aura, decision 0257): a new aura appends at the end, a dropped one repacks — @@ -40,11 +47,20 @@ wire's cancelable bit didn't allow, so a debuff right-click is a silent no-op, as in 1.12. DEVIATIONS from the reference .lua (noted, not bugs): - - The count and duration FontStrings are BLANKED ("") rather than hidden — an empty string - draws nothing, same look. A site that predates region Show/Hide (region.rs has the real - pair now, and the loader honours hidden= on regions); equivalent either way. + - The count FontString is BLANKED ("") rather than hidden — an empty string draws nothing, + same look. A site that predates region Show/Hide; equivalent either way. (The DURATION + strings used the same shortcut until 1139 and no longer do: a hidden setting has to hide + a region, not write an empty string into a visible one.) -->