Files
moon-well-ui/vanilla/Interface/FrameXML/MoonWellUI/Fixes.lua
T
sindoring c7ff319ccc Fix the pet stat tooltip and the spellbook tab flash
PaperDollStatTooltip upper-cases UnitClass(unit)'s token, and a unit whose
class byte has no ChrClasses row answers two nils (UnitClass, 0x518350):
the server's demons do, so hovering the pet page's stats raised "bad
argument #1 to strupper". Such a unit now gets the stock default line, in
both styles.

LEARNED_SPELL_IN_TAB's glow flashed where 1.12's hidden skill line tabs
stood: it now sits on the book's own tabs, and choosing a tab stops it, as
SpellBookSkillLineTab_OnClick does.

Verified: harness probe (the pet tooltip shows the default strength line,
no error; the tab 2 glow's center matches our tab 2's; choosing tab 2
hides it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 20:36:06 +04:00

19 lines
856 B
Lua

-- Fixes to stock 1.12 Lua that MoonWell needs in both styles.
-- PaperDollStatTooltip (PaperDollFrame.lua) builds the class line's string name from
-- UnitClass(unit)'s token with strupper. A unit whose class byte has no ChrClasses row answers
-- two nils (UnitClass, 0x518350): the server's demons do, so the pet page's stats raised
-- "bad argument #1 to `strupper'". Such a unit gets the default line, the stock fallback.
local stockStatTooltip = PaperDollStatTooltip
function PaperDollStatTooltip(unit, stat)
local _, token = UnitClass(unit or "player")
if token then
return stockStatTooltip(unit, stat)
end
GameTooltip:SetOwner(this, "ANCHOR_RIGHT")
GameTooltip:SetText(this.tooltip)
GameTooltip:AddLine(getglobal("DEFAULT_" .. stat .. "_TOOLTIP"), NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g,
NORMAL_FONT_COLOR.b, 1)
GameTooltip:Show()
end