Merge branch 'master' into dev
This commit is contained in:
+4
-3
@@ -1,7 +1,7 @@
|
|||||||
## Interface: 11200
|
## Interface: 11200
|
||||||
## Title: Aux
|
## Title: Aux
|
||||||
## Notes: A lightweight addon designed to help manage auctions
|
## Notes: A lightweight addon designed to help manage auctions
|
||||||
## SavedVariablesPerCharacter: AUX_SELL_SHORTCUT, AUX_BUY_SHORTCUT, AUX_OPEN_SELL, AUX_OPEN_BUY, AUX_INSTANT_BUYOUT, AUX_AUCTION_DURATION
|
## SavedVariablesPerCharacter: aux_view, AUX_SELL_SHORTCUT, AUX_BUY_SHORTCUT, AUX_OPEN_SELL, AUX_OPEN_BUY, AUX_INSTANT_BUYOUT, AUX_AUCTION_DURATION
|
||||||
## SavedVariables: aux_database, aux_recently_searched, aux_auctionable_items
|
## SavedVariables: aux_database, aux_recently_searched, aux_auctionable_items
|
||||||
|
|
||||||
core.xml
|
core.xml
|
||||||
@@ -12,14 +12,15 @@ util.lua
|
|||||||
scan.lua
|
scan.lua
|
||||||
stack.lua
|
stack.lua
|
||||||
post.lua
|
post.lua
|
||||||
list.lua
|
sheet.lua
|
||||||
info.xml
|
info.xml
|
||||||
completion.xml
|
completion.xml
|
||||||
|
|
||||||
item_search_frame.xml
|
item_search_frame.xml
|
||||||
filter_search_frame.xml
|
filter_search_frame.xml
|
||||||
post_frame.xml
|
post_frame.xml
|
||||||
manage_frame.xml
|
auctions_frame.xml
|
||||||
|
bids_frame.xml
|
||||||
scan_frame.xml
|
scan_frame.xml
|
||||||
|
|
||||||
options.xml
|
options.xml
|
||||||
|
|||||||
@@ -0,0 +1,326 @@
|
|||||||
|
local private, public = {}, {}
|
||||||
|
Aux.auctions_frame = public
|
||||||
|
|
||||||
|
local auction_records
|
||||||
|
|
||||||
|
public.auction_listing_config = {
|
||||||
|
on_row_click = function (sheet, row_index)
|
||||||
|
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||||
|
public.on_auction_click(sheet.data[data_index])
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_row_enter = function (sheet, row_index)
|
||||||
|
sheet.rows[row_index].highlight:SetAlpha(.5)
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_row_leave = function (sheet, row_index)
|
||||||
|
sheet.rows[row_index].highlight:SetAlpha(0)
|
||||||
|
end,
|
||||||
|
columns = {
|
||||||
|
{
|
||||||
|
title = 'Auction Item',
|
||||||
|
width = 280,
|
||||||
|
comparator = function(row1, row2) return Aux.util.compare(row1.tooltip[1][1].text, row2.tooltip[1][1].text, Aux.util.GT) end,
|
||||||
|
cell_initializer = function(cell)
|
||||||
|
local icon = CreateFrame('Button', nil, cell)
|
||||||
|
icon:EnableMouse(false)
|
||||||
|
local icon_texture = icon:CreateTexture(nil, 'BORDER')
|
||||||
|
icon_texture:SetAllPoints(icon)
|
||||||
|
icon.icon_texture = icon_texture
|
||||||
|
local normal_texture = icon:CreateTexture(nil)
|
||||||
|
normal_texture:SetPoint('CENTER', 0, 0)
|
||||||
|
normal_texture:SetWidth(22)
|
||||||
|
normal_texture:SetHeight(22)
|
||||||
|
normal_texture:SetTexture('Interface\\Buttons\\UI-Quickslot2')
|
||||||
|
icon:SetNormalTexture(normal_texture)
|
||||||
|
icon:SetPoint('LEFT', cell)
|
||||||
|
icon:SetWidth(12)
|
||||||
|
icon:SetHeight(12)
|
||||||
|
local text = cell:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
|
||||||
|
text:SetPoint("LEFT", icon, "RIGHT", 1, 0)
|
||||||
|
text:SetPoint('TOPRIGHT', cell)
|
||||||
|
text:SetPoint('BOTTOMRIGHT', cell)
|
||||||
|
text:SetJustifyV('TOP')
|
||||||
|
text:SetJustifyH('LEFT')
|
||||||
|
text:SetTextColor(0.8, 0.8, 0.8)
|
||||||
|
cell.text = text
|
||||||
|
cell.icon = icon
|
||||||
|
end,
|
||||||
|
cell_setter = function(cell, datum)
|
||||||
|
cell.icon.icon_texture:SetTexture(Aux.info.item(datum.item_id).texture)
|
||||||
|
if not datum.usable then
|
||||||
|
cell.icon.icon_texture:SetVertexColor(1.0, 0.1, 0.1)
|
||||||
|
else
|
||||||
|
cell.icon.icon_texture:SetVertexColor(1.0, 1.0, 1.0)
|
||||||
|
end
|
||||||
|
cell.text:SetText('['..datum.tooltip[1][1].text..']')
|
||||||
|
local color = ITEM_QUALITY_COLORS[datum.quality]
|
||||||
|
cell.text:SetTextColor(color.r, color.g, color.b)
|
||||||
|
private.auction_alpha_setter(cell, datum)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title = 'Qty',
|
||||||
|
width = 25,
|
||||||
|
comparator = function(row1, row2) return Aux.util.compare(row1.stack_size, row2.stack_size, Aux.util.LT) end,
|
||||||
|
cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
|
||||||
|
cell_setter = function(cell, datum)
|
||||||
|
cell.text:SetText(datum.aux_quantity)
|
||||||
|
private.auction_alpha_setter(cell, datum)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title = 'Left',
|
||||||
|
width = 30,
|
||||||
|
comparator = function(row1, row2) return Aux.util.compare(row1.duration, row2.duration, Aux.util.GT) end,
|
||||||
|
cell_initializer = Aux.sheet.default_cell_initializer('CENTER'),
|
||||||
|
cell_setter = function(cell, datum)
|
||||||
|
local text
|
||||||
|
if datum.duration == 1 then
|
||||||
|
text = '30m'
|
||||||
|
elseif datum.duration == 2 then
|
||||||
|
text = '2h'
|
||||||
|
elseif datum.duration == 3 then
|
||||||
|
text = '8h'
|
||||||
|
elseif datum.duration == 4 then
|
||||||
|
text = '24h'
|
||||||
|
end
|
||||||
|
cell.text:SetText(text)
|
||||||
|
private.auction_alpha_setter(cell, datum)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title = 'Current Bid',
|
||||||
|
width = 90,
|
||||||
|
comparator = function(auction1, auction2) return Aux.util.compare(auction1.current_bid, auction2.current_bid, Aux.util.GT) end,
|
||||||
|
cell_initializer = Aux.sheet.default_cell_initializer('CENTER'),
|
||||||
|
cell_setter = function(cell, auction)
|
||||||
|
cell.text:SetText(auction.current_bid and Aux.util.money_string(auction.current_bid) or RED_FONT_COLOR_CODE..'No Bids'..FONT_COLOR_CODE_CLOSE)
|
||||||
|
private.auction_alpha_setter(cell, auction)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title = 'Min Bid',
|
||||||
|
width = 90,
|
||||||
|
comparator = function(auction1, auction2) return Aux.util.compare(auction1.min_bid, auction2.min_bid, Aux.util.GT) end,
|
||||||
|
cell_initializer = Aux.sheet.default_cell_initializer('CENTER'),
|
||||||
|
cell_setter = function(cell, auction)
|
||||||
|
cell.text:SetText(Aux.util.money_string(auction.min_bid))
|
||||||
|
private.auction_alpha_setter(cell, auction)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title = 'Buy',
|
||||||
|
width = 90,
|
||||||
|
comparator = function(row1, row2) return Aux.util.compare(row1.buyout_price, row2.buyout_price, Aux.util.GT) end,
|
||||||
|
cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
|
||||||
|
cell_setter = function(cell, datum)
|
||||||
|
cell.text:SetText(Aux.util.money_string(datum.buyout_price))
|
||||||
|
private.auction_alpha_setter(cell, datum)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
sort_order = {{ column = 1, order = 'ascending' }},
|
||||||
|
}
|
||||||
|
|
||||||
|
function public.on_open()
|
||||||
|
public.update_auction_records()
|
||||||
|
public.update_listing()
|
||||||
|
end
|
||||||
|
|
||||||
|
function public.on_close()
|
||||||
|
end
|
||||||
|
|
||||||
|
function private.auction_alpha_setter(cell, auction)
|
||||||
|
cell:SetAlpha(auction.gone and 0.3 or 1)
|
||||||
|
end
|
||||||
|
|
||||||
|
function public.update_auction_records()
|
||||||
|
Aux.log('Scanning auctions ...')
|
||||||
|
auction_records = {}
|
||||||
|
Aux.scan.start{
|
||||||
|
type = 'owner',
|
||||||
|
page = 0,
|
||||||
|
on_page_loaded = function(page, total_pages)
|
||||||
|
Aux.log('Scanning auction page '..(page+1)..' out of '..total_pages..' ...')
|
||||||
|
end,
|
||||||
|
on_read_auction = function(auction_info)
|
||||||
|
private.create_auction_record(auction_info)
|
||||||
|
end,
|
||||||
|
on_complete = function()
|
||||||
|
Aux.log('Scan complete: '..getn(auction_records)..' '..Aux_PluralizeIf('auction', getn(auction_records))..' found')
|
||||||
|
public.update_listing()
|
||||||
|
end,
|
||||||
|
on_abort = function()
|
||||||
|
end,
|
||||||
|
next_page = function(page, total_pages)
|
||||||
|
local last_page = max(total_pages - 1, 0)
|
||||||
|
if page < last_page then
|
||||||
|
return page + 1
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function public.update_listing()
|
||||||
|
AuxAuctionsFrameListingAuctionListing:Show()
|
||||||
|
Aux.sheet.populate(AuxAuctionsFrameListingAuctionListing.sheet, auction_records)
|
||||||
|
AuxAuctionsFrameListing:SetWidth(AuxAuctionsFrameListingAuctionListing:GetWidth() + 40)
|
||||||
|
AuxFrame:SetWidth(AuxAuctionsFrameListing:GetWidth() + 15)
|
||||||
|
end
|
||||||
|
|
||||||
|
function private.create_record(auction_info)
|
||||||
|
|
||||||
|
local aux_quantity = auction_info.charges or auction_info.count
|
||||||
|
local bid = (auction_info.current_bid > 0 and auction_info.current_bid or auction_info.min_bid) + auction_info.min_increment
|
||||||
|
local buyout_price = auction_info.buyout_price > 0 and auction_info.buyout_price or nil
|
||||||
|
local buyout_price_per_unit = buyout_price and Aux_Round(auction_info.buyout_price / aux_quantity)
|
||||||
|
|
||||||
|
local status
|
||||||
|
if auction_info.high_bidder then
|
||||||
|
status = GREEN_FONT_COLOR_CODE..'High Bidder'..FONT_COLOR_CODE_CLOSE
|
||||||
|
else
|
||||||
|
status = RED_FONT_COLOR_CODE..'Outbid'..FONT_COLOR_CODE_CLOSE
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
item_id = auction_info.item_id,
|
||||||
|
key = auction_info.item_signature,
|
||||||
|
signature = Aux.auction_signature(auction_info.hyperlink, aux_quantity, bid, auction_info.buyout_price),
|
||||||
|
|
||||||
|
name = auction_info.name,
|
||||||
|
tooltip = auction_info.tooltip,
|
||||||
|
aux_quantity = aux_quantity,
|
||||||
|
buyout_price = buyout_price,
|
||||||
|
buyout_price_per_unit = buyout_price_per_unit,
|
||||||
|
quality = auction_info.quality,
|
||||||
|
hyperlink = auction_info.hyperlink,
|
||||||
|
itemstring = auction_info.itemstring,
|
||||||
|
bid = bid,
|
||||||
|
duration = auction_info.duration,
|
||||||
|
usable = auction_info.usable,
|
||||||
|
high_bidder = auction_info.high_bidder,
|
||||||
|
current_bid = auction_info.current_bid > 0 and auction_info.current_bid or nil,
|
||||||
|
min_bid = auction_info.min_bid,
|
||||||
|
status = status,
|
||||||
|
|
||||||
|
EnhTooltip_info = auction_info.EnhTooltip_info,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function private.create_auction_record(auction_info)
|
||||||
|
tinsert(auction_records, private.create_record(auction_info))
|
||||||
|
end
|
||||||
|
|
||||||
|
function public.dialog_cancel()
|
||||||
|
Aux.log('Aborted.')
|
||||||
|
Aux.scan.abort()
|
||||||
|
AuxAuctionsFrameListingDialog:Hide()
|
||||||
|
public.update_listing()
|
||||||
|
end
|
||||||
|
|
||||||
|
function private.find_auction(entry, express_mode)
|
||||||
|
|
||||||
|
if entry.gone then
|
||||||
|
Aux.log('Auction not available')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local amount
|
||||||
|
|
||||||
|
Aux.log('Processing cancelation request for '..entry.hyperlink..' x '..entry.aux_quantity..' at '..Aux.util.money_string(amount)..' ...')
|
||||||
|
|
||||||
|
if not express_mode then
|
||||||
|
private.show_dialog(entry)
|
||||||
|
end
|
||||||
|
|
||||||
|
PlaySound('igMainMenuOptionCheckBoxOn')
|
||||||
|
|
||||||
|
local found
|
||||||
|
|
||||||
|
Aux.scan.start{
|
||||||
|
type = 'owner',
|
||||||
|
page = entry.page,
|
||||||
|
on_read_auction = function(auction_info, ctrl)
|
||||||
|
|
||||||
|
local auction_record = private.create_record(auction_info)
|
||||||
|
|
||||||
|
if entry.signature == auction_record.signature then
|
||||||
|
ctrl.suspend()
|
||||||
|
found = true
|
||||||
|
Aux.log('Matching auction found.'..(express_mode and '' or ' Awaiting confirmation ...'))
|
||||||
|
|
||||||
|
if express_mode then
|
||||||
|
CancelAuction(auction_info.index)
|
||||||
|
entry.gone = true
|
||||||
|
Aux.log('Canceled'..auction_record.hyperlink..' x '..auction_record.aux_quantity)
|
||||||
|
Aux.scan.abort()
|
||||||
|
else
|
||||||
|
public.dialog_action = function()
|
||||||
|
if private.create_record(Aux.info.auction(auction_info.index, 'owner')).signature == entry.signature then
|
||||||
|
CancelAuction(auction_info.index)
|
||||||
|
entry.gone = true
|
||||||
|
Aux.log('Canceled'..auction_record.hyperlink..' x '..auction_record.aux_quantity)
|
||||||
|
Aux.scan.abort()
|
||||||
|
AuxAuctionsFrameListingDialog:Hide()
|
||||||
|
public.update_listing()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
AuxAuctionsFrameListingDialogContentActionButton:Enable()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
on_complete = function()
|
||||||
|
if not found then
|
||||||
|
Aux.log('No matching auction found. Removing entry from the cache.')
|
||||||
|
entry.gone = true
|
||||||
|
public.dialog_cancel()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
on_abort = function()
|
||||||
|
public.update_listing()
|
||||||
|
end,
|
||||||
|
next_page = function(page, total_pages)
|
||||||
|
if not page or page == entry.page then
|
||||||
|
return entry.page - 1
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
function public.on_auction_click(auction_record)
|
||||||
|
|
||||||
|
local express_mode = IsAltKeyDown()
|
||||||
|
|
||||||
|
if IsControlKeyDown() then
|
||||||
|
DressUpItemLink(auction_record.hyperlink)
|
||||||
|
else
|
||||||
|
private.find_auction(auction_record, express_mode)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function private.show_dialog(entry)
|
||||||
|
AuxAuctionsFrameListingDialogContentItem.itemstring = Aux.info.itemstring(entry.item_id, entry.suffix_id, entry.unique_id, entry.enchant_id)
|
||||||
|
AuxAuctionsFrameListingDialogContentItem.EnhTooltip_info = entry.EnhTooltip_info
|
||||||
|
|
||||||
|
AuxAuctionsFrameListingDialogContentActionButton:Disable()
|
||||||
|
AuxAuctionsFrameListingDialogContentItemIconTexture:SetTexture(Aux.info.item(entry.item_id).texture)
|
||||||
|
AuxAuctionsFrameListingDialogContentItemName:SetText(entry.name)
|
||||||
|
local color = ITEM_QUALITY_COLORS[entry.quality]
|
||||||
|
AuxAuctionsFrameListingDialogContentItemName:SetTextColor(color.r, color.g, color.b)
|
||||||
|
|
||||||
|
if entry.aux_quantity > 1 then
|
||||||
|
AuxAuctionsFrameListingDialogContentItemCount:SetText(entry.aux_quantity);
|
||||||
|
AuxAuctionsFrameListingDialogContentItemCount:Show()
|
||||||
|
else
|
||||||
|
AuxAuctionsFrameListingDialogContentItemCount:Hide()
|
||||||
|
end
|
||||||
|
|
||||||
|
AuxAuctionsFrameListingDialogContentCancelLabel:Show()
|
||||||
|
AuxAuctionsFrameListingDialogContentActionButton:SetText('Yes')
|
||||||
|
AuxAuctionsFrameListingDialogContentCancelButton:SetText('No')
|
||||||
|
|
||||||
|
AuxAuctionsFrameListingDialog:Show()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
|
||||||
|
|
||||||
|
<Script file="auctions_frame.lua"/>
|
||||||
|
|
||||||
|
<Frame name="AuxAuctionsFrame" hidden="true" parent="AuxFrame" setAllPoints="true">
|
||||||
|
<Frames>
|
||||||
|
<Frame name="$parentListing" inherits="AuxFrameBoxTemplate">
|
||||||
|
<Size>
|
||||||
|
<AbsDimension x="400" y="326"/>
|
||||||
|
</Size>
|
||||||
|
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="5" y="-35"/></Offset></Anchor></Anchors>
|
||||||
|
<Scripts>
|
||||||
|
<OnLoad>
|
||||||
|
this:SetBackdropBorderColor(0.4, 0.4, 0.4)
|
||||||
|
this:SetBackdropColor(0.15, 0.15, 0.15)
|
||||||
|
</OnLoad>
|
||||||
|
</Scripts>
|
||||||
|
<Frames>
|
||||||
|
<Frame name="$parentAuctionListing">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||||
|
<Anchor point="BOTTOM"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||||
|
</Anchors>
|
||||||
|
<Scripts>
|
||||||
|
<OnLoad>
|
||||||
|
local config = Aux.auctions_frame.auction_listing_config
|
||||||
|
this.sheet = Aux.sheet.create{
|
||||||
|
frame = this,
|
||||||
|
columns = config.columns,
|
||||||
|
sort_order = config.sort_order,
|
||||||
|
row_setter = config.row_setter,
|
||||||
|
on_row_click = config.on_row_click,
|
||||||
|
on_row_enter = config.on_row_enter,
|
||||||
|
on_row_leave = config.on_row_leave,
|
||||||
|
on_row_update = config.on_row_update,
|
||||||
|
}
|
||||||
|
</OnLoad>
|
||||||
|
</Scripts>
|
||||||
|
</Frame>
|
||||||
|
<Frame name="$parentDialog" frameStrata="FULLSCREEN_DIALOG" inherits="OptionFrameBoxTemplate" enableMouse="true" enableMouseWheel="true" hidden="true">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||||
|
<Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||||
|
</Anchors>
|
||||||
|
<Scripts>
|
||||||
|
<OnMouseWheel></OnMouseWheel>
|
||||||
|
</Scripts>
|
||||||
|
<Frames>
|
||||||
|
<Frame name="$parentContent">
|
||||||
|
<Anchors><Anchor point="CENTER"><Offset><AbsDimension x="0" y="5"/></Offset></Anchor></Anchors>
|
||||||
|
<Size><AbsDimension x="193" y="120"/></Size>
|
||||||
|
<Layers>
|
||||||
|
<Layer level="OVERLAY">
|
||||||
|
<FontString name="$parentCancelLabel" inherits="GameFontNormal" text="Cancel this auction?" justifyH="RIGHT">
|
||||||
|
<Anchors><Anchor point="BOTTOM"><Offset><AbsDimension x="0" y="45"/></Offset></Anchor></Anchors>
|
||||||
|
</FontString>
|
||||||
|
</Layer>
|
||||||
|
</Layers>
|
||||||
|
<Frames>
|
||||||
|
<Frame name="$parentItem" inherits="AuxItemTemplate">
|
||||||
|
<Anchors><Anchor point="TOP"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||||
|
</Frame>
|
||||||
|
<Button name="$parentActionButton" inherits="UIPanelButtonTemplate" text="Buy" disabled="true">
|
||||||
|
<Size><AbsDimension x="90" y="26"/> </Size>
|
||||||
|
<Anchors><Anchor point="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||||
|
<Scripts>
|
||||||
|
<OnClick>
|
||||||
|
Aux.auctions_frame.dialog_action()
|
||||||
|
</OnClick>
|
||||||
|
</Scripts>
|
||||||
|
</Button>
|
||||||
|
<Button name="$parentCancelButton" inherits="UIPanelButtonTemplate" text="Cancel">
|
||||||
|
<Size><AbsDimension x="90" y="26"/></Size>
|
||||||
|
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||||
|
<Scripts>
|
||||||
|
<OnClick>
|
||||||
|
Aux.auctions_frame.dialog_cancel()
|
||||||
|
</OnClick>
|
||||||
|
</Scripts>
|
||||||
|
</Button>
|
||||||
|
</Frames>
|
||||||
|
</Frame>
|
||||||
|
</Frames>
|
||||||
|
</Frame>
|
||||||
|
</Frames>
|
||||||
|
</Frame>
|
||||||
|
</Frames>
|
||||||
|
</Frame>
|
||||||
|
</Ui>
|
||||||
@@ -1,11 +1,7 @@
|
|||||||
local private, public = {}, {}
|
local private, public = {}, {}
|
||||||
Aux.manage_frame = public
|
Aux.bids_frame = public
|
||||||
|
|
||||||
local update_bid_records, update_auction_records, wait_for_bids, wait_for_auctions
|
local bid_records
|
||||||
|
|
||||||
local bid_records, auction_records
|
|
||||||
|
|
||||||
local BIDS, AUCTIONS = 1, 2
|
|
||||||
|
|
||||||
public.bid_listing_config = {
|
public.bid_listing_config = {
|
||||||
on_row_click = function(sheet, row_index, column_index)
|
on_row_click = function(sheet, row_index, column_index)
|
||||||
@@ -148,135 +144,8 @@ public.bid_listing_config = {
|
|||||||
sort_order = {{ column = 1, order = 'ascending' }},
|
sort_order = {{ column = 1, order = 'ascending' }},
|
||||||
}
|
}
|
||||||
|
|
||||||
public.auction_listing_config = {
|
|
||||||
on_row_click = function (sheet, row_index)
|
|
||||||
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
|
||||||
public.on_auction_click(sheet.data[data_index])
|
|
||||||
end,
|
|
||||||
|
|
||||||
on_row_enter = function (sheet, row_index)
|
|
||||||
sheet.rows[row_index].highlight:SetAlpha(.5)
|
|
||||||
end,
|
|
||||||
|
|
||||||
on_row_leave = function (sheet, row_index)
|
|
||||||
sheet.rows[row_index].highlight:SetAlpha(0)
|
|
||||||
end,
|
|
||||||
columns = {
|
|
||||||
{
|
|
||||||
title = 'Auction Item',
|
|
||||||
width = 280,
|
|
||||||
comparator = function(row1, row2) return Aux.util.compare(row1.tooltip[1][1].text, row2.tooltip[1][1].text, Aux.util.GT) end,
|
|
||||||
cell_initializer = function(cell)
|
|
||||||
local icon = CreateFrame('Button', nil, cell)
|
|
||||||
icon:EnableMouse(false)
|
|
||||||
local icon_texture = icon:CreateTexture(nil, 'BORDER')
|
|
||||||
icon_texture:SetAllPoints(icon)
|
|
||||||
icon.icon_texture = icon_texture
|
|
||||||
local normal_texture = icon:CreateTexture(nil)
|
|
||||||
normal_texture:SetPoint('CENTER', 0, 0)
|
|
||||||
normal_texture:SetWidth(22)
|
|
||||||
normal_texture:SetHeight(22)
|
|
||||||
normal_texture:SetTexture('Interface\\Buttons\\UI-Quickslot2')
|
|
||||||
icon:SetNormalTexture(normal_texture)
|
|
||||||
icon:SetPoint('LEFT', cell)
|
|
||||||
icon:SetWidth(12)
|
|
||||||
icon:SetHeight(12)
|
|
||||||
local text = cell:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
|
|
||||||
text:SetPoint("LEFT", icon, "RIGHT", 1, 0)
|
|
||||||
text:SetPoint('TOPRIGHT', cell)
|
|
||||||
text:SetPoint('BOTTOMRIGHT', cell)
|
|
||||||
text:SetJustifyV('TOP')
|
|
||||||
text:SetJustifyH('LEFT')
|
|
||||||
text:SetTextColor(0.8, 0.8, 0.8)
|
|
||||||
cell.text = text
|
|
||||||
cell.icon = icon
|
|
||||||
end,
|
|
||||||
cell_setter = function(cell, datum)
|
|
||||||
cell.icon.icon_texture:SetTexture(Aux.info.item(datum.item_id).texture)
|
|
||||||
if not datum.usable then
|
|
||||||
cell.icon.icon_texture:SetVertexColor(1.0, 0.1, 0.1)
|
|
||||||
else
|
|
||||||
cell.icon.icon_texture:SetVertexColor(1.0, 1.0, 1.0)
|
|
||||||
end
|
|
||||||
cell.text:SetText('['..datum.tooltip[1][1].text..']')
|
|
||||||
local color = ITEM_QUALITY_COLORS[datum.quality]
|
|
||||||
cell.text:SetTextColor(color.r, color.g, color.b)
|
|
||||||
private.auction_alpha_setter(cell, datum)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title = 'Qty',
|
|
||||||
width = 25,
|
|
||||||
comparator = function(row1, row2) return Aux.util.compare(row1.stack_size, row2.stack_size, Aux.util.LT) end,
|
|
||||||
cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
|
|
||||||
cell_setter = function(cell, datum)
|
|
||||||
cell.text:SetText(datum.aux_quantity)
|
|
||||||
private.auction_alpha_setter(cell, datum)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title = 'Left',
|
|
||||||
width = 30,
|
|
||||||
comparator = function(row1, row2) return Aux.util.compare(row1.duration, row2.duration, Aux.util.GT) end,
|
|
||||||
cell_initializer = Aux.sheet.default_cell_initializer('CENTER'),
|
|
||||||
cell_setter = function(cell, datum)
|
|
||||||
local text
|
|
||||||
if datum.duration == 1 then
|
|
||||||
text = '30m'
|
|
||||||
elseif datum.duration == 2 then
|
|
||||||
text = '2h'
|
|
||||||
elseif datum.duration == 3 then
|
|
||||||
text = '8h'
|
|
||||||
elseif datum.duration == 4 then
|
|
||||||
text = '24h'
|
|
||||||
end
|
|
||||||
cell.text:SetText(text)
|
|
||||||
private.auction_alpha_setter(cell, datum)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title = 'Current Bid',
|
|
||||||
width = 90,
|
|
||||||
comparator = function(auction1, auction2) return Aux.util.compare(auction1.current_bid, auction2.current_bid, Aux.util.GT) end,
|
|
||||||
cell_initializer = Aux.sheet.default_cell_initializer('CENTER'),
|
|
||||||
cell_setter = function(cell, auction)
|
|
||||||
cell.text:SetText(auction.current_bid and Aux.util.money_string(auction.current_bid) or RED_FONT_COLOR_CODE..'No Bids'..FONT_COLOR_CODE_CLOSE)
|
|
||||||
private.auction_alpha_setter(cell, auction)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title = 'Min Bid',
|
|
||||||
width = 90,
|
|
||||||
comparator = function(auction1, auction2) return Aux.util.compare(auction1.min_bid, auction2.min_bid, Aux.util.GT) end,
|
|
||||||
cell_initializer = Aux.sheet.default_cell_initializer('CENTER'),
|
|
||||||
cell_setter = function(cell, auction)
|
|
||||||
cell.text:SetText(Aux.util.money_string(auction.min_bid))
|
|
||||||
private.auction_alpha_setter(cell, auction)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title = 'Buy',
|
|
||||||
width = 90,
|
|
||||||
comparator = function(row1, row2) return Aux.util.compare(row1.buyout_price, row2.buyout_price, Aux.util.GT) end,
|
|
||||||
cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
|
|
||||||
cell_setter = function(cell, datum)
|
|
||||||
cell.text:SetText(Aux.util.money_string(datum.buyout_price))
|
|
||||||
private.auction_alpha_setter(cell, datum)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
sort_order = {{ column = 1, order = 'ascending' }},
|
|
||||||
}
|
|
||||||
|
|
||||||
function public.on_open()
|
function public.on_open()
|
||||||
public.listing = public.listing or BIDS
|
public.update_bid_records()
|
||||||
|
|
||||||
if public.listing == BIDS then
|
|
||||||
public.update_bid_records()
|
|
||||||
elseif public.listing == AUCTIONS then
|
|
||||||
public.update_auction_records()
|
|
||||||
end
|
|
||||||
|
|
||||||
public.update_listing()
|
public.update_listing()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -300,34 +169,7 @@ function public.update_bid_records()
|
|||||||
private.create_bid_record(auction_info)
|
private.create_bid_record(auction_info)
|
||||||
end,
|
end,
|
||||||
on_complete = function()
|
on_complete = function()
|
||||||
Aux.log('Scan complete: '..getn(bid_records)..' bids found')
|
Aux.log('Scan complete: '..getn(bid_records)..' '..Aux_PluralizeIf('bid', getn(bid_records))..' found')
|
||||||
public.update_listing()
|
|
||||||
end,
|
|
||||||
on_abort = function()
|
|
||||||
end,
|
|
||||||
next_page = function(page, total_pages)
|
|
||||||
local last_page = max(total_pages - 1, 0)
|
|
||||||
if page < last_page then
|
|
||||||
return page + 1
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
function public.update_auction_records()
|
|
||||||
Aux.log('Scanning auctions ...')
|
|
||||||
auction_records = {}
|
|
||||||
Aux.scan.start{
|
|
||||||
type = 'owner',
|
|
||||||
page = 0,
|
|
||||||
on_page_loaded = function(page, total_pages)
|
|
||||||
Aux.log('Scanning auction page '..(page+1)..' out of '..total_pages..' ...')
|
|
||||||
end,
|
|
||||||
on_read_auction = function(auction_info)
|
|
||||||
private.create_auction_record(auction_info)
|
|
||||||
end,
|
|
||||||
on_complete = function()
|
|
||||||
Aux.log('Scan complete: '..getn(auction_records)..' auctions found')
|
|
||||||
public.update_listing()
|
public.update_listing()
|
||||||
end,
|
end,
|
||||||
on_abort = function()
|
on_abort = function()
|
||||||
@@ -342,24 +184,10 @@ function public.update_auction_records()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function public.update_listing()
|
function public.update_listing()
|
||||||
AuxManageFrameListingBidListing:Hide()
|
AuxBidsFrameListingBidListing:Show()
|
||||||
AuxManageFrameListingAuctionListing:Hide()
|
Aux.sheet.populate(AuxBidsFrameListingBidListing.sheet, bid_records)
|
||||||
|
AuxBidsFrameListing:SetWidth(AuxBidsFrameListingBidListing:GetWidth() + 40)
|
||||||
for i=1,2 do
|
AuxFrame:SetWidth(AuxBidsFrameListing:GetWidth() + 15)
|
||||||
getglobal('AuxManageFrameListingTab'..i):SetAlpha(i == public.listing and 1 or 0.5)
|
|
||||||
end
|
|
||||||
|
|
||||||
if public.listing == BIDS then
|
|
||||||
AuxManageFrameListingBidListing:Show()
|
|
||||||
Aux.list.populate(AuxManageFrameListingBidListing.sheet, bid_records)
|
|
||||||
AuxManageFrameListing:SetWidth(AuxManageFrameListingBidListing:GetWidth() + 40)
|
|
||||||
AuxFrame:SetWidth(AuxManageFrameListing:GetWidth() + 15)
|
|
||||||
elseif public.listing == AUCTIONS then
|
|
||||||
AuxManageFrameListingAuctionListing:Show()
|
|
||||||
Aux.list.populate(AuxManageFrameListingAuctionListing.sheet, auction_records)
|
|
||||||
AuxManageFrameListing:SetWidth(AuxManageFrameListingAuctionListing:GetWidth() + 40)
|
|
||||||
AuxFrame:SetWidth(AuxManageFrameListing:GetWidth() + 15)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.create_record(auction_info)
|
function private.create_record(auction_info)
|
||||||
@@ -382,7 +210,6 @@ function private.create_record(auction_info)
|
|||||||
signature = Aux.auction_signature(auction_info.hyperlink, aux_quantity, bid, auction_info.buyout_price),
|
signature = Aux.auction_signature(auction_info.hyperlink, aux_quantity, bid, auction_info.buyout_price),
|
||||||
|
|
||||||
name = auction_info.name,
|
name = auction_info.name,
|
||||||
level = auction_info.level,
|
|
||||||
tooltip = auction_info.tooltip,
|
tooltip = auction_info.tooltip,
|
||||||
aux_quantity = aux_quantity,
|
aux_quantity = aux_quantity,
|
||||||
buyout_price = buyout_price,
|
buyout_price = buyout_price,
|
||||||
@@ -391,23 +218,17 @@ function private.create_record(auction_info)
|
|||||||
hyperlink = auction_info.hyperlink,
|
hyperlink = auction_info.hyperlink,
|
||||||
itemstring = auction_info.itemstring,
|
itemstring = auction_info.itemstring,
|
||||||
bid = bid,
|
bid = bid,
|
||||||
bid_per_unit = Aux_Round(bid / aux_quantity),
|
|
||||||
owner = auction_info.owner,
|
owner = auction_info.owner,
|
||||||
duration = auction_info.duration,
|
duration = auction_info.duration,
|
||||||
usable = auction_info.usable,
|
usable = auction_info.usable,
|
||||||
high_bidder = auction_info.high_bidder,
|
high_bidder = auction_info.high_bidder,
|
||||||
current_bid = auction_info.current_bid > 0 and auction_info.current_bid or nil,
|
current_bid = auction_info.current_bid > 0 and auction_info.current_bid or nil,
|
||||||
min_bid = auction_info.min_bid,
|
|
||||||
status = status,
|
status = status,
|
||||||
|
|
||||||
EnhTooltip_info = auction_info.EnhTooltip_info,
|
EnhTooltip_info = auction_info.EnhTooltip_info,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.create_auction_record(auction_info)
|
|
||||||
tinsert(auction_records, private.create_record(auction_info))
|
|
||||||
end
|
|
||||||
|
|
||||||
function private.create_bid_record(auction_info)
|
function private.create_bid_record(auction_info)
|
||||||
tinsert(bid_records, private.create_record(auction_info))
|
tinsert(bid_records, private.create_record(auction_info))
|
||||||
end
|
end
|
||||||
@@ -415,7 +236,7 @@ end
|
|||||||
function public.dialog_cancel()
|
function public.dialog_cancel()
|
||||||
Aux.log('Aborted.')
|
Aux.log('Aborted.')
|
||||||
Aux.scan.abort()
|
Aux.scan.abort()
|
||||||
AuxManageFrameListingDialog:Hide()
|
AuxBidsFrameListingDialog:Hide()
|
||||||
public.update_listing()
|
public.update_listing()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -449,7 +270,7 @@ function private.find_auction(entry, action, express_mode)
|
|||||||
local found
|
local found
|
||||||
|
|
||||||
Aux.scan.start{
|
Aux.scan.start{
|
||||||
type = action == 'cancel' and 'owner' or 'bidder',
|
type = 'bidder',
|
||||||
page = entry.page,
|
page = entry.page,
|
||||||
on_read_auction = function(auction_info, ctrl)
|
on_read_auction = function(auction_info, ctrl)
|
||||||
|
|
||||||
@@ -461,11 +282,7 @@ function private.find_auction(entry, action, express_mode)
|
|||||||
Aux.log('Matching auction found.'..(express_mode and '' or ' Awaiting confirmation ...'))
|
Aux.log('Matching auction found.'..(express_mode and '' or ' Awaiting confirmation ...'))
|
||||||
|
|
||||||
if express_mode then
|
if express_mode then
|
||||||
if action == 'cancel' then
|
if GetMoney() >= amount then
|
||||||
CancelAuction(auction_info.index)
|
|
||||||
entry.gone = true
|
|
||||||
Aux.log('Canceled'..auction_record.hyperlink..' x '..auction_record.aux_quantity)
|
|
||||||
elseif GetMoney() >= amount then
|
|
||||||
PlaceAuctionBid('bidder', auction_info.index, amount)
|
PlaceAuctionBid('bidder', auction_info.index, amount)
|
||||||
Aux.log((action == 'buyout' and 'Purchased ' or 'Bid on ')..auction_record.hyperlink..' x '..auction_record.aux_quantity..' at '..Aux.util.money_string(amount)..'.')
|
Aux.log((action == 'buyout' and 'Purchased ' or 'Bid on ')..auction_record.hyperlink..' x '..auction_record.aux_quantity..' at '..Aux.util.money_string(amount)..'.')
|
||||||
entry.gone = true
|
entry.gone = true
|
||||||
@@ -475,22 +292,20 @@ function private.find_auction(entry, action, express_mode)
|
|||||||
Aux.scan.abort()
|
Aux.scan.abort()
|
||||||
else
|
else
|
||||||
public.dialog_action = function()
|
public.dialog_action = function()
|
||||||
if action == 'cancel' then
|
if private.create_record(Aux.info.auction(auction_info.index, 'bidder')).signature == entry.signature then
|
||||||
CancelAuction(auction_info.index)
|
if GetMoney() >= amount then
|
||||||
entry.gone = true
|
PlaceAuctionBid('bidder', auction_info.index, action == 'bid' and MoneyInputFrame_GetCopper(AuxBidsFrameListingDialogContentBid) or amount)
|
||||||
Aux.log('Canceled'..auction_record.hyperlink..' x '..auction_record.aux_quantity)
|
Aux.log((action == 'buyout' and 'Purchased ' or 'Bid on ')..auction_record.hyperlink..' x '..auction_record.aux_quantity..' at '..Aux.util.money_string(action == 'bid' and MoneyInputFrame_GetCopper(AuxBidsFrameListingDialogContentBid) or amount)..'.')
|
||||||
elseif GetMoney() >= amount then
|
entry.gone = true
|
||||||
PlaceAuctionBid('bidder', auction_info.index, action == 'bid' and MoneyInputFrame_GetCopper(AuxManageFrameListingDialogContentBid) or amount)
|
else
|
||||||
Aux.log((action == 'buyout' and 'Purchased ' or 'Bid on ')..auction_record.hyperlink..' x '..auction_record.aux_quantity..' at '..Aux.util.money_string(action == 'bid' and MoneyInputFrame_GetCopper(AuxManageFrameListingDialogContentBid) or amount)..'.')
|
Aux.log('Not enough money.')
|
||||||
entry.gone = true
|
end
|
||||||
else
|
Aux.scan.abort()
|
||||||
Aux.log('Not enough money.')
|
AuxBidsFrameListingDialog:Hide()
|
||||||
|
public.update_listing()
|
||||||
end
|
end
|
||||||
Aux.scan.abort()
|
|
||||||
AuxManageFrameListingDialog:Hide()
|
|
||||||
public.update_listing()
|
|
||||||
end
|
end
|
||||||
AuxManageFrameListingDialogContentActionButton:Enable()
|
AuxBidsFrameListingDialogContentActionButton:Enable()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
@@ -512,17 +327,6 @@ function private.find_auction(entry, action, express_mode)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
function public.on_auction_click(auction_record)
|
|
||||||
|
|
||||||
local express_mode = IsAltKeyDown()
|
|
||||||
|
|
||||||
if IsControlKeyDown() then
|
|
||||||
DressUpItemLink(auction_record.hyperlink)
|
|
||||||
else
|
|
||||||
private.find_auction(auction_record, 'cancel', express_mode)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function public.on_bid_click(bid_record)
|
function public.on_bid_click(bid_record)
|
||||||
|
|
||||||
local express_mode = IsAltKeyDown()
|
local express_mode = IsAltKeyDown()
|
||||||
@@ -536,44 +340,36 @@ function public.on_bid_click(bid_record)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function private.show_dialog(action, entry, amount)
|
function private.show_dialog(action, entry, amount)
|
||||||
AuxManageFrameListingDialogContentItem.itemstring = Aux.info.itemstring(entry.item_id, entry.suffix_id, entry.unique_id, entry.enchant_id)
|
AuxBidsFrameListingDialogContentItem.itemstring = Aux.info.itemstring(entry.item_id, entry.suffix_id, entry.unique_id, entry.enchant_id)
|
||||||
AuxManageFrameListingDialogContentItem.EnhTooltip_info = entry.EnhTooltip_info
|
AuxBidsFrameListingDialogContentItem.EnhTooltip_info = entry.EnhTooltip_info
|
||||||
|
|
||||||
AuxManageFrameListingDialogContentActionButton:Disable()
|
AuxBidsFrameListingDialogContentActionButton:Disable()
|
||||||
AuxManageFrameListingDialogContentItemIconTexture:SetTexture(Aux.info.item(entry.item_id).texture)
|
AuxBidsFrameListingDialogContentItemIconTexture:SetTexture(Aux.info.item(entry.item_id).texture)
|
||||||
AuxManageFrameListingDialogContentItemName:SetText(entry.name)
|
AuxBidsFrameListingDialogContentItemName:SetText(entry.name)
|
||||||
local color = ITEM_QUALITY_COLORS[entry.quality]
|
local color = ITEM_QUALITY_COLORS[entry.quality]
|
||||||
AuxManageFrameListingDialogContentItemName:SetTextColor(color.r, color.g, color.b)
|
AuxBidsFrameListingDialogContentItemName:SetTextColor(color.r, color.g, color.b)
|
||||||
|
|
||||||
if entry.aux_quantity > 1 then
|
if entry.aux_quantity > 1 then
|
||||||
AuxManageFrameListingDialogContentItemCount:SetText(entry.aux_quantity);
|
AuxBidsFrameListingDialogContentItemCount:SetText(entry.aux_quantity);
|
||||||
AuxManageFrameListingDialogContentItemCount:Show()
|
AuxBidsFrameListingDialogContentItemCount:Show()
|
||||||
else
|
else
|
||||||
AuxManageFrameListingDialogContentItemCount:Hide()
|
AuxBidsFrameListingDialogContentItemCount:Hide()
|
||||||
end
|
end
|
||||||
|
|
||||||
if action == 'buyout' then
|
if action == 'buyout' then
|
||||||
AuxManageFrameListingDialogContentActionButton:SetText('Buy')
|
AuxBidsFrameListingDialogContentActionButton:SetText('Buy')
|
||||||
AuxManageFrameListingDialogContentCancelButton:SetText('Cancel')
|
AuxBidsFrameListingDialogContentCancelButton:SetText('Cancel')
|
||||||
MoneyFrame_Update('AuxManageFrameListingDialogContentBuyoutPrice', amount)
|
MoneyFrame_Update('AuxBidsFrameListingDialogContentBuyoutPrice', amount)
|
||||||
AuxManageFrameListingDialogContentBid:Hide()
|
AuxBidsFrameListingDialogContentBid:Hide()
|
||||||
AuxManageFrameListingDialogContentCancelLabel:Hide()
|
AuxBidsFrameListingDialogContentBuyoutPrice:Show()
|
||||||
AuxManageFrameListingDialogContentBuyoutPrice:Show()
|
|
||||||
elseif action == 'bid' then
|
elseif action == 'bid' then
|
||||||
AuxManageFrameListingDialogContentActionButton:SetText('Bid')
|
AuxBidsFrameListingDialogContentActionButton:SetText('Bid')
|
||||||
AuxManageFrameListingDialogContentCancelButton:SetText('Cancel')
|
AuxBidsFrameListingDialogContentCancelButton:SetText('Cancel')
|
||||||
MoneyInputFrame_SetCopper(AuxManageFrameListingDialogContentBid, amount)
|
MoneyInputFrame_SetCopper(AuxBidsFrameListingDialogContentBid, amount)
|
||||||
AuxManageFrameListingDialogContentBuyoutPrice:Hide()
|
AuxBidsFrameListingDialogContentBuyoutPrice:Hide()
|
||||||
AuxManageFrameListingDialogContentCancelLabel:Hide()
|
AuxBidsFrameListingDialogContentBid:Show()
|
||||||
AuxManageFrameListingDialogContentBid:Show()
|
|
||||||
elseif action == 'cancel' then
|
|
||||||
AuxManageFrameListingDialogContentBid:Hide()
|
|
||||||
AuxManageFrameListingDialogContentBuyoutPrice:Hide()
|
|
||||||
AuxManageFrameListingDialogContentCancelLabel:Show()
|
|
||||||
AuxManageFrameListingDialogContentActionButton:SetText('Yes')
|
|
||||||
AuxManageFrameListingDialogContentCancelButton:SetText('No')
|
|
||||||
end
|
end
|
||||||
AuxManageFrameListingDialog:Show()
|
AuxBidsFrameListingDialog:Show()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
|
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
|
||||||
|
|
||||||
<Script file="manage_frame.lua"/>
|
<Script file="bids_frame.lua"/>
|
||||||
|
|
||||||
<Frame name="AuxManageFrame" hidden="true" parent="AuxFrame" setAllPoints="true">
|
<Frame name="AuxBidsFrame" hidden="true" parent="AuxFrame" setAllPoints="true">
|
||||||
<Frames>
|
<Frames>
|
||||||
<Frame name="$parentListing" inherits="AuxFrameBoxTemplate">
|
<Frame name="$parentListing" inherits="AuxFrameBoxTemplate">
|
||||||
<Size>
|
<Size>
|
||||||
@@ -16,44 +16,6 @@
|
|||||||
</OnLoad>
|
</OnLoad>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
<Frames>
|
<Frames>
|
||||||
<Button name="$parentTab1" inherits="AuxTopTabTemplate" id="1">
|
|
||||||
<Anchors>
|
|
||||||
<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT">
|
|
||||||
<Offset>
|
|
||||||
<AbsDimension x="7" y="-2"/>
|
|
||||||
</Offset>
|
|
||||||
</Anchor>
|
|
||||||
</Anchors>
|
|
||||||
<Scripts>
|
|
||||||
<OnLoad>
|
|
||||||
getglobal(this:GetName().."Text"):SetText('Bids')
|
|
||||||
</OnLoad>
|
|
||||||
<OnClick>
|
|
||||||
Aux.manage_frame.listing = this:GetID()
|
|
||||||
Aux.manage_frame.update_bid_records()
|
|
||||||
Aux.manage_frame.update_listing()
|
|
||||||
</OnClick>
|
|
||||||
</Scripts>
|
|
||||||
</Button>
|
|
||||||
<Button name="$parentTab2" inherits="AuxTopTabTemplate" id="2">
|
|
||||||
<Anchors>
|
|
||||||
<Anchor point="LEFT" relativeTo="$parentTab1" relativePoint="RIGHT">
|
|
||||||
<Offset>
|
|
||||||
<AbsDimension x="0" y="0"/>
|
|
||||||
</Offset>
|
|
||||||
</Anchor>
|
|
||||||
</Anchors>
|
|
||||||
<Scripts>
|
|
||||||
<OnLoad>
|
|
||||||
getglobal(this:GetName().."Text"):SetText('Auctions')
|
|
||||||
</OnLoad>
|
|
||||||
<OnClick>
|
|
||||||
Aux.manage_frame.listing = this:GetID()
|
|
||||||
Aux.manage_frame.update_auction_records()
|
|
||||||
Aux.manage_frame.update_listing()
|
|
||||||
</OnClick>
|
|
||||||
</Scripts>
|
|
||||||
</Button>
|
|
||||||
<Frame name="$parentBidListing">
|
<Frame name="$parentBidListing">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||||
@@ -61,25 +23,20 @@
|
|||||||
</Anchors>
|
</Anchors>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
local config = Aux.manage_frame.bid_listing_config
|
local config = Aux.bids_frame.bid_listing_config
|
||||||
local sort_order = Aux.util.map(config.sort_order, function(column_order) return { column = config.columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
this.sheet = Aux.sheet.create{
|
||||||
this.sheet = Aux.sheet.create(this, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave, config.on_row_update)
|
frame = this,
|
||||||
|
columns = config.columns,
|
||||||
|
sort_order = config.sort_order,
|
||||||
|
row_setter = config.row_setter,
|
||||||
|
on_row_click = config.on_row_click,
|
||||||
|
on_row_enter = config.on_row_enter,
|
||||||
|
on_row_leave = config.on_row_leave,
|
||||||
|
on_row_update = config.on_row_update,
|
||||||
|
}
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</Frame>
|
</Frame>
|
||||||
<Frame name="$parentAuctionListing">
|
|
||||||
<Anchors>
|
|
||||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
|
||||||
<Anchor point="BOTTOM"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
|
||||||
</Anchors>
|
|
||||||
<Scripts>
|
|
||||||
<OnLoad>
|
|
||||||
local config = Aux.manage_frame.auction_listing_config
|
|
||||||
local sort_order = Aux.util.map(config.sort_order, function(column_order) return { column = config.columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
|
||||||
this.sheet = Aux.sheet.create(this, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave, config.on_row_update)
|
|
||||||
</OnLoad>
|
|
||||||
</Scripts>
|
|
||||||
</Frame>
|
|
||||||
<Frame name="$parentDialog" frameStrata="FULLSCREEN_DIALOG" inherits="OptionFrameBoxTemplate" enableMouse="true" enableMouseWheel="true" hidden="true">
|
<Frame name="$parentDialog" frameStrata="FULLSCREEN_DIALOG" inherits="OptionFrameBoxTemplate" enableMouse="true" enableMouseWheel="true" hidden="true">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||||
@@ -92,13 +49,6 @@
|
|||||||
<Frame name="$parentContent">
|
<Frame name="$parentContent">
|
||||||
<Anchors><Anchor point="CENTER"><Offset><AbsDimension x="0" y="5"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="CENTER"><Offset><AbsDimension x="0" y="5"/></Offset></Anchor></Anchors>
|
||||||
<Size><AbsDimension x="193" y="120"/></Size>
|
<Size><AbsDimension x="193" y="120"/></Size>
|
||||||
<Layers>
|
|
||||||
<Layer level="OVERLAY">
|
|
||||||
<FontString name="$parentCancelLabel" inherits="GameFontNormal" text="Cancel this auction?" justifyH="RIGHT">
|
|
||||||
<Anchors><Anchor point="BOTTOM"><Offset><AbsDimension x="0" y="45"/></Offset></Anchor></Anchors>
|
|
||||||
</FontString>
|
|
||||||
</Layer>
|
|
||||||
</Layers>
|
|
||||||
<Frames>
|
<Frames>
|
||||||
<Frame name="$parentItem" inherits="AuxItemTemplate">
|
<Frame name="$parentItem" inherits="AuxItemTemplate">
|
||||||
<Anchors><Anchor point="TOP"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="TOP"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||||
@@ -134,7 +84,7 @@
|
|||||||
<Anchors><Anchor point="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="BOTTOMLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
Aux.manage_frame.dialog_action()
|
Aux.bids_frame.dialog_action()
|
||||||
</OnClick>
|
</OnClick>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</Button>
|
</Button>
|
||||||
@@ -143,7 +93,7 @@
|
|||||||
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
Aux.manage_frame.dialog_cancel()
|
Aux.bids_frame.dialog_cancel()
|
||||||
</OnClick>
|
</OnClick>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</Button>
|
</Button>
|
||||||
@@ -153,22 +103,6 @@
|
|||||||
</Frame>
|
</Frame>
|
||||||
</Frames>
|
</Frames>
|
||||||
</Frame>
|
</Frame>
|
||||||
<Frame name="AuxManageAuctions" inherits="AuxFrameBoxTemplate">
|
|
||||||
<Size>
|
|
||||||
<AbsDimension x="400" y="326"/>
|
|
||||||
</Size>
|
|
||||||
<Anchors><Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="AuxManageBids"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
|
||||||
<Scripts>
|
|
||||||
<OnLoad>
|
|
||||||
this:SetBackdropBorderColor(0.4, 0.4, 0.4)
|
|
||||||
this:SetBackdropColor(0.15, 0.15, 0.15)
|
|
||||||
getglobal(this:GetName().."Title"):SetText('Auctions')
|
|
||||||
</OnLoad>
|
|
||||||
</Scripts>
|
|
||||||
<Frames>
|
|
||||||
|
|
||||||
</Frames>
|
|
||||||
</Frame>
|
|
||||||
</Frames>
|
</Frames>
|
||||||
</Frame>
|
</Frame>
|
||||||
</Ui>
|
</Ui>
|
||||||
+14
-3
@@ -1,4 +1,5 @@
|
|||||||
Aux.completion = {}
|
local private, public = {}, {}
|
||||||
|
Aux.completion = public
|
||||||
|
|
||||||
local NUM_MATCHES = 5
|
local NUM_MATCHES = 5
|
||||||
|
|
||||||
@@ -50,7 +51,7 @@ function generate_suggestions(input)
|
|||||||
return Aux.util.map(best, function(match) return { text=match.name, display_text='|c'..Aux_QualityColor(({GetItemInfo(match.id)})[3])..'['..match.name..']'..'|r', value=match.id } end)
|
return Aux.util.map(best, function(match) return { text=match.name, display_text='|c'..Aux_QualityColor(({GetItemInfo(match.id)})[3])..'['..match.name..']'..'|r', value=match.id } end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux.completion.completor(edit_box)
|
function public.completor(edit_box)
|
||||||
local self = {}
|
local self = {}
|
||||||
|
|
||||||
local suggestions = {}
|
local suggestions = {}
|
||||||
@@ -161,7 +162,7 @@ function Aux.completion.completor(edit_box)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux.completion.selector(edit_box)
|
function public.selector(edit_box)
|
||||||
local self = {}
|
local self = {}
|
||||||
|
|
||||||
local suggestions = {}
|
local suggestions = {}
|
||||||
@@ -194,6 +195,10 @@ function Aux.completion.selector(edit_box)
|
|||||||
toggle()
|
toggle()
|
||||||
end
|
end
|
||||||
toggle()
|
toggle()
|
||||||
|
DropDownList1.aux = true
|
||||||
|
DropDownList1:SetScript('OnHide', function()
|
||||||
|
DropDownList1.aux = false
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function update_highlighting()
|
function update_highlighting()
|
||||||
@@ -261,3 +266,9 @@ function Aux.completion.selector(edit_box)
|
|||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function public.UIDropDownMenu_StartCounting(frame)
|
||||||
|
if not frame.aux then
|
||||||
|
return Aux.orig.UIDropDownMenu_StartCounting(frame)
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -4,9 +4,5 @@
|
|||||||
|
|
||||||
<Frame name="AuxCompletionDropDown" inherits="UIDropDownMenuTemplate" hidden="true">
|
<Frame name="AuxCompletionDropDown" inherits="UIDropDownMenuTemplate" hidden="true">
|
||||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="555" y="0"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="555" y="0"/></Offset></Anchor></Anchors>
|
||||||
<OnUpdate>
|
|
||||||
this.isCounting = false
|
|
||||||
UIDropDownMenu_OnUpdate(arg1)
|
|
||||||
</OnUpdate>
|
|
||||||
</Frame>
|
</Frame>
|
||||||
</Ui>
|
</Ui>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
AuxVersion = "2.1.0"
|
AuxVersion = '2.1.8'
|
||||||
AuxAuthors = "shirsig; Zerf; Zirco (Auctionator); Nimeral (Auctionator backport)"
|
AuxAuthors = 'shirsig; Zerf; Zirco (Auctionator); Nimeral (Auctionator backport)'
|
||||||
|
|
||||||
local lastRightClickAction = GetTime()
|
local lastRightClickAction = GetTime()
|
||||||
|
|
||||||
@@ -17,8 +17,15 @@ Aux = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
last_picked_up = {},
|
last_picked_up = {},
|
||||||
|
view = {
|
||||||
|
BUYOUT = 1,
|
||||||
|
BID = 2,
|
||||||
|
FULL = 3,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
aux_view = Aux.view.BUYOUT
|
||||||
|
|
||||||
function Aux_OnLoad()
|
function Aux_OnLoad()
|
||||||
Aux.log('Aux v'..AuxVersion..' loaded.')
|
Aux.log('Aux v'..AuxVersion..' loaded.')
|
||||||
Aux.loaded = true
|
Aux.loaded = true
|
||||||
@@ -34,8 +41,12 @@ function Aux_OnEvent()
|
|||||||
Aux_OnAuctionHouseShow()
|
Aux_OnAuctionHouseShow()
|
||||||
elseif event == 'AUCTION_HOUSE_CLOSED' then
|
elseif event == 'AUCTION_HOUSE_CLOSED' then
|
||||||
Aux_OnAuctionHouseClosed()
|
Aux_OnAuctionHouseClosed()
|
||||||
|
Aux.bids_loaded = false
|
||||||
|
Aux.current_owner_page = nil
|
||||||
|
elseif event == 'AUCTION_BIDDER_LIST_UPDATE' then
|
||||||
|
Aux.bids_loaded = true
|
||||||
elseif event == 'AUCTION_OWNED_LIST_UPDATE' then
|
elseif event == 'AUCTION_OWNED_LIST_UPDATE' then
|
||||||
Aux.current_owner_page = Aux.last_owner_page_requested
|
Aux.current_owner_page = Aux.last_owner_page_requested or 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -124,6 +135,9 @@ function Aux_SetupHookFunctions()
|
|||||||
Aux.orig.AuctionFrameAuctions_OnEvent = AuctionFrameAuctions_OnEvent
|
Aux.orig.AuctionFrameAuctions_OnEvent = AuctionFrameAuctions_OnEvent
|
||||||
AuctionFrameAuctions_OnEvent = Aux.AuctionFrameAuctions_OnEvent
|
AuctionFrameAuctions_OnEvent = Aux.AuctionFrameAuctions_OnEvent
|
||||||
|
|
||||||
|
Aux.orig.UIDropDownMenu_StartCounting = UIDropDownMenu_StartCounting
|
||||||
|
UIDropDownMenu_StartCounting = Aux.completion.UIDropDownMenu_StartCounting
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux.GetOwnerAuctionItems(page)
|
function Aux.GetOwnerAuctionItems(page)
|
||||||
@@ -168,17 +182,19 @@ function Aux.on_tab_click(index)
|
|||||||
Aux.item_search_frame.on_close()
|
Aux.item_search_frame.on_close()
|
||||||
Aux.filter_search_frame.on_close()
|
Aux.filter_search_frame.on_close()
|
||||||
Aux.sell.on_close()
|
Aux.sell.on_close()
|
||||||
Aux.manage_frame.on_close()
|
Aux.auctions_frame.on_close()
|
||||||
|
Aux.bids_frame.on_close()
|
||||||
Aux.history.on_close()
|
Aux.history.on_close()
|
||||||
|
|
||||||
for i=1,4 do
|
for i=1,5 do
|
||||||
getglobal('AuxTab'..i):SetAlpha(i == index and 1 or 0.5)
|
getglobal('AuxTab'..i):SetAlpha(i == index and 1 or 0.5)
|
||||||
end
|
end
|
||||||
|
|
||||||
AuxItemSearchFrame:Hide()
|
AuxItemSearchFrame:Hide()
|
||||||
AuxFilterSearchFrame:Hide()
|
AuxFilterSearchFrame:Hide()
|
||||||
AuxSellFrame:Hide()
|
AuxSellFrame:Hide()
|
||||||
AuxManageFrame:Hide()
|
AuxAuctionsFrame:Hide()
|
||||||
|
AuxBidsFrame:Hide()
|
||||||
AuxHistoryFrame:Hide()
|
AuxHistoryFrame:Hide()
|
||||||
|
|
||||||
if index == 1 then
|
if index == 1 then
|
||||||
@@ -191,9 +207,14 @@ function Aux.on_tab_click(index)
|
|||||||
AuxSellFrame:Show()
|
AuxSellFrame:Show()
|
||||||
Aux.sell.on_open()
|
Aux.sell.on_open()
|
||||||
elseif index == 4 then
|
elseif index == 4 then
|
||||||
AuxManageFrame:Show()
|
AuxAuctionsFrame:Show()
|
||||||
Aux.manage_frame.on_open()
|
Aux.auctions_frame.on_open()
|
||||||
|
elseif index == 5 then
|
||||||
|
AuxBidsFrame:Show()
|
||||||
|
Aux.bids_frame.on_open()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Aux.active_panel = index
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -231,12 +252,16 @@ function Aux_ContainerFrameItemButton_OnClick(button)
|
|||||||
|
|
||||||
if AuxFrame:IsVisible() and button == "LeftButton" and container_item_info then
|
if AuxFrame:IsVisible() and button == "LeftButton" and container_item_info then
|
||||||
if IsAltKeyDown() then
|
if IsAltKeyDown() then
|
||||||
if not AuxItemSearchFrame:IsVisible() then
|
if Aux.active_panel ~= 1 then
|
||||||
Aux.on_tab_click(1)
|
Aux.on_tab_click(1)
|
||||||
end
|
end
|
||||||
AuxItemSearchFrameItemItemInputBox:Hide()
|
|
||||||
Aux.item_search_frame.set_item(container_item_info.item_id)
|
Aux.control.as_soon_as(function() return Aux.active_panel == 1 end, function()
|
||||||
return
|
AuxItemSearchFrameItemItemInputBox:Hide()
|
||||||
|
Aux.item_search_frame.set_item(container_item_info.item_id)
|
||||||
|
end)
|
||||||
|
|
||||||
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -256,7 +281,9 @@ function Aux_QualityColor(code)
|
|||||||
return "ffa335ee" -- epic, purple
|
return "ffa335ee" -- epic, purple
|
||||||
elseif code == 5 then
|
elseif code == 5 then
|
||||||
return "ffff8000" -- legendary, orange
|
return "ffff8000" -- legendary, orange
|
||||||
end
|
elseif code == 6 then
|
||||||
|
return "ffe6cc80" -- artifact, pale gold
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux.auction_signature(hyperlink, stack_size, bid, amount)
|
function Aux.auction_signature(hyperlink, stack_size, bid, amount)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
this:RegisterEvent('ADDON_LOADED')
|
this:RegisterEvent('ADDON_LOADED')
|
||||||
this:RegisterEvent('AUCTION_HOUSE_SHOW')
|
this:RegisterEvent('AUCTION_HOUSE_SHOW')
|
||||||
this:RegisterEvent('AUCTION_HOUSE_CLOSED')
|
this:RegisterEvent('AUCTION_HOUSE_CLOSED')
|
||||||
|
this:RegisterEvent('AUCTION_BIDDER_LIST_UPDATE')
|
||||||
this:RegisterEvent('AUCTION_OWNED_LIST_UPDATE')
|
this:RegisterEvent('AUCTION_OWNED_LIST_UPDATE')
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
<OnEvent>
|
<OnEvent>
|
||||||
@@ -340,7 +341,11 @@
|
|||||||
<AbsDimension x="850" y="445"/>
|
<AbsDimension x="850" y="445"/>
|
||||||
</Size>
|
</Size>
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="CENTER"/>
|
<Anchor point="LEFT">
|
||||||
|
<Offset>
|
||||||
|
<AbsDimension x="100" y="0"/>
|
||||||
|
</Offset>
|
||||||
|
</Anchor>
|
||||||
</Anchors>
|
</Anchors>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
@@ -462,7 +467,24 @@
|
|||||||
</Anchors>
|
</Anchors>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
getglobal(this:GetName().."Text"):SetText('Manage')
|
getglobal(this:GetName().."Text"):SetText('Auctions')
|
||||||
|
</OnLoad>
|
||||||
|
<OnClick>
|
||||||
|
Aux.on_tab_click(this:GetID())
|
||||||
|
</OnClick>
|
||||||
|
</Scripts>
|
||||||
|
</Button>
|
||||||
|
<Button name="AuxTab5" inherits="AuxBottomTabTemplate" id="5">
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="LEFT" relativeTo="AuxTab4" relativePoint="RIGHT">
|
||||||
|
<Offset>
|
||||||
|
<AbsDimension x="0" y="0"/>
|
||||||
|
</Offset>
|
||||||
|
</Anchor>
|
||||||
|
</Anchors>
|
||||||
|
<Scripts>
|
||||||
|
<OnLoad>
|
||||||
|
getglobal(this:GetName().."Text"):SetText('Bids')
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
Aux.on_tab_click(this:GetID())
|
Aux.on_tab_click(this:GetID())
|
||||||
|
|||||||
+103
-95
@@ -18,10 +18,8 @@ function group_alpha_setter(cell, group)
|
|||||||
cell:SetAlpha(Aux.util.all(group, function(auction) return auction.gone end) and 0.3 or 1)
|
cell:SetAlpha(Aux.util.all(group, function(auction) return auction.gone end) and 0.3 or 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
local BUYOUT, BID, FULL = 1, 2, 3
|
|
||||||
|
|
||||||
public.views = {
|
public.views = {
|
||||||
[BUYOUT] = {
|
[Aux.view.BUYOUT] = {
|
||||||
name = 'Buyout',
|
name = 'Buyout',
|
||||||
on_row_click = function (sheet, row_index)
|
on_row_click = function (sheet, row_index)
|
||||||
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||||
@@ -135,7 +133,7 @@ public.views = {
|
|||||||
},
|
},
|
||||||
sort_order = {{column = 1, order = 'ascending' }, {column = 4, order = 'ascending'}},
|
sort_order = {{column = 1, order = 'ascending' }, {column = 4, order = 'ascending'}},
|
||||||
},
|
},
|
||||||
[BID] = {
|
[Aux.view.BID] = {
|
||||||
name = 'Bid',
|
name = 'Bid',
|
||||||
on_row_click = function (sheet, row_index)
|
on_row_click = function (sheet, row_index)
|
||||||
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||||
@@ -279,7 +277,7 @@ public.views = {
|
|||||||
},
|
},
|
||||||
sort_order = {{column = 1, order = 'ascending' }, {column = 4, order = 'ascending' }, {column = 6, order = 'ascending'}},
|
sort_order = {{column = 1, order = 'ascending' }, {column = 4, order = 'ascending' }, {column = 6, order = 'ascending'}},
|
||||||
},
|
},
|
||||||
[FULL] = {
|
[Aux.view.FULL] = {
|
||||||
name = 'Full',
|
name = 'Full',
|
||||||
on_row_click = function (sheet, row_index)
|
on_row_click = function (sheet, row_index)
|
||||||
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||||
@@ -464,13 +462,13 @@ public.views = {
|
|||||||
|
|
||||||
function public.on_close()
|
function public.on_close()
|
||||||
if AuxFilterSearchFrameResultsConfirmation:IsVisible() then
|
if AuxFilterSearchFrameResultsConfirmation:IsVisible() then
|
||||||
Aux.buy.dialog_cancel()
|
public.dialog_cancel()
|
||||||
end
|
end
|
||||||
current_page = nil
|
current_page = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function public.on_open()
|
function public.on_open()
|
||||||
public.set_view(1)
|
public.set_view(aux_view)
|
||||||
update_sheet()
|
update_sheet()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -487,25 +485,30 @@ function public.stop_search()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function update_sheet()
|
function update_sheet()
|
||||||
|
|
||||||
|
if not AuxFilterSearchFrame:IsVisible() then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
AuxFilterSearchFrameResultsBuyListing:Hide()
|
AuxFilterSearchFrameResultsBuyListing:Hide()
|
||||||
AuxFilterSearchFrameResultsBidListing:Hide()
|
AuxFilterSearchFrameResultsBidListing:Hide()
|
||||||
AuxFilterSearchFrameResultsFullListing:Hide()
|
AuxFilterSearchFrameResultsFullListing:Hide()
|
||||||
|
|
||||||
if private.view == BUYOUT then
|
if aux_view == Aux.view.BUYOUT then
|
||||||
AuxFilterSearchFrameResultsBuyListing:Show()
|
AuxFilterSearchFrameResultsBuyListing:Show()
|
||||||
local buyout_auctions = auctions and Aux.util.filter(auctions, function(auction) return auction.owner ~= UnitName('player') and auction.buyout_price end) or {}
|
local buyout_auctions = auctions and Aux.util.filter(auctions, function(auction) return auction.owner ~= UnitName('player') and auction.buyout_price end) or {}
|
||||||
Aux.list.populate(AuxFilterSearchFrameResultsBuyListing.sheet, auctions and Aux.util.group_by(buyout_auctions, function(a1, a2) return a1.item_id == a2.item_id and a1.suffix_id == a2.suffix_id and a1.enchant_id == a2.enchant_id and a1.aux_quantity == a2.aux_quantity and a1.buyout_price == a2.buyout_price end) or {})
|
Aux.sheet.populate(AuxFilterSearchFrameResultsBuyListing.sheet, auctions and Aux.util.group_by(buyout_auctions, function(a1, a2) return a1.item_id == a2.item_id and a1.suffix_id == a2.suffix_id and a1.enchant_id == a2.enchant_id and a1.aux_quantity == a2.aux_quantity and a1.buyout_price == a2.buyout_price end) or {})
|
||||||
AuxFilterSearchFrameResults:SetWidth(AuxFilterSearchFrameResultsBuyListing:GetWidth() + 40)
|
AuxFilterSearchFrameResults:SetWidth(AuxFilterSearchFrameResultsBuyListing:GetWidth() + 40)
|
||||||
AuxFrame:SetWidth(AuxFilterSearchFrameFilters:GetWidth() + AuxFilterSearchFrameResults:GetWidth() + 15)
|
AuxFrame:SetWidth(AuxFilterSearchFrameFilters:GetWidth() + AuxFilterSearchFrameResults:GetWidth() + 15)
|
||||||
elseif private.view == BID then
|
elseif aux_view == Aux.view.BID then
|
||||||
AuxFilterSearchFrameResultsBidListing:Show()
|
AuxFilterSearchFrameResultsBidListing:Show()
|
||||||
local bid_auctions = auctions and Aux.util.filter(auctions, function(auction) return auction.owner ~= UnitName('player') end) or {}
|
local bid_auctions = auctions and Aux.util.filter(auctions, function(auction) return auction.owner ~= UnitName('player') end) or {}
|
||||||
Aux.list.populate(AuxFilterSearchFrameResultsBidListing.sheet, bid_auctions)
|
Aux.sheet.populate(AuxFilterSearchFrameResultsBidListing.sheet, bid_auctions)
|
||||||
AuxFilterSearchFrameResults:SetWidth(AuxFilterSearchFrameResultsBidListing:GetWidth() + 40)
|
AuxFilterSearchFrameResults:SetWidth(AuxFilterSearchFrameResultsBidListing:GetWidth() + 40)
|
||||||
AuxFrame:SetWidth(AuxFilterSearchFrameFilters:GetWidth() + AuxFilterSearchFrameResults:GetWidth() + 15)
|
AuxFrame:SetWidth(AuxFilterSearchFrameFilters:GetWidth() + AuxFilterSearchFrameResults:GetWidth() + 15)
|
||||||
elseif private.view == FULL then
|
elseif aux_view == Aux.view.FULL then
|
||||||
AuxFilterSearchFrameResultsFullListing:Show()
|
AuxFilterSearchFrameResultsFullListing:Show()
|
||||||
Aux.list.populate(AuxFilterSearchFrameResultsFullListing.sheet, auctions or {})
|
Aux.sheet.populate(AuxFilterSearchFrameResultsFullListing.sheet, auctions or {})
|
||||||
AuxFilterSearchFrameResults:SetWidth(AuxFilterSearchFrameResultsFullListing:GetWidth() + 40)
|
AuxFilterSearchFrameResults:SetWidth(AuxFilterSearchFrameResultsFullListing:GetWidth() + 40)
|
||||||
AuxFrame:SetWidth(AuxFilterSearchFrameFilters:GetWidth() + AuxFilterSearchFrameResults:GetWidth() + 15)
|
AuxFrame:SetWidth(AuxFilterSearchFrameFilters:GetWidth() + AuxFilterSearchFrameResults:GetWidth() + 15)
|
||||||
end
|
end
|
||||||
@@ -521,7 +524,7 @@ function public.set_view(view)
|
|||||||
for i=1,3 do
|
for i=1,3 do
|
||||||
getglobal('AuxFilterSearchFrameResultsTab'..i):SetAlpha(i == view and 1 or 0.5)
|
getglobal('AuxFilterSearchFrameResultsTab'..i):SetAlpha(i == view and 1 or 0.5)
|
||||||
end
|
end
|
||||||
private.view = view
|
aux_view = view
|
||||||
update_sheet()
|
update_sheet()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -531,78 +534,77 @@ end
|
|||||||
|
|
||||||
function public.start_search()
|
function public.start_search()
|
||||||
|
|
||||||
if not AuxFilterSearchFrameFiltersSearchButton:IsVisible() then
|
Aux.scan.abort(function()
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
AuxFilterSearchFrameFiltersSearchButton:Hide()
|
AuxFilterSearchFrameFiltersSearchButton:Hide()
|
||||||
AuxFilterSearchFrameFiltersStopButton:Show()
|
AuxFilterSearchFrameFiltersStopButton:Show()
|
||||||
|
|
||||||
auctions = nil
|
auctions = nil
|
||||||
|
|
||||||
refresh = true
|
refresh = true
|
||||||
|
|
||||||
local category = UIDropDownMenu_GetSelectedValue(AuxFilterSearchFrameFiltersCategoryDropDown)
|
local category = UIDropDownMenu_GetSelectedValue(AuxFilterSearchFrameFiltersCategoryDropDown)
|
||||||
local tooltip_patterns = {}
|
local tooltip_patterns = {}
|
||||||
for i=1,4 do
|
for i=1,4 do
|
||||||
local tooltip_pattern = getglobal('AuxFilterSearchFrameFiltersTooltipInputBox'..i):GetText()
|
local tooltip_pattern = getglobal('AuxFilterSearchFrameFiltersTooltipInputBox'..i):GetText()
|
||||||
if tooltip_pattern ~= '' then
|
if tooltip_pattern ~= '' then
|
||||||
tinsert(tooltip_patterns, tooltip_pattern)
|
tinsert(tooltip_patterns, tooltip_pattern)
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
search_query = {
|
|
||||||
name = AuxFilterSearchFrameFiltersNameInputBox:GetText(),
|
|
||||||
min_level = AuxFilterSearchFrameFiltersMinLevel:GetText(),
|
|
||||||
max_level = AuxFilterSearchFrameFiltersMaxLevel:GetText(),
|
|
||||||
slot = category and category.slot,
|
|
||||||
class = category and category.class,
|
|
||||||
subclass = category and category.subclass,
|
|
||||||
quality = UIDropDownMenu_GetSelectedValue(AuxFilterSearchFrameFiltersQualityDropDown),
|
|
||||||
usable = AuxFilterSearchFrameFiltersUsableCheckButton:GetChecked()
|
|
||||||
}
|
|
||||||
|
|
||||||
Aux.log('Scanning auctions ...')
|
|
||||||
Aux.scan.start{
|
|
||||||
query = search_query,
|
|
||||||
page = AuxFilterSearchFrameFiltersAllPagesCheckButton:GetChecked() and 0 or AuxFilterSearchFrameFiltersPageEditBox:GetNumber(),
|
|
||||||
on_submit_query = function()
|
|
||||||
current_page = nil
|
|
||||||
end,
|
|
||||||
on_page_loaded = function(page, total_pages)
|
|
||||||
Aux.log('Scanning page '..(page+1)..' out of '..total_pages..' ...')
|
|
||||||
current_page = page
|
|
||||||
end,
|
|
||||||
on_read_auction = function(auction_info)
|
|
||||||
if Aux.info.tooltip_match(tooltip_patterns, auction_info.tooltip) then
|
|
||||||
auctions = auctions or {}
|
|
||||||
tinsert(auctions, create_auction_record(auction_info, current_page))
|
|
||||||
end
|
end
|
||||||
end,
|
end
|
||||||
on_complete = function()
|
|
||||||
auctions = auctions or {}
|
|
||||||
Aux.log('Scan complete: '..getn(auctions)..' '..Aux_PluralizeIf('auction', getn(auctions))..' found.')
|
|
||||||
|
|
||||||
AuxFilterSearchFrameFiltersStopButton:Hide()
|
search_query = {
|
||||||
AuxFilterSearchFrameFiltersSearchButton:Show()
|
name = AuxFilterSearchFrameFiltersNameInputBox:GetText(),
|
||||||
refresh = true
|
min_level = AuxFilterSearchFrameFiltersMinLevel:GetText(),
|
||||||
end,
|
max_level = AuxFilterSearchFrameFiltersMaxLevel:GetText(),
|
||||||
on_abort = function()
|
slot = category and category.slot,
|
||||||
auctions = auctions or {}
|
class = category and category.class,
|
||||||
Aux.log('Scan aborted: '..getn(auctions)..' '..Aux_PluralizeIf('auction', getn(auctions))..' found.')
|
subclass = category and category.subclass,
|
||||||
AuxFilterSearchFrameFiltersStopButton:Hide()
|
quality = UIDropDownMenu_GetSelectedValue(AuxFilterSearchFrameFiltersQualityDropDown),
|
||||||
AuxFilterSearchFrameFiltersSearchButton:Show()
|
usable = AuxFilterSearchFrameFiltersUsableCheckButton:GetChecked()
|
||||||
refresh = true
|
}
|
||||||
end,
|
|
||||||
next_page = function(page, total_pages)
|
Aux.log('Scanning auctions ...')
|
||||||
if AuxFilterSearchFrameFiltersAllPagesCheckButton:GetChecked() then
|
Aux.scan.start{
|
||||||
local last_page = max(total_pages - 1, 0)
|
query = search_query,
|
||||||
if page < last_page then
|
page = AuxFilterSearchFrameFiltersAllPagesCheckButton:GetChecked() and 0 or AuxFilterSearchFrameFiltersPageEditBox:GetNumber(),
|
||||||
return page + 1
|
on_submit_query = function()
|
||||||
|
current_page = nil
|
||||||
|
end,
|
||||||
|
on_page_loaded = function(page, total_pages)
|
||||||
|
Aux.log('Scanning page '..(page+1)..' out of '..total_pages..' ...')
|
||||||
|
current_page = page
|
||||||
|
end,
|
||||||
|
on_read_auction = function(auction_info)
|
||||||
|
if Aux.info.tooltip_match(tooltip_patterns, auction_info.tooltip) then
|
||||||
|
auctions = auctions or {}
|
||||||
|
tinsert(auctions, create_auction_record(auction_info, current_page))
|
||||||
end
|
end
|
||||||
end
|
end,
|
||||||
end,
|
on_complete = function()
|
||||||
}
|
auctions = auctions or {}
|
||||||
|
Aux.log('Scan complete: '..getn(auctions)..' '..Aux_PluralizeIf('auction', getn(auctions))..' found.')
|
||||||
|
|
||||||
|
AuxFilterSearchFrameFiltersStopButton:Hide()
|
||||||
|
AuxFilterSearchFrameFiltersSearchButton:Show()
|
||||||
|
refresh = true
|
||||||
|
end,
|
||||||
|
on_abort = function()
|
||||||
|
auctions = auctions or {}
|
||||||
|
Aux.log('Scan aborted: '..getn(auctions)..' '..Aux_PluralizeIf('auction', getn(auctions))..' found.')
|
||||||
|
AuxFilterSearchFrameFiltersStopButton:Hide()
|
||||||
|
AuxFilterSearchFrameFiltersSearchButton:Show()
|
||||||
|
refresh = true
|
||||||
|
end,
|
||||||
|
next_page = function(page, total_pages)
|
||||||
|
if AuxFilterSearchFrameFiltersAllPagesCheckButton:GetChecked() then
|
||||||
|
local last_page = max(total_pages - 1, 0)
|
||||||
|
if page < last_page then
|
||||||
|
return page + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function show_dialog(buyout_mode, entry, amount)
|
function show_dialog(buyout_mode, entry, amount)
|
||||||
@@ -696,18 +698,20 @@ function find_auction(entry, buyout_mode, express_mode)
|
|||||||
Aux.scan.abort()
|
Aux.scan.abort()
|
||||||
else
|
else
|
||||||
public.dialog_action = function()
|
public.dialog_action = function()
|
||||||
if GetMoney() >= amount then
|
if create_auction_record(Aux.info.auction(auction_info.index)).signature == entry.signature then
|
||||||
PlaceAuctionBid('list', auction_info.index, buyout_mode and amount or MoneyInputFrame_GetCopper(AuxFilterSearchFrameResultsConfirmationContentBid))
|
if GetMoney() >= amount then
|
||||||
Aux.log((buyout_mode and 'Purchased ' or 'Bid on ')..auction_record.hyperlink..' x '..auction_record.aux_quantity..' at '..Aux.util.money_string(buyout_mode and amount or MoneyInputFrame_GetCopper(AuxFilterSearchFrameResultsConfirmationContentBid))..'.')
|
PlaceAuctionBid('list', auction_info.index, buyout_mode and amount or MoneyInputFrame_GetCopper(AuxFilterSearchFrameResultsConfirmationContentBid))
|
||||||
entry.gone = true
|
Aux.log((buyout_mode and 'Purchased ' or 'Bid on ')..auction_record.hyperlink..' x '..auction_record.aux_quantity..' at '..Aux.util.money_string(buyout_mode and amount or MoneyInputFrame_GetCopper(AuxFilterSearchFrameResultsConfirmationContentBid))..'.')
|
||||||
refresh = true
|
entry.gone = true
|
||||||
else
|
refresh = true
|
||||||
Aux.log('Not enough money.')
|
else
|
||||||
end
|
Aux.log('Not enough money.')
|
||||||
Aux.scan.abort()
|
end
|
||||||
AuxFilterSearchFrameFiltersSearchButton:Enable()
|
Aux.scan.abort()
|
||||||
AuxFilterSearchFrameResultsConfirmation:Hide()
|
AuxFilterSearchFrameFiltersSearchButton:Enable()
|
||||||
update_sheet()
|
AuxFilterSearchFrameResultsConfirmation:Hide()
|
||||||
|
update_sheet()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
AuxFilterSearchFrameResultsConfirmationContentActionButton:Enable()
|
AuxFilterSearchFrameResultsConfirmationContentActionButton:Enable()
|
||||||
end
|
end
|
||||||
@@ -718,7 +722,7 @@ function find_auction(entry, buyout_mode, express_mode)
|
|||||||
Aux.log('No matching auction found. Removing entry from the cache.')
|
Aux.log('No matching auction found. Removing entry from the cache.')
|
||||||
entry.gone = true
|
entry.gone = true
|
||||||
refresh = true
|
refresh = true
|
||||||
Aux.buy.dialog_cancel()
|
public.dialog_cancel()
|
||||||
end
|
end
|
||||||
if express_mode then
|
if express_mode then
|
||||||
AuxFilterSearchFrameFiltersSearchButton:Enable()
|
AuxFilterSearchFrameFiltersSearchButton:Enable()
|
||||||
@@ -744,6 +748,10 @@ function private.on_row_click(entry)
|
|||||||
|
|
||||||
if IsControlKeyDown() then
|
if IsControlKeyDown() then
|
||||||
DressUpItemLink(entry.hyperlink)
|
DressUpItemLink(entry.hyperlink)
|
||||||
|
elseif IsShiftKeyDown() then
|
||||||
|
if ChatFrameEditBox:IsVisible() then
|
||||||
|
ChatFrameEditBox:Insert(entry.hyperlink)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
find_auction(entry, buyout_mode, express_mode)
|
find_auction(entry, buyout_mode, express_mode)
|
||||||
end
|
end
|
||||||
|
|||||||
+100
-9
@@ -37,6 +37,13 @@
|
|||||||
<OnEscapePressed>
|
<OnEscapePressed>
|
||||||
this:ClearFocus()
|
this:ClearFocus()
|
||||||
</OnEscapePressed>
|
</OnEscapePressed>
|
||||||
|
<OnTabPressed>
|
||||||
|
if IsShiftKeyDown() then
|
||||||
|
getglobal(this:GetParent():GetName()..'TooltipInputBox4'):SetFocus()
|
||||||
|
else
|
||||||
|
getglobal(this:GetParent():GetName()..'MinLevel'):SetFocus()
|
||||||
|
end
|
||||||
|
</OnTabPressed>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</EditBox>
|
</EditBox>
|
||||||
|
|
||||||
@@ -110,7 +117,15 @@
|
|||||||
</OnLoad>
|
</OnLoad>
|
||||||
<OnEnterPressed>
|
<OnEnterPressed>
|
||||||
this:ClearFocus()
|
this:ClearFocus()
|
||||||
|
Aux.filter_search_frame.start_search()
|
||||||
</OnEnterPressed>
|
</OnEnterPressed>
|
||||||
|
<OnTabPressed>
|
||||||
|
if IsShiftKeyDown() then
|
||||||
|
getglobal(this:GetParent():GetName()..'NameInputBox'):SetFocus()
|
||||||
|
else
|
||||||
|
getglobal(this:GetParent():GetName()..'MaxLevel'):SetFocus()
|
||||||
|
end
|
||||||
|
</OnTabPressed>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</EditBox>
|
</EditBox>
|
||||||
<EditBox name="$parentMaxLevel" letters="2" numeric="true" autoFocus="false" inherits="AuxInputBoxTemplate">
|
<EditBox name="$parentMaxLevel" letters="2" numeric="true" autoFocus="false" inherits="AuxInputBoxTemplate">
|
||||||
@@ -123,7 +138,15 @@
|
|||||||
</OnLoad>
|
</OnLoad>
|
||||||
<OnEnterPressed>
|
<OnEnterPressed>
|
||||||
this:ClearFocus()
|
this:ClearFocus()
|
||||||
|
Aux.filter_search_frame.start_search()
|
||||||
</OnEnterPressed>
|
</OnEnterPressed>
|
||||||
|
<OnTabPressed>
|
||||||
|
if IsShiftKeyDown() then
|
||||||
|
getglobal(this:GetParent():GetName()..'MinLevel'):SetFocus()
|
||||||
|
else
|
||||||
|
getglobal(this:GetParent():GetName()..'TooltipInputBox1'):SetFocus()
|
||||||
|
end
|
||||||
|
</OnTabPressed>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</EditBox>
|
</EditBox>
|
||||||
<CheckButton name="$parentUsableCheckButton" inherits="UICheckButtonTemplate">
|
<CheckButton name="$parentUsableCheckButton" inherits="UICheckButtonTemplate">
|
||||||
@@ -145,6 +168,17 @@
|
|||||||
getglobal(this:GetName()..'Label'):SetText('Tooltip')
|
getglobal(this:GetName()..'Label'):SetText('Tooltip')
|
||||||
this:SetWidth(150)
|
this:SetWidth(150)
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
|
<OnEnterPressed>
|
||||||
|
this:ClearFocus()
|
||||||
|
Aux.filter_search_frame.start_search()
|
||||||
|
</OnEnterPressed>
|
||||||
|
<OnTabPressed>
|
||||||
|
if IsShiftKeyDown() then
|
||||||
|
getglobal(this:GetParent():GetName()..'MaxLevel'):SetFocus()
|
||||||
|
else
|
||||||
|
getglobal(this:GetParent():GetName()..'TooltipInputBox2'):SetFocus()
|
||||||
|
end
|
||||||
|
</OnTabPressed>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</EditBox>
|
</EditBox>
|
||||||
|
|
||||||
@@ -154,6 +188,17 @@
|
|||||||
<OnLoad>
|
<OnLoad>
|
||||||
this:SetWidth(150)
|
this:SetWidth(150)
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
|
<OnEnterPressed>
|
||||||
|
this:ClearFocus()
|
||||||
|
Aux.filter_search_frame.start_search()
|
||||||
|
</OnEnterPressed>
|
||||||
|
<OnTabPressed>
|
||||||
|
if IsShiftKeyDown() then
|
||||||
|
getglobal(this:GetParent():GetName()..'TooltipInputBox1'):SetFocus()
|
||||||
|
else
|
||||||
|
getglobal(this:GetParent():GetName()..'TooltipInputBox3'):SetFocus()
|
||||||
|
end
|
||||||
|
</OnTabPressed>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</EditBox>
|
</EditBox>
|
||||||
|
|
||||||
@@ -163,6 +208,17 @@
|
|||||||
<OnLoad>
|
<OnLoad>
|
||||||
this:SetWidth(150)
|
this:SetWidth(150)
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
|
<OnEnterPressed>
|
||||||
|
this:ClearFocus()
|
||||||
|
Aux.filter_search_frame.start_search()
|
||||||
|
</OnEnterPressed>
|
||||||
|
<OnTabPressed>
|
||||||
|
if IsShiftKeyDown() then
|
||||||
|
getglobal(this:GetParent():GetName()..'TooltipInputBox2'):SetFocus()
|
||||||
|
else
|
||||||
|
getglobal(this:GetParent():GetName()..'TooltipInputBox4'):SetFocus()
|
||||||
|
end
|
||||||
|
</OnTabPressed>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</EditBox>
|
</EditBox>
|
||||||
|
|
||||||
@@ -172,6 +228,17 @@
|
|||||||
<OnLoad>
|
<OnLoad>
|
||||||
this:SetWidth(150)
|
this:SetWidth(150)
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
|
<OnEnterPressed>
|
||||||
|
this:ClearFocus()
|
||||||
|
Aux.filter_search_frame.start_search()
|
||||||
|
</OnEnterPressed>
|
||||||
|
<OnTabPressed>
|
||||||
|
if IsShiftKeyDown() then
|
||||||
|
getglobal(this:GetParent():GetName()..'TooltipInputBox3'):SetFocus()
|
||||||
|
else
|
||||||
|
getglobal(this:GetParent():GetName()..'NameInputBox'):SetFocus()
|
||||||
|
end
|
||||||
|
</OnTabPressed>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</EditBox>
|
</EditBox>
|
||||||
|
|
||||||
@@ -250,7 +317,7 @@
|
|||||||
</Anchors>
|
</Anchors>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
getglobal(this:GetName().."Text"):SetText('Buy')
|
getglobal(this:GetName()..'Text'):SetText('Buy')
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
Aux.filter_search_frame.set_view(this:GetID())
|
Aux.filter_search_frame.set_view(this:GetID())
|
||||||
@@ -267,7 +334,7 @@
|
|||||||
</Anchors>
|
</Anchors>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
getglobal(this:GetName().."Text"):SetText('Bid')
|
getglobal(this:GetName()..'Text'):SetText('Bid')
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
Aux.filter_search_frame.set_view(this:GetID())
|
Aux.filter_search_frame.set_view(this:GetID())
|
||||||
@@ -284,7 +351,7 @@
|
|||||||
</Anchors>
|
</Anchors>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
getglobal(this:GetName().."Text"):SetText('Full')
|
getglobal(this:GetName()..'Text'):SetText('Full')
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
Aux.filter_search_frame.set_view(this:GetID())
|
Aux.filter_search_frame.set_view(this:GetID())
|
||||||
@@ -299,8 +366,16 @@
|
|||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
local config = Aux.filter_search_frame.views[1]
|
local config = Aux.filter_search_frame.views[1]
|
||||||
local sort_order = Aux.util.map(config.sort_order, function(column_order) return { column = config.columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
this.sheet = Aux.sheet.create{
|
||||||
this.sheet = Aux.sheet.create(this, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave, config.on_row_update)
|
frame = this,
|
||||||
|
columns = config.columns,
|
||||||
|
sort_order = config.sort_order,
|
||||||
|
row_setter = config.row_setter,
|
||||||
|
on_row_click = config.on_row_click,
|
||||||
|
on_row_enter = config.on_row_enter,
|
||||||
|
on_row_leave = config.on_row_leave,
|
||||||
|
on_row_update = config.on_row_update,
|
||||||
|
}
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</Frame>
|
</Frame>
|
||||||
@@ -312,8 +387,16 @@
|
|||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
local config = Aux.filter_search_frame.views[2]
|
local config = Aux.filter_search_frame.views[2]
|
||||||
local sort_order = Aux.util.map(config.sort_order, function(column_order) return { column = config.columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
this.sheet = Aux.sheet.create{
|
||||||
this.sheet = Aux.sheet.create(this, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave, config.on_row_update)
|
frame = this,
|
||||||
|
columns = config.columns,
|
||||||
|
sort_order = config.sort_order,
|
||||||
|
row_setter = config.row_setter,
|
||||||
|
on_row_click = config.on_row_click,
|
||||||
|
on_row_enter = config.on_row_enter,
|
||||||
|
on_row_leave = config.on_row_leave,
|
||||||
|
on_row_update = config.on_row_update,
|
||||||
|
}
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</Frame>
|
</Frame>
|
||||||
@@ -325,8 +408,16 @@
|
|||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
local config = Aux.filter_search_frame.views[3]
|
local config = Aux.filter_search_frame.views[3]
|
||||||
local sort_order = Aux.util.map(config.sort_order, function(column_order) return { column = config.columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
this.sheet = Aux.sheet.create{
|
||||||
this.sheet = Aux.sheet.create(this, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave, config.on_row_update)
|
frame = this,
|
||||||
|
columns = config.columns,
|
||||||
|
sort_order = config.sort_order,
|
||||||
|
row_setter = config.row_setter,
|
||||||
|
on_row_click = config.on_row_click,
|
||||||
|
on_row_enter = config.on_row_enter,
|
||||||
|
on_row_leave = config.on_row_leave,
|
||||||
|
on_row_update = config.on_row_update,
|
||||||
|
}
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</Frame>
|
</Frame>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ function public.container_item(bag, slot)
|
|||||||
local item_id, suffix_id, unique_id, enchant_id = private.parse_hyperlink(hyperlink)
|
local item_id, suffix_id, unique_id, enchant_id = private.parse_hyperlink(hyperlink)
|
||||||
local item_info = public.item(item_id, suffix_id, unique_id, enchant_id)
|
local item_info = public.item(item_id, suffix_id, unique_id, enchant_id)
|
||||||
|
|
||||||
local texture, count, locked, quality, readable, lootable = GetContainerItemInfo(bag, slot)
|
local texture, count, locked, quality, readable, lootable = GetContainerItemInfo(bag, slot) -- quality not working?
|
||||||
local tooltip = public.tooltip(function(tt) tt:SetBagItem(bag, slot) end)
|
local tooltip = public.tooltip(function(tt) tt:SetBagItem(bag, slot) end)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -31,7 +31,7 @@ function public.container_item(bag, slot)
|
|||||||
level = item_info.level,
|
level = item_info.level,
|
||||||
type = item_info.type,
|
type = item_info.type,
|
||||||
subtype = item_info.subtype,
|
subtype = item_info.subtype,
|
||||||
quality = quality,
|
quality = item_info.quality,
|
||||||
max_stack = item_info.max_stack,
|
max_stack = item_info.max_stack,
|
||||||
|
|
||||||
count = count,
|
count = count,
|
||||||
|
|||||||
+108
-93
@@ -17,10 +17,9 @@ function group_alpha_setter(cell, group)
|
|||||||
cell:SetAlpha(Aux.util.all(group, function(auction) return auction.gone end) and 0.3 or 1)
|
cell:SetAlpha(Aux.util.all(group, function(auction) return auction.gone end) and 0.3 or 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
local BUYOUT, BID, FULL = 1, 2, 3
|
|
||||||
|
|
||||||
public.recently_searched_config = {
|
public.recently_searched_config = {
|
||||||
on_row_click = function (sheet, row_index)
|
on_row_click = function (sheet, row_index)
|
||||||
|
PlaySound('igMainMenuOptionCheckBoxOn')
|
||||||
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||||
AuxItemSearchFrameItemItemInputBox:Hide()
|
AuxItemSearchFrameItemItemInputBox:Hide()
|
||||||
public.set_item(sheet.data[data_index].item_id)
|
public.set_item(sheet.data[data_index].item_id)
|
||||||
@@ -81,7 +80,7 @@ public.recently_searched_config = {
|
|||||||
sort_order = {},
|
sort_order = {},
|
||||||
}
|
}
|
||||||
public.views = {
|
public.views = {
|
||||||
[BUYOUT] = {
|
[Aux.view.BUYOUT] = {
|
||||||
name = 'Buyout',
|
name = 'Buyout',
|
||||||
on_row_click = function (sheet, row_index)
|
on_row_click = function (sheet, row_index)
|
||||||
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||||
@@ -153,7 +152,7 @@ public.views = {
|
|||||||
},
|
},
|
||||||
sort_order = {{column = 3, order = 'ascending' }},
|
sort_order = {{column = 3, order = 'ascending' }},
|
||||||
},
|
},
|
||||||
[BID] = {
|
[Aux.view.BID] = {
|
||||||
name = 'Bid',
|
name = 'Bid',
|
||||||
on_row_click = function (sheet, row_index)
|
on_row_click = function (sheet, row_index)
|
||||||
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||||
@@ -255,7 +254,7 @@ public.views = {
|
|||||||
},
|
},
|
||||||
sort_order = {{column = 3, order = 'ascending'}, {column = 5, order = 'ascending'}},
|
sort_order = {{column = 3, order = 'ascending'}, {column = 5, order = 'ascending'}},
|
||||||
},
|
},
|
||||||
[FULL] = {
|
[Aux.view.FULL] = {
|
||||||
name = 'Full',
|
name = 'Full',
|
||||||
on_row_click = function (sheet, row_index)
|
on_row_click = function (sheet, row_index)
|
||||||
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||||
@@ -414,7 +413,7 @@ function public.on_close()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function public.on_open()
|
function public.on_open()
|
||||||
public.set_view(1)
|
public.set_view(aux_view)
|
||||||
public.update_item()
|
public.update_item()
|
||||||
private.update_recently_searched()
|
private.update_recently_searched()
|
||||||
update_listing()
|
update_listing()
|
||||||
@@ -436,25 +435,30 @@ function public.stop_search()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function update_listing()
|
function update_listing()
|
||||||
|
|
||||||
|
if not AuxItemSearchFrame:IsVisible() then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
AuxItemSearchFrameAuctionsBuyListing:Hide()
|
AuxItemSearchFrameAuctionsBuyListing:Hide()
|
||||||
AuxItemSearchFrameAuctionsBidListing:Hide()
|
AuxItemSearchFrameAuctionsBidListing:Hide()
|
||||||
AuxItemSearchFrameAuctionsFullListing:Hide()
|
AuxItemSearchFrameAuctionsFullListing:Hide()
|
||||||
|
|
||||||
if private.view == BUYOUT then
|
if aux_view == Aux.view.BUYOUT then
|
||||||
AuxItemSearchFrameAuctionsBuyListing:Show()
|
AuxItemSearchFrameAuctionsBuyListing:Show()
|
||||||
local buy_records = auctions and Aux.util.filter(auctions, function(auction) return auction.owner ~= UnitName('player') and auction.buyout_price end) or {}
|
local buy_records = auctions and Aux.util.filter(auctions, function(auction) return auction.owner ~= UnitName('player') and auction.buyout_price end) or {}
|
||||||
Aux.list.populate(AuxItemSearchFrameAuctionsBuyListing.sheet, auctions and Aux.util.group_by(buy_records, function(a1, a2) return a1.item_id == a2.item_id and a1.suffix_id == a2.suffix_id and a1.enchant_id == a2.enchant_id and a1.aux_quantity == a2.aux_quantity and a1.buyout_price == a2.buyout_price end) or {})
|
Aux.sheet.populate(AuxItemSearchFrameAuctionsBuyListing.sheet, auctions and Aux.util.group_by(buy_records, function(a1, a2) return a1.item_id == a2.item_id and a1.suffix_id == a2.suffix_id and a1.enchant_id == a2.enchant_id and a1.aux_quantity == a2.aux_quantity and a1.buyout_price == a2.buyout_price end) or {})
|
||||||
AuxItemSearchFrameAuctions:SetWidth(AuxItemSearchFrameAuctionsBuyListing:GetWidth() + 40)
|
AuxItemSearchFrameAuctions:SetWidth(AuxItemSearchFrameAuctionsBuyListing:GetWidth() + 40)
|
||||||
AuxFrame:SetWidth(AuxItemSearchFrameItem:GetWidth() + AuxItemSearchFrameAuctions:GetWidth() + 15)
|
AuxFrame:SetWidth(AuxItemSearchFrameItem:GetWidth() + AuxItemSearchFrameAuctions:GetWidth() + 15)
|
||||||
elseif private.view == BID then
|
elseif aux_view == Aux.view.BID then
|
||||||
AuxItemSearchFrameAuctionsBidListing:Show()
|
AuxItemSearchFrameAuctionsBidListing:Show()
|
||||||
local bid_records = auctions and Aux.util.filter(auctions, function(auction) return auction.owner ~= UnitName('player') end) or {}
|
local bid_records = auctions and Aux.util.filter(auctions, function(auction) return auction.owner ~= UnitName('player') end) or {}
|
||||||
Aux.list.populate(AuxItemSearchFrameAuctionsBidListing.sheet, bid_records)
|
Aux.sheet.populate(AuxItemSearchFrameAuctionsBidListing.sheet, bid_records)
|
||||||
AuxItemSearchFrameAuctions:SetWidth(AuxItemSearchFrameAuctionsBidListing:GetWidth() + 40)
|
AuxItemSearchFrameAuctions:SetWidth(AuxItemSearchFrameAuctionsBidListing:GetWidth() + 40)
|
||||||
AuxFrame:SetWidth(AuxItemSearchFrameItem:GetWidth() + AuxItemSearchFrameAuctions:GetWidth() + 15)
|
AuxFrame:SetWidth(AuxItemSearchFrameItem:GetWidth() + AuxItemSearchFrameAuctions:GetWidth() + 15)
|
||||||
elseif private.view == FULL then
|
elseif aux_view == Aux.view.FULL then
|
||||||
AuxItemSearchFrameAuctionsFullListing:Show()
|
AuxItemSearchFrameAuctionsFullListing:Show()
|
||||||
Aux.list.populate(AuxItemSearchFrameAuctionsFullListing.sheet, auctions or {})
|
Aux.sheet.populate(AuxItemSearchFrameAuctionsFullListing.sheet, auctions or {})
|
||||||
AuxItemSearchFrameAuctions:SetWidth(AuxItemSearchFrameAuctionsFullListing:GetWidth() + 40)
|
AuxItemSearchFrameAuctions:SetWidth(AuxItemSearchFrameAuctionsFullListing:GetWidth() + 40)
|
||||||
AuxFrame:SetWidth(AuxItemSearchFrameItem:GetWidth() + AuxItemSearchFrameAuctions:GetWidth() + 15)
|
AuxFrame:SetWidth(AuxItemSearchFrameItem:GetWidth() + AuxItemSearchFrameAuctions:GetWidth() + 15)
|
||||||
end
|
end
|
||||||
@@ -470,12 +474,12 @@ function public.set_view(view)
|
|||||||
for i=1,3 do
|
for i=1,3 do
|
||||||
getglobal('AuxItemSearchFrameAuctionsTab'..i):SetAlpha(i == view and 1 or 0.5)
|
getglobal('AuxItemSearchFrameAuctionsTab'..i):SetAlpha(i == view and 1 or 0.5)
|
||||||
end
|
end
|
||||||
private.view = view
|
aux_view = view
|
||||||
update_listing()
|
update_listing()
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.update_recently_searched()
|
function private.update_recently_searched()
|
||||||
Aux.list.populate(AuxItemSearchFrameRecentlySearchedListing.sheet, aux_recently_searched)
|
Aux.sheet.populate(AuxItemSearchFrameRecentlySearchedListing.sheet, aux_recently_searched)
|
||||||
end
|
end
|
||||||
|
|
||||||
function public.set_item(item_id)
|
function public.set_item(item_id)
|
||||||
@@ -483,10 +487,16 @@ function public.set_item(item_id)
|
|||||||
AuxItemSearchFrameItemRefreshButton:Enable()
|
AuxItemSearchFrameItemRefreshButton:Enable()
|
||||||
private.item_id = item_id
|
private.item_id = item_id
|
||||||
public.update_item()
|
public.update_item()
|
||||||
tinsert(aux_recently_searched, 1, { item_id=item_id, time=time() })
|
|
||||||
while getn(aux_recently_searched) > 50 do
|
local updated_recently_searched = Aux.util.filter(aux_recently_searched, function(item_entry)
|
||||||
tremove(aux_recently_searched, getn(aux_recently_searched))
|
return item_entry.item_id ~= item_id
|
||||||
|
end)
|
||||||
|
tinsert(updated_recently_searched, 1, { item_id=item_id, time=time() })
|
||||||
|
while getn(updated_recently_searched) > 50 do
|
||||||
|
tremove(updated_recently_searched, getn(updated_recently_searched))
|
||||||
end
|
end
|
||||||
|
aux_recently_searched = updated_recently_searched
|
||||||
|
|
||||||
private.update_recently_searched()
|
private.update_recently_searched()
|
||||||
public.start_search()
|
public.start_search()
|
||||||
elseif not private.item_id then
|
elseif not private.item_id then
|
||||||
@@ -513,75 +523,74 @@ end
|
|||||||
|
|
||||||
function public.start_search()
|
function public.start_search()
|
||||||
|
|
||||||
if not AuxItemSearchFrameItemRefreshButton:IsVisible() then
|
Aux.scan.abort(function()
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
AuxItemSearchFrameItemRefreshButton:Hide()
|
|
||||||
AuxItemSearchFrameItemStopButton:Show()
|
|
||||||
|
|
||||||
auctions = nil
|
|
||||||
|
|
||||||
refresh = true
|
|
||||||
|
|
||||||
local item_id = private.item_id
|
AuxItemSearchFrameItemRefreshButton:Hide()
|
||||||
local item_info = Aux.info.item(item_id)
|
AuxItemSearchFrameItemStopButton:Show()
|
||||||
|
|
||||||
local class_index = Aux.item_class_index(item_info.class)
|
auctions = nil
|
||||||
local subclass_index = class_index and Aux.item_subclass_index(class_index, item_info.subclass)
|
|
||||||
|
|
||||||
search_query = {
|
refresh = true
|
||||||
name = item_info.name,
|
|
||||||
min_level = item_info.level,
|
|
||||||
min_level = item_info.level,
|
|
||||||
slot = item_info.slot,
|
|
||||||
class = Aux.item_class_index(item_info.class),
|
|
||||||
subclass = item_info.subclass,
|
|
||||||
quality = item_info.quality,
|
|
||||||
usable = item_info.usable,
|
|
||||||
}
|
|
||||||
|
|
||||||
Aux.log('Scanning auctions ...')
|
|
||||||
Aux.scan.start{
|
|
||||||
query = search_query,
|
|
||||||
page = AuxItemSearchFrameItemAllPagesCheckButton:GetChecked() and 0 or AuxItemSearchFrameItemPageEditBox:GetNumber(),
|
|
||||||
on_submit_query = function()
|
|
||||||
current_page = nil
|
|
||||||
end,
|
|
||||||
on_page_loaded = function(page, total_pages)
|
|
||||||
Aux.log('Scanning page '..(page+1)..' out of '..total_pages..' ...')
|
|
||||||
current_page = page
|
|
||||||
end,
|
|
||||||
on_read_auction = function(auction_info)
|
|
||||||
if auction_info.item_id == item_id then
|
|
||||||
auctions = auctions or {}
|
|
||||||
tinsert(auctions, create_auction_record(auction_info, current_page))
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
on_complete = function()
|
|
||||||
auctions = auctions or {}
|
|
||||||
Aux.log('Scan complete: '..getn(auctions)..' '..Aux_PluralizeIf('auction', getn(auctions))..' found.')
|
|
||||||
|
|
||||||
AuxItemSearchFrameItemStopButton:Hide()
|
local item_id = private.item_id
|
||||||
AuxItemSearchFrameItemRefreshButton:Show()
|
local item_info = Aux.info.item(item_id)
|
||||||
refresh = true
|
|
||||||
end,
|
local class_index = Aux.item_class_index(item_info.class)
|
||||||
on_abort = function()
|
local subclass_index = class_index and Aux.item_subclass_index(class_index, item_info.subclass)
|
||||||
auctions = auctions or {}
|
|
||||||
Aux.log('Scan aborted: '..getn(auctions)..' '..Aux_PluralizeIf('auction', getn(auctions))..' found.')
|
search_query = {
|
||||||
AuxItemSearchFrameItemStopButton:Hide()
|
name = item_info.name,
|
||||||
AuxItemSearchFrameItemRefreshButton:Show()
|
min_level = item_info.level,
|
||||||
refresh = true
|
min_level = item_info.level,
|
||||||
end,
|
slot = item_info.slot,
|
||||||
next_page = function(page, total_pages)
|
class = Aux.item_class_index(item_info.class),
|
||||||
if AuxItemSearchFrameItemAllPagesCheckButton:GetChecked() then
|
subclass = item_info.subclass,
|
||||||
local last_page = max(total_pages - 1, 0)
|
quality = item_info.quality,
|
||||||
if page < last_page then
|
usable = item_info.usable,
|
||||||
return page + 1
|
}
|
||||||
|
|
||||||
|
Aux.log('Scanning auctions ...')
|
||||||
|
Aux.scan.start{
|
||||||
|
query = search_query,
|
||||||
|
page = AuxItemSearchFrameItemAllPagesCheckButton:GetChecked() and 0 or AuxItemSearchFrameItemPageEditBox:GetNumber(),
|
||||||
|
on_submit_query = function()
|
||||||
|
current_page = nil
|
||||||
|
end,
|
||||||
|
on_page_loaded = function(page, total_pages)
|
||||||
|
Aux.log('Scanning page '..(page+1)..' out of '..total_pages..' ...')
|
||||||
|
current_page = page
|
||||||
|
end,
|
||||||
|
on_read_auction = function(auction_info)
|
||||||
|
if auction_info.item_id == item_id then
|
||||||
|
auctions = auctions or {}
|
||||||
|
tinsert(auctions, create_auction_record(auction_info, current_page))
|
||||||
end
|
end
|
||||||
end
|
end,
|
||||||
end,
|
on_complete = function()
|
||||||
}
|
auctions = auctions or {}
|
||||||
|
Aux.log('Scan complete: '..getn(auctions)..' '..Aux_PluralizeIf('auction', getn(auctions))..' of '..item_info.name..' found.')
|
||||||
|
|
||||||
|
AuxItemSearchFrameItemStopButton:Hide()
|
||||||
|
AuxItemSearchFrameItemRefreshButton:Show()
|
||||||
|
refresh = true
|
||||||
|
end,
|
||||||
|
on_abort = function()
|
||||||
|
auctions = auctions or {}
|
||||||
|
Aux.log('Scan aborted: '..getn(auctions)..' '..Aux_PluralizeIf('auction', getn(auctions))..' of '..item_info.name..' found.')
|
||||||
|
AuxItemSearchFrameItemStopButton:Hide()
|
||||||
|
AuxItemSearchFrameItemRefreshButton:Show()
|
||||||
|
refresh = true
|
||||||
|
end,
|
||||||
|
next_page = function(page, total_pages)
|
||||||
|
if AuxItemSearchFrameItemAllPagesCheckButton:GetChecked() then
|
||||||
|
local last_page = max(total_pages - 1, 0)
|
||||||
|
if page < last_page then
|
||||||
|
return page + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function show_dialog(buyout_mode, entry, amount)
|
function show_dialog(buyout_mode, entry, amount)
|
||||||
@@ -672,18 +681,20 @@ function find_auction(entry, buyout_mode, express_mode)
|
|||||||
Aux.scan.abort()
|
Aux.scan.abort()
|
||||||
else
|
else
|
||||||
public.dialog_action = function()
|
public.dialog_action = function()
|
||||||
if GetMoney() >= amount then
|
if create_auction_record(Aux.info.auction(auction_info.index)).signature == entry.signature then
|
||||||
PlaceAuctionBid('list', auction_info.index, buyout_mode and amount or MoneyInputFrame_GetCopper(AuxItemSearchFrameAuctionsConfirmationContentBid))
|
if GetMoney() >= amount then
|
||||||
Aux.log((buyout_mode and 'Purchased ' or 'Bid on ')..auction_record.hyperlink..' x '..auction_record.aux_quantity..' at '..Aux.util.money_string(buyout_mode and amount or MoneyInputFrame_GetCopper(AuxItemSearchFrameAuctionsConfirmationContentBid))..'.')
|
PlaceAuctionBid('list', auction_info.index, buyout_mode and amount or MoneyInputFrame_GetCopper(AuxItemSearchFrameAuctionsConfirmationContentBid))
|
||||||
entry.gone = true
|
Aux.log((buyout_mode and 'Purchased ' or 'Bid on ')..auction_record.hyperlink..' x '..auction_record.aux_quantity..' at '..Aux.util.money_string(buyout_mode and amount or MoneyInputFrame_GetCopper(AuxItemSearchFrameAuctionsConfirmationContentBid))..'.')
|
||||||
refresh = true
|
entry.gone = true
|
||||||
else
|
refresh = true
|
||||||
Aux.log('Not enough money.')
|
else
|
||||||
end
|
Aux.log('Not enough money.')
|
||||||
Aux.scan.abort()
|
end
|
||||||
AuxItemSearchFrameItemRefreshButton:Enable()
|
Aux.scan.abort()
|
||||||
AuxItemSearchFrameAuctionsConfirmation:Hide()
|
AuxItemSearchFrameItemRefreshButton:Enable()
|
||||||
update_listing()
|
AuxItemSearchFrameAuctionsConfirmation:Hide()
|
||||||
|
update_listing()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
AuxItemSearchFrameAuctionsConfirmationContentActionButton:Enable()
|
AuxItemSearchFrameAuctionsConfirmationContentActionButton:Enable()
|
||||||
end
|
end
|
||||||
@@ -720,6 +731,10 @@ function public.on_row_click(entry)
|
|||||||
|
|
||||||
if IsControlKeyDown() then
|
if IsControlKeyDown() then
|
||||||
DressUpItemLink(entry.hyperlink)
|
DressUpItemLink(entry.hyperlink)
|
||||||
|
elseif IsShiftKeyDown() then
|
||||||
|
if ChatFrameEditBox:IsVisible() then
|
||||||
|
ChatFrameEditBox:Insert(entry.hyperlink)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
find_auction(entry, buyout_mode, express_mode)
|
find_auction(entry, buyout_mode, express_mode)
|
||||||
end
|
end
|
||||||
|
|||||||
+39
-8
@@ -152,8 +152,15 @@
|
|||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
local config = Aux.item_search_frame.recently_searched_config
|
local config = Aux.item_search_frame.recently_searched_config
|
||||||
local sort_order = Aux.util.map(config.sort_order, function(column_order) return { column = config.columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
this.sheet = Aux.sheet.create{
|
||||||
this.sheet = Aux.sheet.create(this, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave)
|
frame = this,
|
||||||
|
columns = config.columns,
|
||||||
|
sort_order = config.sort_order,
|
||||||
|
row_setter = config.row_setter,
|
||||||
|
on_row_click = config.on_row_click,
|
||||||
|
on_row_enter = config.on_row_enter,
|
||||||
|
on_row_leave = config.on_row_leave,
|
||||||
|
}
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</Frame>
|
</Frame>
|
||||||
@@ -231,8 +238,16 @@
|
|||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
local config = Aux.item_search_frame.views[1]
|
local config = Aux.item_search_frame.views[1]
|
||||||
local sort_order = Aux.util.map(config.sort_order, function(column_order) return { column = config.columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
this.sheet = Aux.sheet.create{
|
||||||
this.sheet = Aux.sheet.create(this, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave, config.on_row_update)
|
frame = this,
|
||||||
|
columns = config.columns,
|
||||||
|
sort_order = config.sort_order,
|
||||||
|
row_setter = config.row_setter,
|
||||||
|
on_row_click = config.on_row_click,
|
||||||
|
on_row_enter = config.on_row_enter,
|
||||||
|
on_row_leave = config.on_row_leave,
|
||||||
|
on_row_update = config.on_row_update,
|
||||||
|
}
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</Frame>
|
</Frame>
|
||||||
@@ -244,8 +259,16 @@
|
|||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
local config = Aux.item_search_frame.views[2]
|
local config = Aux.item_search_frame.views[2]
|
||||||
local sort_order = Aux.util.map(config.sort_order, function(column_order) return { column = config.columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
this.sheet = Aux.sheet.create{
|
||||||
this.sheet = Aux.sheet.create(this, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave, config.on_row_update)
|
frame = this,
|
||||||
|
columns = config.columns,
|
||||||
|
sort_order = config.sort_order,
|
||||||
|
row_setter = config.row_setter,
|
||||||
|
on_row_click = config.on_row_click,
|
||||||
|
on_row_enter = config.on_row_enter,
|
||||||
|
on_row_leave = config.on_row_leave,
|
||||||
|
on_row_update = config.on_row_update,
|
||||||
|
}
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</Frame>
|
</Frame>
|
||||||
@@ -257,8 +280,16 @@
|
|||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
local config = Aux.item_search_frame.views[3]
|
local config = Aux.item_search_frame.views[3]
|
||||||
local sort_order = Aux.util.map(config.sort_order, function(column_order) return { column = config.columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
this.sheet = Aux.sheet.create{
|
||||||
this.sheet = Aux.sheet.create(this, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave, config.on_row_update)
|
frame = this,
|
||||||
|
columns = config.columns,
|
||||||
|
sort_order = config.sort_order,
|
||||||
|
row_setter = config.row_setter,
|
||||||
|
on_row_click = config.on_row_click,
|
||||||
|
on_row_enter = config.on_row_enter,
|
||||||
|
on_row_leave = config.on_row_leave,
|
||||||
|
on_row_update = config.on_row_update,
|
||||||
|
}
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</Frame>
|
</Frame>
|
||||||
|
|||||||
+36
-24
@@ -9,7 +9,7 @@ local bestPriceOurStackSize
|
|||||||
|
|
||||||
local current_auction
|
local current_auction
|
||||||
|
|
||||||
local set_auction, update_auction_listing, update_inventory_listing, record_auction, undercut, item_class_index, item_subclass_index, report, select_entry, update_recommendation, refresh_entries, auction_candidates, charge_classes, get_stack_size_slider_value
|
local set_auction, update_auction_listing, record_auction, undercut, item_class_index, item_subclass_index, report, select_entry, update_recommendation, refresh_entries, auction_candidates, charge_classes, get_stack_size_slider_value
|
||||||
|
|
||||||
local LIVE, HISTORICAL, FIXED = 1, 2, 3
|
local LIVE, HISTORICAL, FIXED = 1, 2, 3
|
||||||
|
|
||||||
@@ -21,6 +21,7 @@ Aux.sell.inventory_listing_config = {
|
|||||||
|
|
||||||
on_row_enter = function (sheet, row_index)
|
on_row_enter = function (sheet, row_index)
|
||||||
sheet.rows[row_index].highlight:SetAlpha(.5)
|
sheet.rows[row_index].highlight:SetAlpha(.5)
|
||||||
|
Aux.info.set_tooltip(sheet.rows[row_index].itemstring, nil, this, 'ANCHOR_CURSOR', 0, 30)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_row_leave = function (sheet, row_index)
|
on_row_leave = function (sheet, row_index)
|
||||||
@@ -28,6 +29,7 @@ Aux.sell.inventory_listing_config = {
|
|||||||
if not (current_auction and sheet.data[data_index] == current_auction) then
|
if not (current_auction and sheet.data[data_index] == current_auction) then
|
||||||
sheet.rows[row_index].highlight:SetAlpha(0)
|
sheet.rows[row_index].highlight:SetAlpha(0)
|
||||||
end
|
end
|
||||||
|
AuxTooltip:Hide()
|
||||||
end,
|
end,
|
||||||
|
|
||||||
row_setter = function(row, datum)
|
row_setter = function(row, datum)
|
||||||
@@ -36,6 +38,7 @@ Aux.sell.inventory_listing_config = {
|
|||||||
else
|
else
|
||||||
row.highlight:SetAlpha(0)
|
row.highlight:SetAlpha(0)
|
||||||
end
|
end
|
||||||
|
row.itemstring = Aux.info.itemstring(datum.item_id, datum.suffix_id)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
columns = {
|
columns = {
|
||||||
@@ -68,7 +71,7 @@ Aux.sell.inventory_listing_config = {
|
|||||||
icon:SetWidth(12)
|
icon:SetWidth(12)
|
||||||
icon:SetHeight(12)
|
icon:SetHeight(12)
|
||||||
local text = cell:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
|
local text = cell:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
|
||||||
text:SetPoint("LEFT", icon, "RIGHT", 1, 0)
|
text:SetPoint('LEFT', icon, 'RIGHT', 1, 0)
|
||||||
text:SetPoint('TOPRIGHT', cell)
|
text:SetPoint('TOPRIGHT', cell)
|
||||||
text:SetPoint('BOTTOMRIGHT', cell)
|
text:SetPoint('BOTTOMRIGHT', cell)
|
||||||
text:SetJustifyV('TOP')
|
text:SetJustifyV('TOP')
|
||||||
@@ -89,16 +92,16 @@ Aux.sell.inventory_listing_config = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Aux.sell.auction_listing_config = {
|
Aux.sell.auction_listing_config = {
|
||||||
on_cell_click = function (sheet, row_index, column_index)
|
on_row_click = function (sheet, row_index, column_index)
|
||||||
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||||
AuxSellEntry_OnClick(sheet.data[data_index])
|
AuxSellEntry_OnClick(sheet.data[data_index])
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_cell_enter = function (sheet, row_index, column_index)
|
on_row_enter = function (sheet, row_index, column_index)
|
||||||
sheet.rows[row_index].highlight:SetAlpha(.5)
|
sheet.rows[row_index].highlight:SetAlpha(.5)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_cell_leave = function (sheet, row_index, column_index)
|
on_row_leave = function (sheet, row_index, column_index)
|
||||||
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||||
local datum = sheet.data[data_index]
|
local datum = sheet.data[data_index]
|
||||||
if not (datum and current_auction and Aux.util.safe_index{existing_auctions, current_auction.key, 'selected', 'key'} == datum.key) then
|
if not (datum and current_auction and Aux.util.safe_index{existing_auctions, current_auction.key, 'selected', 'key'} == datum.key) then
|
||||||
@@ -171,15 +174,15 @@ Aux.sell.auction_listing_config = {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
sort_order = {{column = 4, order = 'ascending' }, {column = 4, order = 'ascending'}},
|
sort_order = {{column = 5, order = 'ascending' }},
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_inventory_listing()
|
function private.parse_inventory()
|
||||||
Aux.list.populate(AuxSellInventoryListing.sheet, inventory_data)
|
Aux.sheet.populate(AuxSellInventoryListing.sheet, Aux.util.filter(inventory_data, function(item) return item.aux_quantity > 0 end))
|
||||||
end
|
end
|
||||||
|
|
||||||
function update_auction_listing()
|
function update_auction_listing()
|
||||||
Aux.list.populate(AuxSellAuctionsListing.sheet, current_auction and existing_auctions[current_auction.key] or {})
|
Aux.sheet.populate(AuxSellAuctionsListing.sheet, current_auction and existing_auctions[current_auction.key] or {})
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux.sell.on_open()
|
function Aux.sell.on_open()
|
||||||
@@ -209,8 +212,10 @@ function Aux.sell.on_open()
|
|||||||
|
|
||||||
update_inventory_data()
|
update_inventory_data()
|
||||||
|
|
||||||
update_inventory_listing()
|
private.parse_inventory()
|
||||||
update_auction_listing()
|
update_auction_listing()
|
||||||
|
|
||||||
|
update_recommendation()
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux.sell.on_close()
|
function Aux.sell.on_close()
|
||||||
@@ -248,8 +253,9 @@ function Aux_Sell_SetAuctionDuration(duration)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Aux.sell.post_auctions()
|
function Aux.sell.post_auctions()
|
||||||
if current_auction then
|
local auction = current_auction
|
||||||
local key, hyperlink, stack_size, buyout_price, stack_count = current_auction.key, current_auction.hyperlink, get_stack_size_slider_value(), MoneyInputFrame_GetCopper(AuxSellParametersBuyoutPrice), AuxSellStackCountSlider:GetValue()
|
if auction then
|
||||||
|
local key, hyperlink, stack_size, buyout_price, stack_count = auction.key, auction.hyperlink, get_stack_size_slider_value(), MoneyInputFrame_GetCopper(AuxSellParametersBuyoutPrice), AuxSellStackCountSlider:GetValue()
|
||||||
local duration
|
local duration
|
||||||
if AuctionFrameAuctions.duration == 120 then
|
if AuctionFrameAuctions.duration == 120 then
|
||||||
duration = 2
|
duration = 2
|
||||||
@@ -268,7 +274,7 @@ function Aux.sell.post_auctions()
|
|||||||
stack_count,
|
stack_count,
|
||||||
function(posted)
|
function(posted)
|
||||||
for i = 1, posted do
|
for i = 1, posted do
|
||||||
record_auction(key, stack_size, buyout_price, duration, UnitName("player"))
|
record_auction(key, stack_size, buyout_price, duration, UnitName('player'))
|
||||||
end
|
end
|
||||||
if existing_auctions[key] then
|
if existing_auctions[key] then
|
||||||
for _, entry in ipairs(existing_auctions[key]) do
|
for _, entry in ipairs(existing_auctions[key]) do
|
||||||
@@ -278,8 +284,11 @@ function Aux.sell.post_auctions()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
Aux.sell.clear_auction()
|
Aux.sell.clear_auction()
|
||||||
update_inventory_data()
|
auction.aux_quantity = auction.aux_quantity - (posted * stack_size)
|
||||||
update_inventory_listing()
|
local charge_class = auction.charges or 0
|
||||||
|
auction.availability[charge_class] = auction.availability[charge_class] - (posted * (auction.charges and 1 or stack_size))
|
||||||
|
|
||||||
|
private.parse_inventory()
|
||||||
report(hyperlink, stack_size, buyout_price, posted)
|
report(hyperlink, stack_size, buyout_price, posted)
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
@@ -379,9 +388,9 @@ function update_recommendation()
|
|||||||
MoneyFrame_Update('AuxSellParametersDepositMoneyFrame', floor(current_auction.unit_vendor_price * 0.05 * (current_auction.charges and 1 or get_stack_size_slider_value())) * AuxSellStackCountSlider:GetValue() * AuctionFrameAuctions.duration / 120)
|
MoneyFrame_Update('AuxSellParametersDepositMoneyFrame', floor(current_auction.unit_vendor_price * 0.05 * (current_auction.charges and 1 or get_stack_size_slider_value())) * AuxSellStackCountSlider:GetValue() * AuctionFrameAuctions.duration / 120)
|
||||||
|
|
||||||
if existing_auctions[current_auction.key] and existing_auctions[current_auction.key].selected then
|
if existing_auctions[current_auction.key] and existing_auctions[current_auction.key].selected then
|
||||||
if not existing_auctions[current_auction.key].created or GetTime() - existing_auctions[current_auction.key].created > 1800 then
|
-- if not existing_auctions[current_auction.key].created or GetTime() - existing_auctions[current_auction.key].created > 1800 then
|
||||||
AuxSellParametersStrategyDropDownStaleWarning:SetText('Stale data!') -- data older than half an hour marked as stale
|
-- AuxSellParametersStrategyDropDownStaleWarning:SetText('Stale data!') -- data older than half an hour marked as stale
|
||||||
end
|
-- end
|
||||||
|
|
||||||
local new_buyout_price = existing_auctions[current_auction.key].selected.unit_buyout_price * get_stack_size_slider_value()
|
local new_buyout_price = existing_auctions[current_auction.key].selected.unit_buyout_price * get_stack_size_slider_value()
|
||||||
|
|
||||||
@@ -397,9 +406,12 @@ function update_recommendation()
|
|||||||
-- local market_price = Aux.history.get_price_suggestion(current_auction.key, current_auction.aux_quantity)
|
-- local market_price = Aux.history.get_price_suggestion(current_auction.key, current_auction.aux_quantity)
|
||||||
-- MoneyInputFrame_SetCopper(AuxSellParametersBuyoutPrice, Aux_Round(market_price * 0.95))
|
-- MoneyInputFrame_SetCopper(AuxSellParametersBuyoutPrice, Aux_Round(market_price * 0.95))
|
||||||
-- MoneyInputFrame_SetCopper(AuxSellParametersStartPrice, market_price)
|
-- MoneyInputFrame_SetCopper(AuxSellParametersStartPrice, market_price)
|
||||||
|
elseif existing_auctions[current_auction.key] then
|
||||||
|
MoneyInputFrame_SetCopper(AuxSellParametersStartPrice, max(1, Aux_Round(current_auction.unit_vendor_price * (current_auction.charges and 1 or get_stack_size_slider_value()) * 1.053)))
|
||||||
|
MoneyInputFrame_SetCopper(AuxSellParametersBuyoutPrice, max(1, Aux_Round(current_auction.unit_vendor_price * (current_auction.charges and 1 or get_stack_size_slider_value()) * 4)))
|
||||||
else
|
else
|
||||||
MoneyInputFrame_SetCopper(AuxSellParametersBuyoutPrice, 0)
|
|
||||||
MoneyInputFrame_SetCopper(AuxSellParametersStartPrice, 0)
|
MoneyInputFrame_SetCopper(AuxSellParametersStartPrice, 0)
|
||||||
|
MoneyInputFrame_SetCopper(AuxSellParametersBuyoutPrice, 0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -421,12 +433,12 @@ end
|
|||||||
|
|
||||||
function set_auction(auction_candidate)
|
function set_auction(auction_candidate)
|
||||||
|
|
||||||
PlaySound("igMainMenuOptionCheckBoxOn")
|
PlaySound('igMainMenuOptionCheckBoxOn')
|
||||||
|
|
||||||
Aux.scan.abort(function()
|
Aux.scan.abort(function()
|
||||||
|
|
||||||
current_auction = auction_candidate
|
current_auction = auction_candidate
|
||||||
update_inventory_listing()
|
private.parse_inventory()
|
||||||
|
|
||||||
local charge_classes = charge_classes(current_auction.availability)
|
local charge_classes = charge_classes(current_auction.availability)
|
||||||
AuxSellStackSizeSlider.charge_classes = current_auction.charges and charge_classes
|
AuxSellStackSizeSlider.charge_classes = current_auction.charges and charge_classes
|
||||||
@@ -460,7 +472,7 @@ end
|
|||||||
|
|
||||||
function update_inventory_data()
|
function update_inventory_data()
|
||||||
inventory_data = {}
|
inventory_data = {}
|
||||||
update_inventory_listing()
|
private.parse_inventory()
|
||||||
|
|
||||||
local auction_candidate_map = {}
|
local auction_candidate_map = {}
|
||||||
|
|
||||||
@@ -536,7 +548,7 @@ function update_inventory_data()
|
|||||||
tinsert(auction_candidates, auction_candidate)
|
tinsert(auction_candidates, auction_candidate)
|
||||||
end
|
end
|
||||||
inventory_data = auction_candidates
|
inventory_data = auction_candidates
|
||||||
update_inventory_listing()
|
private.parse_inventory()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -604,7 +616,7 @@ function AuxSellEntry_OnClick(entry)
|
|||||||
update_auction_listing()
|
update_auction_listing()
|
||||||
update_recommendation()
|
update_recommendation()
|
||||||
|
|
||||||
PlaySound("igMainMenuOptionCheckBoxOn")
|
PlaySound('igMainMenuOptionCheckBoxOn')
|
||||||
end
|
end
|
||||||
|
|
||||||
function AuxSellParametersRefreshButton_OnClick()
|
function AuxSellParametersRefreshButton_OnClick()
|
||||||
|
|||||||
+24
-6
@@ -27,8 +27,15 @@
|
|||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
local config = Aux.sell.inventory_listing_config
|
local config = Aux.sell.inventory_listing_config
|
||||||
local sort_order = Aux.util.map(config.sort_order, function(column_order) return { column = config.columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
this.sheet = Aux.sheet.create{
|
||||||
this.sheet = Aux.sheet.create(this, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave)
|
frame = this,
|
||||||
|
columns = config.columns,
|
||||||
|
sort_order = config.sort_order,
|
||||||
|
row_setter = config.row_setter,
|
||||||
|
on_row_click = config.on_row_click,
|
||||||
|
on_row_enter = config.on_row_enter,
|
||||||
|
on_row_leave = config.on_row_leave,
|
||||||
|
}
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</Frame>
|
</Frame>
|
||||||
@@ -197,7 +204,7 @@
|
|||||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="16" y="-181"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="16" y="-181"/></Offset></Anchor></Anchors>
|
||||||
<layers>
|
<layers>
|
||||||
<Layer level="ARTWORK">
|
<Layer level="ARTWORK">
|
||||||
<FontString name="$parentText" inherits="GameFontNormalSmall" text="STARTING_PRICE">
|
<FontString name="$parentText" inherits="GameFontNormalSmall" text="Starting Stack Price">
|
||||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-3" y="12"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-3" y="12"/></Offset></Anchor></Anchors>
|
||||||
</FontString>
|
</FontString>
|
||||||
</Layer>
|
</Layer>
|
||||||
@@ -212,7 +219,7 @@
|
|||||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="16" y="-216"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="16" y="-216"/></Offset></Anchor></Anchors>
|
||||||
<layers>
|
<layers>
|
||||||
<Layer level="OVERLAY">
|
<Layer level="OVERLAY">
|
||||||
<FontString name="$parentText" inherits="GameFontNormalSmall" text="Buyout Price |cff808080(optional)|r">
|
<FontString name="$parentText" inherits="GameFontNormalSmall" text="Buyout Stack Price |cff808080(optional)|r">
|
||||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-3" y="12"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-3" y="12"/></Offset></Anchor></Anchors>
|
||||||
</FontString>
|
</FontString>
|
||||||
<FontString name="$parentErrorText" inherits="GameFontRedSmall" text="AUCTION_BUYOUT_ERROR">
|
<FontString name="$parentErrorText" inherits="GameFontRedSmall" text="AUCTION_BUYOUT_ERROR">
|
||||||
@@ -222,6 +229,10 @@
|
|||||||
</layers>
|
</layers>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
|
MoneyInputFrame_SetPreviousFocus(getglobal(this:GetParent():GetName()..'StartPrice'), getglobal(this:GetName()..'Copper'))
|
||||||
|
MoneyInputFrame_SetNextFocus(getglobal(this:GetParent():GetName()..'StartPrice'), getglobal(this:GetName()..'Gold'))
|
||||||
|
MoneyInputFrame_SetPreviousFocus(this, getglobal(this:GetParent():GetName()..'StartPriceCopper'))
|
||||||
|
MoneyInputFrame_SetNextFocus(this, getglobal(this:GetParent():GetName()..'StartPriceGold'))
|
||||||
MoneyInputFrame_SetOnvalueChangedFunc(this, Aux.sell.validate_parameters)
|
MoneyInputFrame_SetOnvalueChangedFunc(this, Aux.sell.validate_parameters)
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
@@ -274,8 +285,15 @@
|
|||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
local config = Aux.sell.auction_listing_config
|
local config = Aux.sell.auction_listing_config
|
||||||
local sort_order = Aux.util.map(config.sort_order, function(column_order) return { column = config.columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
|
this.sheet = Aux.sheet.create{
|
||||||
this.sheet = Aux.sheet.create(this, config.columns, sort_order, config.row_setter, config.on_cell_click, config.on_cell_enter, config.on_cell_leave)
|
frame = this,
|
||||||
|
columns = config.columns,
|
||||||
|
sort_order = config.sort_order,
|
||||||
|
row_setter = config.row_setter,
|
||||||
|
on_row_click = config.on_row_click,
|
||||||
|
on_row_enter = config.on_row_enter,
|
||||||
|
on_row_leave = config.on_row_leave,
|
||||||
|
}
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</Frame>
|
</Frame>
|
||||||
|
|||||||
@@ -49,7 +49,9 @@ end
|
|||||||
function wait_for_results(k)
|
function wait_for_results(k)
|
||||||
local ok
|
local ok
|
||||||
if state.job.type == 'bidder' then
|
if state.job.type == 'bidder' then
|
||||||
ok = true
|
Aux.control.as_soon_as(function() return Aux.bids_loaded end, function()
|
||||||
|
ok = true
|
||||||
|
end)
|
||||||
elseif state.job.type == 'owner' then
|
elseif state.job.type == 'owner' then
|
||||||
if state.page == Aux.current_owner_page then
|
if state.page == Aux.current_owner_page then
|
||||||
ok = true
|
ok = true
|
||||||
|
|||||||
+47
-63
@@ -1,8 +1,9 @@
|
|||||||
Aux.sheet = {}
|
local private, public = {}, {}
|
||||||
|
Aux.sheet = public
|
||||||
|
|
||||||
Aux.list = {}
|
Aux.list = {}
|
||||||
|
|
||||||
MoneyTypeInfo["AUX_LIST"] = {
|
MoneyTypeInfo['AUX_LIST'] = {
|
||||||
UpdateFunc = function()
|
UpdateFunc = function()
|
||||||
return this.staticMoney
|
return this.staticMoney
|
||||||
end,
|
end,
|
||||||
@@ -11,13 +12,13 @@ MoneyTypeInfo["AUX_LIST"] = {
|
|||||||
showSmallerCoins = 1,
|
showSmallerCoins = 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
function Aux.sheet.render(sheet)
|
function public.render(sheet)
|
||||||
|
|
||||||
for i, column in ipairs(sheet.columns) do
|
for i, column in ipairs(sheet.columns) do
|
||||||
local sort_info = sheet.sort_order[1]
|
local sort_info = sheet.sort_order[1]
|
||||||
|
|
||||||
if sort_info and sort_info.column == column then
|
if sort_info and sort_info.column == i then
|
||||||
if sort_info.sort_ascending then
|
if sort_info.order == 'ascending' then
|
||||||
sheet.labels[i].sort_texture:SetTexCoord(0,0.55,0.2,0.9)
|
sheet.labels[i].sort_texture:SetTexCoord(0,0.55,0.2,0.9)
|
||||||
sheet.labels[i].sort_texture:SetVertexColor(0.2,1,0)
|
sheet.labels[i].sort_texture:SetVertexColor(0.2,1,0)
|
||||||
sheet.labels[i].sort_texture:Show()
|
sheet.labels[i].sort_texture:Show()
|
||||||
@@ -42,7 +43,7 @@ function Aux.sheet.render(sheet)
|
|||||||
local data = sheet.data
|
local data = sheet.data
|
||||||
|
|
||||||
for i, row in ipairs(rows) do
|
for i, row in ipairs(rows) do
|
||||||
local direction, rowR, rowG, rowB, rowA1, rowA2 = "Horizontal", 1, 1, 1, 0, 0 --row level coloring used for gradients
|
local direction, rowR, rowG, rowB, rowA1, rowA2 = 'Horizontal', 1, 1, 1, 0, 0 --row level coloring used for gradients
|
||||||
local datum = data[i + offset]
|
local datum = data[i + offset]
|
||||||
|
|
||||||
if datum then
|
if datum then
|
||||||
@@ -66,9 +67,9 @@ function Aux.sheet.render(sheet)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux.sheet.create(frame, columns, sort_order, row_setter, on_row_click, on_row_enter, on_row_leave, on_row_update)
|
function public.create(params)
|
||||||
local sheet
|
local sheet
|
||||||
local name = (frame:GetName() or '')..'ScrollSheet'
|
local name = (params.frame:GetName() or '')..'ScrollSheet'
|
||||||
|
|
||||||
local id = 1
|
local id = 1
|
||||||
while getglobal(name..id) do
|
while getglobal(name..id) do
|
||||||
@@ -76,22 +77,22 @@ function Aux.sheet.create(frame, columns, sort_order, row_setter, on_row_click,
|
|||||||
end
|
end
|
||||||
name = name..id
|
name = name..id
|
||||||
|
|
||||||
local scroll_frame = CreateFrame("ScrollFrame", name..'ScrollFrame', frame, "FauxScrollFrameTemplate")
|
local scroll_frame = CreateFrame('ScrollFrame', name..'ScrollFrame', params.frame, 'FauxScrollFrameTemplate')
|
||||||
scroll_frame:SetScript("OnVerticalScroll", function()
|
scroll_frame:SetScript('OnVerticalScroll', function()
|
||||||
FauxScrollFrame_OnVerticalScroll(16, function() Aux.sheet.render(this.sheet) end)
|
FauxScrollFrame_OnVerticalScroll(16, function() public.render(this.sheet) end)
|
||||||
end)
|
end)
|
||||||
scroll_frame:SetPoint("TOPLEFT", frame, "TOPLEFT", 5, -10)
|
scroll_frame:SetPoint('TOPLEFT', params.frame, 'TOPLEFT', 5, -10)
|
||||||
scroll_frame:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 5, 19)
|
scroll_frame:SetPoint('BOTTOMRIGHT', params.frame, 'BOTTOMRIGHT', 5, 19)
|
||||||
|
|
||||||
local parent_height = frame:GetHeight()
|
local parent_height = params.frame:GetHeight()
|
||||||
local content = CreateFrame('Frame', name..'Content', frame)
|
local content = CreateFrame('Frame', name..'Content', params.frame)
|
||||||
content:SetHeight(parent_height - 30)
|
content:SetHeight(parent_height - 30)
|
||||||
content:SetPoint("TOPLEFT", scroll_frame, "TOPLEFT", 5, 0)
|
content:SetPoint('TOPLEFT', scroll_frame, 'TOPLEFT', 5, 0)
|
||||||
|
|
||||||
local total_width = 0
|
local total_width = 0
|
||||||
|
|
||||||
local labels = {}
|
local labels = {}
|
||||||
for i = 1,getn(columns) do
|
for i = 1,getn(params.columns) do
|
||||||
local button = CreateFrame('Button', nil, content)
|
local button = CreateFrame('Button', nil, content)
|
||||||
if i == 1 then
|
if i == 1 then
|
||||||
button:SetPoint('TOPLEFT', content, 'TOPLEFT', 5, 0)
|
button:SetPoint('TOPLEFT', content, 'TOPLEFT', 5, 0)
|
||||||
@@ -101,15 +102,15 @@ function Aux.sheet.create(frame, columns, sort_order, row_setter, on_row_click,
|
|||||||
total_width = total_width + 3
|
total_width = total_width + 3
|
||||||
end
|
end
|
||||||
local label = content:CreateFontString(nil, 'OVERLAY', 'GameFontHighlight')
|
local label = content:CreateFontString(nil, 'OVERLAY', 'GameFontHighlight')
|
||||||
label:SetText(columns[i].title)
|
label:SetText(params.columns[i].title)
|
||||||
local column_width = columns[i].width or 30
|
local column_width = params.columns[i].width or 30
|
||||||
|
|
||||||
total_width = total_width + column_width
|
total_width = total_width + column_width
|
||||||
button:SetWidth(column_width)
|
button:SetWidth(column_width)
|
||||||
button:SetHeight(16)
|
button:SetHeight(16)
|
||||||
button:SetID(i)
|
button:SetID(i)
|
||||||
button:SetHighlightTexture('Interface\\QuestFrame\\UI-QuestTitleHighlight')
|
button:SetHighlightTexture('Interface\\QuestFrame\\UI-QuestTitleHighlight')
|
||||||
button:SetScript("OnMouseDown", function() Aux.list.sort(sheet, this:GetID()) end)
|
button:SetScript("OnMouseDown", function() Aux.sheet.sort(sheet, this:GetID()) end)
|
||||||
button:RegisterForClicks("LeftButtonDown", "RightButtonDown")
|
button:RegisterForClicks("LeftButtonDown", "RightButtonDown")
|
||||||
|
|
||||||
local texture = content:CreateTexture(nil, 'ARTWORK')
|
local texture = content:CreateTexture(nil, 'ARTWORK')
|
||||||
@@ -147,17 +148,17 @@ function Aux.sheet.create(frame, columns, sort_order, row_setter, on_row_click,
|
|||||||
labels[i] = label
|
labels[i] = label
|
||||||
end
|
end
|
||||||
total_width = total_width + 5
|
total_width = total_width + 5
|
||||||
frame:SetWidth(total_width)
|
params.frame:SetWidth(total_width)
|
||||||
|
|
||||||
local rows = {}
|
local rows = {}
|
||||||
local row_index = 1
|
local row_index = 1
|
||||||
local max_height = content:GetHeight()
|
local max_height = content:GetHeight()
|
||||||
local total_height = 16
|
local total_height = 16
|
||||||
while total_height + 14 < max_height do
|
while total_height + 14 < max_height do
|
||||||
if getn(columns) > 0 then
|
if getn(params.columns) > 0 then
|
||||||
local row = CreateFrame('Button', nil, content)
|
local row = CreateFrame('Button', nil, content)
|
||||||
row:SetPoint('TOPLEFT', labels[1], 'BOTTOMLEFT', 0, -((row_index-1) * 14))
|
row:SetPoint('TOPLEFT', labels[1], 'BOTTOMLEFT', 0, -((row_index-1) * 14))
|
||||||
row:SetPoint('TOPRIGHT', labels[getn(columns)], 'BOTTOMRIGHT', 0, -((row_index-1) * 14))
|
row:SetPoint('TOPRIGHT', labels[getn(params.columns)], 'BOTTOMRIGHT', 0, -((row_index-1) * 14))
|
||||||
row:RegisterForClicks("LeftButtonDown", "RightButtonDown")
|
row:RegisterForClicks("LeftButtonDown", "RightButtonDown")
|
||||||
row:SetHeight(14)
|
row:SetHeight(14)
|
||||||
|
|
||||||
@@ -168,14 +169,14 @@ function Aux.sheet.create(frame, columns, sort_order, row_setter, on_row_click,
|
|||||||
row:SetScript('OnUpdate', function() if sheet.on_row_update then sheet.on_row_update(sheet, row_idx) end end)
|
row:SetScript('OnUpdate', function() if sheet.on_row_update then sheet.on_row_update(sheet, row_idx) end end)
|
||||||
|
|
||||||
row.cells = {}
|
row.cells = {}
|
||||||
for i = 1,getn(columns) do
|
for i = 1,getn(params.columns) do
|
||||||
local cell = CreateFrame('Button', nil, content)
|
local cell = CreateFrame('Button', nil, content)
|
||||||
cell:SetPoint('TOPLEFT', labels[i], 'BOTTOMLEFT', 0, -((row_index-1) * 14))
|
cell:SetPoint('TOPLEFT', labels[i], 'BOTTOMLEFT', 0, -((row_index-1) * 14))
|
||||||
cell:SetPoint('TOPRIGHT', labels[i], 'BOTTOMRIGHT', 0, -((row_index-1) * 14))
|
cell:SetPoint('TOPRIGHT', labels[i], 'BOTTOMRIGHT', 0, -((row_index-1) * 14))
|
||||||
|
|
||||||
cell:SetHeight(14)
|
cell:SetHeight(14)
|
||||||
|
|
||||||
columns[i].cell_initializer(cell)
|
params.columns[i].cell_initializer(cell)
|
||||||
|
|
||||||
row.cells[i] = cell
|
row.cells[i] = cell
|
||||||
end
|
end
|
||||||
@@ -207,28 +208,28 @@ function Aux.sheet.create(frame, columns, sort_order, row_setter, on_row_click,
|
|||||||
scroll_frame = scroll_frame,
|
scroll_frame = scroll_frame,
|
||||||
labels = labels,
|
labels = labels,
|
||||||
rows = rows,
|
rows = rows,
|
||||||
columns = columns,
|
columns = params.columns,
|
||||||
data = {},
|
data = {},
|
||||||
sort_order = sort_order,
|
sort_order = params.sort_order,
|
||||||
row_setter = row_setter,
|
row_setter = params.row_setter,
|
||||||
on_row_click = on_row_click,
|
on_row_click = params.on_row_click,
|
||||||
on_row_enter = on_row_enter,
|
on_row_enter = params.on_row_enter,
|
||||||
on_row_leave = on_row_leave,
|
on_row_leave = params.on_row_leave,
|
||||||
on_row_update = on_row_update,
|
on_row_update = params.on_row_update,
|
||||||
}
|
}
|
||||||
scroll_frame.sheet = sheet
|
scroll_frame.sheet = sheet
|
||||||
|
|
||||||
return sheet
|
return sheet
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux.list.row_comparator(sheet)
|
function private.row_comparator(sheet)
|
||||||
return function(row1, row2)
|
return function(row1, row2)
|
||||||
for _, sort_info in ipairs(sheet.sort_order) do
|
for _, sort_info in ipairs(sheet.sort_order) do
|
||||||
local column = sort_info.column
|
local column = sheet.columns[sort_info.column]
|
||||||
if column.comparator then
|
if column.comparator then
|
||||||
local ordering = column.comparator(row1, row2)
|
local ordering = column.comparator(row1, row2)
|
||||||
if ordering ~= Aux.util.EQ then
|
if ordering ~= Aux.util.EQ then
|
||||||
return sort_info.sort_ascending and ordering or Aux.util.invert_order(ordering)
|
return sort_info.order == 'ascending' and ordering or Aux.util.invert_order(ordering)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -236,7 +237,7 @@ function Aux.list.row_comparator(sheet)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux.sheet.default_cell_initializer(alignment)
|
function public.default_cell_initializer(alignment)
|
||||||
return function(cell)
|
return function(cell)
|
||||||
local text = cell:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
|
local text = cell:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
|
||||||
text:SetAllPoints(cell)
|
text:SetAllPoints(cell)
|
||||||
@@ -247,41 +248,24 @@ function Aux.sheet.default_cell_initializer(alignment)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux.sheet.initialize(frame)
|
function public.populate(sheet, data)
|
||||||
|
|
||||||
local sort_order = {}
|
|
||||||
for i, column in columns do
|
|
||||||
if i ~= BUYOUT_UNIT and i ~= NAME then
|
|
||||||
tinsert(sort_order, { column = column, sort_ascending = true })
|
|
||||||
end
|
|
||||||
end
|
|
||||||
tinsert(sort_order, 1, { column = columns[BUYOUT_UNIT], sort_ascending = true })
|
|
||||||
tinsert(sort_order, 1, { column = columns[NAME], sort_ascending = true })
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
function Aux.list.populate(sheet, data)
|
|
||||||
sheet.data = data
|
sheet.data = data
|
||||||
|
|
||||||
-- Perform the sort.
|
Aux.util.merge_sort(sheet.data, private.row_comparator(sheet))
|
||||||
Aux.util.merge_sort(sheet.data, Aux.list.row_comparator(sheet))
|
|
||||||
|
|
||||||
-- Update the scroll pane.
|
public.render(sheet)
|
||||||
Aux.sheet.render(sheet)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux.list.sort(sheet, column_index)
|
function Aux.sheet.sort(sheet, column_index)
|
||||||
|
|
||||||
local column = sheet.columns[column_index]
|
|
||||||
|
|
||||||
if sheet.sort_order[1] and sheet.sort_order[1].column == column then
|
if sheet.sort_order[1] and sheet.sort_order[1].column == column_index then
|
||||||
sheet.sort_order[1].sort_ascending = not sheet.sort_order[1].sort_ascending
|
sheet.sort_order[1].order = sheet.sort_order[1].order == 'ascending' and 'descending' or 'ascending'
|
||||||
else
|
else
|
||||||
sheet.sort_order = Aux.util.filter(sheet.sort_order, function(sort_info) return not sort_info.column == column end)
|
sheet.sort_order = Aux.util.filter(sheet.sort_order, function(sort_info) return not sort_info.column == column_index end)
|
||||||
tinsert(sheet.sort_order, 1, {column=column, sort_ascending=true})
|
tinsert(sheet.sort_order, 1, {column=column_index, order = 'ascending'})
|
||||||
end
|
end
|
||||||
|
|
||||||
Aux.util.merge_sort(sheet.data, Aux.list.row_comparator(sheet))
|
Aux.util.merge_sort(sheet.data, private.row_comparator(sheet))
|
||||||
|
|
||||||
Aux.sheet.render(sheet)
|
public.render(sheet)
|
||||||
end
|
end
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
private, public = {}, {}
|
local private, public = {}, {}
|
||||||
Aux.static = public
|
Aux.static = public
|
||||||
|
|
||||||
aux_auctionable_items = {}
|
aux_auctionable_items = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user