Animations: add option-tab fade, minimap pulse, zButton expand fade, map-pin drop-in; wire BeastTraining debug log to /mth err

This commit is contained in:
DuvelCorp
2026-09-10 16:05:36 +02:00
parent 566f3f4925
commit d2fb04f7c5
7 changed files with 91 additions and 2 deletions
+18
View File
@@ -1,5 +1,15 @@
-- MAX_SPELLS = 1024
-- Capture our PizzaSauce instance for the expand animation (guarded; may be nil).
local ZSB_Sauce = PizzaSauce
local function ZSpellButton_AnimateExpand(parent)
if not ZSB_Sauce or not parent or not parent.children then return end
if type(MTH_FX_IsEnabled) == "function" and not MTH_FX_IsEnabled("ui.zbuttons") then return end
-- Hide alpha this frame so there is no one-frame opaque flash before onStart.
if type(parent.children.SetAlpha) == "function" then parent.children:SetAlpha(0) end
ZSB_Sauce:FadeIn(parent.children, 0.2)
end
-- Key binding prefix mapping (button name → Bindings.xml binding prefix)
local ZHUNTER_BINDING_PREFIX = {
zButtonAspect = "ZAspect",
@@ -378,6 +388,7 @@ function ZSpellButton_SetChildrenExpanded(parent, expanded)
end
if expanded then
saved["children"]["expanded"] = 1
local wasCollapsed = parent.children and not parent.children:IsShown()
if parent.children then
parent.children:Show()
end
@@ -394,6 +405,11 @@ function ZSpellButton_SetChildrenExpanded(parent, expanded)
end
end
ZSpellButton_StartFadeTimer(parent)
-- Animate only on a genuine collapsed->expanded toggle, and never on the
-- very first apply at login (guarded by _zbAnimReady, set in ApplyChildrenExpanded).
if wasCollapsed and parent._zbAnimReady then
ZSpellButton_AnimateExpand(parent)
end
else
saved["children"]["expanded"] = 0
if parent.children then
@@ -417,6 +433,8 @@ function ZSpellButton_ApplyChildrenExpanded(parent)
end
ZSpellButton_SetChildrenExpanded(parent, ZSpellButton_GetChildrenExpanded(parent))
ZSpellButton_UpdateKeybindingText(parent)
-- Mark ready so future user toggles animate, but the initial login apply above does not.
parent._zbAnimReady = true
end
-- ========== Fade Timer ==========