mirror of
https://codeberg.org/Duvelcorp/MetaHunt.git
synced 2026-09-28 02:26:03 +00:00
Add Animations feature + fix own-pet tooltip false positive
Animations (all optional, default on, per-effect toggles): - New Options -> Animations tab with master switch + per-effect checkboxes - Embed PizzaSauce animation library (api/PizzaSauce.lua) - fx-celebrate: firework + banner when a pet learns a new ability/rank, triggered from core-scan-beasttraining pet-learn hook - Hunter's Book: slide + fade on open, results list fade on tab switch - Options window: slide + fade on open - All new user-facing strings keyed (ANIM_* namespace) Fixes: - Tooltip #19: own-pet lines (mood/loyalty/happiness/XP) no longer misfire on party members / targets. Removed the fragile title-name fallback in MTH_TT_IsTooltipOnOwnPet; ownership now requires positive unit identity. Temp (remove before release): /mth fx and /mth fxdebug diagnostics.
This commit is contained in:
@@ -20,6 +20,16 @@ local function MTH_OPT_L(key, default)
|
||||
return default or key
|
||||
end
|
||||
|
||||
-- Capture our PizzaSauce instance for the options-window open animation (guarded).
|
||||
local MTH_OPT_Sauce = PizzaSauce
|
||||
local function MTH_OPT_AnimateOpen(frame)
|
||||
if not MTH_OPT_Sauce or not frame 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.
|
||||
if type(frame.SetAlpha) == "function" then frame:SetAlpha(0) end
|
||||
MTH_OPT_Sauce:SlideIn(frame, "UP", 60, 0.4, "outCubic")
|
||||
end
|
||||
|
||||
local function MTH_RegisterEscClose(frameName)
|
||||
if not (frameName and UISpecialFrames) then
|
||||
return
|
||||
@@ -232,6 +242,13 @@ function MTH_SelectOptionsTab(tabKey)
|
||||
elseif MTH and MTH.Print then
|
||||
MTH:Print("ICU options setup function is not loaded", "error")
|
||||
end
|
||||
elseif tabKey == "Animations" then
|
||||
if not MTH_OPTIONS_SETUP["Animations"] then
|
||||
if type(MTH_SetupAnimationsOptions) == "function" then
|
||||
MTH_SetupAnimationsOptions()
|
||||
MTH_OPTIONS_SETUP["Animations"] = true
|
||||
end
|
||||
end
|
||||
elseif tabKey == "Credits" then
|
||||
local setupCredits = _G and _G["MTH_SetupCreditsOptions"]
|
||||
if type(setupCredits) == "function" then
|
||||
@@ -324,6 +341,7 @@ function MTH_OpenOptions(tabKey)
|
||||
return
|
||||
end
|
||||
optionsFrame:Show()
|
||||
MTH_OPT_AnimateOpen(optionsFrame)
|
||||
if MTH_OPTIONS_UpdateRealmGateOverlay(optionsFrame) then return end
|
||||
MTH_SelectOptionsTab(tabKey or "General")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user