refactoring
This commit is contained in:
+14
-14
@@ -17,11 +17,11 @@ local HEAD_HEIGHT = 27
|
||||
local HEAD_SPACE = 2
|
||||
|
||||
local AUCTION_PCT_COLORS = {
|
||||
{ color=inline_color.blue, value=50 },
|
||||
{ color=inline_color.green, value=80 },
|
||||
{ color=inline_color.yellow, value=110 },
|
||||
{ color=inline_color.orange, value=135 },
|
||||
{ color=inline_color.red, value=huge },
|
||||
{color=inline_color.blue, value=50},
|
||||
{color=inline_color.green, value=80},
|
||||
{color=inline_color.yellow, value=110},
|
||||
{color=inline_color.orange, value=135},
|
||||
{color=inline_color.red, value=huge},
|
||||
}
|
||||
|
||||
local TIME_LEFT_STRINGS = {
|
||||
@@ -168,9 +168,9 @@ M.search_config = {
|
||||
fill = function(cell, record)
|
||||
local color
|
||||
if record.high_bidder then
|
||||
color = AUCTION_PCT_COLORS[2].color
|
||||
color = inline_color.green
|
||||
elseif record.high_bid ~= 0 then
|
||||
color = AUCTION_PCT_COLORS[4].color
|
||||
color = inline_color.orange
|
||||
end
|
||||
local price
|
||||
if record.high_bidder then
|
||||
@@ -920,7 +920,7 @@ local methods = {
|
||||
break
|
||||
end
|
||||
end
|
||||
tinsert(self.sorts, 1, { index=abs(arg[k]), descending=arg[k] < 0 })
|
||||
tinsert(self.sorts, 1, {index=abs(arg[k]), descending=arg[k] < 0})
|
||||
end
|
||||
|
||||
self.isSorted = nil
|
||||
@@ -986,7 +986,7 @@ function M.CreateAuctionResultsTable(parent, config)
|
||||
rt.handlers = t
|
||||
rt.sorts = t
|
||||
rt.records = t
|
||||
rt.rowInfo = { numDisplayRows=0 }
|
||||
rt.rowInfo = {numDisplayRows=0}
|
||||
|
||||
for name, func in methods do
|
||||
rt[name] = func
|
||||
@@ -1047,8 +1047,8 @@ function M.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)
|
||||
@@ -1057,14 +1057,14 @@ function M.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)
|
||||
@@ -1097,7 +1097,7 @@ function M.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)
|
||||
|
||||
+18
-18
@@ -19,7 +19,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)
|
||||
@@ -75,7 +75,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)
|
||||
@@ -173,14 +173,14 @@ function M.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)
|
||||
@@ -223,14 +223,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.large)
|
||||
tab:SetFontString(tab.text)
|
||||
|
||||
@@ -238,7 +238,7 @@ do
|
||||
|
||||
tab:SetScript('OnClick', function()
|
||||
if this.id ~= this.group.selected then
|
||||
PlaySound'igCharacterInfoTab'
|
||||
PlaySound('igCharacterInfoTab')
|
||||
this.group:select(this.id)
|
||||
end
|
||||
end)
|
||||
@@ -335,7 +335,7 @@ function M.editbox(parent)
|
||||
local last_click = T('t', 0)
|
||||
editbox:SetScript('OnMouseDown', function()
|
||||
if arg1 == 'RightButton' then
|
||||
this:SetText''
|
||||
this:SetText('')
|
||||
this:ClearFocus()
|
||||
this.block_focus = true
|
||||
else
|
||||
@@ -365,7 +365,7 @@ function M.editbox(parent)
|
||||
overlay:SetPoint('RIGHT', -1.5, 0)
|
||||
overlay:SetTextColor(color.text.enabled())
|
||||
editbox.overlay = overlay
|
||||
editbox:SetAlignment'LEFT'
|
||||
editbox:SetAlignment('LEFT')
|
||||
editbox:SetFontSize(font_size.medium)
|
||||
return editbox
|
||||
end
|
||||
@@ -377,10 +377,10 @@ function M.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()
|
||||
@@ -395,10 +395,10 @@ function M.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()
|
||||
@@ -512,7 +512,7 @@ end
|
||||
function M.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)
|
||||
@@ -537,7 +537,7 @@ function M.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
|
||||
@@ -555,7 +555,7 @@ function M.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
@@ -11,7 +11,7 @@ local ST_ROW_HEIGHT = 15
|
||||
local ST_ROW_TEXT_SIZE = 14
|
||||
local ST_HEAD_HEIGHT = 26.3
|
||||
local ST_HEAD_SPACE = 2
|
||||
local DEFAULT_COL_INFO = {{ width=1 }}
|
||||
local DEFAULT_COL_INFO = {{width=1}}
|
||||
|
||||
|
||||
local function GetTableIndex(tbl, value)
|
||||
|
||||
Reference in New Issue
Block a user