big refactoring
This commit is contained in:
@@ -1031,7 +1031,7 @@ function public.CreateAuctionResultsTable(parent, config)
|
||||
rt.scrollFrame = scrollFrame
|
||||
FauxScrollFrame_Update(rt.scrollFrame, 0, numRows, rt.ROW_HEIGHT)
|
||||
|
||||
local scrollBar = getglobal(scrollFrame:GetName()..'ScrollBar')
|
||||
local scrollBar = _g[scrollFrame:GetName()..'ScrollBar']
|
||||
scrollBar:ClearAllPoints()
|
||||
scrollBar:SetPoint('BOTTOMRIGHT', rt, -4, 4)
|
||||
scrollBar:SetPoint('TOPRIGHT', rt, -4, -HEAD_HEIGHT)
|
||||
@@ -1041,8 +1041,8 @@ function public.CreateAuctionResultsTable(parent, config)
|
||||
thumbTex:SetTexture(color.content.background())
|
||||
thumbTex:SetHeight(150)
|
||||
thumbTex:SetWidth(scrollBar:GetWidth())
|
||||
getglobal(scrollBar:GetName()..'ScrollUpButton'):Hide()
|
||||
getglobal(scrollBar:GetName()..'ScrollDownButton'):Hide()
|
||||
_g[scrollBar:GetName()..'ScrollUpButton']:Hide()
|
||||
_g[scrollBar:GetName()..'ScrollDownButton']:Hide()
|
||||
|
||||
-- create the header cells
|
||||
rt.headCells = {}
|
||||
|
||||
+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)
|
||||
|
||||
@@ -48,15 +48,15 @@ function public.create(parent, on_click, selected)
|
||||
scroll_frame:SetPoint('TOPLEFT', content, 'TOPLEFT', 0, 15)
|
||||
scroll_frame:SetPoint('BOTTOMRIGHT', content, 'BOTTOMRIGHT', -4, -15)
|
||||
|
||||
local scrollBar = getglobal(scroll_frame:GetName()..'ScrollBar')
|
||||
local scrollBar = _g[scroll_frame:GetName()..'ScrollBar']
|
||||
scrollBar:SetWidth(12)
|
||||
local thumbTex = scrollBar:GetThumbTexture()
|
||||
thumbTex:SetPoint('CENTER', 0, 0)
|
||||
thumbTex:SetTexture(color.content.background())
|
||||
thumbTex:SetHeight(50)
|
||||
thumbTex:SetWidth(12)
|
||||
getglobal(scrollBar:GetName()..'ScrollUpButton'):Hide()
|
||||
getglobal(scrollBar:GetName()..'ScrollDownButton'):Hide()
|
||||
_g[scrollBar:GetName()..'ScrollUpButton']:Hide()
|
||||
_g[scrollBar:GetName()..'ScrollDownButton']:Hide()
|
||||
|
||||
local rows = {}
|
||||
local row_index = 1
|
||||
|
||||
+3
-3
@@ -424,7 +424,7 @@ function public.CreateScrollingTable(parent)
|
||||
scrollFrame:SetAllPoints(contentFrame)
|
||||
st.scrollFrame = scrollFrame
|
||||
|
||||
local scrollBar = getglobal(scrollFrame:GetName()..'ScrollBar')
|
||||
local scrollBar = _g[scrollFrame:GetName()..'ScrollBar']
|
||||
scrollBar:SetWidth(12)
|
||||
st.scrollBar = scrollBar
|
||||
local thumbTex = scrollBar:GetThumbTexture()
|
||||
@@ -432,8 +432,8 @@ function public.CreateScrollingTable(parent)
|
||||
thumbTex:SetTexture(color.content.background())
|
||||
thumbTex:SetHeight(50)
|
||||
thumbTex:SetWidth(12)
|
||||
getglobal(scrollBar:GetName()..'ScrollUpButton'):Hide()
|
||||
getglobal(scrollBar:GetName()..'ScrollDownButton'):Hide()
|
||||
_g[scrollBar:GetName()..'ScrollUpButton']:Hide()
|
||||
_g[scrollBar:GetName()..'ScrollDownButton']:Hide()
|
||||
|
||||
-- create head line at default position
|
||||
st.headLine = gui.horizontal_line(st, 0)
|
||||
|
||||
Reference in New Issue
Block a user