mirror of
https://codeberg.org/Duvelcorp/MetaHunt.git
synced 2026-09-23 16:16:58 +00:00
Strengthen subtle animations: pin scale-pops, window slide-in/out with overshoot, panel slides, zButton cascade, zBar springy stagger
This commit is contained in:
+15
-4
@@ -27,7 +27,9 @@ local function MTH_OPT_AnimateOpen(frame)
|
||||
if type(MTH_FX_IsEnabled) == "function" and not MTH_FX_IsEnabled("ui.options") then return end
|
||||
-- Hide alpha this frame so there is no one-frame opaque flash before onStart.
|
||||
if type(frame.SetAlpha) == "function" then frame:SetAlpha(0) end
|
||||
MTH_OPT_Sauce:SlideIn(frame, "UP", 60, 0.4, "outCubic")
|
||||
-- Bigger travel + a springy "outBack" overshoot so the window clearly
|
||||
-- pops up into place instead of a subtle nudge.
|
||||
MTH_OPT_Sauce:SlideIn(frame, "UP", 110, 0.5, "outBack")
|
||||
end
|
||||
|
||||
-- Fade the active settings panel when switching options tabs, unless disabled.
|
||||
@@ -40,14 +42,16 @@ local function MTH_OPT_AnimateTabContent(tabKey)
|
||||
local frame = MTH_GetFrame(MTH_OPTIONS_TABS[i].frame)
|
||||
if frame then
|
||||
if type(frame.SetAlpha) == "function" then frame:SetAlpha(0) end
|
||||
MTH_OPT_Sauce:FadeIn(frame, 0.22)
|
||||
-- Slide the panel in from the right while fading so the content
|
||||
-- visibly moves, not just brightens.
|
||||
MTH_OPT_Sauce:SlideIn(frame, "RIGHT", 55, 0.3, "outCubic")
|
||||
end
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Fade the options window out before hiding it, unless disabled.
|
||||
-- Slide the options window down and out before hiding it, unless disabled.
|
||||
local function MTH_OPT_AnimateClose()
|
||||
local frame = MetaHuntOptions
|
||||
if not frame then return end
|
||||
@@ -57,10 +61,17 @@ local function MTH_OPT_AnimateClose()
|
||||
frame:Hide()
|
||||
return
|
||||
end
|
||||
MTH_OPT_Sauce:FadeOut(frame, 0.22, "inQuad", {
|
||||
-- Capture the resting anchor so SlideOut's downward displacement can be
|
||||
-- restored once the window is hidden (otherwise the next open is offset).
|
||||
local p, rel, rp, x, y = frame:GetPoint(1)
|
||||
MTH_OPT_Sauce:SlideOut(frame, "DOWN", 90, 0.26, "inCubic", {
|
||||
onFinish = function()
|
||||
frame:Hide()
|
||||
frame:SetAlpha(1)
|
||||
if p then
|
||||
frame:ClearAllPoints()
|
||||
frame:SetPoint(p, rel, rp, x, y)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user