Skip to content

Commit

Permalink
Added skin for new macro/character icon selection frame.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wetxius committed Nov 2, 2016
1 parent 7c375c8 commit a094934
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 93 deletions.
43 changes: 43 additions & 0 deletions ShestakUI/Core/Functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,49 @@ function T.SkinSlider(f)
slider:SetBlendMode("ADD")
end

function T.SkinIconSelectionFrame(frame, numIcons, buttonNameTemplate, frameNameOverride)
local frameName = frameNameOverride or frame:GetName()
local scrollFrame = _G[frameName.."ScrollFrame"]
local editBox = _G[frameName.."EditBox"]
local okayButton = _G[frameName.."OkayButton"] or _G[frameName.."Okay"]
local cancelButton = _G[frameName.."CancelButton"] or _G[frameName.."Cancel"]

frame:StripTextures()
frame.BorderBox:StripTextures()
scrollFrame:StripTextures()
scrollFrame:CreateBackdrop("Overlay")
scrollFrame.backdrop:SetPoint("TOPLEFT", 15, 4)
scrollFrame.backdrop:SetPoint("BOTTOMRIGHT", 28, -8)
editBox:DisableDrawLayer("BACKGROUND")

frame:SetTemplate("Transparent")
frame:SetHeight(frame:GetHeight() + 10)
scrollFrame:SetHeight(scrollFrame:GetHeight() + 10)

okayButton:SkinButton()
cancelButton:SkinButton()
T.SkinEditBox(editBox)

cancelButton:ClearAllPoints()
cancelButton:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -5, 5)

if buttonNameTemplate then
for i = 1, numIcons do
local button = _G[buttonNameTemplate..i]
local icon = _G[button:GetName().."Icon"]

button:StripTextures()
button:StyleButton(true)
button:SetTemplate("Default")

icon:ClearAllPoints()
icon:SetPoint("TOPLEFT", 2, -2)
icon:SetPoint("BOTTOMRIGHT", -2, 2)
icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
end
end
end

local LoadBlizzardSkin = CreateFrame("Frame")
LoadBlizzardSkin:RegisterEvent("ADDON_LOADED")
LoadBlizzardSkin:SetScript("OnEvent", function(self, event, addon)
Expand Down
34 changes: 2 additions & 32 deletions ShestakUI/Modules/Skins/Blizzard/Character.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,40 +161,10 @@ local function LoadSkin()
object.icon:SetSize(36, 36)
object.icon.SetSize = T.dummy
end
GearManagerDialogPopup:StripTextures()
GearManagerDialogPopup:SetTemplate("Transparent")
GearManagerDialogPopup:SetPoint("TOPLEFT", PaperDollFrame, "TOPRIGHT", 3, 0)
GearManagerDialogPopupScrollFrame:StripTextures()
GearManagerDialogPopupEditBox:StripTextures(true)
GearManagerDialogPopupEditBox:SetTemplate("Overlay")
GearManagerDialogPopupEditBox:SetTextInsets(3, 0, 0, 0)
GearManagerDialogPopupOkay:SkinButton()
GearManagerDialogPopupCancel:SkinButton()
GearManagerDialogPopupScrollFrame:SetPoint("TOPRIGHT", -34, -64)

for i = 1, NUM_GEARSET_ICONS_SHOWN do
local button = _G["GearManagerDialogPopupButton"..i]
local icon = button.icon

if button then
button:StripTextures()
button:StyleButton(true)

icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
_G["GearManagerDialogPopupButton"..i.."Icon"]:SetTexture(nil)

icon:ClearAllPoints()
icon:SetPoint("TOPLEFT", 2, -2)
icon:SetPoint("BOTTOMRIGHT", -2, 2)
button:SetFrameLevel(button:GetFrameLevel() + 2)
if not button.backdrop then
button:CreateBackdrop("Default")
button.backdrop:SetAllPoints()
end
end
end
end)

T.SkinIconSelectionFrame(GearManagerDialogPopup, NUM_GEARSET_ICONS_SHOWN, "GearManagerDialogPopupButton", frameNameOverride)

-- Handle Tabs at bottom of character frame
for i = 1, 4 do
T.SkinTab(_G["CharacterFrameTab"..i])
Expand Down
26 changes: 1 addition & 25 deletions ShestakUI/Modules/Skins/Blizzard/GuildBank.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,31 +94,7 @@ local function LoadSkin()
GuildBankFrameTab1:SetPoint("TOPLEFT", GuildBankFrame, "BOTTOMLEFT", 0, 2)

-- Popup
GuildBankPopupFrame:CreateBackdrop("Transparent")
GuildBankPopupFrame.backdrop:SetPoint("TOPLEFT", 5, 0)
GuildBankPopupFrame.backdrop:SetPoint("BOTTOMRIGHT", -25, 23)
GuildBankPopupFrame:StripTextures()
GuildBankPopupFrame:SetPoint("TOPLEFT", GuildBankFrame, "TOPRIGHT", -4, 0)

GuildBankPopupCancelButton:SkinButton(true)
GuildBankPopupOkayButton:SkinButton(true)
GuildBankPopupScrollFrame:StripTextures()
GuildBankPopupEditBox:StripTextures(true)
T.SkinEditBox(GuildBankPopupEditBox, nil, GuildBankPopupEditBox:GetHeight() - 5)

