fixed issue of auctions not showing after posting, setting of view is now shared between the search panels as well as persisted between sessions, tab/shift-tab can now be used to switch between all input fields
This commit is contained in:
+2
-2
@@ -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,7 +12,7 @@ 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
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
AuxVersion = "2.1.0"
|
AuxVersion = '2.1.1'
|
||||||
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,16 @@ Aux = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
last_picked_up = {},
|
last_picked_up = {},
|
||||||
|
view = {
|
||||||
|
BUYOUT = 1,
|
||||||
|
BID = 2,
|
||||||
|
FULL = 3,
|
||||||
|
},
|
||||||
|
last_owner_page_requested = 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
|||||||
+11
-13
@@ -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)
|
||||||
@@ -470,7 +468,7 @@ function public.on_close()
|
|||||||
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
|
||||||
|
|
||||||
@@ -491,21 +489,21 @@ function update_sheet()
|
|||||||
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 +519,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
|
||||||
|
|
||||||
|
|||||||
+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>
|
||||||
|
|||||||
+12
-14
@@ -17,8 +17,6 @@ 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)
|
||||||
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||||
@@ -81,7 +79,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 +151,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 +253,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 +412,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()
|
||||||
@@ -440,21 +438,21 @@ function update_listing()
|
|||||||
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 +468,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)
|
||||||
|
|||||||
+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>
|
||||||
|
|||||||
+2
-2
@@ -351,12 +351,12 @@ function public.update_listing()
|
|||||||
|
|
||||||
if public.listing == BIDS then
|
if public.listing == BIDS then
|
||||||
AuxManageFrameListingBidListing:Show()
|
AuxManageFrameListingBidListing:Show()
|
||||||
Aux.list.populate(AuxManageFrameListingBidListing.sheet, bid_records)
|
Aux.sheet.populate(AuxManageFrameListingBidListing.sheet, bid_records)
|
||||||
AuxManageFrameListing:SetWidth(AuxManageFrameListingBidListing:GetWidth() + 40)
|
AuxManageFrameListing:SetWidth(AuxManageFrameListingBidListing:GetWidth() + 40)
|
||||||
AuxFrame:SetWidth(AuxManageFrameListing:GetWidth() + 15)
|
AuxFrame:SetWidth(AuxManageFrameListing:GetWidth() + 15)
|
||||||
elseif public.listing == AUCTIONS then
|
elseif public.listing == AUCTIONS then
|
||||||
AuxManageFrameListingAuctionListing:Show()
|
AuxManageFrameListingAuctionListing:Show()
|
||||||
Aux.list.populate(AuxManageFrameListingAuctionListing.sheet, auction_records)
|
Aux.sheet.populate(AuxManageFrameListingAuctionListing.sheet, auction_records)
|
||||||
AuxManageFrameListing:SetWidth(AuxManageFrameListingAuctionListing:GetWidth() + 40)
|
AuxManageFrameListing:SetWidth(AuxManageFrameListingAuctionListing:GetWidth() + 40)
|
||||||
AuxFrame:SetWidth(AuxManageFrameListing:GetWidth() + 15)
|
AuxFrame:SetWidth(AuxManageFrameListing:GetWidth() + 15)
|
||||||
end
|
end
|
||||||
|
|||||||
+20
-4
@@ -62,8 +62,16 @@
|
|||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
local config = Aux.manage_frame.bid_listing_config
|
local config = Aux.manage_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>
|
||||||
@@ -75,8 +83,16 @@
|
|||||||
<Scripts>
|
<Scripts>
|
||||||
<OnLoad>
|
<OnLoad>
|
||||||
local config = Aux.manage_frame.auction_listing_config
|
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.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>
|
||||||
|
|||||||
+6
-6
@@ -89,16 +89,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
|
||||||
@@ -175,11 +175,11 @@ Aux.sell.auction_listing_config = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function update_inventory_listing()
|
function update_inventory_listing()
|
||||||
Aux.list.populate(AuxSellInventoryListing.sheet, inventory_data)
|
Aux.sheet.populate(AuxSellInventoryListing.sheet, inventory_data)
|
||||||
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()
|
||||||
@@ -604,7 +604,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()
|
||||||
|
|||||||
+22
-4
@@ -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>
|
||||||
@@ -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>
|
||||||
|
|||||||
+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