mirror of
https://codeberg.org/Duvelcorp/MetaHunt.git
synced 2026-10-10 18:40:01 +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
|
-- 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
|
-- 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
|
-- 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.
|
-- a slide + fade is the strongest effect that keeps the layout intact. A
|
||||||
Sauce:SlideIn(frame, "UP", 60, 0.4, "outCubic")
|
-- bigger travel + springy "outBack" overshoot makes the entrance pop.
|
||||||
|
Sauce:SlideIn(frame, "UP", 110, 0.5, "outBack")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Fade the results list back in when switching Hunter's Book tabs, unless disabled.
|
-- 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")
|
local list = getglobal("MTH_BOOK_ListBackdrop")
|
||||||
if not list then return end
|
if not list then return end
|
||||||
if type(list.SetAlpha) == "function" then list:SetAlpha(0) 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
|
end
|
||||||
|
|
||||||
-- Fade the book window out before hiding it, unless disabled (shares the
|
-- Fade the book window out before hiding it, unless disabled (shares the
|
||||||
@@ -39,10 +42,17 @@ local function MTH_BOOK_FadeOutWindow(frame)
|
|||||||
frame:Hide()
|
frame:Hide()
|
||||||
return
|
return
|
||||||
end
|
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()
|
onFinish = function()
|
||||||
frame:Hide()
|
frame:Hide()
|
||||||
if type(frame.SetAlpha) == "function" then frame:SetAlpha(1) end
|
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,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
@@ -54,7 +64,8 @@ local function MTH_BOOK_AnimateSearchResults()
|
|||||||
local list = getglobal("MTH_BOOK_ListBackdrop")
|
local list = getglobal("MTH_BOOK_ListBackdrop")
|
||||||
if not list then return end
|
if not list then return end
|
||||||
if type(list.SetAlpha) == "function" then list:SetAlpha(0) 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
|
end
|
||||||
|
|
||||||
MTH_HUNTERBOOK_LOADED = true
|
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 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(MTH_FX_IsEnabled) == "function" and not MTH_FX_IsEnabled("ui.mappins") then return end
|
||||||
if type(pin.SetAlpha) == "function" then pin:SetAlpha(0) 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
|
end
|
||||||
|
|
||||||
-- Ping a minimap pin that just came into range. Only called for genuinely new
|
-- 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 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(MTH_FX_IsEnabled) == "function" and not MTH_FX_IsEnabled("ui.minimapping") then return end
|
||||||
if type(pin.SetAlpha) == "function" then pin:SetAlpha(0) 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
|
end
|
||||||
|
|
||||||
local MTH_MAP_MINIMAP_ZOOM = {
|
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
|
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.
|
-- Hide alpha this frame so there is no one-frame opaque flash before onStart.
|
||||||
if type(frame.SetAlpha) == "function" then frame:SetAlpha(0) end
|
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
|
end
|
||||||
|
|
||||||
-- Fade the active settings panel when switching options tabs, unless disabled.
|
-- 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)
|
local frame = MTH_GetFrame(MTH_OPTIONS_TABS[i].frame)
|
||||||
if frame then
|
if frame then
|
||||||
if type(frame.SetAlpha) == "function" then frame:SetAlpha(0) end
|
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
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
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 function MTH_OPT_AnimateClose()
|
||||||
local frame = MetaHuntOptions
|
local frame = MetaHuntOptions
|
||||||
if not frame then return end
|
if not frame then return end
|
||||||
@@ -57,10 +61,17 @@ local function MTH_OPT_AnimateClose()
|
|||||||
frame:Hide()
|
frame:Hide()
|
||||||
return
|
return
|
||||||
end
|
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()
|
onFinish = function()
|
||||||
frame:Hide()
|
frame:Hide()
|
||||||
frame:SetAlpha(1)
|
frame:SetAlpha(1)
|
||||||
|
if p then
|
||||||
|
frame:ClearAllPoints()
|
||||||
|
frame:SetPoint(p, rel, rp, x, y)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,9 +5,22 @@ local ZSB_Sauce = PizzaSauce
|
|||||||
local function ZSpellButton_AnimateExpand(parent)
|
local function ZSpellButton_AnimateExpand(parent)
|
||||||
if not ZSB_Sauce or not parent or not parent.children then return end
|
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
|
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.
|
-- The child cluster is anchored to the main button, not to the container, so
|
||||||
if type(parent.children.SetAlpha) == "function" then parent.children:SetAlpha(0) end
|
-- sliding the container has no visible effect. Instead reveal the children in
|
||||||
ZSB_Sauce:FadeIn(parent.children, 0.2)
|
-- 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
|
end
|
||||||
|
|
||||||
-- Key binding prefix mapping (button name → Bindings.xml binding prefix)
|
-- Key binding prefix mapping (button name → Bindings.xml binding prefix)
|
||||||
|
|||||||
@@ -298,7 +298,9 @@ function MTH_ZBar_AnimateActivate()
|
|||||||
local btn = getglobal(buttonName)
|
local btn = getglobal(buttonName)
|
||||||
if btn and btn:IsShown() then
|
if btn and btn:IsShown() then
|
||||||
btn:SetAlpha(0)
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user