mirror of
https://codeberg.org/Duvelcorp/MetaHunt.git
synced 2026-10-12 19:40:00 +00:00
Add Growl pet auto-teach feature and smooth zButton expand animation
- New Pet Auto-Teach: on tame, offer to teach Growl at the best rank via the Beast Training window (Craft API DoCraft), with a General options checkbox and /mth growl on|off|status toggle (on by default). - De-stagger zButton flyout bars and zBar so buttons fade in together. - Update CHANGELOG.
This commit is contained in:
@@ -418,11 +418,9 @@ function ZSpellButton_SetChildrenExpanded(parent, expanded)
|
||||
end
|
||||
end
|
||||
ZSpellButton_StartFadeTimer(parent)
|
||||
-- Animate only on a genuine collapsed->expanded toggle, and never on the
|
||||
-- very first apply at login (guarded by _zbAnimReady, set in ApplyChildrenExpanded).
|
||||
if wasCollapsed and parent._zbAnimReady then
|
||||
ZSpellButton_AnimateExpand(parent)
|
||||
end
|
||||
-- Flyout reveal is instant: no stagger/cascade animation. The staggered
|
||||
-- "stacking one after the other" fly-out was slow and unwanted, so the
|
||||
-- children just appear immediately when expanded.
|
||||
else
|
||||
saved["children"]["expanded"] = 0
|
||||
if parent.children then
|
||||
|
||||
@@ -284,11 +284,9 @@ function MTH_ZBar_Release()
|
||||
end
|
||||
end
|
||||
|
||||
-- Animations: gentle staggered fade-in of the bar's buttons when it activates.
|
||||
-- NOTE: keep this a plain alpha fade only. A SlideIn (position tween) here caused
|
||||
-- client micro-freezes on reload because it re-anchors every chained button each
|
||||
-- frame, forcing repeated layout recalcs. Use position/scale tweens on the zBar
|
||||
-- with extreme caution.
|
||||
-- Animations: a single, quick, simultaneous fade-in of the bar's buttons when
|
||||
-- it activates. NO stagger (no per-button delay) — every button fades in at the
|
||||
-- same time so it reads as one clean fade instead of a slow "stacking" cascade.
|
||||
function MTH_ZBar_AnimateActivate()
|
||||
if not ZBar_Sauce then return end
|
||||
if type(MTH_FX_IsEnabled) ~= "function" or not MTH_FX_IsEnabled("ui.zbar") then
|
||||
@@ -302,7 +300,7 @@ 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 })
|
||||
ZBar_Sauce:FadeTo(btn, 1, 0.20, "outQuad")
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -356,5 +354,8 @@ function MTH_ZBar_Init()
|
||||
if s.enabled then
|
||||
MTH_ZBar_EnsureAnchor()
|
||||
MTH_ZBar_ApplyLayout()
|
||||
-- Play the gentle fade on login/reload too, not just on checkbox toggle.
|
||||
-- Safe here because AnimateActivate is a plain alpha fade (no re-anchoring).
|
||||
MTH_ZBar_AnimateActivate()
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user