You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
145 lines
4.5 KiB
145 lines
4.5 KiB
|
4 years ago
|
local E, L, V, P, G = unpack(ElvUI)
|
||
|
5 years ago
|
local S = E:GetModule('Skins')
|
||
|
|
|
||
|
|
local _G = _G
|
||
|
|
local unpack = unpack
|
||
|
4 years ago
|
|
||
|
5 years ago
|
local HideUIPanel = HideUIPanel
|
||
|
|
local ShowUIPanel = ShowUIPanel
|
||
|
|
|
||
|
|
function S:Blizzard_MacroUI()
|
||
|
|
if not (E.private.skins.blizzard.enable and E.private.skins.blizzard.macro) then return end
|
||
|
|
|
||
|
|
local MacroFrame = _G.MacroFrame
|
||
|
4 years ago
|
S:HandleFrame(MacroFrame, true, nil, -5, 0, -2, -1)
|
||
|
|
|
||
|
|
_G.MacroFrameCloseButton:Point('TOPRIGHT', 0, 2)
|
||
|
5 years ago
|
|
||
|
|
_G.MacroFrameTextBackground:StripTextures()
|
||
|
4 years ago
|
_G.MacroFrameTextBackground:CreateBackdrop('Default')
|
||
|
|
_G.MacroFrameTextBackground.backdrop:Point('TOPLEFT', 0, -3)
|
||
|
|
_G.MacroFrameTextBackground.backdrop:Point('BOTTOMRIGHT', -3, 2)
|
||
|
|
|
||
|
5 years ago
|
_G.MacroButtonScrollFrame:StripTextures()
|
||
|
4 years ago
|
_G.MacroButtonScrollFrame:CreateBackdrop('Default')
|
||
|
|
_G.MacroButtonScrollFrame:Point('TOPLEFT', 8, -65)
|
||
|
5 years ago
|
|
||
|
|
S:HandleScrollBar(_G.MacroButtonScrollFrameScrollBar)
|
||
|
|
S:HandleScrollBar(_G.MacroFrameScrollFrameScrollBar)
|
||
|
|
|
||
|
|
local buttons = {
|
||
|
|
_G.MacroSaveButton,
|
||
|
|
_G.MacroCancelButton,
|
||
|
|
_G.MacroDeleteButton,
|
||
|
|
_G.MacroNewButton,
|
||
|
|
_G.MacroExitButton,
|
||
|
|
_G.MacroEditButton,
|
||
|
|
}
|
||
|
|
|
||
|
|
for i = 1, #buttons do
|
||
|
|
buttons[i]:StripTextures()
|
||
|
|
S:HandleButton(buttons[i])
|
||
|
|
end
|
||
|
|
|
||
|
4 years ago
|
_G.MacroCancelButton:ClearAllPoints()
|
||
|
|
_G.MacroCancelButton:Point('TOPRIGHT', _G.MacroFrameTextBackground.backdrop, 'TOPRIGHT', 0, 34)
|
||
|
|
_G.MacroSaveButton:Point('BOTTOMLEFT', _G.MacroCancelButton, 'TOPLEFT', 0, 2)
|
||
|
|
|
||
|
|
_G.MacroDeleteButton:Point('BOTTOMLEFT', 0, 4)
|
||
|
|
_G.MacroExitButton:Point('BOTTOMRIGHT', -7, 4)
|
||
|
|
|
||
|
5 years ago
|
_G.MacroNewButton:ClearAllPoints()
|
||
|
4 years ago
|
_G.MacroNewButton:SetPoint('TOPRIGHT', _G.MacroExitButton, 'TOPLEFT', -2 , 0)
|
||
|
5 years ago
|
|
||
|
|
for i = 1, 2 do
|
||
|
4 years ago
|
local tab = _G['MacroFrameTab'..i]
|
||
|
|
tab:StripTextures()
|
||
|
|
S:HandleButton(tab)
|
||
|
|
|
||
|
5 years ago
|
tab:Height(22)
|
||
|
4 years ago
|
tab:ClearAllPoints()
|
||
|
|
|
||
|
|
if i == 1 then
|
||
|
|
tab:Point('TOPLEFT', MacroFrame, 'TOPLEFT', 7, -40)
|
||
|
|
tab:Width(125)
|
||
|
|
elseif i == 2 then
|
||
|
|
tab:Point('TOPRIGHT', MacroFrame, 'TOPRIGHT', -35, -40)
|
||
|
|
tab:Width(168)
|
||
|
|
end
|
||
|
|
|
||
|
|
tab.SetWidth = E.noop
|
||
|
5 years ago
|
end
|
||
|
|
|
||
|
|
--Reposition edit button
|
||
|
|
_G.MacroEditButton:ClearAllPoints()
|
||
|
|
_G.MacroEditButton:Point('BOTTOMLEFT', _G.MacroFrameSelectedMacroButton, 'BOTTOMRIGHT', 10, 0)
|
||
|
|
|
||
|
4 years ago
|
-- Regular scroll bar
|
||
|
|
S:HandleScrollBar(_G.MacroButtonScrollFrame)
|
||
|
|
|
||
|
5 years ago
|
-- Big icon
|
||
|
|
_G.MacroFrameSelectedMacroButton:StripTextures()
|
||
|
|
_G.MacroFrameSelectedMacroButton:StyleButton(true)
|
||
|
|
_G.MacroFrameSelectedMacroButton:GetNormalTexture():SetTexture()
|
||
|
|
_G.MacroFrameSelectedMacroButton:SetTemplate()
|
||
|
|
_G.MacroFrameSelectedMacroButtonIcon:SetTexCoord(unpack(E.TexCoords))
|
||
|
|
_G.MacroFrameSelectedMacroButtonIcon:Point('TOPLEFT', 1, -1)
|
||
|
|
_G.MacroFrameSelectedMacroButtonIcon:Point('BOTTOMRIGHT', -1, 1)
|
||
|
|
|
||
|
|
-- Skin all buttons
|
||
|
|
for i = 1, _G.MAX_ACCOUNT_MACROS do
|
||
|
|
local b = _G['MacroButton'..i]
|
||
|
|
local t = _G['MacroButton'..i..'Icon']
|
||
|
|
|
||
|
|
if b then
|
||
|
|
b:StripTextures()
|
||
|
|
b:StyleButton(true)
|
||
|
4 years ago
|
b:SetTemplate(nil, true)
|
||
|
5 years ago
|
end
|
||
|
|
|
||
|
|
if t then
|
||
|
|
t:SetTexCoord(unpack(E.TexCoords))
|
||
|
|
t:Point('TOPLEFT', 1, -1)
|
||
|
|
t:Point('BOTTOMRIGHT', -1, 1)
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
--Icon selection frame
|
||
|
|
ShowUIPanel(MacroFrame) --Toggle frame to create necessary variables needed for popup frame
|
||
|
|
HideUIPanel(MacroFrame)
|
||
|
|
local MacroPopupFrame = _G.MacroPopupFrame
|
||
|
|
MacroPopupFrame:Show() --Toggle the frame in order to create the necessary button elements
|
||
|
|
MacroPopupFrame:Hide()
|
||
|
|
|
||
|
|
-- Popout Frame
|
||
|
4 years ago
|
S:HandleButton(_G.MacroPopupFrame.BorderBox.OkayButton)
|
||
|
|
_G.MacroPopupFrame.BorderBox.OkayButton:Point('TOPRIGHT', _G.MacroPopupFrame.BorderBox.CancelButton, 'TOPLEFT', -2, 0)
|
||
|
|
S:HandleButton(_G.MacroPopupFrame.BorderBox.CancelButton)
|
||
|
|
_G.MacroPopupFrame.BorderBox.CancelButton:Point('BOTTOMRIGHT', _G.MacroPopupFrame.BorderBox, 'BOTTOMRIGHT', -4, 4)
|
||
|
|
|
||
|
|
if _G.MacroPopupButton1 then -- Doesn't exist if you open it in combat for some reason
|
||
|
|
_G.MacroPopupButton1:Point('TOPLEFT', _G.MacroPopupScrollFrame, 'TOPLEFT', 6, -6)
|
||
|
|
end
|
||
|
|
|
||
|
|
_G.MacroPopupScrollFrame:CreateBackdrop('Default')
|
||
|
|
_G.MacroPopupScrollFrame.backdrop:Point('BOTTOMRIGHT', -2, -1)
|
||
|
|
_G.MacroPopupScrollFrame:Point('TOPLEFT', _G.MacroPopupFrame.BorderBox, 'TOPLEFT', 25, -75)
|
||
|
|
|
||
|
5 years ago
|
S:HandleScrollBar(_G.MacroPopupScrollFrameScrollBar)
|
||
|
|
S:HandleEditBox(_G.MacroPopupEditBox)
|
||
|
4 years ago
|
_G.MacroPopupEditBox:Point('TOPLEFT', 25, -25)
|
||
|
|
|
||
|
5 years ago
|
_G.MacroPopupNameLeft:SetTexture()
|
||
|
|
_G.MacroPopupNameMiddle:SetTexture()
|
||
|
|
_G.MacroPopupNameRight:SetTexture()
|
||
|
|
|
||
|
|
S:HandleIconSelectionFrame(MacroPopupFrame, _G.NUM_MACRO_ICONS_SHOWN, 'MacroPopupButton', 'MacroPopup')
|
||
|
|
|
||
|
4 years ago
|
MacroPopupFrame:HookScript('OnShow', function(frame)
|
||
|
|
frame:ClearAllPoints()
|
||
|
|
frame:Point('TOPLEFT', MacroFrame, 'TOPRIGHT', 2, 0)
|
||
|
5 years ago
|
end)
|
||
|
|
end
|
||
|
|
|
||
|
|
S:AddCallbackForAddon('Blizzard_MacroUI')
|