refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-08-29 17:24:39 +02:00
parent da07e35976
commit fc347ed4cd
11 changed files with 85 additions and 84 deletions
+31 -31
View File
@@ -55,14 +55,14 @@ end
public.search_config = {
{
title = 'Item',
width = 0.35,
width = .35,
init = item_column_init,
fill = function(cell, record, _, _, _, indented)
cell.icon:SetTexture(record.texture)
if indented then
cell.spacer:SetWidth(10)
cell.icon:SetAlpha(0.5)
cell:GetFontString():SetAlpha(0.7)
cell.icon:SetAlpha(.5)
cell:GetFontString():SetAlpha(.7)
else
cell.spacer:SetWidth(1)
cell.icon:SetAlpha(1)
@@ -76,7 +76,7 @@ public.search_config = {
},
{
title = 'Lvl',
width = 0.035,
width = .035,
align = 'CENTER',
fill = function(cell, record)
local display_level = max(record.level, 1)
@@ -89,7 +89,7 @@ public.search_config = {
},
{
title = 'Auctions',
width = 0.06,
width = .06,
align = 'CENTER',
fill = function(cell, record, count, own, expandable)
local numAuctionsText = expandable and color.link(count) or count
@@ -113,7 +113,7 @@ public.search_config = {
},
{
title = 'Stack Size',
width = 0.055,
width = .055,
align = 'CENTER',
fill = function(cell, record)
cell:SetText(record.aux_quantity)
@@ -124,7 +124,7 @@ public.search_config = {
},
{
title = 'Time Left',
width = 0.04,
width = .04,
align = 'CENTER',
fill = function(cell, record)
cell:SetText(TIME_LEFT_STRINGS[record.duration or 0] or '---')
@@ -135,7 +135,7 @@ public.search_config = {
},
{
title = 'Seller',
width = 0.13,
width = .13,
align = 'CENTER',
fill = function(cell, record)
cell:SetText(is_player(record.owner) and (color.yellow(record.owner)) or (record.owner or '---'))
@@ -154,7 +154,7 @@ public.search_config = {
},
{
title = {'Auction Bid\n(per item)', 'Auction Bid\n(per stack)'},
width = 0.125,
width = .125,
align = 'RIGHT',
isPrice = true,
fill = function(cell, record)
@@ -190,7 +190,7 @@ public.search_config = {
},
{
title = {'Auction Buyout\n(per item)', 'Auction Buyout\n(per stack)'},
width = 0.125,
width = .125,
align = 'RIGHT',
isPrice = true,
fill = function(cell, record)
@@ -208,7 +208,7 @@ public.search_config = {
},
{
title = '% Hist. Value',
width = 0.08,
width = .08,
align = 'CENTER',
fill = function(cell, record)
local pct, bidPct = record_percentage(record)
@@ -225,14 +225,14 @@ public.search_config = {
public.auctions_config = {
{
title = 'Item',
width = 0.35,
width = .35,
init = item_column_init,
fill = function(cell, record, _, _, _, indented)
cell.icon:SetTexture(record.texture)
if indented then
cell.spacer:SetWidth(10)
cell.icon:SetAlpha(0.5)
cell:GetFontString():SetAlpha(0.7)
cell.icon:SetAlpha(.5)
cell:GetFontString():SetAlpha(.7)
else
cell.spacer:SetWidth(1)
cell.icon:SetAlpha(1)
@@ -246,7 +246,7 @@ public.auctions_config = {
},
{
title = 'Lvl',
width = 0.035,
width = .035,
align = 'CENTER',
fill = function(cell, record)
local display_level = max(record.level, 1)
@@ -259,7 +259,7 @@ public.auctions_config = {
},
{
title = 'Auctions',
width = 0.06,
width = .06,
align = 'CENTER',
fill = function(cell, record, count, own, expandable)
local numAuctionsText = expandable and inline_color.link..count..FONT_COLOR_CODE_CLOSE or count
@@ -280,7 +280,7 @@ public.auctions_config = {
},
{
title = 'Stack Size',
width = 0.055,
width = .055,
align = 'CENTER',
fill = function(cell, record)
cell:SetText(record.aux_quantity)
@@ -291,7 +291,7 @@ public.auctions_config = {
},
{
title = 'Time Left',
width = 0.04,
width = .04,
align = 'CENTER',
fill = function(cell, record)
cell:SetText(TIME_LEFT_STRINGS[record.duration or 0] or '---')
@@ -302,7 +302,7 @@ public.auctions_config = {
},
{
title = {'Auction Bid\n(per item)', 'Auction Bid\n(per stack)'},
width = 0.125,
width = .125,
align = 'RIGHT',
isPrice = true,
fill = function(cell, record)
@@ -332,7 +332,7 @@ public.auctions_config = {
},
{
title = {'Auction Buyout\n(per item)', 'Auction Buyout\n(per stack)'},
width = 0.125,
width = .125,
align = 'RIGHT',
isPrice = true,
fill = function(cell, record)
@@ -350,7 +350,7 @@ public.auctions_config = {
},
{
title = 'High Bidder',
width = 0.21,
width = .21,
align = 'CENTER',
fill = function(cell, record)
cell:SetText(record.high_bidder or color.red 'No Bids')
@@ -372,14 +372,14 @@ public.auctions_config = {
public.bids_config = {
{
title = 'Item',
width = 0.35,
width = .35,
init = item_column_init,
fill = function(cell, record, _, _, _, indented)
cell.icon:SetTexture(record.texture)
if indented then
cell.spacer:SetWidth(10)
cell.icon:SetAlpha(0.5)
cell:GetFontString():SetAlpha(0.7)
cell.icon:SetAlpha(.5)
cell:GetFontString():SetAlpha(.7)
else
cell.spacer:SetWidth(1)
cell.icon:SetAlpha(1)
@@ -393,7 +393,7 @@ public.bids_config = {
},
{
title = 'Auctions',
width = 0.06,
width = .06,
align = 'CENTER',
fill = function(cell, record, count, own, expandable)
local numAuctionsText = expandable and inline_color.link..count..FONT_COLOR_CODE_CLOSE or count
@@ -414,7 +414,7 @@ public.bids_config = {
},
{
title = 'Stack Size',
width = 0.055,
width = .055,
align = 'CENTER',
fill = function(cell, record)
cell:SetText(record.aux_quantity)
@@ -425,7 +425,7 @@ public.bids_config = {
},
{
title = 'Time Left',
width = 0.04,
width = .04,
align = 'CENTER',
fill = function(cell, record)
cell:SetText(TIME_LEFT_STRINGS[record.duration or 0] or '---')
@@ -436,7 +436,7 @@ public.bids_config = {
},
{
title = 'Seller',
width = 0.13,
width = .13,
align = 'CENTER',
fill = function(cell, record)
cell:SetText(is_player(record.owner) and (color.yellow(record.owner)) or (record.owner or '---'))
@@ -455,7 +455,7 @@ public.bids_config = {
},
{
title = {'Auction Bid\n(per item)', 'Auction Bid\n(per stack)'},
width = 0.125,
width = .125,
align = 'RIGHT',
isPrice = true,
fill = function(cell, record)
@@ -485,7 +485,7 @@ public.bids_config = {
},
{
title = {'Auction Buyout\n(per item)', 'Auction Buyout\n(per stack)'},
width = 0.125,
width = .125,
align = 'RIGHT',
isPrice = true,
fill = function(cell, record)
@@ -503,7 +503,7 @@ public.bids_config = {
},
{
title = 'Status',
width = 0.115,
width = .115,
align = 'CENTER',
fill = function(cell, record)
local status
+3 -2
View File
@@ -28,7 +28,7 @@ function LOAD()
DropDownList1Backdrop:SetBackdrop{}
aux_border:Show()
aux_background:Show()
DropDownList1:SetWidth(dropdown:GetWidth() * 0.9)
DropDownList1:SetWidth(dropdown:GetWidth() * .9)
DropDownList1:SetHeight(DropDownList1:GetHeight() - 10)
DropDownList1:ClearAllPoints()
DropDownList1:SetPoint('TOPLEFT', dropdown, 'BOTTOMLEFT', -2, -2)
@@ -376,6 +376,7 @@ function public.editbox(parent)
cursor:SetText('|')
cursor:SetTextColor(color.text.enabled())
cursor:SetAlpha(0)
cursor.last_change = 0
editbox.cursor = cursor
editbox:SetAlignment('LEFT')
editbox:SetFontSize(font_size.medium)
@@ -507,7 +508,7 @@ function public.dropdown(parent)
local button = _G[dropdown:GetName()..'Button']
button:ClearAllPoints()
button:SetScale(0.9)
button:SetScale(.9)
button:SetPoint('RIGHT', dropdown, 0, 0)
dropdown.button = button
+1 -1
View File
@@ -79,7 +79,7 @@ function public.create(parent, on_click, selected)
end)
row.item = gui.item(row)
row.item:SetScale(0.9)
row.item:SetScale(.9)
row.item:SetPoint('LEFT', 2.5, 0)
row.item:SetPoint('RIGHT', -2.5, 0)
row.item.button:SetScript('OnEnter', function()
+2 -2
View File
@@ -314,8 +314,8 @@ local methods = {
local tex = col:CreateTexture()
tex:SetAllPoints()
tex:SetTexture([[Interface\Buttons\UI-Listbox-Highlight]])
tex:SetTexCoord(0.025, 0.957, 0.087, 0.931)
tex:SetAlpha(0.2)
tex:SetTexCoord(.025, .957, .087, .931)
tex:SetAlpha(.2)
col:SetHighlightTexture(tex)
tinsert(st.headCols, col)