more progress on the new filter tab
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
## Interface: 11200
|
||||
## Title: Aux
|
||||
## Notes: A lightweight addon designed to help manage auctions
|
||||
## SavedVariablesPerCharacter: aux_recently_searched, aux_recent_searches, aux_favorite_searches, aux_bid, aux_view, AUX_AUCTION_DURATION
|
||||
## SavedVariablesPerCharacter: aux_recently_searched, aux_recent_searches, aux_favorite_searches, aux_view, AUX_AUCTION_DURATION
|
||||
## SavedVariables: aux_database, aux_auctionable_items
|
||||
|
||||
slash.lua
|
||||
|
||||
+12
-2
@@ -132,10 +132,20 @@ function public.on_load()
|
||||
btn:Disable()
|
||||
private.cancel_button = btn
|
||||
end
|
||||
do
|
||||
local btn = Aux.gui.button(AuxAuctionsFrame, 16)
|
||||
btn:SetPoint('TOPLEFT', private.cancel_button, 'TOPRIGHT', 5, 0)
|
||||
btn:SetWidth(80)
|
||||
btn:SetHeight(24)
|
||||
btn:SetText('Refresh')
|
||||
btn:SetScript('OnClick', function()
|
||||
public.scan_auctions()
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function public.on_open()
|
||||
public.update_auction_records()
|
||||
public.scan_auctions()
|
||||
refresh = true
|
||||
end
|
||||
|
||||
@@ -143,7 +153,7 @@ function public.on_close()
|
||||
private.clear_selection()
|
||||
end
|
||||
|
||||
function public.update_auction_records()
|
||||
function public.scan_auctions()
|
||||
|
||||
private.status_bar:update_status(0,0)
|
||||
private.status_bar:set_text('Scanning auctions...')
|
||||
|
||||
+12
-2
@@ -147,10 +147,20 @@ function public.on_load()
|
||||
btn:Disable()
|
||||
private.bid_button = btn
|
||||
end
|
||||
do
|
||||
local btn = Aux.gui.button(AuxBidsFrame, 16)
|
||||
btn:SetPoint('TOPLEFT', private.bid_button, 'TOPRIGHT', 5, 0)
|
||||
btn:SetWidth(80)
|
||||
btn:SetHeight(24)
|
||||
btn:SetText('Refresh')
|
||||
btn:SetScript('OnClick', function()
|
||||
public.scan_bids()
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function public.on_open()
|
||||
public.update_bid_records()
|
||||
public.scan_bids()
|
||||
refresh = true
|
||||
end
|
||||
|
||||
@@ -158,7 +168,7 @@ function public.on_close()
|
||||
private.clear_selection()
|
||||
end
|
||||
|
||||
function public.update_bid_records()
|
||||
function public.scan_bids()
|
||||
|
||||
private.status_bar:update_status(0,0)
|
||||
private.status_bar:set_text('Scanning auctions...')
|
||||
|
||||
@@ -62,22 +62,6 @@ function Aux_OnLoad()
|
||||
tab_group.on_select = Aux.on_tab_click
|
||||
Aux.tab_group = tab_group
|
||||
end
|
||||
do
|
||||
local btn = Aux.gui.button(AuxFrame, 12)
|
||||
btn:SetPoint('TOPRIGHT', 0, 0)
|
||||
btn:SetWidth(60)
|
||||
btn:SetHeight(17)
|
||||
btn:SetText('Default UI')
|
||||
btn:SetScript('OnClick',function()
|
||||
if AuctionFrame:IsVisible() then
|
||||
Aux.blizzard_ui_shown = false
|
||||
HideUIPanel(AuctionFrame)
|
||||
else
|
||||
Aux.blizzard_ui_shown = true
|
||||
ShowUIPanel(AuctionFrame)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
do
|
||||
local btn = Aux.gui.button(AuxFrame, 16)
|
||||
@@ -88,6 +72,24 @@ function Aux_OnLoad()
|
||||
btn:SetScript('OnClick',function()
|
||||
HideUIPanel(this:GetParent())
|
||||
end)
|
||||
Aux.close_button = btn
|
||||
end
|
||||
|
||||
do
|
||||
local btn = Aux.gui.button(AuxFrame, 16)
|
||||
btn:SetPoint('RIGHT', Aux.close_button, 'LEFT' , -5, 0)
|
||||
btn:SetWidth(65)
|
||||
btn:SetHeight(24)
|
||||
btn:SetText('Default UI')
|
||||
btn:SetScript('OnClick',function()
|
||||
if AuctionFrame:IsVisible() then
|
||||
Aux.blizzard_ui_shown = false
|
||||
HideUIPanel(AuctionFrame)
|
||||
else
|
||||
Aux.blizzard_ui_shown = true
|
||||
ShowUIPanel(AuctionFrame)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
Aux.item_search_frame.on_load()
|
||||
|
||||
+96
-75
@@ -95,6 +95,9 @@ end
|
||||
function public.on_open()
|
||||
private.update_search_listings()
|
||||
private.update_tab(SAVED)
|
||||
|
||||
AuxFilterSearchFrameResults:SetWidth(985)
|
||||
AuxFrame:SetWidth(991)
|
||||
end
|
||||
|
||||
function public.on_load()
|
||||
@@ -117,7 +120,7 @@ function public.on_load()
|
||||
columns = {
|
||||
{
|
||||
width = 900,
|
||||
comparator = function(filter_string1, filter_string2) return Aux.util.compare(filter_string1, filter_string2, Aux.util.LT) end,
|
||||
comparator = function(filter_string1, filter_string2) return Aux.util.compare(filter_string1, filter_string2, Aux.util.GT) end,
|
||||
cell_initializer = Aux.sheet.default_cell_initializer('LEFT'),
|
||||
cell_setter = function(cell, filter_string)
|
||||
cell.text:SetText(filter_string)
|
||||
@@ -145,7 +148,7 @@ function public.on_load()
|
||||
columns = {
|
||||
{
|
||||
width = 900,
|
||||
comparator = function(filter_string1, filter_string2) return Aux.util.compare(filter_string1, filter_string2, Aux.util.LT) end,
|
||||
comparator = function(filter_string1, filter_string2) return Aux.util.compare(filter_string1, filter_string2, Aux.util.GT) end,
|
||||
cell_initializer = Aux.sheet.default_cell_initializer('LEFT'),
|
||||
cell_setter = function(cell, filter_string)
|
||||
cell.text:SetText(filter_string)
|
||||
@@ -155,7 +158,7 @@ function public.on_load()
|
||||
sort_order = {{ column = 1, order = 'ascending' }},
|
||||
}
|
||||
private.results_config = {
|
||||
frame = AuxFilterSearchFrameResultsBuyListing,
|
||||
frame = AuxFilterSearchFrameResultsListing,
|
||||
on_row_click = function(sheet, row_index)
|
||||
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||
private.on_row_click(sheet.data[data_index], true)
|
||||
@@ -301,7 +304,7 @@ function public.on_load()
|
||||
end
|
||||
do
|
||||
local btn = Aux.gui.button(AuxFilterSearchFrame, 22)
|
||||
btn:SetPoint('TOPRIGHT', -5, -3)
|
||||
btn:SetPoint('TOPRIGHT', -5, -6)
|
||||
btn:SetWidth(60)
|
||||
btn:SetHeight(25)
|
||||
btn:SetText('Search')
|
||||
@@ -310,7 +313,7 @@ function public.on_load()
|
||||
end
|
||||
do
|
||||
local btn = Aux.gui.button(AuxFilterSearchFrame, 22)
|
||||
btn:SetPoint('TOPRIGHT', -5, -3)
|
||||
btn:SetPoint('TOPRIGHT', -5, -6)
|
||||
btn:SetWidth(60)
|
||||
btn:SetHeight(25)
|
||||
btn:SetText('Stop')
|
||||
@@ -320,8 +323,8 @@ function public.on_load()
|
||||
end
|
||||
do
|
||||
local editbox = Aux.gui.editbox(AuxFilterSearchFrame)
|
||||
editbox:SetPoint('TOPLEFT', 5, -3)
|
||||
editbox:SetPoint('TOPRIGHT', private.search_button, 'TOPLEFT', -4, -5)
|
||||
editbox:SetPoint('TOPLEFT', 5, -6)
|
||||
editbox:SetPoint('RIGHT', private.search_button, 'LEFT', -4, 0)
|
||||
editbox:SetWidth(400)
|
||||
editbox:SetHeight(25)
|
||||
-- editbox:SetScript('OnTabPressed', function()
|
||||
@@ -341,13 +344,13 @@ function public.on_load()
|
||||
private.search_box = editbox
|
||||
end
|
||||
do
|
||||
Aux.gui.horizontal_line(AuxFilterSearchFrame, -35)
|
||||
Aux.gui.horizontal_line(AuxFilterSearchFrame, -37)
|
||||
end
|
||||
do
|
||||
local btn = Aux.gui.button(AuxFilterSearchFrame, 18)
|
||||
btn:SetPoint('TOPLEFT', 10, -40)
|
||||
btn:SetWidth(330)
|
||||
btn:SetHeight(24)
|
||||
btn:SetPoint('TOPLEFT', 10, -49)
|
||||
btn:SetWidth(310)
|
||||
btn:SetHeight(22)
|
||||
btn:SetText('Search Results')
|
||||
btn:SetScript('OnClick', function() private.update_tab(RESULTS) end)
|
||||
private.search_results_button = btn
|
||||
@@ -355,8 +358,8 @@ function public.on_load()
|
||||
do
|
||||
local btn = Aux.gui.button(AuxFilterSearchFrame, 18)
|
||||
btn:SetPoint('TOPLEFT', private.search_results_button, 'TOPRIGHT', 5, 0)
|
||||
btn:SetWidth(330)
|
||||
btn:SetHeight(24)
|
||||
btn:SetWidth(310)
|
||||
btn:SetHeight(22)
|
||||
btn:SetText('Saved Searches')
|
||||
btn:SetScript('OnClick', function() private.update_tab(SAVED) end)
|
||||
private.saved_searches_button = btn
|
||||
@@ -364,12 +367,24 @@ function public.on_load()
|
||||
do
|
||||
local btn = Aux.gui.button(AuxFilterSearchFrame, 18)
|
||||
btn:SetPoint('TOPLEFT', private.saved_searches_button, 'TOPRIGHT', 5, 0)
|
||||
btn:SetWidth(330)
|
||||
btn:SetHeight(24)
|
||||
btn:SetWidth(310)
|
||||
btn:SetHeight(22)
|
||||
btn:SetText('New Filter')
|
||||
btn:SetScript('OnClick', function() private.update_tab(FILTER) end)
|
||||
private.new_filter_button = btn
|
||||
end
|
||||
do
|
||||
local line = Aux.gui.horizontal_line(AuxFilterSearchFrameSavedRecent, -25)
|
||||
local label = Aux.gui.label(AuxFilterSearchFrameSavedRecent, 13)
|
||||
label:SetPoint('BOTTOM', line, 'TOP', 0, 5)
|
||||
label:SetText('Recent Searches')
|
||||
end
|
||||
do
|
||||
local line = Aux.gui.horizontal_line(AuxFilterSearchFrameSavedFavorite, -25)
|
||||
local label = Aux.gui.label(AuxFilterSearchFrameSavedFavorite, 13)
|
||||
label:SetPoint('BOTTOM', line, 'TOP', 0, 5)
|
||||
label:SetText('Favorite Searches')
|
||||
end
|
||||
do
|
||||
local editbox = Aux.gui.editbox(private.elements[FILTER].item_filter)
|
||||
local function add_item_filter(item_id)
|
||||
@@ -489,14 +504,32 @@ function public.on_load()
|
||||
label:SetText('Name')
|
||||
end
|
||||
do
|
||||
local label = Aux.gui.label(AuxFilterSearchFrameFiltersCategoryDropDown, 13)
|
||||
label:SetPoint('BOTTOMLEFT', AuxFilterSearchFrameFiltersCategoryDropDown, 'TOPLEFT', -2, -4)
|
||||
local dropdown = Aux.gui.dropdown(private.elements[FILTER].filters)
|
||||
dropdown:SetPoint('TOPLEFT', 14, -53)
|
||||
dropdown:SetWidth(250)
|
||||
dropdown:SetHeight(10)
|
||||
local label = Aux.gui.label(dropdown, 13)
|
||||
label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -4)
|
||||
label:SetText('Category')
|
||||
private.category_dropdown = dropdown
|
||||
UIDropDownMenu_Initialize(dropdown, AuxFilterSearchFrameFiltersCategoryDropDown_Initialize)
|
||||
dropdown:SetScript('OnShow', function()
|
||||
UIDropDownMenu_Initialize(this, AuxFilterSearchFrameFiltersQualityDropDown_Initialize)
|
||||
end)
|
||||
end
|
||||
do
|
||||
local label = Aux.gui.label(AuxFilterSearchFrameFiltersQualityDropDown, 13)
|
||||
label:SetPoint('BOTTOMLEFT', AuxFilterSearchFrameFiltersQualityDropDown, 'TOPLEFT', -2, -4)
|
||||
label:SetText('Rarity')
|
||||
local dropdown = Aux.gui.dropdown(private.elements[FILTER].filters)
|
||||
dropdown:SetPoint('TOPLEFT', 14, -93)
|
||||
dropdown:SetWidth(250)
|
||||
dropdown:SetHeight(10)
|
||||
local label = Aux.gui.label(dropdown, 13)
|
||||
label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -4)
|
||||
label:SetText('Min Rarity')
|
||||
private.quality_dropdown = dropdown
|
||||
UIDropDownMenu_Initialize(dropdown, AuxFilterSearchFrameFiltersQualityDropDown_Initialize)
|
||||
dropdown:SetScript('OnShow', function()
|
||||
UIDropDownMenu_Initialize(this, AuxFilterSearchFrameFiltersQualityDropDown_Initialize)
|
||||
end)
|
||||
end
|
||||
do
|
||||
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentMinLevel')
|
||||
@@ -634,28 +667,29 @@ function public.on_load()
|
||||
-- TODO replace with real gui dropdown
|
||||
-- CreateFrame('Frame', '$parentCategoryDropDown', AuxFilterSearchFrameFilters, 'UIDropDownMenuTemplate')
|
||||
-- local dropdown = CreateFrame('Frame', '$parentQualityDropDown', AuxFilterSearchFrameFilters, 'UIDropDownMenuTemplate')
|
||||
for _, dropdown in ipairs({AuxFilterSearchFrameFiltersCategoryDropDown, AuxFilterSearchFrameFiltersQualityDropDown}) do
|
||||
dropdown:SetWidth(250)
|
||||
dropdown:SetHeight(10)
|
||||
dropdown:SetBackdrop({bgFile='Interface\\Buttons\\WHITE8X8', edgeFile='Interface\\Buttons\\WHITE8X8', edgeSize=Aux.gui.config.edge_size, insets={top=5,bottom=5}})
|
||||
dropdown:SetBackdropColor(unpack(Aux.gui.config.content_color))
|
||||
dropdown:SetBackdropBorderColor(unpack(Aux.gui.config.content_border_color))
|
||||
local left = getglobal(dropdown:GetName()..'Left'):Hide()
|
||||
local middle = getglobal(dropdown:GetName()..'Middle'):Hide()
|
||||
local right = getglobal(dropdown:GetName()..'Right'):Hide()
|
||||
|
||||
local button = getglobal(dropdown:GetName()..'Button')
|
||||
-- button:RegisterForClicks('AnyUp')
|
||||
button:ClearAllPoints()
|
||||
button:SetPoint('RIGHT', dropdown, 0, 0)
|
||||
|
||||
local text = getglobal(dropdown:GetName()..'Text')
|
||||
text:ClearAllPoints()
|
||||
text:SetPoint('RIGHT', button, 'LEFT', -2, 0)
|
||||
text:SetPoint('LEFT', dropdown, 'LEFT', 8, 0)
|
||||
text:SetFont(Aux.gui.config.content_font, 13)
|
||||
text:SetShadowColor(0, 0, 0, 0)
|
||||
end
|
||||
-- for _, dropdown in ipairs({AuxFilterSearchFrameFiltersCategoryDropDown, AuxFilterSearchFrameFiltersQualityDropDown}) do
|
||||
-- dropdown:SetWidth(250)
|
||||
-- dropdown:SetHeight(10)
|
||||
-- dropdown:SetBackdrop({bgFile='Interface\\Buttons\\WHITE8X8', edgeFile='Interface\\Buttons\\WHITE8X8', edgeSize=Aux.gui.config.edge_size, insets={top=5,bottom=5}})
|
||||
-- dropdown:SetBackdropColor(unpack(Aux.gui.config.content_color))
|
||||
-- dropdown:SetBackdropBorderColor(unpack(Aux.gui.config.content_border_color))
|
||||
-- local left = getglobal(dropdown:GetName()..'Left'):Hide()
|
||||
-- local middle = getglobal(dropdown:GetName()..'Middle'):Hide()
|
||||
-- local right = getglobal(dropdown:GetName()..'Right'):Hide()
|
||||
--
|
||||
-- local button = getglobal(dropdown:GetName()..'Button')
|
||||
---- button:RegisterForClicks('AnyUp')
|
||||
-- button:ClearAllPoints()
|
||||
-- button:SetPoint('RIGHT', dropdown, 0, 0)
|
||||
--
|
||||
-- local text = getglobal(dropdown:GetName()..'Text')
|
||||
-- text:ClearAllPoints()
|
||||
-- text:SetPoint('RIGHT', button, 'LEFT', -2, 0)
|
||||
-- text:SetPoint('LEFT', dropdown, 'LEFT', 8, 0)
|
||||
-- text:SetFont(Aux.gui.config.content_font, 13)
|
||||
-- text:SetShadowColor(0, 0, 0, 0)
|
||||
-- end
|
||||
end
|
||||
|
||||
function public.stop_search()
|
||||
@@ -668,11 +702,6 @@ function private.update_listing()
|
||||
return
|
||||
end
|
||||
|
||||
AuxFilterSearchFrameResultsBuyListing:Hide()
|
||||
AuxFilterSearchFrameResultsBidListing:Hide()
|
||||
AuxFilterSearchFrameResultsFullListing:Hide()
|
||||
|
||||
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.sheet.populate(private.listings.results, auctions and Aux.util.group_by(buyout_auctions, function(a1, a2)
|
||||
return a1.item_id == a2.item_id
|
||||
@@ -683,34 +712,12 @@ function private.update_listing()
|
||||
and a1.bid_price == a2.bid_price
|
||||
and a1.owner == a2.owner
|
||||
end) or {})
|
||||
AuxFilterSearchFrameResults:SetWidth(AuxFilterSearchFrameResultsBuyListing:GetWidth() + 40)
|
||||
AuxFrame:SetWidth(AuxFilterSearchFrameResults:GetWidth() + 15)
|
||||
end
|
||||
|
||||
function public.start_search()
|
||||
|
||||
tinsert(aux_recent_searches, 1, private.search_box:GetText())
|
||||
while getn(aux_recent_searches) > 50 do
|
||||
tremove(aux_recent_searches)
|
||||
end
|
||||
private.update_search_listings()
|
||||
|
||||
Aux.scan.abort(function()
|
||||
|
||||
private.update_tab(RESULTS)
|
||||
|
||||
private.clear_selection()
|
||||
|
||||
private.status_bar:update_status(0,0)
|
||||
private.status_bar:set_text('Scanning auctions...')
|
||||
|
||||
private.search_button:Hide()
|
||||
private.stop_button:Show()
|
||||
|
||||
auctions = nil
|
||||
|
||||
refresh = true
|
||||
|
||||
local tooltip_patterns = {}
|
||||
for i=1,4 do
|
||||
local tooltip_pattern = getglobal('AuxFilterSearchFrameFiltersTooltipInputBox'..i):GetText()
|
||||
@@ -719,8 +726,6 @@ function public.start_search()
|
||||
end
|
||||
end
|
||||
|
||||
local group = Aux.groups.parse_group(Aux.groups.test_group)
|
||||
|
||||
local queries
|
||||
|
||||
-- queries = { private.create_filter_query() }
|
||||
@@ -738,6 +743,22 @@ function public.start_search()
|
||||
return
|
||||
end
|
||||
|
||||
tinsert(aux_recent_searches, 1, private.search_box:GetText())
|
||||
while getn(aux_recent_searches) > 50 do
|
||||
tremove(aux_recent_searches)
|
||||
end
|
||||
private.update_search_listings()
|
||||
|
||||
private.clear_selection()
|
||||
private.search_button:Hide()
|
||||
private.stop_button:Show()
|
||||
auctions = nil
|
||||
refresh = true
|
||||
|
||||
private.update_tab(RESULTS)
|
||||
|
||||
private.status_bar:update_status(0,0)
|
||||
private.status_bar:set_text('Scanning auctions...')
|
||||
|
||||
Aux.scan.start{
|
||||
queries = queries,
|
||||
@@ -857,7 +878,7 @@ end
|
||||
function private.create_auction_record(auction_info)
|
||||
|
||||
local buyout_price = auction_info.buyout_price > 0 and auction_info.buyout_price or nil
|
||||
local unit_buyout_price = buyout_price and Aux.round(auction_info.buyout_price / auction_info.aux_quantity)
|
||||
local unit_buyout_price = buyout_price and auction_info.buyout_price / auction_info.aux_quantity
|
||||
local status
|
||||
if auction_info.current_bid == 0 then
|
||||
status = 'No Bid'
|
||||
@@ -889,7 +910,7 @@ function private.create_auction_record(auction_info)
|
||||
hyperlink = auction_info.hyperlink,
|
||||
itemstring = auction_info.itemstring,
|
||||
bid_price = auction_info.bid_price,
|
||||
unit_bid_price = Aux.round(auction_info.bid_price / auction_info.aux_quantity),
|
||||
unit_bid_price = auction_info.bid_price / auction_info.aux_quantity,
|
||||
owner = auction_info.owner,
|
||||
duration = auction_info.duration,
|
||||
usable = auction_info.usable,
|
||||
@@ -967,15 +988,15 @@ function AuxFilterSearchFrameFiltersCategoryDropDown_OnClick()
|
||||
end
|
||||
end
|
||||
|
||||
UIDropDownMenu_SetSelectedValue(AuxFilterSearchFrameFiltersCategoryDropDown, this.value)
|
||||
UIDropDownMenu_SetText(qualified_name, AuxFilterSearchFrameFiltersCategoryDropDown)
|
||||
UIDropDownMenu_SetSelectedValue(private.category_dropdown, this.value)
|
||||
UIDropDownMenu_SetText(qualified_name, private.category_dropdown)
|
||||
CloseDropDownMenus(1)
|
||||
end
|
||||
|
||||
function AuxFilterSearchFrameFiltersQualityDropDown_Initialize()
|
||||
|
||||
local function on_click()
|
||||
UIDropDownMenu_SetSelectedValue(AuxFilterSearchFrameFiltersQualityDropDown, this.value)
|
||||
UIDropDownMenu_SetSelectedValue(private.quality_dropdown, this.value)
|
||||
end
|
||||
|
||||
UIDropDownMenu_AddButton{
|
||||
|
||||
+28
-51
@@ -12,39 +12,15 @@
|
||||
|
||||
<Frame name="AuxFilterSearchFrame" hidden="true" parent="AuxFrame" setAllPoints="true">
|
||||
<Frames>
|
||||
<Frame name="$parentFilters" inherits="AuxFrameBoxTemplate">
|
||||
<Frame name="$parentFilters">
|
||||
<Size><AbsDimension x="600" y="290"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="5" y="-70"/></Offset></Anchor></Anchors>
|
||||
|
||||
<Frames>
|
||||
<Frame name="$parentCategoryDropDown" inherits="UIDropDownMenuTemplate">
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="14" y="-53" /></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
UIDropDownMenu_Initialize(this, AuxFilterSearchFrameFiltersCategoryDropDown_Initialize)
|
||||
</OnLoad>
|
||||
<OnShow>
|
||||
UIDropDownMenu_Initialize(this, AuxFilterSearchFrameFiltersCategoryDropDown_Initialize)
|
||||
</OnShow>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
|
||||
<Frame name="$parentQualityDropDown" inherits="UIDropDownMenuTemplate">
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="14" y="-93" /></Offset></Anchor></Anchors>
|
||||
<Scripts>
|
||||
<OnLoad>
|
||||
UIDropDownMenu_Initialize(this, AuxFilterSearchFrameFiltersQualityDropDown_Initialize)
|
||||
</OnLoad>
|
||||
<OnShow>
|
||||
UIDropDownMenu_Initialize(this, AuxFilterSearchFrameFiltersQualityDropDown_Initialize)
|
||||
</OnShow>
|
||||
</Scripts>
|
||||
</Frame>
|
||||
<CheckButton name="$parentUsableCheckButton" inherits="UICheckButtonTemplate">
|
||||
<CheckButton name="$parentUsableCheckButton" inherits="UICheckButtonTemplate" hidden="true">
|
||||
<Size><AbsDimension x="22" y="22"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="87" y="-136" /></Offset></Anchor></Anchors>
|
||||
</CheckButton>
|
||||
<CheckButton name="$parentExactCheckButton" inherits="UICheckButtonTemplate">
|
||||
<CheckButton name="$parentExactCheckButton" inherits="UICheckButtonTemplate" hidden="true">
|
||||
<Size><AbsDimension x="22" y="22"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="120" y="-136" /></Offset></Anchor></Anchors>
|
||||
</CheckButton>
|
||||
@@ -52,41 +28,42 @@
|
||||
</Frame>
|
||||
<Frame name="$parentResults" inherits="AuxFrameBoxTemplate">
|
||||
<Size>
|
||||
<AbsDimension x="655" y="300"/>
|
||||
<AbsDimension x="655" y="278"/>
|
||||
</Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="3" y="-65"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="3" y="-82"/></Offset></Anchor></Anchors>
|
||||
<Frames>
|
||||
<Frame name="$parentBuyListing" hidden="true">
|
||||
<Frame name="$parentListing">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOM"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
</Frame>
|
||||
<Frame name="$parentBidListing" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOM"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
</Frame>
|
||||
<Frame name="$parentFullListing" hidden="true">
|
||||
<Anchors>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOM"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
|
||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="-8" y="5"/></Offset></Anchor>
|
||||
<Anchor point="BOTTOM"><Offset><AbsDimension x="-8" y="-15"/></Offset></Anchor>
|
||||
</Anchors>
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Frame>
|
||||
<Frame name="$parentSaved">
|
||||
<Size><AbsDimension x="655" y="400"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="3" y="-65"/></Offset></Anchor></Anchors>
|
||||
<Size><AbsDimension x="900" y="380"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="3" y="-82"/></Offset></Anchor></Anchors>
|
||||
<Frames>
|
||||
<Frame name="$parentRecentListing" inherits="AuxFrameBoxTemplate">
|
||||
<Size><AbsDimension x="0" y="150"/></Size>
|
||||
<Frame name="$parentRecent" inherits="AuxFrameBoxTemplate">
|
||||
<Size><AbsDimension x="950" y="134"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
<Anchors><Anchor point="TOPRIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
<Frames>
|
||||
<Frame name="$parentListing">
|
||||
<Size><AbsDimension x="0" y="130"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-10" y="-20"/></Offset></Anchor></Anchors>
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Frame>
|
||||
<Frame name="$parentFavoriteListing" inherits="AuxFrameBoxTemplate">
|
||||
<Size><AbsDimension x="0" y="150"/></Size>
|
||||
<Anchors><Anchor point="TOP" relativeTo="$parentRecentListing" relativePoint="BOTTOM"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||
<Frame name="$parentFavorite" inherits="AuxFrameBoxTemplate">
|
||||
<Size><AbsDimension x="950" y="134"/></Size>
|
||||
<Anchors><Anchor point="TOP" relativeTo="$parentRecent" relativePoint="BOTTOM"><Offset><AbsDimension x="0" y="-5"/></Offset></Anchor></Anchors>
|
||||
<Frames>
|
||||
<Frame name="$parentListing">
|
||||
<Size><AbsDimension x="0" y="130"/></Size>
|
||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-10" y="-20"/></Offset></Anchor></Anchors>
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Frame>
|
||||
</Frames>
|
||||
</Frame>
|
||||
|
||||
+13
@@ -17,4 +17,17 @@ m.test_group = '13127;9510;4438;16254;12006;13131;13012;4413;1482'
|
||||
function m.test()
|
||||
local array = Aux.persistence.deserialize(';', ';')
|
||||
snipe.log(getn(array))
|
||||
end
|
||||
|
||||
function on_char()
|
||||
for _, data in ipairs(TSM.db.global.savedSearches) do
|
||||
if data.searchMode == "normal" then
|
||||
local prevSearch = strlower(data.filter)
|
||||
if strsub(prevSearch, 1, textLen) == text then
|
||||
self:SetText(prevSearch)
|
||||
self:HighlightText(textLen, -1)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -370,80 +370,101 @@ function m.vertical_line(parent, x_offset, inverted_color)
|
||||
return texture
|
||||
end
|
||||
|
||||
function m.dropdown()
|
||||
local count = AceGUI:GetNextWidgetNum(Type)
|
||||
do
|
||||
local id = 0
|
||||
function m.dropdown(parent)
|
||||
id = id + 1
|
||||
|
||||
local frame = CreateFrame("Frame", nil, UIParent)
|
||||
local dropdown = CreateFrame("Frame", "TSMDropDown"..count, frame, "UIDropDownMenuTemplate")
|
||||
-- local frame = CreateFrame("Frame", nil, UIParent)
|
||||
local dropdown = CreateFrame('Frame', 'aux_dropdown'..id, parent, 'UIDropDownMenuTemplate')
|
||||
|
||||
frame:SetScript("OnHide", Dropdown_OnHide)
|
||||
dropdown:SetBackdrop({bgFile='Interface\\Buttons\\WHITE8X8', edgeFile='Interface\\Buttons\\WHITE8X8', edgeSize=Aux.gui.config.edge_size, insets={top=5,bottom=5}})
|
||||
dropdown:SetBackdropColor(unpack(Aux.gui.config.content_color))
|
||||
dropdown:SetBackdropBorderColor(unpack(Aux.gui.config.content_border_color))
|
||||
local left = getglobal(dropdown:GetName()..'Left'):Hide()
|
||||
local middle = getglobal(dropdown:GetName()..'Middle'):Hide()
|
||||
local right = getglobal(dropdown:GetName()..'Right'):Hide()
|
||||
|
||||
dropdown:ClearAllPoints()
|
||||
dropdown:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -7, 0)
|
||||
dropdown:SetScript("OnHide", nil)
|
||||
dropdown:SetScript("OnEnter", Control_OnEnter)
|
||||
dropdown:SetScript("OnLeave", Control_OnLeave)
|
||||
dropdown:SetScript("OnMouseUp", function(self, button) Dropdown_TogglePullout(self.obj.button, button) end)
|
||||
TSMAPI.Design:SetContentColor(dropdown)
|
||||
local button = getglobal(dropdown:GetName()..'Button')
|
||||
button:ClearAllPoints()
|
||||
button:SetPoint('RIGHT', dropdown, 0, 0)
|
||||
|
||||
local left = _G[dropdown:GetName().."Left"]
|
||||
local middle = _G[dropdown:GetName().."Middle"]
|
||||
local right = _G[dropdown:GetName().."Right"]
|
||||
local text = getglobal(dropdown:GetName()..'Text')
|
||||
text:ClearAllPoints()
|
||||
text:SetPoint('RIGHT', button, 'LEFT', -2, 0)
|
||||
text:SetPoint('LEFT', dropdown, 'LEFT', 8, 0)
|
||||
text:SetFont(Aux.gui.config.content_font, 13)
|
||||
text:SetShadowColor(0, 0, 0, 0)
|
||||
|
||||
middle:ClearAllPoints()
|
||||
right:ClearAllPoints()
|
||||
-- frame:SetScript("OnHide", Dropdown_OnHide)
|
||||
--
|
||||
-- dropdown:ClearAllPoints()
|
||||
-- dropdown:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -7, 0)
|
||||
-- dropdown:SetScript("OnHide", nil)
|
||||
-- dropdown:SetScript("OnEnter", Control_OnEnter)
|
||||
-- dropdown:SetScript("OnLeave", Control_OnLeave)
|
||||
-- dropdown:SetScript("OnMouseUp", function(self, button) Dropdown_TogglePullout(self.obj.button, button) end)
|
||||
-- TSMAPI.Design:SetContentColor(dropdown)
|
||||
--
|
||||
-- local left = _G[dropdown:GetName().."Left"]
|
||||
-- local middle = _G[dropdown:GetName().."Middle"]
|
||||
-- local right = _G[dropdown:GetName().."Right"]
|
||||
--
|
||||
-- middle:ClearAllPoints()
|
||||
-- right:ClearAllPoints()
|
||||
--
|
||||
-- middle:SetPoint("LEFT", left, "RIGHT", 0, 0)
|
||||
-- middle:SetPoint("RIGHT", right, "LEFT", 0, 0)
|
||||
-- right:SetPoint("TOPRIGHT", dropdown, "TOPRIGHT", 0, 17)
|
||||
--
|
||||
-- local button = _G[dropdown:GetName().."Button"]
|
||||
-- button:RegisterForClicks("AnyUp")
|
||||
-- button:SetScript("OnEnter", Control_OnEnter)
|
||||
-- button:SetScript("OnLeave", Control_OnLeave)
|
||||
-- button:SetScript("OnClick", Dropdown_TogglePullout)
|
||||
-- button:ClearAllPoints()
|
||||
-- button:SetPoint("RIGHT", dropdown, 0, 0)
|
||||
--
|
||||
-- local text = _G[dropdown:GetName().."Text"]
|
||||
-- text:ClearAllPoints()
|
||||
-- text:SetPoint("RIGHT", button, "LEFT", -2, 0)
|
||||
-- text:SetPoint("LEFT", dropdown, "LEFT", 8, 0)
|
||||
-- text:SetFont(TSMAPI.Design:GetContentFont("normal"))
|
||||
-- text:SetShadowColor(0, 0, 0, 0)
|
||||
--
|
||||
-- local label = frame:CreateFontString(nil, "OVERLAY")
|
||||
-- label:SetPoint("TOPLEFT", frame, "TOPLEFT", 0, 0)
|
||||
-- label:SetPoint("TOPRIGHT", frame, "TOPRIGHT", 0, 0)
|
||||
-- label:SetJustifyH("LEFT")
|
||||
-- label:SetHeight(18)
|
||||
-- label:SetFont(TSMAPI.Design:GetContentFont("small"))
|
||||
-- label:SetShadowColor(0, 0, 0, 0)
|
||||
-- label:Hide()
|
||||
--
|
||||
-- left:Hide()
|
||||
-- middle:Hide()
|
||||
-- right:Hide()
|
||||
--
|
||||
-- local widget = {
|
||||
-- frame = frame,
|
||||
-- label = label,
|
||||
-- dropdown = dropdown,
|
||||
-- text = text,
|
||||
-- button = button,
|
||||
-- count = count,
|
||||
-- alignoffset = 30,
|
||||
-- type = Type,
|
||||
-- }
|
||||
-- for method, func in pairs(methods) do
|
||||
-- widget[method] = func
|
||||
-- end
|
||||
-- frame.obj = widget
|
||||
-- dropdown.obj = widget
|
||||
-- text.obj = widget
|
||||
-- button.obj = widget
|
||||
|
||||
middle:SetPoint("LEFT", left, "RIGHT", 0, 0)
|
||||
middle:SetPoint("RIGHT", right, "LEFT", 0, 0)
|
||||
right:SetPoint("TOPRIGHT", dropdown, "TOPRIGHT", 0, 17)
|
||||
|
||||
local button = _G[dropdown:GetName().."Button"]
|
||||
button:RegisterForClicks("AnyUp")
|
||||
button:SetScript("OnEnter", Control_OnEnter)
|
||||
button:SetScript("OnLeave", Control_OnLeave)
|
||||
button:SetScript("OnClick", Dropdown_TogglePullout)
|
||||
button:ClearAllPoints()
|
||||
button:SetPoint("RIGHT", dropdown, 0, 0)
|
||||
|
||||
local text = _G[dropdown:GetName().."Text"]
|
||||
text:ClearAllPoints()
|
||||
text:SetPoint("RIGHT", button, "LEFT", -2, 0)
|
||||
text:SetPoint("LEFT", dropdown, "LEFT", 8, 0)
|
||||
text:SetFont(TSMAPI.Design:GetContentFont("normal"))
|
||||
text:SetShadowColor(0, 0, 0, 0)
|
||||
|
||||
local label = frame:CreateFontString(nil, "OVERLAY")
|
||||
label:SetPoint("TOPLEFT", frame, "TOPLEFT", 0, 0)
|
||||
label:SetPoint("TOPRIGHT", frame, "TOPRIGHT", 0, 0)
|
||||
label:SetJustifyH("LEFT")
|
||||
label:SetHeight(18)
|
||||
label:SetFont(TSMAPI.Design:GetContentFont("small"))
|
||||
label:SetShadowColor(0, 0, 0, 0)
|
||||
label:Hide()
|
||||
|
||||
left:Hide()
|
||||
middle:Hide()
|
||||
right:Hide()
|
||||
|
||||
local widget = {
|
||||
frame = frame,
|
||||
label = label,
|
||||
dropdown = dropdown,
|
||||
text = text,
|
||||
button = button,
|
||||
count = count,
|
||||
alignoffset = 30,
|
||||
type = Type,
|
||||
}
|
||||
for method, func in pairs(methods) do
|
||||
widget[method] = func
|
||||
return dropdown
|
||||
end
|
||||
frame.obj = widget
|
||||
dropdown.obj = widget
|
||||
text.obj = widget
|
||||
button.obj = widget
|
||||
|
||||
return AceGUI:RegisterAsWidget(widget)
|
||||
end
|
||||
|
||||
function m.slider(frame, name)
|
||||
@@ -533,4 +554,43 @@ function m.slider(frame, name)
|
||||
slider.label = label
|
||||
slider.editbox = editbox
|
||||
return slider
|
||||
end
|
||||
end
|
||||
|
||||
--function m.checkbox()
|
||||
-- local frame = CreateFrame('Button', nil, UIParent)
|
||||
-- frame:Hide()
|
||||
-- frame:EnableMouse(true)
|
||||
-- frame:SetScript("OnEnter", Control_OnEnter)
|
||||
-- frame:SetScript("OnLeave", Control_OnLeave)
|
||||
-- frame:SetScript("OnMouseDown", CheckBox_OnMouseDown)
|
||||
-- frame:SetScript("OnMouseUp", CheckBox_OnMouseUp)
|
||||
--
|
||||
-- local checkbox = CreateFrame('Button', nil, frame)
|
||||
-- checkbox:EnableMouse(false)
|
||||
-- checkbox:SetWidth(16)
|
||||
-- checkbox:SetHeight(16)
|
||||
-- checkbox:SetPoint('TOPLEFT', 4, -4)
|
||||
-- checkbox:SetBackdrop({ bgFile='Interface\\Buttons\\WHITE8X8', edgeFile='Interface\\Buttons\\WHITE8X8', edgeSize=m.config.edge_size })
|
||||
-- checkbox:SetBackdropColor(unpack(m.config.content_color))
|
||||
-- checkbox:SetBackdropBorderColor(unpack(m.config.content_border_color))
|
||||
-- local highlight = checkbox:CreateTexture(nil, 'HIGHLIGHT')
|
||||
-- highlight:SetAllPoints()
|
||||
-- highlight:SetTexture(1, 1, 1, .2)
|
||||
-- highlight:SetBlendMode('BLEND')
|
||||
--
|
||||
-- local check = checkbox:CreateTexture(nil, 'OVERLAY')
|
||||
-- check:SetTexture([[Interface\Buttons\UI-CheckBox-Check]])
|
||||
-- check:SetTexCoord(.12, .88, .12, .88)
|
||||
-- check:SetBlendMode('BLEND')
|
||||
-- check:SetPoint('BOTTOMRIGHT')
|
||||
--
|
||||
-- local text = frame:CreateFontString(nil, 'OVERLAY')
|
||||
-- text:SetJustifyH('LEFT')
|
||||
-- text:SetHeight(18)
|
||||
-- text:SetPoint('LEFT', checkbox, 'RIGHT')
|
||||
-- text:SetPoint('RIGHT')
|
||||
-- text:SetFont(m.config.content_font, m.config.normal_font_size)
|
||||
--
|
||||
-- checkbox.text = text
|
||||
-- return checkbox
|
||||
--end
|
||||
@@ -462,7 +462,7 @@ end
|
||||
function private.create_auction_record(auction_info)
|
||||
|
||||
local buyout_price = auction_info.buyout_price > 0 and auction_info.buyout_price or nil
|
||||
local unit_buyout_price = buyout_price and Aux.round(auction_info.buyout_price / auction_info.aux_quantity)
|
||||
local unit_buyout_price = buyout_price and auction_info.buyout_price / auction_info.aux_quantity
|
||||
local status
|
||||
if auction_info.current_bid == 0 then
|
||||
status = 'No Bid'
|
||||
@@ -492,7 +492,7 @@ function private.create_auction_record(auction_info)
|
||||
quality = auction_info.quality,
|
||||
hyperlink = auction_info.hyperlink,
|
||||
bid_price = auction_info.bid_price,
|
||||
unit_bid_price = Aux.round(auction_info.bid_price / auction_info.aux_quantity),
|
||||
unit_bid_price = auction_info.bid_price / auction_info.aux_quantity,
|
||||
owner = auction_info.owner,
|
||||
duration = auction_info.duration,
|
||||
usable = auction_info.usable,
|
||||
|
||||
+16
-17
@@ -55,13 +55,13 @@ function m.create_item_filter(item_id)
|
||||
local subclass_index = class_index and Aux.item_subclass_index(class_index, item_info.subclass)
|
||||
|
||||
return {
|
||||
exact_only = true,
|
||||
name = item_info.name,
|
||||
min_level = item_info.level,
|
||||
min_level = item_info.level,
|
||||
slot = item_info.slot,
|
||||
class = class_index,
|
||||
subclass = subclass_index,
|
||||
subclass = item_info.subclass,
|
||||
quality = item_info.quality,
|
||||
usable = item_info.usable,
|
||||
}
|
||||
@@ -87,22 +87,17 @@ function m.parse_filter_string(filter_string)
|
||||
local filters = {}
|
||||
for _, str in ipairs(parts) do
|
||||
str = Aux.util.trim(str)
|
||||
-- if tonumber(str) then
|
||||
-- local filter = m.create_item_filter(tonumber(str))
|
||||
-- if filter then
|
||||
-- tinsert(filters, filter)
|
||||
-- end
|
||||
-- else
|
||||
|
||||
local filter, error = m.filter_from_string(str)
|
||||
|
||||
if not filter then
|
||||
Aux.log('Invalid filter: '..error)
|
||||
return
|
||||
elseif filter.name and strlen(filter.name) > 63 then
|
||||
|
||||
else
|
||||
tinsert(filters, filter)
|
||||
end
|
||||
-- end
|
||||
end
|
||||
|
||||
return filters
|
||||
@@ -159,8 +154,12 @@ function m.filter_from_string(filter_term)
|
||||
else
|
||||
return false, 'Invalid Even Only Filter'
|
||||
end
|
||||
-- elseif Aux.money.from_string(str) then
|
||||
-- filter.min_profit = Aux.money.from_string(str)
|
||||
elseif Aux.money.from_string(str) > 0 then
|
||||
if not filter.max_price then
|
||||
filter.max_price = Aux.money.from_string(str)
|
||||
else
|
||||
return false, 'Invalid Max Price Filter'
|
||||
end
|
||||
elseif i == 1 then
|
||||
filter.name = str
|
||||
else
|
||||
@@ -174,7 +173,9 @@ function m.filter_from_string(filter_term)
|
||||
end
|
||||
for id, info in pairs(Aux.static.auctionable_items) do
|
||||
if info.name == filter.name then
|
||||
return m.create_item_filter(id)
|
||||
local item_filter = m.create_item_filter(id)
|
||||
item_filter.even_only = filter.even_only
|
||||
return item_filter
|
||||
end
|
||||
end
|
||||
return false, 'Invalid Exact Only Filter'
|
||||
@@ -237,23 +238,21 @@ end
|
||||
function m.validator(filter)
|
||||
|
||||
return function(record)
|
||||
|
||||
if filter.exact_only and record.name ~= filter.name then
|
||||
return
|
||||
end
|
||||
|
||||
if filter.even_only and rem(record.aux_quantity, 5) ~= 0 then
|
||||
if filter.even_only and mod(record.aux_quantity, 5) ~= 0 then
|
||||
return
|
||||
end
|
||||
|
||||
if filter.min_level and record.level < filter.min_level then
|
||||
return
|
||||
end
|
||||
|
||||
if filter.max_level and record.level > filter.max_level then
|
||||
return
|
||||
end
|
||||
|
||||
if filter.max_price and record.buyout_price > filter.max_price then
|
||||
return
|
||||
end
|
||||
return true
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user