diff --git a/completion.lua b/completion.lua
index 723bbc4..f2437a5 100644
--- a/completion.lua
+++ b/completion.lua
@@ -68,9 +68,7 @@ function Aux.completion.completor(edit_box)
value = suggestion.value,
notCheckable = true,
func = function()
--- self.set_quietly(text)
- Aux.item_search_frame.set_item(this.value)
- AuxItemSearchFrameItemItemInputBox:ClearFocus()
+ self.set_quietly(text)
end,
}
end
@@ -140,10 +138,9 @@ function Aux.completion.completor(edit_box)
index = index > 0 and math.mod(index + 1, getn(suggestions) + 1) or 1
update_highlighting()
if index == 0 then
--- self.set_quietly(input)
+ self.set_quietly(input)
else
--- self.set_quietly(suggestions[index].text)
- Aux.item_search_frame.set_item(suggestions[index].value)
+ self.set_quietly(suggestions[index].text)
end
end
end
@@ -154,13 +151,115 @@ function Aux.completion.completor(edit_box)
index = index > 0 and index - 1 or getn(suggestions)
update_highlighting()
if index == 0 then
--- self.set_quietly(input)
+ self.set_quietly(input)
else
--- self.set_quietly(suggestions[index].text)
- Aux.item_search_frame.set_item(suggestions[index].value)
+ self.set_quietly(suggestions[index].text)
end
end
end
return self
end
+
+function Aux.completion.selector(edit_box)
+ local self = {}
+
+ local suggestions = {}
+ local index = 0
+ local input
+
+ local fill_dropdown, update_dropdown, update_highlighting
+
+ function fill_dropdown()
+ for i, suggestion in ipairs(suggestions) do
+ local text = suggestion.text
+ UIDropDownMenu_AddButton{
+ text = suggestion.display_text,
+ value = i,
+ notCheckable = true,
+ func = function()
+ index = this.value
+ AuxItemSearchFrameItemItemInputBox:ClearFocus()
+ end,
+ }
+ end
+ end
+
+ function update_dropdown()
+ function toggle()
+ ToggleDropDownMenu(1, nil, AuxCompletionDropDown, edit_box, -12, 4)
+ end
+
+ if DropDownList1:IsVisible() then
+ toggle()
+ end
+ toggle()
+ end
+
+ function update_highlighting()
+ for i=1,32 do
+ local highlight = getglobal('DropDownList1Button' .. i .. 'Highlight')
+ if i == index then
+ highlight:Show()
+ else
+ highlight:Hide()
+ end
+ end
+ end
+
+ function self.close()
+ CloseDropDownMenus(1)
+ end
+
+ function self.open()
+ local _, owner = DropDownList1:GetPoint()
+ return DropDownList1:IsVisible() and owner == edit_box
+ end
+
+ function self.suggest()
+ local new_input = edit_box:GetText()
+
+ input = new_input
+
+ if input == '' then
+ suggestions = {}
+ else
+ suggestions = generate_suggestions(input)
+ UIDropDownMenu_Initialize(AuxCompletionDropDown, function() fill_dropdown() end)
+ end
+
+ index = 1
+ update_highlighting()
+
+ update_dropdown()
+ end
+
+ function self.next()
+ update_dropdown()
+ if getn(suggestions) > 0 then
+ index = math.mod(index, getn(suggestions)) + 1
+ update_highlighting()
+ Aux.item_search_frame.set_item(suggestions[index].value)
+ end
+ end
+
+ function self.previous()
+ update_dropdown()
+ if getn(suggestions) > 0 then
+ index = index > 1 and index - 1 or getn(suggestions)
+ update_highlighting()
+ Aux.item_search_frame.set_item(suggestions[index].value)
+ end
+ end
+
+ function self.selected_value()
+ return suggestions[index] and suggestions[index].value
+ end
+
+ function self.clear()
+ index = 1
+ suggestions = {}
+ end
+
+ return self
+end
diff --git a/completion.xml b/completion.xml
index c1338bc..4932b22 100644
--- a/completion.xml
+++ b/completion.xml
@@ -4,5 +4,9 @@
+
+ this.isCounting = false
+ UIDropDownMenu_OnUpdate(arg1)
+
\ No newline at end of file
diff --git a/core.lua b/core.lua
index 21771d8..2e885f8 100644
--- a/core.lua
+++ b/core.lua
@@ -32,20 +32,21 @@ function Aux_OnLoad()
end
function Aux_OnEvent()
- if event == "VARIABLES_LOADED" then
+ if event == 'VARIABLES_LOADED' then
Aux_OnLoad()
- elseif event == "ADDON_LOADED" then
+ elseif event == 'ADDON_LOADED' then
Aux_OnAddonLoaded()
- elseif event == "AUCTION_HOUSE_SHOW" then
+ elseif event == 'AUCTION_HOUSE_SHOW' then
Aux_OnAuctionHouseShow()
- elseif event == "AUCTION_HOUSE_CLOSED" then
+ elseif event == 'AUCTION_HOUSE_CLOSED' then
Aux_OnAuctionHouseClosed()
- end
+ elseif event == 'AUCTION_OWNED_LIST_UPDATE' then
+ Aux.current_owner_page = Aux.last_owner_page_requested
+ end
end
function Aux_OnAddonLoaded()
if string.lower(arg1) == "blizzard_auctionui" then
- AuctionFrame:SetScript('OnHide', nil)
Aux_SetupHookFunctions()
end
end
@@ -102,15 +103,23 @@ end
function Aux_SetupHookFunctions()
+ local blizzard_ui_on_hide = function()
+ Aux.blizzard_ui_shown = false
+ end
+ AuctionFrame:SetScript('OnHide', blizzard_ui_on_hide)
+
Aux.orig.AuctionFrame_OnShow = AuctionFrame_OnShow
- -- TODO for some reason this breaks the auction house functionality
--- AuctionFrame_OnShow = function()
--- if not Aux.blizzard_ui_shown then
--- HideUIPanel(AuctionFrame)
--- else
--- return Aux.orig.AuctionFrame_OnShow()
--- end
--- end
+ AuctionFrame_OnShow = function()
+ if not Aux.blizzard_ui_shown then
+ Aux.control.as_soon_as(function() return AuctionFrame:GetScript('OnHide') == blizzard_ui_on_hide end, function()
+ HideUIPanel(AuctionFrame)
+ end)
+ end
+ return Aux.orig.AuctionFrame_OnShow()
+ end
+
+ Aux.orig.GetOwnerAuctionItems = GetOwnerAuctionItems
+ GetOwnerAuctionItems = Aux.GetOwnerAuctionItems
Aux.orig.PickupContainerItem = PickupContainerItem
PickupContainerItem = Aux.PickupContainerItem
@@ -123,6 +132,11 @@ function Aux_SetupHookFunctions()
end
+function Aux.GetOwnerAuctionItems(page)
+ Aux.last_owner_page_requested = page
+ return Aux.orig.GetOwnerAuctionItems(page)
+end
+
function Aux.AuctionFrameAuctions_OnEvent()
if AuctionFrameAuctions:IsVisible() then
Aux.orig.AuctionFrameAuctions_OnEvent()
@@ -147,7 +161,7 @@ function Aux_OnAuctionHouseClosed()
Aux.stack.stop()
Aux.scan.abort()
- Aux.buy.on_close()
+ Aux.filter_search_frame.on_close()
Aux.sell.on_close()
AuxFrame:Hide()
@@ -158,7 +172,7 @@ function Aux.on_tab_click(index)
Aux.stack.stop()
Aux.scan.abort(function()
Aux.item_search_frame.on_close()
- Aux.buy.on_close()
+ Aux.filter_search_frame.on_close()
Aux.sell.on_close()
Aux.manage_frame.on_close()
Aux.history.on_close()
@@ -168,7 +182,7 @@ function Aux.on_tab_click(index)
end
AuxItemSearchFrame:Hide()
- AuxBuyFrame:Hide()
+ AuxFilterSearchFrame:Hide()
AuxSellFrame:Hide()
AuxManageFrame:Hide()
AuxHistoryFrame:Hide()
@@ -177,7 +191,7 @@ function Aux.on_tab_click(index)
AuxItemSearchFrame:Show()
Aux.item_search_frame.on_open()
elseif index == 2 then
- AuxBuyFrame:Show()
+ AuxFilterSearchFrame:Show()
Aux.filter_search_frame.on_open()
elseif index == 3 then
AuxSellFrame:Show()
@@ -221,23 +235,23 @@ function Aux_ContainerFrameItemButton_OnClick(button)
local bag, slot = this:GetParent():GetID(), this:GetID()
local container_item = Aux.info.container_item(bag, slot)
- if AuctionFrame:IsVisible() and button == "LeftButton" and container_item then
-
- if IsShiftKeyDown()
- and not ChatFrameEditBox:IsVisible()
- and AuxBuyFrame:IsVisible()
- then
- AuxBuyNameInputBox.completor.set_quietly(container_item.name)
- return
- elseif AUX_BUY_SHORTCUT and IsAltKeyDown() then
- if not AuxBuyFrame:IsVisible() then
- Aux.on_tab_click(1)
- end
- AuxBuyNameInputBox.completor.set_quietly(container_item.name)
- Aux.buy.SearchButton_onclick()
- return
- end
- end
+-- if AuctionFrame:IsVisible() and button == "LeftButton" and container_item then
+--
+-- if IsShiftKeyDown()
+-- and not ChatFrameEditBox:IsVisible()
+-- and AuxBuyFrame:IsVisible()
+-- then
+-- AuxBuyNameInputBox.completor.set_quietly(container_item.name)
+-- return
+-- elseif AUX_BUY_SHORTCUT and IsAltKeyDown() then
+-- if not AuxBuyFrame:IsVisible() then
+-- Aux.on_tab_click(1)
+-- end
+-- AuxBuyNameInputBox.completor.set_quietly(container_item.name)
+-- Aux.filter_search_frame.start_search()
+-- return
+-- end
+-- end
return Aux.orig.ContainerFrameItemButton_OnClick(button)
end
diff --git a/core.xml b/core.xml
index 3c660c9..483ac98 100644
--- a/core.xml
+++ b/core.xml
@@ -5,10 +5,11 @@
- this:RegisterEvent("VARIABLES_LOADED")
- this:RegisterEvent("ADDON_LOADED")
- this:RegisterEvent("AUCTION_HOUSE_SHOW")
- this:RegisterEvent("AUCTION_HOUSE_CLOSED")
+ this:RegisterEvent('VARIABLES_LOADED')
+ this:RegisterEvent('ADDON_LOADED')
+ this:RegisterEvent('AUCTION_HOUSE_SHOW')
+ this:RegisterEvent('AUCTION_HOUSE_CLOSED')
+ this:RegisterEvent('AUCTION_OWNED_LIST_UPDATE')
Aux_OnEvent()
@@ -18,7 +19,7 @@
-
+
@@ -89,7 +90,7 @@
- getglobal(this:GetName().."Text"):SetText('Post')
+ getglobal(this:GetName().."Text"):SetText('Filter Search')
Aux.on_tab_click(this:GetID())
@@ -449,7 +441,7 @@
- getglobal(this:GetName().."Text"):SetText('Manage')
+ getglobal(this:GetName().."Text"):SetText('Post')
Aux.on_tab_click(this:GetID())
@@ -466,7 +458,7 @@
- getglobal(this:GetName().."Text"):SetText('Scan')
+ getglobal(this:GetName().."Text"):SetText('Manage')
Aux.on_tab_click(this:GetID())
@@ -481,6 +473,11 @@
+
+
+
+
+
diff --git a/filter_search_frame.lua b/filter_search_frame.lua
index a9c5eb7..968a583 100644
--- a/filter_search_frame.lua
+++ b/filter_search_frame.lua
@@ -1,7 +1,7 @@
Aux.buy = {}
local private, public = {}, {}
-Aux.browse_frame = public
+Aux.filter_search_frame = public
local create_auction_record, show_dialog, find_auction, hide_sheet, update_sheet, auction_alpha_setter, group_alpha_setter, create_auction_record
local auctions
@@ -20,12 +20,12 @@ end
local BUYOUT, BID, FULL = 1, 2, 3
-Aux.buy.modes = {
+public.views = {
[BUYOUT] = {
name = 'Buyout',
on_row_click = function (sheet, row_index)
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
- AuxBuyEntry_OnClick(Aux.util.filter(sheet.data[data_index], function(auction) return not auction.gone end)[1] or sheet.data[data_index][1])
+ private.on_row_click(Aux.util.filter(sheet.data[data_index], function(auction) return not auction.gone end)[1] or sheet.data[data_index][1])
end,
on_row_enter = function (sheet, row_index)
sheet.rows[row_index].highlight:SetAlpha(.5)
@@ -80,8 +80,6 @@ Aux.buy.modes = {
cell.icon = icon
end,
cell_setter = function(cell, group)
- cell.tooltip = group[1].tooltip
- cell.EnhTooltip_info = group[1].EnhTooltip_info
cell.icon.icon_texture:SetTexture(group[1].texture)
if not group[1].usable then
cell.icon.icon_texture:SetVertexColor(1.0, 0.1, 0.1)
@@ -131,7 +129,7 @@ Aux.buy.modes = {
name = 'Bid',
on_row_click = function (sheet, row_index)
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
- AuxBuyEntry_OnClick(sheet.data[data_index])
+ private.on_row_click(sheet.data[data_index])
end,
on_row_enter = function (sheet, row_index)
sheet.rows[row_index].highlight:SetAlpha(.5)
@@ -186,8 +184,6 @@ Aux.buy.modes = {
cell.icon = icon
end,
cell_setter = function(cell, datum)
- cell.tooltip = datum.tooltip
- cell.EnhTooltip_info = datum.EnhTooltip_info
cell.icon.icon_texture:SetTexture(datum.texture)
if not datum.usable then
cell.icon.icon_texture:SetVertexColor(1.0, 0.1, 0.1)
@@ -267,7 +263,7 @@ Aux.buy.modes = {
name = 'Full',
on_row_click = function (sheet, row_index)
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
- AuxBuyEntry_OnClick(sheet.data[data_index])
+ private.on_row_click(sheet.data[data_index])
end,
on_row_enter = function (sheet, row_index)
sheet.rows[row_index].highlight:SetAlpha(.5)
@@ -324,8 +320,6 @@ Aux.buy.modes = {
cell.icon = icon
end,
cell_setter = function(cell, datum)
- cell.tooltip = datum.tooltip
- cell.EnhTooltip_info = datum.EnhTooltip_info
cell.icon.icon_texture:SetTexture(datum.texture)
if not datum.usable then
cell.icon.icon_texture:SetVertexColor(1.0, 0.1, 0.1)
@@ -430,56 +424,65 @@ Aux.buy.modes = {
},
}
-function Aux.buy.on_close()
- if AuxBuyConfirmation:IsVisible() then
+function public.on_close()
+ if AuxFilterSearchFrameResultsConfirmation:IsVisible() then
Aux.buy.dialog_cancel()
end
current_page = nil
end
-function Aux.buy.on_open()
+function public.on_open()
public.set_view(1)
update_sheet()
end
-function Aux.buy.dialog_cancel()
+function public.dialog_cancel()
Aux.log('Canceled.')
Aux.scan.abort()
- AuxBuyConfirmation:Hide()
+ AuxFilterSearchFrameResultsConfirmation:Hide()
update_sheet()
- AuxBuySearchButton:Enable()
+ AuxFilterSearchFrameFiltersSearchButton:Enable()
end
-function Aux.buy.StopButton_onclick()
+function public.stop_search()
Aux.scan.abort()
end
function update_sheet()
- AuxBuyBuyList:Hide()
- AuxBuyBidList:Hide()
- AuxBuyFullList:Hide()
+ AuxFilterSearchFrameResultsBuyListing:Hide()
+ AuxFilterSearchFrameResultsBidListing:Hide()
+ AuxFilterSearchFrameResultsFullListing:Hide()
if private.view == BUYOUT then
- AuxBuyBuyList: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 {}
- Aux.list.populate(AuxBuyBuyList.sheet, auctions and Aux.util.group_by(buyout_auctions, function(a1, a2) return a1.hyperlink == a2.hyperlink and a1.stack_size == a2.stack_size and a1.buyout_price == a2.buyout_price end) or {})
+ Aux.list.populate(AuxFilterSearchFrameResultsBuyListing.sheet, auctions and Aux.util.group_by(buyout_auctions, function(a1, a2) return a1.hyperlink == a2.hyperlink and a1.stack_size == a2.stack_size and a1.buyout_price == a2.buyout_price end) or {})
+ AuxFilterSearchFrameResults:SetWidth(AuxFilterSearchFrameResultsBuyListing:GetWidth() + 40)
+ AuxFrame:SetWidth(AuxFilterSearchFrameFilters:GetWidth() + AuxFilterSearchFrameResults:GetWidth() + 20)
elseif private.view == BID then
- AuxBuyBidList:Show()
+ AuxFilterSearchFrameResultsBidListing:Show()
local bid_auctions = auctions and Aux.util.filter(auctions, function(auction) return auction.owner ~= UnitName('player') end) or {}
- Aux.list.populate(AuxBuyBidList.sheet, bid_auctions)
+ Aux.list.populate(AuxFilterSearchFrameResultsBidListing.sheet, bid_auctions)
+ AuxFilterSearchFrameResults:SetWidth(AuxFilterSearchFrameResultsBidListing:GetWidth() + 40)
+ AuxFrame:SetWidth(AuxFilterSearchFrameFilters:GetWidth() + AuxFilterSearchFrameResults:GetWidth() + 20)
elseif private.view == FULL then
- AuxBuyFullList:Show()
- Aux.list.populate(AuxBuyFullList.sheet, auctions or {})
+ AuxFilterSearchFrameResultsFullListing:Show()
+ Aux.list.populate(AuxFilterSearchFrameResultsFullListing.sheet, auctions or {})
+ AuxFilterSearchFrameResults:SetWidth(AuxFilterSearchFrameResultsFullListing:GetWidth() + 40)
+ AuxFrame:SetWidth(AuxFilterSearchFrameFilters:GetWidth() + AuxFilterSearchFrameResults:GetWidth() + 20)
end
end
function hide_sheet()
- AuxBuyBuyList:Hide()
- AuxBuyBidList:Hide()
- AuxBuyFullList:Hide()
+ AuxFilterSearchFrameResultsBuyListing:Hide()
+ AuxFilterSearchFrameResultsBidListing:Hide()
+ AuxFilterSearchFrameResultsFullListing:Hide()
end
function public.set_view(view)
+ for i=1,3 do
+ getglobal('AuxFilterSearchFrameResultsTab'..i):SetAlpha(i == view and 1 or 0.5)
+ end
private.view = view
update_sheet()
end
@@ -488,43 +491,43 @@ function public.set_item(item_id)
private.item_id = item_id
end
-function Aux.buy.SearchButton_onclick()
+function public.start_search()
- if not AuxBuySearchButton:IsVisible() then
+ if not AuxFilterSearchFrameFiltersSearchButton:IsVisible() then
return
end
-
- AuxBuySearchButton:Hide()
- AuxBuyStopButton:Show()
+
+ AuxFilterSearchFrameFiltersSearchButton:Hide()
+ AuxFilterSearchFrameFiltersStopButton:Show()
auctions = nil
refresh = true
- local category = UIDropDownMenu_GetSelectedValue(AuxBuyCategoryDropDown)
+ local category = UIDropDownMenu_GetSelectedValue(AuxFilterSearchFrameFiltersCategoryDropDown)
local tooltip_patterns = {}
for i=1,4 do
- local tooltip_pattern = getglobal('AuxBuyFiltersTooltipInputBox'..i):GetText()
+ local tooltip_pattern = getglobal('AuxFilterSearchFrameFiltersTooltipInputBox'..i):GetText()
if tooltip_pattern ~= '' then
tinsert(tooltip_patterns, tooltip_pattern)
end
end
search_query = {
- name = AuxBuyNameInputBox:GetText(),
- min_level = AuxBuyMinLevel:GetText(),
- max_level = AuxBuyMaxLevel:GetText(),
+ 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(AuxBuyQualityDropDown),
- usable = AuxBuyUsableCheckButton:GetChecked()
+ quality = UIDropDownMenu_GetSelectedValue(AuxFilterSearchFrameFiltersQualityDropDown),
+ usable = AuxFilterSearchFrameFiltersUsableCheckButton:GetChecked()
}
Aux.log('Scanning auctions ...')
Aux.scan.start{
query = search_query,
- page = AuxBuyAllPagesCheckButton:GetChecked() and 0 or AuxBuyPageEditBox:GetNumber(),
+ page = AuxFilterSearchFrameFiltersAllPagesCheckButton:GetChecked() and 0 or AuxFilterSearchFrameFiltersPageEditBox:GetNumber(),
on_submit_query = function()
current_page = nil
end,
@@ -535,7 +538,7 @@ function Aux.buy.SearchButton_onclick()
on_read_auction = function(i)
local auction_item = Aux.info.auction_item(i)
if auction_item then
- if (auction_item.name == search_query.name or search_query.name == '' or not (private.filter == ITEM)) and Aux.info.tooltip_match(tooltip_patterns, auction_item.tooltip) then
+ if Aux.info.tooltip_match(tooltip_patterns, auction_item.tooltip) then
auctions = auctions or {}
tinsert(auctions, create_auction_record(auction_item, current_page))
end
@@ -545,19 +548,19 @@ function Aux.buy.SearchButton_onclick()
auctions = auctions or {}
Aux.log('Scan complete: '..getn(auctions)..' '..Aux_PluralizeIf('auction', getn(auctions))..' found.')
- AuxBuyStopButton:Hide()
- AuxBuySearchButton:Show()
+ 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.')
- AuxBuyStopButton:Hide()
- AuxBuySearchButton:Show()
+ AuxFilterSearchFrameFiltersStopButton:Hide()
+ AuxFilterSearchFrameFiltersSearchButton:Show()
refresh = true
end,
next_page = function(page, total_pages)
- if AuxBuyAllPagesCheckButton:GetChecked() then
+ if AuxFilterSearchFrameFiltersAllPagesCheckButton:GetChecked() then
local last_page = max(total_pages - 1, 0)
if page < last_page then
return page + 1
@@ -568,33 +571,33 @@ function Aux.buy.SearchButton_onclick()
end
function show_dialog(buyout_mode, entry, amount)
- AuxBuyConfirmationContentItem.tooltip = entry.tooltip
- AuxBuyConfirmationContentItem.EnhTooltip_info = entry.EnhTooltip_info
-
- AuxBuyConfirmationContentActionButton:Disable()
- AuxBuyConfirmationContentItemIconTexture:SetTexture(entry.texture)
- AuxBuyConfirmationContentItemName:SetText(entry.tooltip[1][1].text)
+ AuxFilterSearchFrameResultsConfirmationContentItem.tooltip = entry.tooltip
+ AuxFilterSearchFrameResultsConfirmationContentItem.EnhTooltip_info = entry.EnhTooltip_info
+
+ AuxFilterSearchFrameResultsConfirmationContentActionButton:Disable()
+ AuxFilterSearchFrameResultsConfirmationContentItemIconTexture:SetTexture(entry.texture)
+ AuxFilterSearchFrameResultsConfirmationContentItemName:SetText(entry.tooltip[1][1].text)
local color = ITEM_QUALITY_COLORS[entry.quality]
- AuxBuyConfirmationContentItemName:SetTextColor(color.r, color.g, color.b)
+ AuxFilterSearchFrameResultsConfirmationContentItemName:SetTextColor(color.r, color.g, color.b)
if entry.stack_size > 1 then
- AuxBuyConfirmationContentItemCount:SetText(entry.stack_size);
- AuxBuyConfirmationContentItemCount:Show()
+ AuxFilterSearchFrameResultsConfirmationContentItemCount:SetText(entry.stack_size);
+ AuxFilterSearchFrameResultsConfirmationContentItemCount:Show()
else
- AuxBuyConfirmationContentItemCount:Hide()
+ AuxFilterSearchFrameResultsConfirmationContentItemCount:Hide()
end
if buyout_mode then
- AuxBuyConfirmationContentActionButton:SetText('Buy')
- MoneyFrame_Update('AuxBuyConfirmationContentBuyoutPrice', amount)
- AuxBuyConfirmationContentBid:Hide()
- AuxBuyConfirmationContentBuyoutPrice:Show()
+ AuxFilterSearchFrameResultsConfirmationContentActionButton:SetText('Buy')
+ MoneyFrame_Update('AuxFilterSearchFrameResultsConfirmationContentBuyoutPrice', amount)
+ AuxFilterSearchFrameResultsConfirmationContentBid:Hide()
+ AuxFilterSearchFrameResultsConfirmationContentBuyoutPrice:Show()
else
- AuxBuyConfirmationContentActionButton:SetText('Bid')
- MoneyInputFrame_SetCopper(AuxBuyConfirmationContentBid, amount)
- AuxBuyConfirmationContentBuyoutPrice:Hide()
- AuxBuyConfirmationContentBid:Show()
+ AuxFilterSearchFrameResultsConfirmationContentActionButton:SetText('Bid')
+ MoneyInputFrame_SetCopper(AuxFilterSearchFrameResultsConfirmationContentBid, amount)
+ AuxFilterSearchFrameResultsConfirmationContentBuyoutPrice:Hide()
+ AuxFilterSearchFrameResultsConfirmationContentBid:Show()
end
- AuxBuyConfirmation:Show()
+ AuxFilterSearchFrameResultsConfirmation:Show()
end
function find_auction(entry, buyout_mode, express_mode)
@@ -617,7 +620,7 @@ function find_auction(entry, buyout_mode, express_mode)
end
Aux.log('Processing '..(buyout_mode and 'buyout' or 'bid')..' request for '..entry.hyperlink..' x '..entry.stack_size..' at '..Aux.util.money_string(amount)..' ...')
- AuxBuySearchButton:Disable()
+ AuxFilterSearchFrameFiltersSearchButton:Disable()
if not express_mode then
show_dialog(buyout_mode, entry, amount)
@@ -674,11 +677,11 @@ function find_auction(entry, buyout_mode, express_mode)
Aux.log('Not enough money.')
end
Aux.scan.abort()
- AuxBuySearchButton:Enable()
- AuxBuyConfirmation:Hide()
+ AuxFilterSearchFrameFiltersSearchButton:Enable()
+ AuxFilterSearchFrameResultsConfirmation:Hide()
update_sheet()
end
- AuxBuyConfirmationContentActionButton:Enable()
+ AuxFilterSearchFrameResultsConfirmationContentActionButton:Enable()
end
end
end,
@@ -690,12 +693,12 @@ function find_auction(entry, buyout_mode, express_mode)
Aux.buy.dialog_cancel()
end
if express_mode then
- AuxBuySearchButton:Enable()
+ AuxFilterSearchFrameFiltersSearchButton:Enable()
end
end,
on_abort = function()
if express_mode then
- AuxBuySearchButton:Enable()
+ AuxFilterSearchFrameFiltersSearchButton:Enable()
end
end,
next_page = function(page, total_pages)
@@ -706,7 +709,7 @@ function find_auction(entry, buyout_mode, express_mode)
}
end
-function AuxBuyEntry_OnClick(entry)
+function private.on_row_click(entry)
local express_mode = IsAltKeyDown()
local buyout_mode = arg1 == 'LeftButton'
@@ -730,7 +733,7 @@ function create_auction_record(auction_item, current_page)
elseif auction_item.high_bidder then
status = GREEN_FONT_COLOR_CODE..'Your Bid'..FONT_COLOR_CODE_CLOSE
else
- status = RED_FONT_COLOR_CODE..'Other Bidder'..FONT_COLOR_CODE_CLOSE
+ status = 'Other Bidder'
end
return {
@@ -767,7 +770,7 @@ function Aux.buy.onupdate()
end
end
-function AuxBuyCategoryDropDown_Initialize(arg1)
+function AuxFilterSearchFrameFiltersCategoryDropDown_Initialize(arg1)
local level = arg1 or 1
if level == 1 then
@@ -775,7 +778,7 @@ function AuxBuyCategoryDropDown_Initialize(arg1)
UIDropDownMenu_AddButton({
text = ALL,
value = value,
- func = AuxBuyCategoryDropDown_OnClick,
+ func = AuxFilterSearchFrameFiltersCategoryDropDown_OnClick,
}, 1)
for i, class in pairs({ GetAuctionItemClasses() }) do
@@ -784,7 +787,7 @@ function AuxBuyCategoryDropDown_Initialize(arg1)
hasArrow = GetAuctionItemSubClasses(value.class),
text = class,
value = value,
- func = AuxBuyCategoryDropDown_OnClick,
+ func = AuxFilterSearchFrameFiltersCategoryDropDown_OnClick,
}, 1)
end
end
@@ -797,7 +800,7 @@ function AuxBuyCategoryDropDown_Initialize(arg1)
hasArrow = GetAuctionInvTypes(value.class, value.subclass),
text = subclass,
value = value,
- func = AuxBuyCategoryDropDown_OnClick,
+ func = AuxFilterSearchFrameFiltersCategoryDropDown_OnClick,
}, 2)
end
end
@@ -810,13 +813,13 @@ function AuxBuyCategoryDropDown_Initialize(arg1)
UIDropDownMenu_AddButton({
text = slot_name,
value = value,
- func = AuxBuyCategoryDropDown_OnClick,
+ func = AuxFilterSearchFrameFiltersCategoryDropDown_OnClick,
}, 3)
end
end
end
-function AuxBuyCategoryDropDown_OnClick()
+function AuxFilterSearchFrameFiltersCategoryDropDown_OnClick()
local qualified_name = ({ GetAuctionItemClasses() })[this.value.class] or 'All'
if this.value.subclass then
local subclass_name = ({ GetAuctionItemSubClasses(this.value.class) })[this.value.subclass]
@@ -827,15 +830,15 @@ function AuxBuyCategoryDropDown_OnClick()
end
end
- UIDropDownMenu_SetSelectedValue(AuxBuyCategoryDropDown, this.value)
- UIDropDownMenu_SetText(qualified_name, AuxBuyCategoryDropDown)
+ UIDropDownMenu_SetSelectedValue(AuxFilterSearchFrameFiltersCategoryDropDown, this.value)
+ UIDropDownMenu_SetText(qualified_name, AuxFilterSearchFrameFiltersCategoryDropDown)
CloseDropDownMenus(1)
end
-function AuxBuyQualityDropDown_Initialize()
+function AuxFilterSearchFrameFiltersQualityDropDown_Initialize()
local function on_click()
- UIDropDownMenu_SetSelectedValue(AuxBuyQualityDropDown, this.value)
+ UIDropDownMenu_SetSelectedValue(AuxFilterSearchFrameFiltersQualityDropDown, this.value)
end
UIDropDownMenu_AddButton{
diff --git a/filter_search_frame.xml b/filter_search_frame.xml
index aba4392..5e9a78e 100644
--- a/filter_search_frame.xml
+++ b/filter_search_frame.xml
@@ -1,6 +1,6 @@
-
+
@@ -10,10 +10,10 @@
-
+
-
-
+
+
@@ -23,50 +23,16 @@
-
-
-
-
-
-
-
-
-
-
- getglobal(this:GetName().."Text"):SetText('Item')
-
-
- Aux.browse_frame.set_filter(this:GetID())
-
-
-
-
-
-
-
-
-
-
-
-
-
- getglobal(this:GetName().."Text"):SetText('Filters')
-
-
- Aux.browse_frame.set_filter(this:GetID())
-
-
-
-
-
-
+
+
getglobal(this:GetName()..'Label'):SetText('Name')
+ this:SetWidth(150)
this:ClearFocus()
- Aux.buy.SearchButton_onclick()
+ Aux.filter_search_frame.start_search()
this:ClearFocus()
@@ -74,8 +40,8 @@
-
-
+
+
@@ -92,23 +58,23 @@
UIDropDownMenu_SetWidth(140)
- UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize)
+ UIDropDownMenu_Initialize(this, AuxFilterSearchFrameFiltersCategoryDropDown_Initialize)
- UIDropDownMenu_Initialize(this, AuxBuyCategoryDropDown_Initialize)
+ UIDropDownMenu_Initialize(this, AuxFilterSearchFrameFiltersCategoryDropDown_Initialize)
-
-
+
+
UIDropDownMenu_SetWidth(140)
- UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize)
+ UIDropDownMenu_Initialize(this, AuxFilterSearchFrameFiltersQualityDropDown_Initialize)
- UIDropDownMenu_Initialize(this, AuxBuyQualityDropDown_Initialize)
+ UIDropDownMenu_Initialize(this, AuxFilterSearchFrameFiltersQualityDropDown_Initialize)
@@ -126,9 +92,9 @@
-
+
-
+
@@ -147,9 +113,9 @@
-
+
-
+
@@ -160,9 +126,9 @@
-
+
-
+
@@ -173,64 +139,61 @@
-
+
getglobal(this:GetName()..'Label'):SetText('Tooltip')
- this:SetWidth(110)
+ this:SetWidth(150)
-
- AuxBuyTooltipButton_OnClick(this)
-
-
+
- this:SetWidth(110)
+ this:SetWidth(150)
-
- AuxBuyTooltipButton_OnClick(this)
-
-
+
- this:SetWidth(110)
+ this:SetWidth(150)
-
- AuxBuyTooltipButton_OnClick(this)
-
-
+
- this:SetWidth(110)
+ this:SetWidth(150)
-
- AuxBuyTooltipButton_OnClick(this)
-
-
+
- Aux.buy.SearchButton_onclick()
+ Aux.filter_search_frame.start_search()
-
+
+
+
+
+
+ Aux.filter_search_frame.stop_search()
+
+
+
+
@@ -244,7 +207,7 @@
-
+
@@ -256,19 +219,19 @@
- AuxBuyPageEditBox:EnableMouse(not this:GetChecked())
- AuxBuyPageEditBox:SetAlpha(this:GetChecked() and 0.5 or 1)
- AuxBuyPageEditBox:ClearFocus()
+ AuxFilterSearchFrameFiltersPageEditBox:EnableMouse(not this:GetChecked())
+ AuxFilterSearchFrameFiltersPageEditBox:SetAlpha(this:GetChecked() and 0.5 or 1)
+ AuxFilterSearchFrameFiltersPageEditBox:ClearFocus()
-
+
-
+
this:SetBackdropBorderColor(0.4, 0.4, 0.4)
@@ -290,7 +253,7 @@
getglobal(this:GetName().."Text"):SetText('Buy')
- Aux.browse_frame.set_view(this:GetID())
+ Aux.filter_search_frame.set_view(this:GetID())
@@ -307,7 +270,7 @@
getglobal(this:GetName().."Text"):SetText('Bid')
- Aux.browse_frame.set_view(this:GetID())
+ Aux.filter_search_frame.set_view(this:GetID())
@@ -324,47 +287,50 @@
getglobal(this:GetName().."Text"):SetText('Full')
- Aux.browse_frame.set_view(this:GetID())
+ Aux.filter_search_frame.set_view(this:GetID())
-
+
-
+
- local sort_order = Aux.util.map(Aux.buy.modes[1].sort_order, function(column_order) return { column = Aux.buy.modes[1].columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
- this.sheet = Aux.sheet.create(this, Aux.buy.modes[1].columns, sort_order, Aux.buy.modes[1].row_setter, Aux.buy.modes[1].on_row_click, Aux.buy.modes[1].on_row_enter, Aux.buy.modes[1].on_row_leave)
+ 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, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave)
-
+
-
+
- local sort_order = Aux.util.map(Aux.buy.modes[2].sort_order, function(column_order) return { column = Aux.buy.modes[2].columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
- this.sheet = Aux.sheet.create(this, Aux.buy.modes[2].columns, sort_order, Aux.buy.modes[2].row_setter, Aux.buy.modes[2].on_row_click, Aux.buy.modes[2].on_row_enter, Aux.buy.modes[2].on_row_leave)
+ 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, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave)
-
+
-
+
- local sort_order = Aux.util.map(Aux.buy.modes[3].sort_order, function(column_order) return { column = Aux.buy.modes[3].columns[column_order.column], sort_ascending = column_order.order == 'ascending' } end)
- this.sheet = Aux.sheet.create(this, Aux.buy.modes[3].columns, sort_order, Aux.buy.modes[3].row_setter, Aux.buy.modes[3].on_row_click, Aux.buy.modes[3].on_row_enter, Aux.buy.modes[3].on_row_leave)
+ 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, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave)
-
+
@@ -411,7 +377,7 @@
- Aux.buy.dialog_action()
+ Aux.filter_search_frame.dialog_action()
@@ -420,7 +386,7 @@
- Aux.buy.dialog_cancel()
+ Aux.filter_search_frame.dialog_cancel()
@@ -430,15 +396,6 @@
-
-
-
-
-
- Aux.buy.StopButton_onclick()
-
-
-
diff --git a/item_search_frame.lua b/item_search_frame.lua
index 61f63a3..9d14dd3 100644
--- a/item_search_frame.lua
+++ b/item_search_frame.lua
@@ -7,6 +7,7 @@ local search_query
local tooltip_patterns = {}
local current_page
local refresh
+local recently_searched = {}
function auction_alpha_setter(cell, auction)
cell:SetAlpha(auction.gone and 0.3 or 1)
@@ -18,6 +19,60 @@ end
local BUYOUT, BID, FULL = 1, 2, 3
+public.recently_searched_config = {
+ on_row_click = function (sheet, row_index)
+ local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
+ public.set_item(sheet.data[data_index].item_id)
+ 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 = 'Item',
+ width = 163,
+ comparator = function(datum1, datum2)
+ return Aux.util.compare(datum1.time, datum2.time, 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)
+ local info = { GetItemInfo(datum.item_id) }
+ cell.icon.icon_texture:SetTexture(info[9])
+ cell.text:SetText('['..info[1]..']')
+ local color = ITEM_QUALITY_COLORS[info[3]]
+ cell.text:SetTextColor(color.r, color.g, color.b)
+ end,
+ },
+ },
+ sort_order = {},
+}
public.views = {
[BUYOUT] = {
name = 'Buyout',
@@ -38,16 +93,6 @@ public.views = {
row.EnhTooltip_info = group[1].EnhTooltip_info
end,
columns = {
- {
- title = 'Avail',
- width = 40,
- comparator = function(group1, group2) return Aux.util.compare(getn(Aux.util.filter(group1, function(auction) return not auction.gone end)), getn(Aux.util.filter(group2, function(auction) return not auction.gone end)), Aux.util.LT) end,
- cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
- cell_setter = function(cell, group)
- cell.text:SetText(getn(Aux.util.filter(group, function(auction) return not auction.gone end)))
- group_alpha_setter(cell, group)
- end,
- },
{
title = 'Qty',
width = 23,
@@ -58,6 +103,16 @@ public.views = {
group_alpha_setter(cell, group)
end,
},
+ {
+ title = 'Buy',
+ width = 93,
+ comparator = function(group1, group2) return Aux.util.compare(group1[1].buyout_price, group2[1].buyout_price, Aux.util.GT) end,
+ cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
+ cell_setter = function(cell, group)
+ cell.text:SetText(Aux.util.money_string(group[1].buyout_price))
+ group_alpha_setter(cell, group)
+ end,
+ },
{
title = 'Buy/ea',
width = 93,
@@ -69,17 +124,17 @@ public.views = {
end,
},
{
- title = 'Buy',
- width = 93,
- comparator = function(group1, group2) return Aux.util.compare(group1[1].buyout_price, group2[1].buyout_price, Aux.util.GT) end,
+ title = 'Avail',
+ width = 40,
+ comparator = function(group1, group2) return Aux.util.compare(getn(Aux.util.filter(group1, function(auction) return not auction.gone end)), getn(Aux.util.filter(group2, function(auction) return not auction.gone end)), Aux.util.LT) end,
cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
cell_setter = function(cell, group)
- cell.text:SetText(Aux.util.money_string(group[1].buyout_price))
+ cell.text:SetText(getn(Aux.util.filter(group, function(auction) return not auction.gone end)))
group_alpha_setter(cell, group)
end,
},
},
- sort_order = {{column = 2, order = 'ascending' }, {column = 4, order = 'ascending'}},
+ sort_order = {{column = 3, order = 'ascending' }},
},
[BID] = {
name = 'Bid',
@@ -295,7 +350,7 @@ public.views = {
}
function public.on_close()
- if AuxBuyConfirmation:IsVisible() then
+ if AuxItemSearchFrameAuctionsConfirmation:IsVisible() then
public.dialog_cancel()
end
current_page = nil
@@ -304,15 +359,16 @@ end
function public.on_open()
public.set_view(1)
public.update_item()
+ private.update_recently_searched()
update_listing()
end
function public.dialog_cancel()
Aux.log('Canceled.')
Aux.scan.abort()
- AuxBuyConfirmation:Hide()
+ AuxItemSearchFrameAuctionsConfirmation:Hide()
update_listing()
- AuxBuySearchButton:Enable()
+ AuxItemSearchFrameItemSearchButton:Enable()
end
function public.stop_search()
@@ -328,13 +384,19 @@ function update_listing()
AuxItemSearchFrameAuctionsBuyListing:Show()
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.hyperlink == a2.hyperlink and a1.stack_size == a2.stack_size and a1.buyout_price == a2.buyout_price end) or {})
+ AuxItemSearchFrameAuctions:SetWidth(AuxItemSearchFrameAuctionsBuyListing:GetWidth() + 40)
+ AuxFrame:SetWidth(AuxItemSearchFrameItem:GetWidth() + AuxItemSearchFrameAuctions:GetWidth() + 20)
elseif private.view == BID then
AuxItemSearchFrameAuctionsBidListing:Show()
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)
+ AuxItemSearchFrameAuctions:SetWidth(AuxItemSearchFrameAuctionsBidListing:GetWidth() + 40)
+ AuxFrame:SetWidth(AuxItemSearchFrameItem:GetWidth() + AuxItemSearchFrameAuctions:GetWidth() + 20)
elseif private.view == FULL then
AuxItemSearchFrameAuctionsFullListing:Show()
Aux.list.populate(AuxItemSearchFrameAuctionsFullListing.sheet, auctions or {})
+ AuxItemSearchFrameAuctions:SetWidth(AuxItemSearchFrameAuctionsFullListing:GetWidth() + 40)
+ AuxFrame:SetWidth(AuxItemSearchFrameItem:GetWidth() + AuxItemSearchFrameAuctions:GetWidth() + 20)
end
end
@@ -352,8 +414,18 @@ function public.set_view(view)
update_listing()
end
+function private.update_recently_searched()
+ Aux.list.populate(AuxItemSearchFrameRecentlySearchedListing.sheet, recently_searched)
+end
+
function public.set_item(item_id)
- private.item_id = item_id
+ if item_id ~= private.item_id then
+ private.item_id = item_id
+ public.update_item()
+ tinsert(recently_searched, 1, { item_id=item_id, time=time() })
+ private.update_recently_searched()
+ public.start_search()
+ end
end
function public.update_item()
@@ -365,7 +437,6 @@ function public.update_item()
AuxItemSearchFrameItemItemName:SetTextColor(color.r, color.g, color.b)
AuxItemSearchFrameItemItem:Show()
AuxItemSearchFrameItemItemInputBox:Hide()
- public.start_search()
else
AuxItemSearchFrameItemItem:Hide()
end
@@ -444,33 +515,33 @@ function public.start_search()
end
function show_dialog(buyout_mode, entry, amount)
- AuxBuyConfirmationContentItem.tooltip = entry.tooltip
- AuxBuyConfirmationContentItem.EnhTooltip_info = entry.EnhTooltip_info
-
- AuxBuyConfirmationContentActionButton:Disable()
- AuxBuyConfirmationContentItemIconTexture:SetTexture(entry.texture)
- AuxBuyConfirmationContentItemName:SetText(entry.tooltip[1][1].text)
+ AuxItemSearchFrameAuctionsConfirmationContentItem.tooltip = entry.tooltip
+ AuxItemSearchFrameAuctionsConfirmationContentItem.EnhTooltip_info = entry.EnhTooltip_info
+
+ AuxItemSearchFrameAuctionsConfirmationContentActionButton:Disable()
+ AuxItemSearchFrameAuctionsConfirmationContentItemIconTexture:SetTexture(entry.texture)
+ AuxItemSearchFrameAuctionsConfirmationContentItemName:SetText(entry.tooltip[1][1].text)
local color = ITEM_QUALITY_COLORS[entry.quality]
- AuxBuyConfirmationContentItemName:SetTextColor(color.r, color.g, color.b)
+ AuxItemSearchFrameAuctionsConfirmationContentItemName:SetTextColor(color.r, color.g, color.b)
if entry.stack_size > 1 then
- AuxBuyConfirmationContentItemCount:SetText(entry.stack_size);
- AuxBuyConfirmationContentItemCount:Show()
+ AuxItemSearchFrameAuctionsConfirmationContentItemCount:SetText(entry.stack_size);
+ AuxItemSearchFrameAuctionsConfirmationContentItemCount:Show()
else
- AuxBuyConfirmationContentItemCount:Hide()
+ AuxItemSearchFrameAuctionsConfirmationContentItemCount:Hide()
end
if buyout_mode then
- AuxBuyConfirmationContentActionButton:SetText('Buy')
- MoneyFrame_Update('AuxBuyConfirmationContentBuyoutPrice', amount)
- AuxBuyConfirmationContentBid:Hide()
- AuxBuyConfirmationContentBuyoutPrice:Show()
+ AuxItemSearchFrameAuctionsConfirmationContentActionButton:SetText('Buy')
+ MoneyFrame_Update('AuxItemSearchFrameAuctionsConfirmationContentBuyoutPrice', amount)
+ AuxItemSearchFrameAuctionsConfirmationContentBid:Hide()
+ AuxItemSearchFrameAuctionsConfirmationContentBuyoutPrice:Show()
else
- AuxBuyConfirmationContentActionButton:SetText('Bid')
- MoneyInputFrame_SetCopper(AuxBuyConfirmationContentBid, amount)
- AuxBuyConfirmationContentBuyoutPrice:Hide()
- AuxBuyConfirmationContentBid:Show()
+ AuxItemSearchFrameAuctionsConfirmationContentActionButton:SetText('Bid')
+ MoneyInputFrame_SetCopper(AuxItemSearchFrameAuctionsConfirmationContentBid, amount)
+ AuxItemSearchFrameAuctionsConfirmationContentBuyoutPrice:Hide()
+ AuxItemSearchFrameAuctionsConfirmationContentBid:Show()
end
- AuxBuyConfirmation:Show()
+ AuxItemSearchFrameAuctionsConfirmation:Show()
end
function find_auction(entry, buyout_mode, express_mode)
@@ -551,10 +622,10 @@ function find_auction(entry, buyout_mode, express_mode)
end
Aux.scan.abort()
AuxItemSearchFrameItemSearchButton:Enable()
- AuxItemSearchFrameConfirmation:Hide()
+ AuxItemSearchFrameAuctionsConfirmation:Hide()
update_listing()
end
- AuxItemSearchFrameConfirmationContentActionButton:Enable()
+ AuxItemSearchFrameAuctionsConfirmationContentActionButton:Enable()
end
end
end,
@@ -606,7 +677,7 @@ function create_auction_record(auction_item, current_page)
elseif auction_item.high_bidder then
status = GREEN_FONT_COLOR_CODE..'Your Bid'..FONT_COLOR_CODE_CLOSE
else
- status = RED_FONT_COLOR_CODE..'Other Bidder'..FONT_COLOR_CODE_CLOSE
+ status = 'Other Bidder'
end
return {
diff --git a/item_search_frame.xml b/item_search_frame.xml
index e2229f3..1e8f5bb 100644
--- a/item_search_frame.xml
+++ b/item_search_frame.xml
@@ -13,7 +13,7 @@
-
+
@@ -39,45 +39,46 @@
-
+
- getglobal(this:GetName()..'Label'):SetText('Item')
- this.completor = Aux.completion.completor(this)
- this:SetWidth(165)
+ this.selector = Aux.completion.selector(this)
+ this:SetWidth(185)
- this.completor.suggest()
+ this.selector.suggest()
if IsShiftKeyDown() then
- this.completor.previous()
+ this.selector.previous()
else
- this.completor.next()
+ this.selector.next()
end
- this.completor.close()
- this:ClearFocus()
-
-
- this:Hide()
- Aux.item_search_frame.update_item()
- Aux.item_search_frame.start_search()
-
-
- if this.completor.open() then
- this.completor.close()
- else
+ if this.selector.selected_value() then
this:ClearFocus()
end
+
+
+ this.selector.close()
+ if this.selector.selected_value() then
+ Aux.item_search_frame.set_item(this.selector.selected_value())
+ end
+ this:Hide()
+ this.selector.clear()
+ Aux.item_search_frame.update_item()
+
+
+ this.selector.clear()
+ this:ClearFocus()
-
+
Aux.item_search_frame.start_search()
@@ -86,7 +87,7 @@
-
+
Aux.item_search_frame.stop_search()
@@ -94,7 +95,7 @@
-
+
getglobal(this:GetName()..'Label'):SetText('Page')
@@ -109,7 +110,7 @@
-
+
@@ -127,6 +128,35 @@
+
+
+
+
+
+
+
+
+ this:SetBackdropBorderColor(0.4, 0.4, 0.4)
+ this:SetBackdropColor(0.15, 0.15, 0.15)
+ getglobal(this:GetName().."Title"):SetText('Recently Searched')
+
+
+
+
+
+
+
+
+
+
+ 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, config.columns, sort_order, config.row_setter, config.on_row_click, config.on_row_enter, config.on_row_leave)
+
+
+
+
+
diff --git a/manage_frame.lua b/manage_frame.lua
index 84bf439..9c694e9 100644
--- a/manage_frame.lua
+++ b/manage_frame.lua
@@ -1,22 +1,23 @@
local private, public = {}, {}
+Aux.manage_frame = public
-local on_open, on_close
+local update_bid_records, update_auction_records, wait_for_bids, wait_for_auctions
-local bid_records, auction_records, create_bid_record, create_auction_record, update_bid_records, update_auction_records, wait_for_bids, wait_for_auctions, create_record
+local bid_records, auction_records
-local position
+local BIDS, AUCTIONS = 1, 2
-local bid_listing_config = {
- on_cell_click = function(sheet, row_index, column_index)
+public.bid_listing_config = {
+ on_row_click = function(sheet, row_index, column_index)
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
AuxBuyEntry_OnClick(sheet.data[data_index])
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)
end,
- on_cell_leave = function(sheet, row_index, column_index)
+ on_row_leave = function(sheet, row_index, column_index)
sheet.rows[row_index].highlight:SetAlpha(0)
end,
columns = {
@@ -36,6 +37,7 @@ local bid_listing_config = {
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
@@ -48,10 +50,7 @@ local bid_listing_config = {
icon:SetPoint('LEFT', cell)
icon:SetWidth(12)
icon:SetHeight(12)
- icon:SetNormalTexture('Interface\\Buttons\\UI-Quickslot2')
- icon:SetPushedTexture('Interface\\Buttons\\UI-Quickslot-Depress')
- icon:SetHighlightTexture('Interface\\Buttons\\ButtonHilight-Square')
- icon:SetScript('OnEnter', function() Aux.info.set_game_tooltip(this, cell.tooltip, 'ANCHOR_RIGHT', cell.EnhTooltip_info) end)
+ icon:SetScript('OnEnter', function() Aux.info.set_game_tooltip(this, cell.tooltip, 'ANCHOR_CURSOR', cell.EnhTooltip_info) end)
icon:SetScript('OnLeave', function() GameTooltip:Hide() end)
local text = cell:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
text:SetPoint("LEFT", icon, "RIGHT", 1, 0)
@@ -78,23 +77,6 @@ local bid_listing_config = {
private.auction_alpha_setter(cell, datum)
end,
},
- {
- title = 'Lvl',
- width = 23,
- comparator = function(row1, row2) return Aux.util.compare(row1.level, row2.level, Aux.util.GT) end,
- cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
- cell_setter = function(cell, datum)
- local level = max(1, datum.level)
- local text
- if level > UnitLevel('player') then
- text = RED_FONT_COLOR_CODE..level..FONT_COLOR_CODE_CLOSE
- else
- text = level
- end
- cell.text:SetText(text)
- private.auction_alpha_setter(cell, datum)
- end,
- },
{
title = 'Left',
width = 30,
@@ -125,26 +107,6 @@ local bid_listing_config = {
private.auction_alpha_setter(cell, datum)
end,
},
- {
- title = 'Bid/ea',
- width = 70,
- comparator = function(row1, row2) return Aux.util.compare(row1.bid_per_unit, row2.bid_per_unit, 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.bid_per_unit))
- private.auction_alpha_setter(cell, datum)
- end,
- },
- {
- title = 'Buy/ea',
- width = 70,
- comparator = function(row1, row2) return Aux.util.compare(row1.buyout_price_per_unit, row2.buyout_price_per_unit, 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_per_unit))
- private.auction_alpha_setter(cell, datum)
- end,
- },
{
title = 'Bid',
width = 70,
@@ -169,17 +131,17 @@ local bid_listing_config = {
sort_order = {},
}
-local auction_listing_config = {
- on_cell_click = function (sheet, row_index, column_index)
+public.auction_listing_config = {
+ on_row_click = function (sheet, row_index)
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
AuxBuyEntry_OnClick(sheet.data[data_index])
end,
- on_cell_enter = function (sheet, row_index, column_index)
+ on_row_enter = function (sheet, row_index)
sheet.rows[row_index].highlight:SetAlpha(.5)
end,
- on_cell_leave = function (sheet, row_index, column_index)
+ on_row_leave = function (sheet, row_index)
sheet.rows[row_index].highlight:SetAlpha(0)
end,
columns = {
@@ -199,6 +161,7 @@ local auction_listing_config = {
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
@@ -211,10 +174,7 @@ local auction_listing_config = {
icon:SetPoint('LEFT', cell)
icon:SetWidth(12)
icon:SetHeight(12)
- icon:SetNormalTexture('Interface\\Buttons\\UI-Quickslot2')
- icon:SetPushedTexture('Interface\\Buttons\\UI-Quickslot-Depress')
- icon:SetHighlightTexture('Interface\\Buttons\\ButtonHilight-Square')
- icon:SetScript('OnEnter', function() Aux.info.set_game_tooltip(this, cell.tooltip, 'ANCHOR_RIGHT', cell.EnhTooltip_info) end)
+ icon:SetScript('OnEnter', function() Aux.info.set_game_tooltip(this, cell.tooltip, 'ANCHOR_CURSOR', cell.EnhTooltip_info) end)
icon:SetScript('OnLeave', function() GameTooltip:Hide() end)
local text = cell:CreateFontString(nil, 'OVERLAY', 'GameFontHighlightSmall')
text:SetPoint("LEFT", icon, "RIGHT", 1, 0)
@@ -241,23 +201,6 @@ local auction_listing_config = {
private.auction_alpha_setter(cell, datum)
end,
},
- {
- title = 'Lvl',
- width = 23,
- comparator = function(row1, row2) return Aux.util.compare(row1.level, row2.level, Aux.util.GT) end,
- cell_initializer = Aux.sheet.default_cell_initializer('RIGHT'),
- cell_setter = function(cell, datum)
- local level = max(1, datum.level)
- local text
- if level > UnitLevel('player') then
- text = RED_FONT_COLOR_CODE..level..FONT_COLOR_CODE_CLOSE
- else
- text = level
- end
- cell.text:SetText(text)
- private.auction_alpha_setter(cell, datum)
- end,
- },
{
title = 'Left',
width = 30,
@@ -278,36 +221,6 @@ local auction_listing_config = {
private.auction_alpha_setter(cell, datum)
end,
},
- {
- title = 'Owner',
- width = 70,
- comparator = function(row1, row2) return Aux.util.compare(row1.owner, row2.owner, Aux.util.GT) end,
- cell_initializer = Aux.sheet.default_cell_initializer('LEFT'),
- cell_setter = function(cell, datum)
- cell.text:SetText(datum.owner)
- private.auction_alpha_setter(cell, datum)
- end,
- },
- {
- title = 'Bid/ea',
- width = 70,
- comparator = function(row1, row2) return Aux.util.compare(row1.bid_per_unit, row2.bid_per_unit, 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.bid_per_unit))
- private.auction_alpha_setter(cell, datum)
- end,
- },
- {
- title = 'Buy/ea',
- width = 70,
- comparator = function(row1, row2) return Aux.util.compare(row1.buyout_price_per_unit, row2.buyout_price_per_unit, 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_per_unit))
- private.auction_alpha_setter(cell, datum)
- end,
- },
{
title = 'Bid',
width = 70,
@@ -332,41 +245,39 @@ local auction_listing_config = {
sort_order = {},
}
-function on_open()
- Aux.list.populate(AuxManageBidsListing.sheet, {})
- Aux.list.populate(AuxManageAuctionsListing.sheet, {})
+function public.on_open()
+ public.listing = public.listing or BIDS
- update_bid_records(function()
- update_auction_records(function()
- end)
- end)
+ if public.listing == BIDS then
+ public.update_bid_records()
+ elseif public.listing == AUCTIONS then
+ public.update_auction_records()
+ end
+
+ public.update_listing()
end
-function on_close()
+function public.on_close()
end
function private.auction_alpha_setter(cell, auction)
cell:SetAlpha(auction.gone and 0.3 or 1)
end
-function update_bid_records(k)
+function public.update_bid_records()
bid_records = {}
Aux.scan.start{
type = 'bidder',
page = 0,
- on_submit_query = function()
- position = nil
- end,
on_page_loaded = function(page, total_pages)
Aux.log('Scanning bid page '..(page+1)..' out of '..total_pages..' ...')
- position = 'bids#'..page
end,
on_read_auction = function(i)
- create_bid_record(i)
+ private.create_bid_record(i)
end,
on_complete = function()
- Aux.list.populate(AuxManageBidsListing.sheet, bid_records)
- return k()
+ Aux.log('Scan complete: '..getn(bid_records)..' bids found')
+ public.update_listing()
end,
on_abort = function()
end,
@@ -379,24 +290,20 @@ function update_bid_records(k)
}
end
-function update_auction_records(k)
+function public.update_auction_records()
auction_records = {}
Aux.scan.start{
type = 'owner',
page = 0,
- on_submit_query = function()
- position = nil
- end,
on_page_loaded = function(page, total_pages)
Aux.log('Scanning auction page '..(page+1)..' out of '..total_pages..' ...')
- position = 'auctions#'..page
end,
on_read_auction = function(i)
- create_auction_record(i)
+ private.create_auction_record(i)
end,
on_complete = function()
- Aux.list.populate(AuxManageAuctionsListing.sheet, auction_records)
- return k()
+ Aux.log('Scan complete: '..getn(auction_records)..' auctions found')
+ public.update_listing()
end,
on_abort = function()
end,
@@ -409,7 +316,26 @@ function update_auction_records(k)
}
end
-function create_record(auction_item)
+function public.update_listing()
+ AuxManageFrameListingBidListing:Hide()
+ AuxManageFrameListingAuctionListing:Hide()
+
+ for i=1,2 do
+ 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)
+ elseif public.listing == AUCTIONS then
+ AuxManageFrameListingAuctionListing:Show()
+ Aux.list.populate(AuxManageFrameListingAuctionListing.sheet, auction_records)
+ AuxManageFrameListing:SetWidth(AuxManageFrameListingAuctionListing:GetWidth() + 40)
+ end
+end
+
+function private.create_record(auction_item)
local stack_size = auction_item.charges or auction_item.count
local bid = (auction_item.current_bid > 0 and auction_item.current_bid or auction_item.min_bid) + auction_item.min_increment
@@ -450,25 +376,18 @@ function create_record(auction_item)
}
end
-function create_auction_record(index)
+function private.create_auction_record(index)
local auction_item = Aux.info.auction_item(index, 'owner')
if auction_item then
- tinsert(auction_records, create_record(auction_item))
+ tinsert(auction_records, private.create_record(auction_item))
end
end
-function create_bid_record(index)
+function private.create_bid_record(index)
local auction_item = Aux.info.auction_item(index, 'bidder')
if auction_item then
- tinsert(auction_records, create_record(auction_item))
+ tinsert(bid_records, private.create_record(auction_item))
end
end
-Aux.manage_frame = {
- on_open = on_open,
- on_close = on_close,
- bid_listing_config = bid_listing_config,
- auction_listing_config = auction_listing_config,
-}
-
diff --git a/manage_frame.xml b/manage_frame.xml
index e3d18be..b45cffb 100644
--- a/manage_frame.xml
+++ b/manage_frame.xml
@@ -1,18 +1,10 @@
-
-
-
-
-
- Aux.buy.onupdate()
-
-
-
+
-
+
@@ -21,24 +13,61 @@
this:SetBackdropBorderColor(0.4, 0.4, 0.4)
this:SetBackdropColor(0.15, 0.15, 0.15)
- getglobal(this:GetName().."Title"):SetText('Bids')
-
+
+
+
+
+
+
+
+
+
+
+ getglobal(this:GetName().."Text"):SetText('Bids')
+
+
+ Aux.manage_frame.listing = this:GetID()
+ Aux.manage_frame.update_bid_records()
+ Aux.manage_frame.update_listing()
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getglobal(this:GetName().."Text"):SetText('Auctions')
+
+
+ Aux.manage_frame.listing = this:GetID()
+ Aux.manage_frame.update_auction_records()
+ Aux.manage_frame.update_listing()
+
+
+
+
-
+
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, config.columns, sort_order, config.row_setter, config.on_cell_click, config.on_cell_enter, config.on_cell_leave)
+ 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)
-
+
@@ -102,6 +131,83 @@
+
+
+
+
+
+
+
+ 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)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SmallMoneyFrame_OnLoad()
+ MoneyFrame_SetType("STATIC")
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Aux.buy.dialog_action()
+
+
+
+
+
+
+
+
+ Aux.buy.dialog_cancel()
+
+
+
+
+
+
+
@@ -117,83 +223,7 @@
-
-
-
-
-
-
-
- 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_cell_click, config.on_cell_enter, config.on_cell_leave)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- SmallMoneyFrame_OnLoad()
- MoneyFrame_SetType("STATIC")
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Aux.buy.dialog_action()
-
-
-
-
-
-
-
-
- Aux.buy.dialog_cancel()
-
-
-
-
-
-
-
+
diff --git a/post_frame.xml b/post_frame.xml
index 77ddd14..ac1c96b 100644
--- a/post_frame.xml
+++ b/post_frame.xml
@@ -22,7 +22,7 @@
-
+
@@ -251,7 +251,7 @@
-
+
diff --git a/scan.lua b/scan.lua
index 9146195..8ecee65 100644
--- a/scan.lua
+++ b/scan.lua
@@ -21,7 +21,8 @@ function Aux.scan.start(job)
state = {
job = job,
page = job.page
- }
+ }
+
return scan()
end)
end
@@ -49,9 +50,13 @@ function wait_for_results(k)
if state.job.type == 'bidder' then
ok = true
elseif state.job.type == 'owner' then
- Aux.control.on_next_event('AUCTION_OWNED_LIST_UPDATE', function()
+ if state.page == Aux.current_owner_page then
ok = true
- end)
+ else
+ Aux.control.on_next_event('AUCTION_OWNED_LIST_UPDATE', function()
+ ok = true
+ end)
+ end
else
Aux.control.on_next_event('AUCTION_ITEM_LIST_UPDATE', function()
ok = true
@@ -137,7 +142,7 @@ end
function submit_query(k)
if state.page then
controller().wait(function() return state.job.type ~= 'list' or CanSendAuctionQuery() end, function()
- snipe.log('kek')
+
if state.job.on_submit_query then
state.job.on_submit_query()
end