for i = 1, 16 do
local button = _G["GuildBankPopupButton"..i]
local texture = _G["GuildBankPopupButton"..i.."Icon"]

button:StripTextures()
button:StyleButton()
button:SetTemplate("Default")

texture:ClearAllPoints()
texture:SetPoint("TOPLEFT", 2, -2)
texture:SetPoint("BOTTOMRIGHT", -2, 2)
texture:SetTexCoord(0.1, 0.9, 0.1, 0.9)
end
T.SkinIconSelectionFrame(GuildBankPopupFrame, NUM_GUILDBANK_ICONS_SHOWN, nil, "GuildBankPopup")
end

T.SkinFuncs["Blizzard_GuildBankUI"] = LoadSkin
39 changes: 3 additions & 36 deletions ShestakUI/Modules/Skins/Blizzard/Macro.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ local function LoadSkin()
"MacroEditButton",
"MacroFrameTab1",
"MacroFrameTab2",
"MacroPopupOkayButton",
"MacroPopupCancelButton",
"MacroSaveButton",
"MacroCancelButton"
}
Expand Down Expand Up @@ -43,19 +41,6 @@ local function LoadSkin()

MacroButtonScrollFrame:CreateBackdrop("Overlay")

MacroPopupFrame:StripTextures()
MacroPopupFrame:SetTemplate("Transparent")

MacroPopupScrollFrame:StripTextures()
MacroPopupScrollFrame:CreateBackdrop("Overlay")
MacroPopupScrollFrame.backdrop:SetPoint("TOPLEFT", 51, 2)
MacroPopupScrollFrame.backdrop:SetPoint("BOTTOMRIGHT", -4, 4)

MacroPopupEditBox:StripTextures(true)
MacroPopupEditBox:CreateBackdrop("Overlay")
MacroPopupEditBox.backdrop:SetPoint("TOPLEFT", -3, 0)
MacroPopupEditBox.backdrop:SetPoint("BOTTOMRIGHT", 0, 0)

T.SkinCloseButton(MacroFrameCloseButton, MacroFrame.backdrop)

-- Reposition buttons
Expand All @@ -72,11 +57,6 @@ local function LoadSkin()
T.SkinScrollBar(MacroFrameScrollFrameScrollBar)
T.SkinScrollBar(MacroPopupScrollFrameScrollBar)

MacroPopupFrame:HookScript("OnShow", function(self)
self:ClearAllPoints()
self:SetPoint("TOPLEFT", MacroFrame, "TOPRIGHT", 3, 0)
end)

-- Big icon
MacroFrameSelectedMacroButton:StripTextures()
MacroFrameSelectedMacroButton:StyleButton(true)
Expand All @@ -95,9 +75,6 @@ local function LoadSkin()
for i = 1, MAX_ACCOUNT_MACROS do
local b = _G["MacroButton"..i]
local t = _G["MacroButton"..i.."Icon"]
local pb = _G["MacroPopupButton"..i]
local pt = _G["MacroPopupButton"..i.."Icon"]

if b then
b:StripTextures()
b:StyleButton(true)
Expand All @@ -110,20 +87,10 @@ local function LoadSkin()
t:SetPoint("TOPLEFT", 2, -2)
t:SetPoint("BOTTOMRIGHT", -2, 2)
end

if pb then
pb:StripTextures()
pb:StyleButton(true)
pb:SetTemplate("Default")
end

if pt then
pt:SetTexCoord(0.1, 0.9, 0.1, 0.9)
pt:ClearAllPoints()
pt:SetPoint("TOPLEFT", 2, -2)
pt:SetPoint("BOTTOMRIGHT", -2, 2)
end
end

-- Icon selection frame
T.SkinIconSelectionFrame(MacroPopupFrame, NUM_MACRO_ICONS_SHOWN, nil, "MacroPopup")
end

T.SkinFuncs["Blizzard_MacroUI"] = LoadSkin
21 changes: 21 additions & 0 deletions ShestakUI/Modules/Skins/Blizzard/Others.lua
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,27 @@ SkinBlizzUI:SetScript("OnEvent", function(self, event, addon)
CliqueSpellTab.backdrop:SetAllPoints()
CliqueSpellTab:StyleButton()
end

local function SkinIconArray(baseName, rowSize, numRows)
for i = 1, rowSize * numRows do
local button = _G[baseName..i]
local texture = _G[baseName..i.."Icon"]

button:StripTextures()
button:StyleButton(true)
button:SetTemplate("Default")

texture:ClearAllPoints()
texture:SetPoint("TOPLEFT", 2, -2)
texture:SetPoint("BOTTOMRIGHT", -2, 2)
texture:SetTexCoord(0.1, 0.9, 0.1, 0.9)
end
end

-- This is used to create icons for the GuildBankPopupFrame, MacroPopupFrame, and GearManagerDialogPopup
hooksecurefunc("BuildIconArray", function(parent, baseName, template, rowSize, numRows, onButtonCreated)
SkinIconArray(baseName, rowSize, numRows)
end)
end
end

Expand Down

0 comments on commit a094934

Please sign in to comment.