Strengthen subtle animations: pin scale-pops, window slide-in/out with overshoot, panel slides, zButton cascade, zBar springy stagger

This commit is contained in:
DuvelCorp
2026-09-10 17:21:10 +02:00
parent 66ff1ae711
commit 3233ebff7f
5 changed files with 61 additions and 15 deletions
+16 -3
View File
@@ -5,9 +5,22 @@ 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)
-- The child cluster is anchored to the main button, not to the container, so
-- sliding the container has no visible effect. Instead reveal the children in
-- a quick staggered cascade so the fly-out clearly reads as motion. Keep the
-- container fully visible and drive each child's own alpha.
local container = parent.children
if type(container.SetAlpha) == "function" then container:SetAlpha(1) end
local count = parent.count or 0
local shown = 0
for i = 1, count do
local btn = getglobal((parent.name or "") .. i)
if btn and btn:IsShown() then
if type(btn.SetAlpha) == "function" then btn:SetAlpha(0) end
ZSB_Sauce:FadeTo(btn, 1, 0.20, "outQuad", { delay = shown * 0.05 })
shown = shown + 1
end
end
end
-- Key binding prefix mapping (button name → Bindings.xml binding prefix)
+3 -1
View File
@@ -298,7 +298,9 @@ function MTH_ZBar_AnimateActivate()
local btn = getglobal(buttonName)
if btn and btn:IsShown() then
btn:SetAlpha(0)
ZBar_Sauce:FadeTo(btn, 1, 0.30, "outQuad", { delay = (i - 1) * 0.05 })
-- Staggered springy slide-up so the bar visibly assembles button
-- by button instead of a faint collective fade.
ZBar_Sauce:SlideIn(btn, "UP", 26, 0.32, "outBack", { delay = (i - 1) * 0.06 })
end
end
end