mirror of
https://codeberg.org/Duvelcorp/MetaHunt.git
synced 2026-09-22 07:36: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:
+16
-5
@@ -15,8 +15,9 @@ local function MTH_BOOK_FadeInWindow(frame)
|
||||
-- Slide the whole window up into place while fading in. Position and alpha are
|
||||
-- the only safe properties on a complex frame: the built-in "scale" tween
|
||||
-- resizes width/height, which the child widgets do NOT follow (they clip), so
|
||||
-- a slide + fade is the strongest effect that keeps the layout intact.
|
||||
Sauce:SlideIn(frame, "UP", 60, 0.4, "outCubic")
|
||||
-- a slide + fade is the strongest effect that keeps the layout intact. A
|
||||
-- bigger travel + springy "outBack" overshoot makes the entrance pop.
|
||||
Sauce:SlideIn(frame, "UP", 110, 0.5, "outBack")
|
||||
end
|
||||
|
||||
-- Fade the results list back in when switching Hunter's Book tabs, unless disabled.
|
||||
@@ -26,7 +27,9 @@ local function MTH_BOOK_AnimateTabSwitch()
|
||||
local list = getglobal("MTH_BOOK_ListBackdrop")
|
||||
if not list then return end
|
||||
if type(list.SetAlpha) == "function" then list:SetAlpha(0) end
|
||||
Sauce:FadeIn(list, 0.25)
|
||||
-- Slide the list in from the right while fading so the tab change reads as
|
||||
-- motion rather than a faint brightness bump.
|
||||
Sauce:SlideIn(list, "RIGHT", 55, 0.3, "outCubic")
|
||||
end
|
||||
|
||||
-- Fade the book window out before hiding it, unless disabled (shares the
|
||||
@@ -39,10 +42,17 @@ local function MTH_BOOK_FadeOutWindow(frame)
|
||||
frame:Hide()
|
||||
return
|
||||
end
|
||||
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)
|
||||
Sauce:SlideOut(frame, "DOWN", 90, 0.26, "inCubic", {
|
||||
onFinish = function()
|
||||
frame:Hide()
|
||||
if type(frame.SetAlpha) == "function" then frame:SetAlpha(1) end
|
||||
if p then
|
||||
frame:ClearAllPoints()
|
||||
frame:SetPoint(p, rel, rp, x, y)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
@@ -54,7 +64,8 @@ local function MTH_BOOK_AnimateSearchResults()
|
||||
local list = getglobal("MTH_BOOK_ListBackdrop")
|
||||
if not list then return end
|
||||
if type(list.SetAlpha) == "function" then list:SetAlpha(0) end
|
||||
Sauce:FadeIn(list, 0.22)
|
||||
-- Slide the refreshed list in from the right so a search visibly refreshes.
|
||||
Sauce:SlideIn(list, "RIGHT", 45, 0.26, "outCubic")
|
||||
end
|
||||
|
||||
MTH_HUNTERBOOK_LOADED = true
|
||||
|
||||
+11
-2
@@ -35,7 +35,12 @@ local function MTH_Map_AnimatePin(pin)
|
||||
if not MTH_MAP_Sauce or not pin then return end
|
||||
if type(MTH_FX_IsEnabled) == "function" and not MTH_FX_IsEnabled("ui.mappins") then return end
|
||||
if type(pin.SetAlpha) == "function" then pin:SetAlpha(0) end
|
||||
MTH_MAP_Sauce:FadeIn(pin, 0.3)
|
||||
-- Bouncy scale "pop": the pin overshoots its size and springs back while
|
||||
-- fading in. Far more eye-catching than a plain alpha fade.
|
||||
MTH_MAP_Sauce:Group({
|
||||
MTH_MAP_Sauce:FadeIn(pin, 0.20, "outQuad", { defer = true }),
|
||||
MTH_MAP_Sauce:Rubber(pin, 0.35, 0.55, { defer = true }),
|
||||
})
|
||||
end
|
||||
|
||||
-- Ping a minimap pin that just came into range. Only called for genuinely new
|
||||
@@ -44,7 +49,11 @@ local function MTH_Map_PingMinimapPin(pin)
|
||||
if not MTH_MAP_Sauce or not pin then return end
|
||||
if type(MTH_FX_IsEnabled) == "function" and not MTH_FX_IsEnabled("ui.minimapping") then return end
|
||||
if type(pin.SetAlpha) == "function" then pin:SetAlpha(0) end
|
||||
MTH_MAP_Sauce:FadeIn(pin, 0.35)
|
||||
-- Springy grow-in so a freshly-discovered node clearly "pops" onto the minimap.
|
||||
MTH_MAP_Sauce:Group({
|
||||
MTH_MAP_Sauce:FadeIn(pin, 0.20, "outQuad", { defer = true }),
|
||||
MTH_MAP_Sauce:Rubber(pin, 0.30, 0.55, { defer = true }),
|
||||
})
|
||||
end
|
||||
|
||||
local MTH_MAP_MINIMAP_ZOOM = {
|
||||
|
||||
+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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user