Skip to content

Commit

Permalink
Start to skin the new designed StableFrame WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Merathilis committed Apr 12, 2024
1 parent 70c2c4b commit 37dd5d3
Showing 1 changed file with 19 additions and 65 deletions.
84 changes: 19 additions & 65 deletions ElvUI/Mainline/Modules/Skins/Stable.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,73 +2,27 @@ local E, L, V, P, G = unpack(ElvUI)
local S = E:GetModule('Skins')

local _G = _G
local unpack = unpack
local CreateFrame = CreateFrame

local function PetButtons(btn, p)
local button = _G[btn]
local icon = _G[btn..'IconTexture']
local highlight = button:GetHighlightTexture()
button:StripTextures()

if button.Checked then
button.Checked:SetColorTexture(unpack(E.media.rgbvaluecolor))
button.Checked:SetAllPoints(icon)
button.Checked:SetAlpha(0.3)
end

if highlight then
highlight:SetColorTexture(1, 1, 1, 0.3)
highlight:SetAllPoints(icon)
end

if icon then
icon:SetTexCoord(unpack(E.TexCoords))
icon:ClearAllPoints()
icon:Point('TOPLEFT', p, -p)
icon:Point('BOTTOMRIGHT', -p, p)

button:SetFrameLevel(button:GetFrameLevel() + 2)
button:SetTemplate(nil, true)
end
end

function S:PetStableFrame()
function S:Blizzard_StableUI()
if not (E.private.skins.blizzard.enable and E.private.skins.blizzard.stable) then return end

local PetStableFrame = _G.PetStableFrame
S:HandlePortraitFrame(PetStableFrame)

_G.PetStableLeftInset:Hide()
_G.PetStableBottomInset:Hide()
_G.PetStableFrameModelBg:Hide()
_G.PetStableDietTexture:SetTexture(132165)
_G.PetStableDietTexture:SetTexCoord(unpack(E.TexCoords))
_G.PetStableFrameInset:SetTemplate('Transparent')

S:HandleModelSceneControlButtons(_G.PetStableModelScene.ControlFrame)
S:HandleButton(_G.PetStablePrevPageButton) -- Required to remove graphical glitch from Prev page button
S:HandleButton(_G.PetStableNextPageButton) -- Required to remove graphical glitch from Next page button

local p = E.PixelMode and 1 or 2
local PetStableSelectedPetIcon = _G.PetStableSelectedPetIcon
if PetStableSelectedPetIcon then
PetStableSelectedPetIcon:SetTexCoord(unpack(E.TexCoords))

local b = CreateFrame('Frame', nil, PetStableSelectedPetIcon:GetParent())
b:Point('TOPLEFT', PetStableSelectedPetIcon, -p, p)
b:Point('BOTTOMRIGHT', PetStableSelectedPetIcon, p, -p)
PetStableSelectedPetIcon:Size(37)
PetStableSelectedPetIcon:SetParent(b)
b:SetTemplate()
end

for i = 1, _G.NUM_PET_ACTIVE_SLOTS do
PetButtons('PetStableActivePet' .. i, p)
end
for i = 1, _G.NUM_PET_STABLE_SLOTS do
PetButtons('PetStableStabledPet' .. i, p)
end
local StableFrame = _G.StableFrame
S:HandlePortraitFrame(StableFrame)
StableFrame.MainHelpButton:Hide()
S:HandleButton(StableFrame.StableTogglePetButton)
S:HandleButton(StableFrame.ReleasePetButton)

local StabledPetList = StableFrame.StabledPetList
StabledPetList:StripTextures()
StabledPetList.ListCounter:StripTextures()
StabledPetList.ListCounter:CreateBackdrop('Transparent')
S:HandleEditBox(StabledPetList.FilterBar.SearchBox)
S:HandleButton(StabledPetList.FilterBar.FilterButton)
S:HandleTrimScrollBar(StabledPetList.ScrollBar)

local StableModelScene = StableFrame.PetModelScene
--S:HandleButton(StableModelScene.PetInfo.NameBox.EditButton) -- ToDo: 10.2.7: Halp, Fix me
S:HandleModelSceneControlButtons(StableModelScene.ControlFrame)
end

S:AddCallback('PetStableFrame')
S:AddCallbackForAddon('Blizzard_StableUI')

0 comments on commit 37dd5d3

Please sign in to comment.