big refactoring
This commit is contained in:
+14
-14
@@ -57,7 +57,7 @@ do
|
||||
blizzard_backdrop = DropDownList1Backdrop:GetBackdrop()
|
||||
hook('ToggleDropDownMenu', function(...)
|
||||
local ret = {orig.ToggleDropDownMenu(unpack(arg))}
|
||||
local dropdown = getglobal(arg[4] or '') or this:GetParent()
|
||||
local dropdown = _g[arg[4] or ''] or this:GetParent()
|
||||
if strfind(dropdown:GetName() or '', '^aux_frame%d+$') then
|
||||
set_aux_dropdown_style(dropdown)
|
||||
else
|
||||
@@ -75,20 +75,20 @@ do
|
||||
DropDownList1:ClearAllPoints()
|
||||
DropDownList1:SetPoint('TOPLEFT', dropdown, 'BOTTOMLEFT', -2, -2)
|
||||
for i=1,UIDROPDOWNMENU_MAXBUTTONS do
|
||||
local button = getglobal('DropDownList1Button'..i)
|
||||
local button = _g['DropDownList1Button'..i]
|
||||
button:SetPoint('TOPLEFT', 0, -((button:GetID() - 1) * UIDROPDOWNMENU_BUTTON_HEIGHT) - 7)
|
||||
button:SetPoint('TOPRIGHT', 0, -((button:GetID() - 1) * UIDROPDOWNMENU_BUTTON_HEIGHT) - 7)
|
||||
local text = button:GetFontString()
|
||||
text:SetFont(font, font_size.small2)
|
||||
text:SetPoint('TOPLEFT', 18, 0)
|
||||
text:SetPoint('BOTTOMRIGHT', -8, 0)
|
||||
local highlight = getglobal('DropDownList1Button'..i..'Highlight')
|
||||
local highlight = _g['DropDownList1Button'..i..'Highlight']
|
||||
highlight:ClearAllPoints()
|
||||
highlight:SetDrawLayer 'OVERLAY'
|
||||
highlight:SetHeight(14)
|
||||
highlight:SetPoint('LEFT', 5, 0)
|
||||
highlight:SetPoint('RIGHT', -3, 0)
|
||||
local check = getglobal('DropDownList1Button'..i..'Check')
|
||||
local check = _g['DropDownList1Button'..i..'Check']
|
||||
check:SetWidth(16)
|
||||
check:SetHeight(16)
|
||||
check:SetPoint('LEFT', 3, -1)
|
||||
@@ -100,14 +100,14 @@ do
|
||||
aux_border:Hide()
|
||||
aux_background:Hide()
|
||||
for i=1,UIDROPDOWNMENU_MAXBUTTONS do
|
||||
local button = getglobal('DropDownList1Button'..i)
|
||||
local button = _g['DropDownList1Button'..i]
|
||||
local text = button:GetFontString()
|
||||
text:SetFont([[Fonts\FRIZQT__.ttf]], 10)
|
||||
text:SetShadowOffset(1, -1)
|
||||
local highlight = getglobal('DropDownList1Button'..i..'Highlight')
|
||||
local highlight = _g['DropDownList1Button'..i..'Highlight']
|
||||
highlight:SetAllPoints()
|
||||
highlight:SetDrawLayer 'BACKGROUND'
|
||||
local check = getglobal('DropDownList1Button'..i..'Check')
|
||||
local check = _g['DropDownList1Button'..i..'Check']
|
||||
check:SetWidth(24)
|
||||
check:SetHeight(24)
|
||||
check:SetPoint('LEFT', 0, 0)
|
||||
@@ -464,13 +464,13 @@ function public.item(parent)
|
||||
btn:SetPoint('LEFT', 2, .5)
|
||||
btn:SetHighlightTexture(nil)
|
||||
btn:RegisterForClicks()
|
||||
item.texture = getglobal(btn:GetName()..'Icon')
|
||||
item.texture = _g[btn:GetName()..'Icon']
|
||||
item.texture:SetTexCoord(.06, .94, .06, .94)
|
||||
item.name = label(btn, 15)
|
||||
item.name:SetJustifyH 'LEFT'
|
||||
item.name:SetPoint('LEFT', btn, 'RIGHT', 10, 0)
|
||||
item.name:SetPoint('RIGHT', item, 'RIGHT', -10, .5)
|
||||
item.count = getglobal(btn:GetName()..'Count')
|
||||
item.count = _g[btn:GetName()..'Count']
|
||||
item.count:SetTextHeight(17)
|
||||
return item
|
||||
end
|
||||
@@ -512,17 +512,17 @@ function public.dropdown(parent)
|
||||
local dropdown = CreateFrame('Frame', name, parent, 'UIDropDownMenuTemplate')
|
||||
set_content_style(dropdown, 0, 0, 4, 4)
|
||||
|
||||
getglobal(dropdown:GetName()..'Left'):Hide()
|
||||
getglobal(dropdown:GetName()..'Middle'):Hide()
|
||||
getglobal(dropdown:GetName()..'Right'):Hide()
|
||||
_g[dropdown:GetName()..'Left']:Hide()
|
||||
_g[dropdown:GetName()..'Middle']:Hide()
|
||||
_g[dropdown:GetName()..'Right']:Hide()
|
||||
|
||||
local button = getglobal(dropdown:GetName()..'Button')
|
||||
local button = _g[dropdown:GetName()..'Button']
|
||||
button:ClearAllPoints()
|
||||
button:SetScale(0.9)
|
||||
button:SetPoint('RIGHT', dropdown, 0, 0)
|
||||
dropdown.button = button
|
||||
|
||||
local text = getglobal(dropdown:GetName()..'Text')
|
||||
local text = _g[dropdown:GetName()..'Text']
|
||||
text:ClearAllPoints()
|
||||
text:SetPoint('RIGHT', button, 'LEFT', -2, 0)
|
||||
text:SetPoint('LEFT', 8, 0)
|
||||
|
||||
Reference in New Issue
Block a user