more progress with the new layout
This commit is contained in:
@@ -61,6 +61,7 @@ function Aux.buy.SearchButton_onclick()
|
||||
slot = category and category.slot,
|
||||
class = category and category.class,
|
||||
subclass = category and category.subclass,
|
||||
quality = UIDropDownMenu_GetSelectedValue(AuxBuyQualityDropDown),
|
||||
usable = AuxBuyUsableCheckButton:GetChecked()
|
||||
}
|
||||
|
||||
@@ -289,6 +290,7 @@ function process_auction(auction_item, current_page)
|
||||
if auction_item.owner ~= UnitName("player") then
|
||||
tinsert(entries, {
|
||||
name = auction_item.name,
|
||||
level = auction_item.level,
|
||||
texture = auction_item.texture,
|
||||
tooltip = auction_item.tooltip,
|
||||
stack_size = stack_size,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Aux.list = {}
|
||||
|
||||
local MAX_COLUMNS = 6
|
||||
local MAX_COLUMNS = 7
|
||||
|
||||
local NAME, OWNER, BID, BID_UNIT, BUYOUT, BUYOUT_UNIT, QUANTITY, TIME_LEFT = 1, 2, 3, 4, 5, 6, 7, 8
|
||||
local NAME, LEVEL, OWNER, BID, BID_UNIT, BUYOUT, BUYOUT_UNIT, QUANTITY, TIME_LEFT = 1, 2, 3, 4, 5, 6, 7, 8, 9
|
||||
|
||||
MoneyTypeInfo["AUX_LIST"] = {
|
||||
UpdateFunc = function()
|
||||
@@ -22,6 +22,12 @@ local logical_columns = {
|
||||
getter = function(row) return ' ['..row.tooltip[1][1].text..']' end,
|
||||
color = function(row) return ITEM_QUALITY_COLORS[row.quality] end,
|
||||
},
|
||||
{
|
||||
type = 'NUMBER',
|
||||
title = 'Lvl',
|
||||
comparator = function(row1, row2) return Aux.util.compare(row1.level, row2.level, Aux.util.GT) end,
|
||||
getter = function(row) return row.level end,
|
||||
},
|
||||
{
|
||||
type = 'STRING',
|
||||
title = 'Owner',
|
||||
@@ -29,28 +35,28 @@ local logical_columns = {
|
||||
getter = function(row) return row.owner end,
|
||||
},
|
||||
{
|
||||
type = 'MONEY',
|
||||
type = 'STRING',
|
||||
title = 'Bid',
|
||||
comparator = function(row1, row2) return Aux.util.compare(row1.bid, row2.bid, Aux.util.GT) end,
|
||||
getter = function(row) return row.bid end,
|
||||
getter = function(row) return Aux.util.coins(row.bid) end,
|
||||
},
|
||||
{
|
||||
type = 'MONEY',
|
||||
type = 'STRING',
|
||||
title = 'Bid (Unit)',
|
||||
comparator = function(row1, row2) return Aux.util.compare(row1.bid_per_unit, row2.bid_per_unit, Aux.util.GT) end,
|
||||
getter = function(row) return row.bid_per_unit end,
|
||||
getter = function(row) return Aux.util.coins(row.bid_per_unit) end,
|
||||
},
|
||||
{
|
||||
type = 'MONEY',
|
||||
type = 'STRING',
|
||||
title = 'Buyout',
|
||||
comparator = function(row1, row2) return Aux.util.compare(row1.buyout_price, row2.buyout_price, Aux.util.GT) end,
|
||||
getter = function(row) return row.buyout_price end,
|
||||
getter = function(row) return Aux.util.coins(row.buyout_price) end,
|
||||
},
|
||||
{
|
||||
type = 'MONEY',
|
||||
type = 'STRING',
|
||||
title = 'Buyout (Unit)',
|
||||
comparator = function(row1, row2) return Aux.util.compare(row1.buyout_price_per_unit, row2.buyout_price_per_unit, Aux.util.GT) end,
|
||||
getter = function(row) return row.buyout_price_per_unit end,
|
||||
getter = function(row) return Aux.util.coins(row.buyout_price_per_unit) end,
|
||||
},
|
||||
{
|
||||
type = 'NUMBER',
|
||||
@@ -70,7 +76,7 @@ local logical_columns = {
|
||||
elseif row.duration == 3 then
|
||||
return '8h'
|
||||
elseif row.duration == 4 then
|
||||
return '12h'
|
||||
return '24h'
|
||||
end
|
||||
end,
|
||||
},
|
||||
@@ -87,10 +93,15 @@ local physical_columns = {
|
||||
logical_column = logical_columns[NAME],
|
||||
width = 180
|
||||
},
|
||||
{
|
||||
logical_columns = { logical_columns[LEVEL] },
|
||||
logical_column = logical_columns[LEVEL],
|
||||
width = 40
|
||||
},
|
||||
{
|
||||
logical_columns = { logical_columns[TIME_LEFT] },
|
||||
logical_column = logical_columns[TIME_LEFT],
|
||||
width = 40
|
||||
width = 50
|
||||
},
|
||||
{
|
||||
logical_columns = { logical_columns[OWNER] },
|
||||
@@ -100,12 +111,12 @@ local physical_columns = {
|
||||
{
|
||||
logical_columns = { logical_columns[BID_UNIT], logical_columns[BUYOUT_UNIT] },
|
||||
logical_column = logical_columns[BUYOUT_UNIT],
|
||||
width = 140
|
||||
width = 100
|
||||
},
|
||||
{
|
||||
logical_columns = { logical_columns[BID], logical_columns[BUYOUT] },
|
||||
logical_column = logical_columns[BUYOUT],
|
||||
width = 140
|
||||
width = 100
|
||||
},
|
||||
}
|
||||
|
||||
@@ -301,9 +312,6 @@ function Aux.list.scroll_frame_update(frame)
|
||||
local text = getglobal(parent:GetName().."Item"..line.."Column"..column_index)
|
||||
-- text:Hide() TODO
|
||||
text:SetText()
|
||||
|
||||
local moneyFrame = getglobal(parent:GetName().."Item"..line.."Column"..column_index.."MoneyFrame")
|
||||
moneyFrame:Hide()
|
||||
|
||||
if column_index <= table.getn(parent.physical_columns) then
|
||||
local physical_column = parent.physical_columns[column_index]
|
||||
@@ -334,20 +342,6 @@ function Aux.list.scroll_frame_update(frame)
|
||||
-- text:SetJustifyH("LEFT")
|
||||
-- end
|
||||
text:Show()
|
||||
elseif moneyFrame and logical_column.type == "MONEY" then
|
||||
if value >= 0 then
|
||||
MoneyFrame_Update(moneyFrame:GetName(), value)
|
||||
SetMoneyFrameColor(moneyFrame:GetName(), 255, 255, 255)
|
||||
else
|
||||
MoneyFrame_Update(moneyFrame:GetName(), -value)
|
||||
SetMoneyFrameColor(moneyFrame:GetName(), 255, 0, 0)
|
||||
end
|
||||
if logical_column.alphaFunc then
|
||||
moneyFrame:SetAlpha(logical_column.alphaFunc(content[row_index]))
|
||||
else
|
||||
moneyFrame:SetAlpha(1.0)
|
||||
end
|
||||
moneyFrame:Show()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
<Size><AbsDimension x="100" y="16"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn1" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
<FontString name="$parentColumn3" inherits="GameFontHighlight" wraponspaces="false" justifyH="CENTER">
|
||||
<FontString name="$parentColumn3" inherits="GameFontHighlight" wraponspaces="false" justifyH="RIGHT">
|
||||
<Size><AbsDimension x="100" y="16"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn2" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
<FontString name="$parentColumn4" inherits="GameFontHighlight" wraponspaces="false" justifyH="LEFT">
|
||||
<FontString name="$parentColumn4" inherits="GameFontHighlight" wraponspaces="false" justifyH="CENTER">
|
||||
<Size><AbsDimension x="100" y="16"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn3" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
@@ -30,6 +30,10 @@
|
||||
<Size><AbsDimension x="100" y="16"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn5" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
<FontString name="$parentColumn7" inherits="GameFontHighlight" wraponspaces="false" justifyH="RIGHT">
|
||||
<Size><AbsDimension x="100" y="16"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentColumn6" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
|
||||
</FontString>
|
||||
</Layer>
|
||||
</Layers>
|
||||
<Frames>
|
||||
@@ -73,60 +77,6 @@
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
<Frame name="$parentColumn1MoneyFrame" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn1" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
MoneyFrame_SetType("AUX_LIST")
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentColumn2MoneyFrame" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn2" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
MoneyFrame_SetType("AUX_LIST")
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentColumn3MoneyFrame" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn3" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
MoneyFrame_SetType("AUX_LIST")
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentColumn4MoneyFrame" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn4" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
MoneyFrame_SetType("AUX_LIST")
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentColumn5MoneyFrame" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn5" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
MoneyFrame_SetType("AUX_LIST")
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Frame name="$parentColumn6MoneyFrame" inherits="SmallMoneyFrameTemplate">
|
||||
<Anchors><Anchor point="TOPRIGHT" relativeTo="$parentColumn6" relativePoint="TOPRIGHT"><Offset><AbsDimension x="3" y="0"/></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
SmallMoneyFrame_OnLoad()
|
||||
MoneyFrame_SetType("AUX_LIST")
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Button>
|
||||
|
||||
@@ -354,6 +304,37 @@
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<Button name="$parentColumn7Sort" inherits="ListSortButtonTemplate">
|
||||
<Size>
|
||||
<AbsDimension x="174" y="24"/>
|
||||
</Size>
|
||||
<Anchors>
|
||||
<Anchor point="LEFT" relativeTo="$parentColumn6Sort" relativePoint="RIGHT">
|
||||
<Offset>
|
||||
<AbsDimension x="-2" y="0"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnClick>
|
||||
Aux.list.sort(this:GetParent(), 6)
|
||||
</OnClick>
|
||||
</Scripts>
|
||||
</Button>
|
||||
<Frame name="$parentColumn7DropDown" inherits="UIDropDownMenuTemplate" id="7">
|
||||
<Anchors>
|
||||
<Anchor point="LEFT" relativeTo="$parentColumn7Sort" relativePoint="LEFT">
|
||||
<Offset>
|
||||
<AbsDimension x="-14" y="-3"/>
|
||||
</Offset>
|
||||
</Anchor>
|
||||
</Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
Aux.list.dropdown_on_load()
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<ScrollFrame name="$parentScrollFrame" inherits="FauxScrollFrameTemplate">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT">
|
||||
|
||||
@@ -188,4 +188,29 @@ function Aux.util.index_of(value, array)
|
||||
return i
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local GOLD = "ffd100"
|
||||
local SILVER = "e6e6e6"
|
||||
local COPPER = "c8602c"
|
||||
|
||||
local GSC_3 = "|cff%s%d|cff000000.|cff%s%02d|cff000000.|cff%s%02d|r"
|
||||
local GSC_2 = "|cff%s%d|cff000000.|cff%s%02d|r"
|
||||
local GSC_1 = "|cff%s%d|r"
|
||||
|
||||
function Aux.util.coins(money)
|
||||
money = floor(tonumber(money) or 0)
|
||||
local g = floor(money / 10000)
|
||||
money = money - g * 10000
|
||||
local s = floor(money / 100)
|
||||
money = money - s * 100
|
||||
local c = money
|
||||
|
||||
if g > 0 then
|
||||
return string.format(GSC_3, GOLD, g, SILVER, s, COPPER, c)
|
||||
elseif s > 0 then
|
||||
return string.format(GSC_2, SILVER, s, COPPER, c)
|
||||
else
|
||||
return string.format(GSC_1, COPPER, c)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user