post tab almost complete
This commit is contained in:
+25
-16
@@ -18,6 +18,30 @@ local TIME_LEFT_STRINGS = {
|
|||||||
'|cff2992ff48h|r', -- Very Long
|
'|cff2992ff48h|r', -- Very Long
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function public.percentage_market(pct, based_on_bid)
|
||||||
|
local pctColor = '|cffffffff'
|
||||||
|
|
||||||
|
if based_on_bid then
|
||||||
|
pctColor = '|cffbbbbbb'
|
||||||
|
else
|
||||||
|
for i=1, getn(AUCTION_PCT_COLORS) do
|
||||||
|
if pct < AUCTION_PCT_COLORS[i].value then
|
||||||
|
pctColor = AUCTION_PCT_COLORS[i].color
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if pct > 10000 then
|
||||||
|
pct = '>10000'
|
||||||
|
end
|
||||||
|
|
||||||
|
return format('%s%s%%|r', pctColor, pct)
|
||||||
|
end
|
||||||
|
|
||||||
|
function public.time_left(code)
|
||||||
|
return TIME_LEFT_STRINGS[code]
|
||||||
|
end
|
||||||
|
|
||||||
local methods = {
|
local methods = {
|
||||||
|
|
||||||
@@ -404,22 +428,7 @@ local methods = {
|
|||||||
row.cells[7]:SetText(bid > 0 and Aux.money.to_string(bid, true, false, colorBid) or '---')
|
row.cells[7]:SetText(bid > 0 and Aux.money.to_string(bid, true, false, colorBid) or '---')
|
||||||
row.cells[8]:SetText(buyout > 0 and Aux.money.to_string(buyout, true, false, colorBuyout) or '---')
|
row.cells[8]:SetText(buyout > 0 and Aux.money.to_string(buyout, true, false, colorBuyout) or '---')
|
||||||
local pct, bidPct = self:GetRecordPercent(record)
|
local pct, bidPct = self:GetRecordPercent(record)
|
||||||
local pctColor = '|cffffffff'
|
row.cells[9]:SetText((pct or bidPct) and public.percentage_market(pct or bidPct, not pct) or '---')
|
||||||
if pct then
|
|
||||||
for i=1, getn(AUCTION_PCT_COLORS) do
|
|
||||||
if pct < AUCTION_PCT_COLORS[i].value then
|
|
||||||
pctColor = AUCTION_PCT_COLORS[i].color
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
elseif bidPct then
|
|
||||||
pctColor = '|cffbbbbbb'
|
|
||||||
pct = bidPct
|
|
||||||
end
|
|
||||||
if pct and pct > 10000 then
|
|
||||||
pct = '>10000'
|
|
||||||
end
|
|
||||||
row.cells[9]:SetText(pct and format('%s%s%%|r', pctColor, pct) or '---')
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
|||||||
+55
-45
@@ -24,6 +24,7 @@ function private.update_inventory_listing()
|
|||||||
itemstring = Aux.info.itemstring(inventory_record.item_id, inventory_record.suffix_id),
|
itemstring = Aux.info.itemstring(inventory_record.item_id, inventory_record.suffix_id),
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
sort(inventory_rows, function(a, b) return a.record.name < b.record.name end)
|
||||||
private.inventory_listing:SetData(inventory_rows)
|
private.inventory_listing:SetData(inventory_rows)
|
||||||
private.inventory_listing:SetSelection(function(row) return row.record == selected_item end)
|
private.inventory_listing:SetSelection(function(row) return row.record == selected_item end)
|
||||||
end
|
end
|
||||||
@@ -34,29 +35,23 @@ function private.update_auction_listing()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local auction_rows = {}
|
local auction_rows = {}
|
||||||
for i, auction_record in ipairs(selected_item and existing_auctions[selected_item.key] or {}) do
|
if selected_item then
|
||||||
local left
|
for i, auction_record in ipairs(existing_auctions[selected_item.key] or {}) do
|
||||||
if auction_record.max_time_left == 1 then
|
local stack_size = auction_record.stack_size == private.get_stack_size_slider_value() and GREEN_FONT_COLOR_CODE..auction_record.stack_size..FONT_COLOR_CODE_CLOSE or auction_record.stack_size
|
||||||
left = '30m'
|
local market_value = Aux.history.market_value(auction_record.item_key)
|
||||||
elseif auction_record.max_time_left == 2 then
|
tinsert(auction_rows, {
|
||||||
left = '2h'
|
cols = {
|
||||||
elseif auction_record.max_time_left == 3 then
|
{ value=auction_record.count },
|
||||||
left = '8h'
|
{ value=auction_record.yours },
|
||||||
elseif auction_record.max_time_left == 4 then
|
{ value=Aux.auction_listing.time_left(auction_record.max_time_left) },
|
||||||
left = '24h'
|
{ value=stack_size },
|
||||||
|
{ value=Aux.money.to_string(auction_record.unit_buyout_price) },
|
||||||
|
{ value=Aux.auction_listing.percentage_market(market_value and Aux.round(auction_record.unit_buyout_price/market_value * 100) or '---') },
|
||||||
|
},
|
||||||
|
record = auction_record,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
local stack_size = auction_record.stack_size == private.get_stack_size_slider_value() and GREEN_FONT_COLOR_CODE..row.stack_size..FONT_COLOR_CODE_CLOSE or auction_record.stack_size
|
sort(auction_rows, function(a, b) return a.record.unit_buyout_price < b.record.unit_buyout_price end)
|
||||||
tinsert(auction_rows, {
|
|
||||||
cols = {
|
|
||||||
{ value=auction_record.count },
|
|
||||||
{ value=auction_record.yours },
|
|
||||||
{ value=left },
|
|
||||||
{ value=stack_size },
|
|
||||||
{ value=Aux.util.money_string(auction_record.unit_buyout_price) },
|
|
||||||
{ value=auction_record.stack_size },
|
|
||||||
},
|
|
||||||
record = auction_record,
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
private.auction_listing:SetData(auction_rows)
|
private.auction_listing:SetData(auction_rows)
|
||||||
private.auction_listing:SetSelection(function(row) return row.record == private.selected_auction() end)
|
private.auction_listing:SetSelection(function(row) return row.record == private.selected_auction() end)
|
||||||
@@ -67,16 +62,32 @@ function private.selected_auction()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function public.on_load()
|
function public.on_load()
|
||||||
private.auction_listing_config = {
|
|
||||||
columns = {
|
Aux.gui.vertical_line(AuxPostFrameContent, 208)
|
||||||
Aux.listing_util.percentage_market_column(function(entry) return entry.item_key end, function(entry) return entry.unit_buyout_price end),
|
Aux.gui.vertical_line(AuxPostFrameContent, 431)
|
||||||
},
|
|
||||||
sort_order = {{column = 5, order = 'ascending' }},
|
do
|
||||||
}
|
local label = Aux.gui.label(AuxSellParametersItem, 13)
|
||||||
|
label:SetPoint('BOTTOMLEFT', AuxSellParametersItem, 'TOPLEFT', 0, 0)
|
||||||
|
label:SetText('Auction Item')
|
||||||
|
end
|
||||||
|
|
||||||
|
AuxSellParametersItem:SetScript('OnReceiveDrag', function()
|
||||||
|
local item_info = Aux.cursor_item()
|
||||||
|
if item_info then
|
||||||
|
for _, inventory_record in ipairs(Aux.util.filter(inventory_data, function(record) return record.aux_quantity > 0 end)) do
|
||||||
|
if inventory_record.key == item_info.item_key then
|
||||||
|
private.set_item(inventory_record)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
ClearCursor()
|
||||||
|
end)
|
||||||
|
|
||||||
private.inventory_listing = Aux.listing.CreateScrollingTable(AuxSellInventory)
|
private.inventory_listing = Aux.listing.CreateScrollingTable(AuxSellInventory)
|
||||||
private.inventory_listing:SetColInfo({
|
private.inventory_listing:SetColInfo({
|
||||||
{name='Qty', width=.15, align='RIGHT'},
|
{name='Qty', width=.15, align='CENTER'},
|
||||||
{name='Item', width=.85 }
|
{name='Item', width=.85 }
|
||||||
})
|
})
|
||||||
private.inventory_listing:SetHandler('OnClick', function(table, row_data, column)
|
private.inventory_listing:SetHandler('OnClick', function(table, row_data, column)
|
||||||
@@ -91,18 +102,16 @@ function public.on_load()
|
|||||||
|
|
||||||
private.auction_listing = Aux.listing.CreateScrollingTable(AuxSellAuctions)
|
private.auction_listing = Aux.listing.CreateScrollingTable(AuxSellAuctions)
|
||||||
private.auction_listing:SetColInfo({
|
private.auction_listing:SetColInfo({
|
||||||
{ name='Avail', width=.1, align='RIGHT' },
|
{ name='Avail', width=.14, align='CENTER' },
|
||||||
{ name='Yours', width=.1, align='RIGHT' },
|
{ name='Yours', width=.14, align='CENTER' },
|
||||||
{ name='Max Left', width=.2, align='CENTER' },
|
{ name='Left', width=.14, align='CENTER' },
|
||||||
{ name='Qty', width=.2, align='RIGHT' },
|
{ name='Qty', width=.08, align='CENTER' },
|
||||||
{ name='Buy/ea', width=.2, align='RIGHT' },
|
{ name='Buy/ea', width=.3, align='RIGHT' },
|
||||||
{ name='Pct', width=.2, align='RIGHT' }
|
{ name='Pct', width=.2, align='CENTER' }
|
||||||
})
|
})
|
||||||
private.auction_listing:SetHandler('OnClick', function(table, row_data, column)
|
private.auction_listing:SetHandler('OnClick', function(table, row_data, column)
|
||||||
private.set_auction(row_data.record)
|
private.set_auction(row_data.record)
|
||||||
end)
|
end)
|
||||||
-- private.auction_listing:SetHandler('OnEnter', handlers.OnEnter)
|
|
||||||
-- private.auction_listing:SetHandler('OnLeave', handlers.OnLeave)
|
|
||||||
|
|
||||||
do
|
do
|
||||||
local status_bar = Aux.gui.status_bar(AuxPostFrame)
|
local status_bar = Aux.gui.status_bar(AuxPostFrame)
|
||||||
@@ -134,7 +143,7 @@ function public.on_load()
|
|||||||
do
|
do
|
||||||
local slider = Aux.gui.slider(AuxSellParameters)
|
local slider = Aux.gui.slider(AuxSellParameters)
|
||||||
slider:SetValueStep(1)
|
slider:SetValueStep(1)
|
||||||
slider:SetPoint('TOPLEFT', 16, -70)
|
slider:SetPoint('TOPLEFT', 16, -110)
|
||||||
slider:SetWidth(170)
|
slider:SetWidth(170)
|
||||||
slider:SetScript('OnValueChanged', function()
|
slider:SetScript('OnValueChanged', function()
|
||||||
private.quantity_update()
|
private.quantity_update()
|
||||||
@@ -169,7 +178,7 @@ function public.on_load()
|
|||||||
do
|
do
|
||||||
local slider = Aux.gui.slider(AuxSellParameters)
|
local slider = Aux.gui.slider(AuxSellParameters)
|
||||||
slider:SetValueStep(1)
|
slider:SetValueStep(1)
|
||||||
slider:SetPoint('TOPLEFT', 16, -120)
|
slider:SetPoint('TOPLEFT', 16, -160)
|
||||||
slider:SetWidth(170)
|
slider:SetWidth(170)
|
||||||
slider:SetScript('OnValueChanged', function()
|
slider:SetScript('OnValueChanged', function()
|
||||||
private.quantity_update()
|
private.quantity_update()
|
||||||
@@ -207,7 +216,7 @@ function public.on_load()
|
|||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(AuxSellParameters)
|
local editbox = Aux.gui.editbox(AuxSellParameters)
|
||||||
editbox:SetPoint('TOPLEFT', 16, -215)
|
editbox:SetPoint('TOPLEFT', 16, -255)
|
||||||
editbox:SetWidth(170)
|
editbox:SetWidth(170)
|
||||||
editbox:SetScript('OnTextChanged', function()
|
editbox:SetScript('OnTextChanged', function()
|
||||||
private.validate_parameters()
|
private.validate_parameters()
|
||||||
@@ -235,7 +244,7 @@ function public.on_load()
|
|||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(AuxSellParameters)
|
local editbox = Aux.gui.editbox(AuxSellParameters)
|
||||||
editbox:SetPoint('TOPLEFT', 16, -255)
|
editbox:SetPoint('TOPLEFT', 16, -295)
|
||||||
editbox:SetWidth(170)
|
editbox:SetWidth(170)
|
||||||
editbox:SetScript('OnTextChanged', function()
|
editbox:SetScript('OnTextChanged', function()
|
||||||
private.validate_parameters()
|
private.validate_parameters()
|
||||||
@@ -263,7 +272,7 @@ function public.on_load()
|
|||||||
end
|
end
|
||||||
do
|
do
|
||||||
local label = Aux.gui.label(AuxSellParameters, 15)
|
local label = Aux.gui.label(AuxSellParameters, 15)
|
||||||
label:SetPoint('TOPLEFT', AuxSellParameters, 'TOPLEFT', 16, -290)
|
label:SetPoint('TOPLEFT', AuxSellParameters, 'TOPLEFT', 16, -330)
|
||||||
private.deposit = label
|
private.deposit = label
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -645,7 +654,7 @@ function private.refresh_entries()
|
|||||||
private.status_bar:set_text('Done Scanning')
|
private.status_bar:set_text('Done Scanning')
|
||||||
end,
|
end,
|
||||||
on_complete = function()
|
on_complete = function()
|
||||||
existing_auctions[item_key] = existing_auctions[item_key] or { created = time() }
|
existing_auctions[item_key] = existing_auctions[item_key] or {}
|
||||||
private.update_recommendation()
|
private.update_recommendation()
|
||||||
refresh = true
|
refresh = true
|
||||||
private.status_bar:update_status(100, 100)
|
private.status_bar:update_status(100, 100)
|
||||||
@@ -674,10 +683,10 @@ end
|
|||||||
|
|
||||||
function private.record_auction(key, aux_quantity, buyout_price, duration, owner)
|
function private.record_auction(key, aux_quantity, buyout_price, duration, owner)
|
||||||
if buyout_price > 0 then
|
if buyout_price > 0 then
|
||||||
existing_auctions[key] = existing_auctions[key] or { created = GetTime() }
|
existing_auctions[key] = existing_auctions[key] or {}
|
||||||
local entry
|
local entry
|
||||||
for _, existing_entry in ipairs(existing_auctions[key]) do
|
for _, existing_entry in ipairs(existing_auctions[key]) do
|
||||||
if buyout_price == existing_entry.buyout_price and aux_quantity == existing_entry.stack_size then
|
if buyout_price == existing_entry.buyout_price and aux_quantity == existing_entry.stack_size and duration == existing_entry.duration then
|
||||||
entry = existing_entry
|
entry = existing_entry
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -690,6 +699,7 @@ function private.record_auction(key, aux_quantity, buyout_price, duration, owner
|
|||||||
item_key = key,
|
item_key = key,
|
||||||
stack_size = aux_quantity,
|
stack_size = aux_quantity,
|
||||||
buyout_price = buyout_price,
|
buyout_price = buyout_price,
|
||||||
|
duration = duration,
|
||||||
unit_buyout_price = buyout_price / aux_quantity,
|
unit_buyout_price = buyout_price / aux_quantity,
|
||||||
max_time_left = duration,
|
max_time_left = duration,
|
||||||
count = 1,
|
count = 1,
|
||||||
|
|||||||
+6
-6
@@ -41,15 +41,15 @@
|
|||||||
<frame name="AuxSellParameters" inherits="AuxFrameBoxTemplate">
|
<frame name="AuxSellParameters" inherits="AuxFrameBoxTemplate">
|
||||||
<Size><AbsDimension x="213" y="326"/></Size>
|
<Size><AbsDimension x="213" y="326"/></Size>
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="AuxSellInventory"><Offset><AbsDimension x="5" y="0"/></Offset></Anchor>
|
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="AuxSellInventory"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor>
|
||||||
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT" relativeTo="AuxSellInventory"><Offset><AbsDimension x="5" y="0"/></Offset></Anchor>
|
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT" relativeTo="AuxSellInventory"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor>
|
||||||
</Anchors>
|
</Anchors>
|
||||||
<frames>
|
<frames>
|
||||||
<Frame name="$parentItem" inherits="AuxItemTemplate">
|
<Frame name="$parentItem" inherits="AuxItemTemplate">
|
||||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="10" y="-10"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="10" y="-30"/></Offset></Anchor></Anchors>
|
||||||
</Frame>
|
</Frame>
|
||||||
<CheckButton name="$parentShortDurationRadio" inherits="AuxRadioButtonTemplate">
|
<CheckButton name="$parentShortDurationRadio" inherits="AuxRadioButtonTemplate">
|
||||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="14" y="-170"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="14" y="-210"/></Offset></Anchor></Anchors>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
getglobal(this:GetName().."Text"):SetText("2h")
|
getglobal(this:GetName().."Text"):SetText("2h")
|
||||||
@@ -86,8 +86,8 @@
|
|||||||
<Frame name="AuxSellAuctions" inherits="AuxFrameBoxTemplate">
|
<Frame name="AuxSellAuctions" inherits="AuxFrameBoxTemplate">
|
||||||
<Size><AbsDimension y="326"/></Size>
|
<Size><AbsDimension y="326"/></Size>
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="AuxSellParameters"><Offset><AbsDimension x="5" y="0"/></Offset></Anchor>
|
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="AuxSellParameters"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor>
|
||||||
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT" relativeTo="AuxSellParameters"><Offset><AbsDimension x="5" y="0"/></Offset></Anchor>
|
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT" relativeTo="AuxSellParameters"><Offset><AbsDimension x="10" y="0"/></Offset></Anchor>
|
||||||
<Anchor point="RIGHT"><Offset><AbsDimension x="-4" y="0"/></Offset></Anchor>
|
<Anchor point="RIGHT"><Offset><AbsDimension x="-4" y="0"/></Offset></Anchor>
|
||||||
</Anchors>
|
</Anchors>
|
||||||
<Frames>
|
<Frames>
|
||||||
|
|||||||
+1
-1
@@ -443,7 +443,7 @@ end
|
|||||||
local label = Aux.gui.label(AuxFilterSearchFrameFilterExactCheckButton, 13)
|
local label = Aux.gui.label(AuxFilterSearchFrameFilterExactCheckButton, 13)
|
||||||
label:SetPoint('BOTTOMLEFT', AuxFilterSearchFrameFilterExactCheckButton, 'TOPLEFT', 1, -3)
|
label:SetPoint('BOTTOMLEFT', AuxFilterSearchFrameFilterExactCheckButton, 'TOPLEFT', 1, -3)
|
||||||
label:SetText('Exact')
|
label:SetText('Exact')
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local label = Aux.gui.label(AuxFilterSearchFrameFilterDiscardCheckButton, 13)
|
local label = Aux.gui.label(AuxFilterSearchFrameFilterDiscardCheckButton, 13)
|
||||||
label:SetPoint('BOTTOMLEFT', AuxFilterSearchFrameFilterDiscardCheckButton, 'TOPLEFT', 1, -3)
|
label:SetPoint('BOTTOMLEFT', AuxFilterSearchFrameFilterDiscardCheckButton, 'TOPLEFT', 1, -3)
|
||||||
|
|||||||
Reference in New Issue
Block a user