Fix Hunter's Book animation SetPoint errors

The window's first anchor is relative to a child, so SlideIn/SlideOut's
position tween threw '<child> is dependent on this' every tick. Switch the
open/close/tab/search animations to alpha-only fades (matches the option labels).
This commit is contained in:
DuvelCorp
2026-09-12 12:08:54 +02:00
parent f3af63926e
commit 67ed20532b
+9 -19
View File
@@ -12,12 +12,9 @@ local function MTH_BOOK_FadeInWindow(frame)
-- book renders fully opaque for one frame before the tween's onStart snaps it
-- to 0 -- a flash that makes the fade look like it never happened.
if type(frame.SetAlpha) == "function" then frame:SetAlpha(0) end
-- 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. A
-- bigger travel + springy "outBack" overshoot makes the entrance pop.
Sauce:SlideIn(frame, "UP", 110, 0.5, "outBack")
-- Fade only: the window's first anchor is relative to a child, so a position
-- tween's per-frame SetPoint throws "<child> is dependent on this". Alpha is safe.
Sauce:FadeIn(frame, 0.5, "outQuad")
end
-- Fade the results list back in when switching Hunter's Book tabs, unless disabled.
@@ -27,9 +24,8 @@ 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
-- 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")
-- Fade only (position tween SetPoint is unsafe on this anchor; see FadeInWindow).
Sauce:FadeIn(list, 0.3, "outQuad")
end
-- Fade the book window out before hiding it, unless disabled (shares the
@@ -42,17 +38,11 @@ local function MTH_BOOK_FadeOutWindow(frame)
frame:Hide()
return
end
-- 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", {
-- Fade only (position tween SetPoint is unsafe on this anchor; see FadeInWindow).
Sauce:FadeTo(frame, 0, 0.26, "inQuad", {
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
@@ -64,8 +54,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
-- Slide the refreshed list in from the right so a search visibly refreshes.
Sauce:SlideIn(list, "RIGHT", 45, 0.26, "outCubic")
-- Fade only (position tween SetPoint is unsafe on this anchor; see FadeInWindow).
Sauce:FadeIn(list, 0.26, "outQuad")
end
MTH_HUNTERBOOK_LOADED = true