diff --git a/vanilla/Interface/FrameXML/MoonWellUI/Fixes.lua b/vanilla/Interface/FrameXML/MoonWellUI/Fixes.lua new file mode 100644 index 0000000..ae30a9e --- /dev/null +++ b/vanilla/Interface/FrameXML/MoonWellUI/Fixes.lua @@ -0,0 +1,18 @@ +-- 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 diff --git a/vanilla/Interface/FrameXML/MoonWellUI/Forever/SpellBook.lua b/vanilla/Interface/FrameXML/MoonWellUI/Forever/SpellBook.lua index a5ae33f..467929f 100644 --- a/vanilla/Interface/FrameXML/MoonWellUI/Forever/SpellBook.lua +++ b/vanilla/Interface/FrameXML/MoonWellUI/Forever/SpellBook.lua @@ -689,6 +689,14 @@ local function layoutTabs(cats, selected) b:ClearAllPoints() b:SetPoint("TOPLEFT", tabs, "TOPLEFT", (i - 1) * (G.tabW + G.tabGap), 0) b:Show() + -- LEARNED_SPELL_IN_TAB's glow (SpellBookSkillLineTabFlash, 64 on a 32 tab) on our tab + local flash = getglobal("SpellBookSkillLineTab" .. i .. "Flash") + if flash and not cat.pet then + flash:ClearAllPoints() + flash:SetPoint("CENTER", b, "CENTER", 0, 0) + flash:SetWidth(G.tabW * 2) + flash:SetHeight(G.tabH * 2) + end if i == selected then b.frame:Hide() b.active:Show() @@ -702,6 +710,7 @@ local function layoutTabs(cats, selected) for i = table.getn(cats) + 1, table.getn(tabs.buttons) do tabs.buttons[i]:Hide() end + SpellBookTabFlashFrame:SetFrameLevel(tabs:GetFrameLevel() + 3) end -- ------------------------------------------------------------ Build @@ -794,13 +803,14 @@ local function build() createSettings(pages) end --- Hides 1.12's regions and frames in SpellBookFrame, except the book and the close button. +-- Hides 1.12's regions and frames in SpellBookFrame, except the book, the close button and +-- the tabs' flash, which UIFrameFlash shows on our tabs. function B.suppressClient() for _, region in ipairs({ SpellBookFrame:GetRegions() }) do suppress(region) end for _, child in ipairs({ SpellBookFrame:GetChildren() }) do - if child ~= B.book and child ~= SpellBookCloseButton then + if child ~= B.book and child ~= SpellBookCloseButton and child ~= SpellBookTabFlashFrame then suppress(child) end end @@ -839,6 +849,11 @@ function B.choose(index) B.state.category, B.state.page = index, 1 -- so P and Shift-P toggle as 1.12's book does SpellBookFrame.bookType = cat.book + -- SpellBookSkillLineTab_OnClick: a chosen tab stops flashing + local flash = not cat.pet and getglobal("SpellBookSkillLineTab" .. index .. "Flash") + if flash then + flash:Hide() + end B.update() end diff --git a/vanilla/Interface/FrameXML/MoonWellUI/MoonWellUI.xml b/vanilla/Interface/FrameXML/MoonWellUI/MoonWellUI.xml index 871a401..acc762d 100644 --- a/vanilla/Interface/FrameXML/MoonWellUI/MoonWellUI.xml +++ b/vanilla/Interface/FrameXML/MoonWellUI/MoonWellUI.xml @@ -2,6 +2,7 @@ ..\UI.xsd">