Files
ShaguTweaks-ClassicAPI/mods/unitframes-hide-pet.lua
T
OEVGandClaude Opus 5.5 a482808743 Add Hide Pet Unit Frame and show XP numbers on the XP bar
Hide Pet Unit Frame (Unit Frames, off by default) parents PetFrame to a
frame that is never shown. PetFrame_Update shows the frame again on
every pet change, so a plain Hide() would not last; with the hidden
parent the stock pet code runs unchanged and nothing draws.

XP Bar Text shows current/needed XP like the reputation bar
("1555/3000  51%"), followed by the rested bonus as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019W3rwusM4i1CYaHQAYixJ7
2026-11-02 01:25:13 +00:00

25 lines
768 B
Lua

local T = ShaguTweaks.T
local module = ShaguTweaks:register({
title = T["Hide Pet Unit Frame"],
description = T["Hides the Pet unitframe below the player in pet classes."],
expansions = { ["vanilla"] = true },
category = T["Unit Frames"],
enabled = false,
})
module.enable = function(self)
if not PetFrame then return end
-- PetFrame_Update shows the frame again whenever the pet changes, so a
-- plain Hide() does not last. Parent it to a frame that is never shown:
-- the stock pet code keeps running unchanged, and the frame, its bars and
-- its child overlays (such as Real Health Numbers' text) never draw.
if not self.hidden then
self.hidden = CreateFrame("Frame")
self.hidden:Hide()
end
PetFrame:SetParent(self.hidden)
end