From 37dd5d30c27af53b02584c12e060db41dbcd127e Mon Sep 17 00:00:00 2001 From: Merathilis Date: Fri, 12 Apr 2024 15:09:25 +0200 Subject: [PATCH] Start to skin the new designed StableFrame WIP --- ElvUI/Mainline/Modules/Skins/Stable.lua | 84 ++++++------------------- 1 file changed, 19 insertions(+), 65 deletions(-) diff --git a/ElvUI/Mainline/Modules/Skins/Stable.lua b/ElvUI/Mainline/Modules/Skins/Stable.lua index e5f95d7f1e..47346a4441 100644 --- a/ElvUI/Mainline/Modules/Skins/Stable.lua +++ b/ElvUI/Mainline/Modules/Skins/Stable.lua @@ -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')