refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-08-28 03:00:16 +02:00
parent f42e54a4fc
commit c07c3dad6f
16 changed files with 92 additions and 92 deletions
+8 -8
View File
@@ -508,7 +508,7 @@ public.bids_config = {
fill = function(cell, record)
local status
if record.high_bidder then
status = color.yellow 'High Bidder'
status = color.yellow('High Bidder')
else
status = color.red 'Outbid'
end
@@ -732,9 +732,9 @@ local methods = {
-- update sorting highlights
for _, cell in self.headCells do
local tex = cell:GetNormalTexture()
tex:SetTexture [[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]]
tex:SetTexture([[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]])
tex:SetTexCoord(.017, 1, .083, .909)
tex:SetAlpha(0.5)
tex:SetAlpha(.5)
end
if getn(self.sorts) > 0 then
@@ -1062,8 +1062,8 @@ function public.CreateAuctionResultsTable(parent, config)
cell:SetScript('OnClick', rt.OnHeadColumnClick)
local text = cell:CreateFontString()
text:SetJustifyH 'CENTER'
text:SetJustifyV 'CENTER'
text:SetJustifyH('CENTER')
text:SetJustifyV('CENTER')
text:SetFont(gui.font, 12)
text:SetTextColor(color.label.enabled())
cell:SetFontString(text)
@@ -1072,14 +1072,14 @@ function public.CreateAuctionResultsTable(parent, config)
local tex = cell:CreateTexture()
tex:SetAllPoints()
tex:SetTexture [[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]]
tex:SetTexture([[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]])
tex:SetTexCoord(.017, 1, .083, .909)
tex:SetAlpha(.5)
cell:SetNormalTexture(tex)
local tex = cell:CreateTexture()
tex:SetAllPoints()
tex:SetTexture [[Interface\Buttons\UI-Listbox-Highlight]]
tex:SetTexture([[Interface\Buttons\UI-Listbox-Highlight]])
tex:SetTexCoord(.025, .957, .087, .931)
tex:SetAlpha(.2)
cell:SetHighlightTexture(tex)
@@ -1112,7 +1112,7 @@ function public.CreateAuctionResultsTable(parent, config)
local text = cell:CreateFontString()
text:SetFont(gui.font, min(14, rt.ROW_HEIGHT))
text:SetJustifyH(rt.config[j].align or 'LEFT')
text:SetJustifyV 'CENTER'
text:SetJustifyV('CENTER')
text:SetPoint('TOPLEFT', 1, -1)
text:SetPoint('BOTTOMRIGHT', -1, 1)
cell:SetFontString(text)
+22 -22
View File
@@ -8,7 +8,7 @@ function LOAD()
aux_border:SetTexture(1, 1, 1, .02)
aux_border:SetPoint('TOPLEFT', DropDownList1Backdrop, 'TOPLEFT', -2, 2)
aux_border:SetPoint('BOTTOMRIGHT', DropDownList1Backdrop, 'BOTTOMRIGHT', 1.5, -1.5)
aux_border:SetBlendMode 'ADD'
aux_border:SetBlendMode('ADD')
aux_background = DropDownList1:CreateTexture(nil, 'OVERLAY')
aux_background:SetTexture(color.content.background())
aux_background:SetAllPoints(DropDownList1Backdrop)
@@ -42,7 +42,7 @@ function LOAD()
text:SetPoint('BOTTOMRIGHT', -8, 0)
local highlight = _G['DropDownList1Button'..i..'Highlight']
highlight:ClearAllPoints()
highlight:SetDrawLayer 'OVERLAY'
highlight:SetDrawLayer('OVERLAY')
highlight:SetHeight(14)
highlight:SetPoint('LEFT', 5, 0)
highlight:SetPoint('RIGHT', -3, 0)
@@ -64,7 +64,7 @@ function LOAD()
text:SetShadowOffset(1, -1)
local highlight = _G['DropDownList1Button'..i..'Highlight']
highlight:SetAllPoints()
highlight:SetDrawLayer 'BACKGROUND'
highlight:SetDrawLayer('BACKGROUND')
local check = _G['DropDownList1Button'..i..'Check']
check:SetWidth(24)
check:SetHeight(24)
@@ -97,7 +97,7 @@ end
do
local menu, structure, orig
menu = CreateFrame('Frame', name, UIParent, 'UIMenuTemplate')
orig = menu:GetScript 'OnShow'
orig = menu:GetScript('OnShow')
menu:SetScript('OnShow', function()
UIMenu_Initialize()
for i = 1, getn(structure) do
@@ -171,14 +171,14 @@ function public.button(parent, text_height)
local highlight = button:CreateTexture(nil, 'HIGHLIGHT')
highlight:SetAllPoints()
highlight:SetTexture(1, 1, 1, .2)
highlight:SetBlendMode 'BLEND'
highlight:SetBlendMode('BLEND')
button.highlight = highlight
do
local label = button:CreateFontString()
label:SetFont(font, text_height)
label:SetPoint('CENTER', 0, 0)
label:SetJustifyH 'CENTER'
label:SetJustifyV 'CENTER'
label:SetJustifyH('CENTER')
label:SetJustifyV('CENTER')
label:SetHeight(text_height)
label:SetTextColor(color.text.enabled())
button:SetFontString(label)
@@ -226,14 +226,14 @@ do
local highlight = tab:CreateTexture(nil, 'HIGHLIGHT')
highlight:SetAllPoints()
highlight:SetTexture(1, 1, 1, .2)
highlight:SetBlendMode 'BLEND'
highlight:SetBlendMode('BLEND')
tab.highlight = highlight
tab.text = tab:CreateFontString()
tab.text:SetPoint('LEFT', 3, -1)
tab.text:SetPoint('RIGHT', -3, -1)
tab.text:SetJustifyH 'CENTER'
tab.text:SetJustifyV 'CENTER'
tab.text:SetJustifyH('CENTER')
tab.text:SetJustifyV('CENTER')
tab.text:SetFont(font, font_size.large2)
tab:SetFontString(tab.text)
@@ -241,7 +241,7 @@ do
tab:SetScript('OnClick', function()
if this.id ~= this.group.selected then
PlaySound 'igCharacterInfoTab'
PlaySound('igCharacterInfoTab')
this.group:select(this.id)
end
end)
@@ -373,11 +373,11 @@ function public.editbox(parent)
display:SetTextColor(color.text.enabled())
editbox.display = display
local cursor = label(editbox, font_size.large)
cursor:SetText '|'
cursor:SetText('|')
cursor:SetTextColor(color.text.enabled())
cursor:SetAlpha(0)
editbox.cursor = cursor
editbox:SetAlignment 'LEFT'
editbox:SetAlignment('LEFT')
editbox:SetFontSize(font_size.medium)
return editbox
end
@@ -389,10 +389,10 @@ function public.status_bar(parent)
do
-- minor status bar (gray one)
local status_bar = CreateFrame('STATUSBAR', nil, self, 'TextStatusBar')
status_bar:SetOrientation 'HORIZONTAL'
status_bar:SetOrientation('HORIZONTAL')
status_bar:SetMinMaxValues(0, 100)
status_bar:SetAllPoints()
status_bar:SetStatusBarTexture [[Interface\Buttons\WHITE8X8]]
status_bar:SetStatusBarTexture([[Interface\Buttons\WHITE8X8]])
status_bar:SetStatusBarColor(.42, .42, .42, .7)
status_bar:SetFrameLevel(level + 2)
status_bar:SetScript('OnUpdate', function()
@@ -407,10 +407,10 @@ function public.status_bar(parent)
do
-- major status bar (main blue one)
local status_bar = CreateFrame('STATUSBAR', nil, self, 'TextStatusBar')
status_bar:SetOrientation 'HORIZONTAL'
status_bar:SetOrientation('HORIZONTAL')
status_bar:SetMinMaxValues(0, 100)
status_bar:SetAllPoints()
status_bar:SetStatusBarTexture [[Interface\Buttons\WHITE8X8]]
status_bar:SetStatusBarTexture([[Interface\Buttons\WHITE8X8]])
status_bar:SetStatusBarColor(.19, .22, .33, .9)
status_bar:SetFrameLevel(level + 3)
status_bar:SetScript('OnUpdate', function()
@@ -456,7 +456,7 @@ function public.item(parent)
item.texture = _G[btn:GetName()..'Icon']
item.texture:SetTexCoord(.06, .94, .06, .94)
item.name = label(btn, 15)
item.name:SetJustifyH 'LEFT'
item.name:SetJustifyH('LEFT')
item.name:SetPoint('LEFT', btn, 'RIGHT', 10, 0)
item.name:SetPoint('RIGHT', item, 'RIGHT', -10, .5)
item.count = _G[btn:GetName()..'Count']
@@ -524,7 +524,7 @@ end
function public.slider(parent)
local slider = CreateFrame('Slider', nil, parent)
slider:SetOrientation 'HORIZONTAL'
slider:SetOrientation('HORIZONTAL')
slider:SetHeight(6)
slider:SetHitRectInsets(0, 0, -12, -12)
slider:SetValue(0)
@@ -541,7 +541,7 @@ function public.slider(parent)
local label = slider:CreateFontString(nil, 'OVERLAY')
label:SetPoint('BOTTOMLEFT', slider, 'TOPLEFT', -3, 8)
label:SetPoint('BOTTOMRIGHT', slider, 'TOPRIGHT', 6, 8)
label:SetJustifyH 'LEFT'
label:SetJustifyH('LEFT')
label:SetHeight(13)
label:SetFont(font, font_size.small)
label:SetTextColor(color.label.enabled())
@@ -549,7 +549,7 @@ function public.slider(parent)
local editbox = editbox(slider)
editbox:SetPoint('LEFT', slider, 'RIGHT', 5, 0)
set_size(editbox, 45, 18)
editbox:SetAlignment 'CENTER'
editbox:SetAlignment('CENTER')
editbox:SetFontSize(17)
slider.label = label
@@ -567,6 +567,6 @@ function public.checkbox(parent)
checkbox:GetHighlightTexture():SetAllPoints()
checkbox:GetHighlightTexture():SetTexture(1, 1, 1, .2)
checkbox:GetCheckedTexture():SetTexCoord(.12, .88, .12, .88)
checkbox:GetHighlightTexture 'BLEND'
checkbox:GetHighlightTexture('BLEND')
return checkbox
end
+1 -1
View File
@@ -334,7 +334,7 @@ local methods = {
local col = CreateFrame('Button', nil, row)
local text = col:CreateFontString()
text:SetFont(gui.font, ST_ROW_TEXT_SIZE)
text:SetJustifyV 'CENTER'
text:SetJustifyV('CENTER')
text:SetPoint('TOPLEFT', 1, -1)
text:SetPoint('BOTTOMRIGHT', -1, 1)
col.text = text