Skip to content

Commit

Permalink
[wrath] Skin pets/mounts pane
Browse files Browse the repository at this point in the history
Fixes #81
  • Loading branch information
Gethe committed Mar 19, 2023
1 parent 8879a09 commit d522b59
Showing 1 changed file with 84 additions and 12 deletions.
96 changes: 84 additions & 12 deletions Skin/Classic/Interface_Wrath/FrameXML/PetPaperDollFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,74 @@ local _, private = ...
if private.shouldSkip() then return end

--[[ Lua Globals ]]
-- luacheck: globals floor
-- luacheck: globals floor wipe tinsert

--[[ Core ]]
local Aurora = private.Aurora
local Base = Aurora.Base
local Hook, Skin = Aurora.Hook, Aurora.Skin
local Util = Aurora.Util
local Color, Util = Aurora.Color, Aurora.Util

do --[[ FrameXML\PetPaperDollFrame.lua ]]
function Hook.PetTab_Update(self)
_G.CharacterFrameTab3:ClearAllPoints()
local tabs = {}
function Hook.PetPaperDollFrame_UpdateTabs(self)
_G.PetPaperDollFrameTab1:ClearAllPoints()
_G.PetPaperDollFrameTab2:ClearAllPoints()
_G.PetPaperDollFrameTab3:ClearAllPoints()
wipe(tabs)

if _G.HasPetUI() then
_G.CharacterFrameTab3:SetPoint("TOPLEFT", "CharacterFrameTab2", "TOPRIGHT", 1, 0);
else
_G.CharacterFrameTab3:SetPoint("TOPLEFT", "CharacterFrameTab1", "TOPRIGHT", 1, 0);
tinsert(tabs, _G.PetPaperDollFrameTab1)
end
if _G.GetNumCompanions("CRITTER") > 0 then
tinsert(tabs, _G.PetPaperDollFrameTab2)
end
if _G.GetNumCompanions("MOUNT") > 0 then
tinsert(tabs, _G.PetPaperDollFrameTab3)
end

Util.PositionRelative("BOTTOMLEFT", _G.CompanionModelFrame._bg, "TOPLEFT", 20, 1, 1, "Right", tabs)
end
end

--do --[[ FrameXML\PetPaperDollFrame.xml ]]
--end
do --[[ FrameXML\PetPaperDollFrame.xml ]]
function Skin.CompanionButtonTemplate(CheckButton)
Base.SetBackdrop(CheckButton, Color.black, Color.frame.a)
CheckButton._auroraIconBorder = CheckButton

Base.CropIcon(_G[CheckButton:GetName().."ActiveTexture"])

local bg = CheckButton:GetBackdropTexture("bg")
local disabled = CheckButton:GetDisabledTexture()
disabled:SetTexCoord(0.234375, 0.75, 0.234375, 0.75)
disabled:SetPoint("TOPLEFT", bg, 1, -1)
disabled:SetPoint("BOTTOMRIGHT", bg, -1, 1)

Base.CropIcon(CheckButton:GetHighlightTexture())
CheckButton:SetNormalTexture(private.textures.plain)
local normal = CheckButton:GetNormalTexture()
Base.CropIcon(normal)
normal:SetPoint("TOPLEFT", bg, 1, -1)
normal:SetPoint("BOTTOMRIGHT", bg, -1, 1)
end
end

function private.FrameXML.PetPaperDollFrame()
--_G.hooksecurefunc("PetTab_Update", Hook.PetTab_Update)
_G.hooksecurefunc("PetPaperDollFrame_UpdateTabs", Hook.PetPaperDollFrame_UpdateTabs)

local PetPaperDollFrame = _G.PetPaperDollFrame
local TopLeft, TopRight, BotLeft, BotRight = PetPaperDollFrame:GetRegions()

_G.PetNameText:SetAllPoints(_G.CharacterNameText)
local _, TopLeft, TopRight, BotLeft, BotRight = PetPaperDollFrame:GetRegions()
TopLeft:Hide()
TopRight:Hide()
BotLeft:Hide()
BotRight:Hide()

_G.PetNameText:SetAllPoints(_G.CharacterNameText)

--------------
-- PetFrame --
--------------
Skin.FrameTypeStatusBar(_G.PetPaperDollFrameExpBar)
local left, right = _G.PetPaperDollFrameExpBar:GetRegions()
left:Hide()
Expand Down Expand Up @@ -70,4 +105,41 @@ function private.FrameXML.PetPaperDollFrame()
frame:SetPoint("TOPRIGHT", _G["PetMagicResFrame"..i - 1], "BOTTOMRIGHT", 0, -6)
end
end


--------------------
-- CompanionFrame --
--------------------
local slotsBG, modelBG = _G.PetPaperDollFrameCompanionFrame:GetRegions()
slotsBG:Hide()
modelBG:Hide()

Base.SetBackdrop(_G.CompanionModelFrame, Color.frame)
_G.CompanionModelFrame:SetBackdropOption("offsets", {
left = -9,
right = -9,
top = -9,
bottom = -53,
})
_G.CompanionModelFrame._bg = _G.CompanionModelFrame:GetBackdropTexture("bg")

Skin.NavButtonPrevious(_G.CompanionModelFrameRotateLeftButton)
Skin.NavButtonNext(_G.CompanionModelFrameRotateRightButton)
Skin.GameMenuButtonTemplate(_G.CompanionSummonButton)

for i = 1, 12 do
Skin.CompanionButtonTemplate(_G["CompanionButton"..i])
end

Skin.NavButtonPrevious(_G.CompanionPrevPageButton)
Skin.NavButtonNext(_G.CompanionNextPageButton)

Skin.TabButtonTemplate(_G.PetPaperDollFrameTab1)
Skin.TabButtonTemplate(_G.PetPaperDollFrameTab2)
Skin.TabButtonTemplate(_G.PetPaperDollFrameTab3)


--------------
-- PetFrame --
--------------
end

0 comments on commit d522b59

Please sign in to comment.