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:
DuvelCorp
2026-09-10 14:41:26 +02:00
parent 060fc555fe
commit 566f3f4925
12 changed files with 1992 additions and 43 deletions
+63
View File
@@ -325,6 +325,69 @@ function SlashCmdList.MTH(msg, editbox)
MTH_CommandBook()
elseif lowerMsg == "peers" or lowerMsg == "who" then
MTH_CommandPeers()
elseif lowerCmd == "trainscan" or lowerCmd == "petscan" then
if type(MTH_CommandTrainScan) == "function" then
MTH_CommandTrainScan()
else
MTH:Print("Train scan is not available.")
end
elseif lowerCmd == "fx" or lowerCmd == "fireworks" or lowerCmd == "celebrate" then
-- TEMP: preview the pet-ability celebration effect.
if type(MTH_Celebrate) == "function" then
local label = msg
local _, _, rest = string.find(msg, "^%S+%s+(.-)%s*$")
if rest and rest ~= "" then
MTH_Celebrate("New Pet Ability!", rest)
else
MTH_Celebrate("New Pet Ability!", "Growl (Rank 3)")
end
else
-- Self-diagnosing: report which piece failed to load so we can tell
-- a stale UI from a genuine load error.
MTH:Print("Celebration effect is not available. Diagnostics:")
MTH:Print(" PizzaSauce global: " .. type(PizzaSauce))
MTH:Print(" MTH_Celebrate: " .. type(MTH_Celebrate))
MTH:Print(" MTH_FX_IsEnabled: " .. type(MTH_FX_IsEnabled))
MTH:Print(" MTH_SetupAnimationsOptions: " .. type(MTH_SetupAnimationsOptions))
MTH:Print(" -> If these are 'nil', do /reload (your UI is running code from before the feature was added).")
end
elseif lowerCmd == "fxdebug" then
-- TEMP: dump the animation load-path tracers so we can see exactly where
-- fx-celebrate.lua / options-animations.lua aborted at load time.
MTH:Print("=== MetaHunt animation load debug ===")
MTH:Print("Globals: PizzaSauce=" .. type(PizzaSauce)
.. " CreateFrame=" .. type(CreateFrame)
.. " MTH=" .. type(MTH))
if type(MTH_FX_DBG) == "table" then
MTH:Print("fx-celebrate: step=" .. tostring(MTH_FX_DBG.step)
.. " sauceType=" .. tostring(MTH_FX_DBG.sauceType)
.. " registerOk=" .. tostring(MTH_FX_DBG.registerOk)
.. " registerSkipped=" .. tostring(MTH_FX_DBG.registerSkipped))
if MTH_FX_DBG.registerErr ~= nil then
MTH:Print("fx-celebrate: registerErr=" .. tostring(MTH_FX_DBG.registerErr))
end
MTH:Print("fx-celebrate: hasCelebrate=" .. tostring(MTH_FX_DBG.hasCelebrate)
.. " hasIsEnabled=" .. tostring(MTH_FX_DBG.hasIsEnabled)
.. " hasAnimEnabled=" .. tostring(MTH_FX_DBG.hasAnimEnabled))
else
MTH:Print("fx-celebrate: MTH_FX_DBG is " .. type(MTH_FX_DBG) .. " (file did not reach its first line)")
end
if type(MTH_ANIM_DBG) == "table" then
MTH:Print("options-animations: step=" .. tostring(MTH_ANIM_DBG.step)
.. " ready=" .. tostring(MTH_ANIM_DBG.ready)
.. " hasSetup=" .. tostring(MTH_ANIM_DBG.hasSetup))
MTH:Print("options-animations: req=" .. tostring(MTH_ANIM_DBG.reqType)
.. " getFrame=" .. tostring(MTH_ANIM_DBG.getFrameType)
.. " clear=" .. tostring(MTH_ANIM_DBG.clearType)
.. " checkbox=" .. tostring(MTH_ANIM_DBG.checkboxType))
MTH:Print("options-animations: setupCalled=" .. tostring(MTH_ANIM_DBG.setupCalled)
.. " setupResult=" .. tostring(MTH_ANIM_DBG.setupResult)
.. " containerType=" .. tostring(MTH_ANIM_DBG.containerType)
.. " fxEnabledType=" .. tostring(MTH_ANIM_DBG.fxEnabledType))
else
MTH:Print("options-animations: MTH_ANIM_DBG is " .. type(MTH_ANIM_DBG) .. " (file did not reach its first line)")
end
MTH:Print("=== end animation load debug ===")
elseif lowerMsg == "zoneinfo" then
-- Dumps all available zone data for the current zone, for adding to ds-zones / ds-minimap-sizes
pcall(SetMapToCurrentZone)