more progress on the filter tab
This commit is contained in:
+1
-1
@@ -51,7 +51,7 @@ function generate_suggestions(input)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return Aux.util.map(best, function(match) return { text=match.name, display_text='|c'..Aux_QualityColor(Aux.static.item_info(match.id).quality)..'['..match.name..']'..'|r', value=match.id } end)
|
return Aux.util.map(best, function(match) return { text=match.name, display_text='|c'..Aux.quality_color(Aux.static.item_info(match.id).quality)..'['..match.name..']'..'|r', value=match.id } end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function public.completor(edit_box)
|
function public.completor(edit_box)
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ Aux = {
|
|||||||
blizzard_ui_shown = false,
|
blizzard_ui_shown = false,
|
||||||
loaded = false,
|
loaded = false,
|
||||||
orig = {},
|
orig = {},
|
||||||
last_picked_up = {},
|
|
||||||
view = {
|
view = {
|
||||||
BUYOUT = 1,
|
BUYOUT = 1,
|
||||||
BID = 2,
|
BID = 2,
|
||||||
@@ -54,11 +53,11 @@ function Aux_OnLoad()
|
|||||||
|
|
||||||
do
|
do
|
||||||
local tab_group = Aux.gui.tab_group(AuxFrame, 'BOTTOM')
|
local tab_group = Aux.gui.tab_group(AuxFrame, 'BOTTOM')
|
||||||
tab_group:create_tab('Item Search')
|
tab_group:create_tab('Search')
|
||||||
tab_group:create_tab('Filter Search')
|
|
||||||
tab_group:create_tab('Post')
|
tab_group:create_tab('Post')
|
||||||
tab_group:create_tab('Auctions')
|
tab_group:create_tab('Auctions')
|
||||||
tab_group:create_tab('Bids')
|
tab_group:create_tab('Bids')
|
||||||
|
-- tab_group:create_tab('Scan')
|
||||||
tab_group.on_select = Aux.on_tab_click
|
tab_group.on_select = Aux.on_tab_click
|
||||||
Aux.tab_group = tab_group
|
Aux.tab_group = tab_group
|
||||||
end
|
end
|
||||||
@@ -242,11 +241,8 @@ function Aux.AuctionFrameAuctions_OnEvent()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Aux_OnAuctionHouseShow()
|
function Aux_OnAuctionHouseShow()
|
||||||
|
|
||||||
AuxFrame:Show()
|
AuxFrame:Show()
|
||||||
|
|
||||||
Aux.tab_group:set_tab(1)
|
Aux.tab_group:set_tab(1)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux_OnAuctionHouseClosed()
|
function Aux_OnAuctionHouseClosed()
|
||||||
@@ -254,7 +250,7 @@ function Aux_OnAuctionHouseClosed()
|
|||||||
Aux.stack.stop()
|
Aux.stack.stop()
|
||||||
Aux.scan.abort()
|
Aux.scan.abort()
|
||||||
|
|
||||||
Aux.item_search_frame.on_close()
|
-- Aux.item_search_frame.on_close()
|
||||||
Aux.filter_search_frame.on_close()
|
Aux.filter_search_frame.on_close()
|
||||||
Aux.post_frame.on_close()
|
Aux.post_frame.on_close()
|
||||||
Aux.auctions_frame.on_close()
|
Aux.auctions_frame.on_close()
|
||||||
@@ -268,14 +264,14 @@ function Aux.on_tab_click(index)
|
|||||||
Aux.post.stop()
|
Aux.post.stop()
|
||||||
Aux.stack.stop()
|
Aux.stack.stop()
|
||||||
Aux.scan.abort(function()
|
Aux.scan.abort(function()
|
||||||
Aux.item_search_frame.on_close()
|
-- Aux.item_search_frame.on_close()
|
||||||
Aux.filter_search_frame.on_close()
|
Aux.filter_search_frame.on_close()
|
||||||
Aux.post_frame.on_close()
|
Aux.post_frame.on_close()
|
||||||
Aux.auctions_frame.on_close()
|
Aux.auctions_frame.on_close()
|
||||||
Aux.bids_frame.on_close()
|
Aux.bids_frame.on_close()
|
||||||
Aux.history_frame.on_close()
|
Aux.history_frame.on_close()
|
||||||
|
|
||||||
AuxItemSearchFrame:Hide()
|
-- AuxItemSearchFrame:Hide()
|
||||||
AuxFilterSearchFrame:Hide()
|
AuxFilterSearchFrame:Hide()
|
||||||
AuxPostFrame:Hide()
|
AuxPostFrame:Hide()
|
||||||
AuxAuctionsFrame:Hide()
|
AuxAuctionsFrame:Hide()
|
||||||
@@ -283,20 +279,20 @@ function Aux.on_tab_click(index)
|
|||||||
AuxHistoryFrame:Hide()
|
AuxHistoryFrame:Hide()
|
||||||
|
|
||||||
if index == 1 then
|
if index == 1 then
|
||||||
AuxItemSearchFrame:Show()
|
|
||||||
Aux.item_search_frame.on_open()
|
|
||||||
elseif index == 2 then
|
|
||||||
AuxFilterSearchFrame:Show()
|
AuxFilterSearchFrame:Show()
|
||||||
Aux.filter_search_frame.on_open()
|
Aux.filter_search_frame.on_open()
|
||||||
elseif index == 3 then
|
elseif index == 2 then
|
||||||
AuxPostFrame:Show()
|
AuxPostFrame:Show()
|
||||||
Aux.post_frame.on_open()
|
Aux.post_frame.on_open()
|
||||||
elseif index == 4 then
|
elseif index == 3 then
|
||||||
AuxAuctionsFrame:Show()
|
AuxAuctionsFrame:Show()
|
||||||
Aux.auctions_frame.on_open()
|
Aux.auctions_frame.on_open()
|
||||||
elseif index == 5 then
|
elseif index == 4 then
|
||||||
AuxBidsFrame:Show()
|
AuxBidsFrame:Show()
|
||||||
Aux.bids_frame.on_open()
|
Aux.bids_frame.on_open()
|
||||||
|
-- elseif index == 5 then
|
||||||
|
-- AuxItemSearchFrame:Show()
|
||||||
|
-- Aux.item_search_frame.on_open()
|
||||||
end
|
end
|
||||||
|
|
||||||
Aux.active_panel = index
|
Aux.active_panel = index
|
||||||
@@ -340,16 +336,24 @@ function Aux_AuctionsButton_OnMouseDown()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux.PickupContainerItem(bag, item)
|
do
|
||||||
Aux.last_picked_up = { bag=bag, slot=item }
|
local last_picked_up
|
||||||
return Aux.orig.PickupContainerItem(bag, item)
|
function Aux.PickupContainerItem(bag, slot)
|
||||||
|
last_picked_up = { bag, slot }
|
||||||
|
return Aux.orig.PickupContainerItem(bag, slot)
|
||||||
|
end
|
||||||
|
function Aux.cursor_item()
|
||||||
|
if last_picked_up and CursorHasItem() then
|
||||||
|
return Aux.info.container_item(unpack(last_picked_up))
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux_ContainerFrameItemButton_OnClick(button)
|
function Aux_ContainerFrameItemButton_OnClick(button)
|
||||||
local bag, slot = this:GetParent():GetID(), this:GetID()
|
local bag, slot = this:GetParent():GetID(), this:GetID()
|
||||||
local container_item_info = Aux.info.container_item(bag, slot)
|
local item_info = Aux.info.container_item(bag, slot)
|
||||||
|
|
||||||
if AuxFrame:IsVisible() and button == "LeftButton" and container_item_info then
|
if AuxFrame:IsVisible() and button == "LeftButton" and item_info then
|
||||||
if IsAltKeyDown() then
|
if IsAltKeyDown() then
|
||||||
if Aux.active_panel ~= 1 then
|
if Aux.active_panel ~= 1 then
|
||||||
Aux.on_tab_click(1)
|
Aux.on_tab_click(1)
|
||||||
@@ -357,7 +361,7 @@ function Aux_ContainerFrameItemButton_OnClick(button)
|
|||||||
|
|
||||||
Aux.control.as_soon_as(function() return Aux.active_panel == 1 end, function()
|
Aux.control.as_soon_as(function() return Aux.active_panel == 1 end, function()
|
||||||
AuxItemSearchFrameItemItemInputBox:Hide()
|
AuxItemSearchFrameItemItemInputBox:Hide()
|
||||||
Aux.item_search_frame.set_item(container_item_info.item_id)
|
Aux.item_search_frame.set_item(item_info.item_id)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
return
|
return
|
||||||
@@ -367,7 +371,7 @@ function Aux_ContainerFrameItemButton_OnClick(button)
|
|||||||
return Aux.orig.ContainerFrameItemButton_OnClick(button)
|
return Aux.orig.ContainerFrameItemButton_OnClick(button)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux_QualityColor(code)
|
function Aux.quality_color(code)
|
||||||
if code == 0 then
|
if code == 0 then
|
||||||
return "ff9d9d9d" -- poor, gray
|
return "ff9d9d9d" -- poor, gray
|
||||||
elseif code == 1 then
|
elseif code == 1 then
|
||||||
|
|||||||
+53
-20
@@ -94,7 +94,6 @@ end
|
|||||||
|
|
||||||
function public.on_open()
|
function public.on_open()
|
||||||
private.update_search_listings()
|
private.update_search_listings()
|
||||||
private.update_tab(SAVED)
|
|
||||||
|
|
||||||
AuxFilterSearchFrameResults:SetWidth(985)
|
AuxFilterSearchFrameResults:SetWidth(985)
|
||||||
AuxFrame:SetWidth(991)
|
AuxFrame:SetWidth(991)
|
||||||
@@ -117,13 +116,23 @@ function public.on_load()
|
|||||||
private.update_search_listings()
|
private.update_search_listings()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
on_row_enter = function(sheet, row_index)
|
||||||
|
GameTooltip_SetDefaultAnchor(GameTooltip, UIParent)
|
||||||
|
GameTooltip:AddLine(gsub(sheet.rows[row_index].cells[1].text:GetText(), ';', '\n'), 255/255, 254/255, 250/255)
|
||||||
|
GameTooltip:Show()
|
||||||
|
end,
|
||||||
|
on_row_leave = function(sheet, row_index)
|
||||||
|
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||||
|
GameTooltip:ClearLines()
|
||||||
|
GameTooltip:Hide()
|
||||||
|
end,
|
||||||
columns = {
|
columns = {
|
||||||
{
|
{
|
||||||
width = 900,
|
width = 440,
|
||||||
comparator = function(filter_string1, filter_string2) return Aux.util.compare(filter_string1, filter_string2, Aux.util.GT) 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_initializer = Aux.sheet.default_cell_initializer('LEFT'),
|
||||||
cell_setter = function(cell, filter_string)
|
cell_setter = function(cell, filter_string)
|
||||||
cell.text:SetText(filter_string)
|
cell.text:SetText(Aux.test.prettify_search(filter_string))
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -145,13 +154,23 @@ function public.on_load()
|
|||||||
private.update_search_listings()
|
private.update_search_listings()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
on_row_enter = function(sheet, row_index)
|
||||||
|
GameTooltip_SetDefaultAnchor(GameTooltip, UIParent)
|
||||||
|
GameTooltip:AddLine(gsub(sheet.rows[row_index].cells[1].text:GetText(), ';', '\n'), 255/255, 254/255, 250/255)
|
||||||
|
GameTooltip:Show()
|
||||||
|
end,
|
||||||
|
on_row_leave = function(sheet, row_index)
|
||||||
|
local data_index = row_index + FauxScrollFrame_GetOffset(sheet.scroll_frame)
|
||||||
|
GameTooltip:ClearLines()
|
||||||
|
GameTooltip:Hide()
|
||||||
|
end,
|
||||||
columns = {
|
columns = {
|
||||||
{
|
{
|
||||||
width = 900,
|
width = 440,
|
||||||
comparator = function(filter_string1, filter_string2) return Aux.util.compare(filter_string1, filter_string2, Aux.util.GT) 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_initializer = Aux.sheet.default_cell_initializer('LEFT'),
|
||||||
cell_setter = function(cell, filter_string)
|
cell_setter = function(cell, filter_string)
|
||||||
cell.text:SetText(filter_string)
|
cell.text:SetText(Aux.test.prettify_search(filter_string))
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -323,24 +342,37 @@ function public.on_load()
|
|||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(AuxFilterSearchFrame)
|
local editbox = Aux.gui.editbox(AuxFilterSearchFrame)
|
||||||
|
editbox:EnableMouse(1)
|
||||||
|
editbox.complete = Aux.test.complete
|
||||||
editbox:SetPoint('TOPLEFT', 5, -6)
|
editbox:SetPoint('TOPLEFT', 5, -6)
|
||||||
editbox:SetPoint('RIGHT', private.search_button, 'LEFT', -4, 0)
|
editbox:SetPoint('RIGHT', private.search_button, 'LEFT', -4, 0)
|
||||||
editbox:SetWidth(400)
|
editbox:SetWidth(400)
|
||||||
editbox:SetHeight(25)
|
editbox:SetHeight(25)
|
||||||
-- editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnChar', function()
|
||||||
-- if IsShiftKeyDown() then
|
this:complete()
|
||||||
-- getglobal(this:GetParent():GetName()..'TooltipInputBox4'):SetFocus()
|
end)
|
||||||
-- else
|
editbox:SetScript('OnTabPressed', function()
|
||||||
-- getglobal(this:GetParent():GetName()..'MinLevel'):SetFocus()
|
this:HighlightText(0, 0)
|
||||||
-- end
|
end)
|
||||||
-- end)
|
|
||||||
editbox:SetScript('OnEnterPressed', function()
|
editbox:SetScript('OnEnterPressed', function()
|
||||||
|
this:HighlightText(0, 0)
|
||||||
this:ClearFocus()
|
this:ClearFocus()
|
||||||
public.start_search()
|
public.start_search()
|
||||||
end)
|
end)
|
||||||
editbox:SetScript('OnEscapePressed', function()
|
editbox:SetScript('OnEscapePressed', function()
|
||||||
|
this:HighlightText(0, 0)
|
||||||
this:ClearFocus()
|
this:ClearFocus()
|
||||||
end)
|
end)
|
||||||
|
editbox:SetScript('OnEditFocusGained', function()
|
||||||
|
this:HighlightText()
|
||||||
|
end)
|
||||||
|
editbox:SetScript('OnReceiveDrag', function()
|
||||||
|
local item_info = Aux.cursor_item() and Aux.static.item_info(Aux.cursor_item().item_id)
|
||||||
|
if item_info then
|
||||||
|
this:SetText(item_info.name..'/exact')
|
||||||
|
end
|
||||||
|
ClearCursor()
|
||||||
|
end)
|
||||||
private.search_box = editbox
|
private.search_box = editbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
@@ -349,7 +381,7 @@ function public.on_load()
|
|||||||
do
|
do
|
||||||
local btn = Aux.gui.button(AuxFilterSearchFrame, 18)
|
local btn = Aux.gui.button(AuxFilterSearchFrame, 18)
|
||||||
btn:SetPoint('TOPLEFT', 10, -49)
|
btn:SetPoint('TOPLEFT', 10, -49)
|
||||||
btn:SetWidth(310)
|
btn:SetWidth(320)
|
||||||
btn:SetHeight(22)
|
btn:SetHeight(22)
|
||||||
btn:SetText('Search Results')
|
btn:SetText('Search Results')
|
||||||
btn:SetScript('OnClick', function() private.update_tab(RESULTS) end)
|
btn:SetScript('OnClick', function() private.update_tab(RESULTS) end)
|
||||||
@@ -358,7 +390,7 @@ function public.on_load()
|
|||||||
do
|
do
|
||||||
local btn = Aux.gui.button(AuxFilterSearchFrame, 18)
|
local btn = Aux.gui.button(AuxFilterSearchFrame, 18)
|
||||||
btn:SetPoint('TOPLEFT', private.search_results_button, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', private.search_results_button, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetWidth(310)
|
btn:SetWidth(320)
|
||||||
btn:SetHeight(22)
|
btn:SetHeight(22)
|
||||||
btn:SetText('Saved Searches')
|
btn:SetText('Saved Searches')
|
||||||
btn:SetScript('OnClick', function() private.update_tab(SAVED) end)
|
btn:SetScript('OnClick', function() private.update_tab(SAVED) end)
|
||||||
@@ -367,21 +399,21 @@ function public.on_load()
|
|||||||
do
|
do
|
||||||
local btn = Aux.gui.button(AuxFilterSearchFrame, 18)
|
local btn = Aux.gui.button(AuxFilterSearchFrame, 18)
|
||||||
btn:SetPoint('TOPLEFT', private.saved_searches_button, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', private.saved_searches_button, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetWidth(310)
|
btn:SetWidth(320)
|
||||||
btn:SetHeight(22)
|
btn:SetHeight(22)
|
||||||
btn:SetText('New Filter')
|
btn:SetText('New Filter')
|
||||||
btn:SetScript('OnClick', function() private.update_tab(FILTER) end)
|
btn:SetScript('OnClick', function() private.update_tab(FILTER) end)
|
||||||
private.new_filter_button = btn
|
private.new_filter_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local line = Aux.gui.horizontal_line(AuxFilterSearchFrameSavedRecent, -25)
|
local line = Aux.gui.horizontal_line(AuxFilterSearchFrameSavedRecent, -30)
|
||||||
local label = Aux.gui.label(AuxFilterSearchFrameSavedRecent, 13)
|
local label = Aux.gui.label(AuxFilterSearchFrameSavedRecent, 15)
|
||||||
label:SetPoint('BOTTOM', line, 'TOP', 0, 5)
|
label:SetPoint('BOTTOM', line, 'TOP', 0, 5)
|
||||||
label:SetText('Recent Searches')
|
label:SetText('Recent Searches')
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local line = Aux.gui.horizontal_line(AuxFilterSearchFrameSavedFavorite, -25)
|
local line = Aux.gui.horizontal_line(AuxFilterSearchFrameSavedFavorite, -30)
|
||||||
local label = Aux.gui.label(AuxFilterSearchFrameSavedFavorite, 13)
|
local label = Aux.gui.label(AuxFilterSearchFrameSavedFavorite, 15)
|
||||||
label:SetPoint('BOTTOM', line, 'TOP', 0, 5)
|
label:SetPoint('BOTTOM', line, 'TOP', 0, 5)
|
||||||
label:SetText('Favorite Searches')
|
label:SetText('Favorite Searches')
|
||||||
end
|
end
|
||||||
@@ -514,7 +546,7 @@ function public.on_load()
|
|||||||
private.category_dropdown = dropdown
|
private.category_dropdown = dropdown
|
||||||
UIDropDownMenu_Initialize(dropdown, AuxFilterSearchFrameFiltersCategoryDropDown_Initialize)
|
UIDropDownMenu_Initialize(dropdown, AuxFilterSearchFrameFiltersCategoryDropDown_Initialize)
|
||||||
dropdown:SetScript('OnShow', function()
|
dropdown:SetScript('OnShow', function()
|
||||||
UIDropDownMenu_Initialize(this, AuxFilterSearchFrameFiltersQualityDropDown_Initialize)
|
UIDropDownMenu_Initialize(this, AuxFilterSearchFrameFiltersCategoryDropDown_Initialize)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
@@ -690,6 +722,7 @@ function public.on_load()
|
|||||||
-- text:SetFont(Aux.gui.config.content_font, 13)
|
-- text:SetFont(Aux.gui.config.content_font, 13)
|
||||||
-- text:SetShadowColor(0, 0, 0, 0)
|
-- text:SetShadowColor(0, 0, 0, 0)
|
||||||
-- end
|
-- end
|
||||||
|
private.update_tab(SAVED)
|
||||||
end
|
end
|
||||||
|
|
||||||
function public.stop_search()
|
function public.stop_search()
|
||||||
|
|||||||
@@ -44,24 +44,24 @@
|
|||||||
<Size><AbsDimension x="900" y="380"/></Size>
|
<Size><AbsDimension x="900" y="380"/></Size>
|
||||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="3" y="-82"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="3" y="-82"/></Offset></Anchor></Anchors>
|
||||||
<Frames>
|
<Frames>
|
||||||
<Frame name="$parentRecent" inherits="AuxFrameBoxTemplate">
|
<Frame name="$parentFavorite" inherits="AuxFrameBoxTemplate">
|
||||||
<Size><AbsDimension x="950" y="134"/></Size>
|
<Size><AbsDimension x="488" y="280"/></Size>
|
||||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
<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>
|
<Anchors><Anchor point="TOPRIGHT"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor></Anchors>
|
||||||
<Frames>
|
<Frames>
|
||||||
<Frame name="$parentListing">
|
<Frame name="$parentListing">
|
||||||
<Size><AbsDimension x="0" y="130"/></Size>
|
<Size><AbsDimension x="0" y="250"/></Size>
|
||||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-10" y="-20"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-10" y="-25"/></Offset></Anchor></Anchors>
|
||||||
</Frame>
|
</Frame>
|
||||||
</Frames>
|
</Frames>
|
||||||
</Frame>
|
</Frame>
|
||||||
<Frame name="$parentFavorite" inherits="AuxFrameBoxTemplate">
|
<Frame name="$parentRecent" inherits="AuxFrameBoxTemplate">
|
||||||
<Size><AbsDimension x="950" y="134"/></Size>
|
<Size><AbsDimension x="488" y="280"/></Size>
|
||||||
<Anchors><Anchor point="TOP" relativeTo="$parentRecent" relativePoint="BOTTOM"><Offset><AbsDimension x="0" y="-5"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="TOPLEFT" relativeTo="$parentFavorite" relativePoint="TOPRIGHT"><Offset><AbsDimension x="5" y="0"/></Offset></Anchor></Anchors>
|
||||||
<Frames>
|
<Frames>
|
||||||
<Frame name="$parentListing">
|
<Frame name="$parentListing">
|
||||||
<Size><AbsDimension x="0" y="130"/></Size>
|
<Size><AbsDimension x="0" y="250"/></Size>
|
||||||
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-10" y="-20"/></Offset></Anchor></Anchors>
|
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="-10" y="-25"/></Offset></Anchor></Anchors>
|
||||||
</Frame>
|
</Frame>
|
||||||
</Frames>
|
</Frames>
|
||||||
</Frame>
|
</Frame>
|
||||||
|
|||||||
+40
-21
@@ -1,27 +1,9 @@
|
|||||||
local m = {}
|
local m = {}
|
||||||
Aux.groups = m
|
Aux.test = m
|
||||||
|
|
||||||
|
function m.on_char()
|
||||||
function m.parse_group(datastring)
|
|
||||||
return Aux.persistence.deserialize(datastring, ',')
|
|
||||||
end
|
|
||||||
|
|
||||||
function m.parse_item_key(item_key)
|
|
||||||
local _, _, item_id, suffix_id = strfind(item_key, '(%d+):?(%d*)')
|
|
||||||
return tonumber(item_id), suffix_id == '' and 0 or tonumber(suffix_id)
|
|
||||||
end
|
|
||||||
|
|
||||||
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
|
for _, data in ipairs(TSM.db.global.savedSearches) do
|
||||||
if data.searchMode == "normal" then
|
if data.searchMode == 'normal' then
|
||||||
local prevSearch = strlower(data.filter)
|
local prevSearch = strlower(data.filter)
|
||||||
if strsub(prevSearch, 1, textLen) == text then
|
if strsub(prevSearch, 1, textLen) == text then
|
||||||
self:SetText(prevSearch)
|
self:SetText(prevSearch)
|
||||||
@@ -30,4 +12,41 @@ function on_char()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function m.prettify_search(search)
|
||||||
|
local item_pattern = '([^/;]+)([^;]*)/exact'
|
||||||
|
while true do
|
||||||
|
local _, _, name, in_between = strfind(search, item_pattern)
|
||||||
|
if name then
|
||||||
|
search = gsub(search, item_pattern, m.display_name(Aux.static.auctionable_items[strupper(name)])..in_between, 1)
|
||||||
|
else
|
||||||
|
return search
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function m.display_name(item_id)
|
||||||
|
local item_info = Aux.static.item_info(item_id)
|
||||||
|
return '|c'..Aux.quality_color(item_info.quality)..'['..item_info.name..']'..'|r'
|
||||||
|
end
|
||||||
|
|
||||||
|
function m:complete()
|
||||||
|
local options = {'exact', 'even', 'discard' }
|
||||||
|
|
||||||
|
for _, class in ipairs({ GetAuctionItemClasses() }) do
|
||||||
|
tinsert(options, class)
|
||||||
|
end
|
||||||
|
|
||||||
|
local filter_string = this:GetText()
|
||||||
|
local start_index, _, current_modifier = strfind(filter_string, '([^/;]*)$')
|
||||||
|
current_modifier = current_modifier or ''
|
||||||
|
|
||||||
|
for _, option in ipairs(options) do
|
||||||
|
if strfind(strupper(option), '^'..strupper(current_modifier)) then
|
||||||
|
this:SetText(string.sub(filter_string, 1, start_index - 1)..option)
|
||||||
|
this:HighlightText(strlen(filter_string), -1)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
+22
-15
@@ -51,17 +51,14 @@ function m.create_item_filter(item_id)
|
|||||||
local item_info = Aux.static.item_info(item_id)
|
local item_info = Aux.static.item_info(item_id)
|
||||||
|
|
||||||
if item_info then
|
if item_info then
|
||||||
local class_index = Aux.item_class_index(item_info.class)
|
|
||||||
local subclass_index = class_index and Aux.item_subclass_index(class_index, item_info.subclass)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
exact_only = true,
|
exact_only = true,
|
||||||
name = item_info.name,
|
name = item_info.name,
|
||||||
min_level = item_info.level,
|
min_level = item_info.level,
|
||||||
min_level = item_info.level,
|
min_level = item_info.level,
|
||||||
slot = item_info.slot,
|
slot = item_info.slot,
|
||||||
class = class_index,
|
class = item_info.class,
|
||||||
subclass = subclass_index,
|
subclass = item_info.subclass,
|
||||||
quality = item_info.quality,
|
quality = item_info.quality,
|
||||||
usable = item_info.usable,
|
usable = item_info.usable,
|
||||||
}
|
}
|
||||||
@@ -69,16 +66,17 @@ function m.create_item_filter(item_id)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function m.create_item_query(item_id)
|
function m.create_item_query(item_id)
|
||||||
local item_info = Aux.static.item_info(item_id)
|
|
||||||
|
|
||||||
local filter = m.create_item_filter(item_id)
|
local filter = m.create_item_filter(item_id)
|
||||||
|
|
||||||
return item_info and {
|
if filter then
|
||||||
|
return {
|
||||||
type = 'list',
|
type = 'list',
|
||||||
start_page = 0,
|
start_page = 0,
|
||||||
validator = m.validator(filter),
|
validator = m.validator(filter),
|
||||||
blizzard_query = m.blizzard_query(filter),
|
blizzard_query = m.blizzard_query(filter),
|
||||||
}
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function m.parse_filter_string(filter_string)
|
function m.parse_filter_string(filter_string)
|
||||||
@@ -154,6 +152,12 @@ function m.filter_from_string(filter_term)
|
|||||||
else
|
else
|
||||||
return false, 'Invalid Even Only Filter'
|
return false, 'Invalid Even Only Filter'
|
||||||
end
|
end
|
||||||
|
elseif strlower(str) == 'discard' then
|
||||||
|
if not filter.discard then
|
||||||
|
filter.discard = true
|
||||||
|
else
|
||||||
|
return false, 'Invalid Even Only Filter'
|
||||||
|
end
|
||||||
elseif Aux.money.from_string(str) > 0 then
|
elseif Aux.money.from_string(str) > 0 then
|
||||||
if not filter.max_price then
|
if not filter.max_price then
|
||||||
filter.max_price = Aux.money.from_string(str)
|
filter.max_price = Aux.money.from_string(str)
|
||||||
@@ -171,12 +175,12 @@ function m.filter_from_string(filter_term)
|
|||||||
if filter.min_level or filter.max_level or filter.class or filter.subclass or filter.quality or filter.usable_only then
|
if filter.min_level or filter.max_level or filter.class or filter.subclass or filter.quality or filter.usable_only then
|
||||||
return false, 'Invalid Exact Only Filter'
|
return false, 'Invalid Exact Only Filter'
|
||||||
end
|
end
|
||||||
for id, info in pairs(Aux.static.auctionable_items) do
|
local id = Aux.static.auctionable_items[strupper(filter.name)]
|
||||||
if info.name == filter.name then
|
if id then
|
||||||
local item_filter = m.create_item_filter(id)
|
local item_filter = m.create_item_filter(id)
|
||||||
item_filter.even_only = filter.even_only
|
item_filter.even_only = filter.even_only
|
||||||
return item_filter
|
item_filter.discard = filter.discard
|
||||||
end
|
return item_filter
|
||||||
end
|
end
|
||||||
return false, 'Invalid Exact Only Filter'
|
return false, 'Invalid Exact Only Filter'
|
||||||
end
|
end
|
||||||
@@ -188,7 +192,7 @@ function m.filter_from_string(filter_term)
|
|||||||
return filter
|
return filter
|
||||||
end
|
end
|
||||||
|
|
||||||
function m.filter_to_string(filter)
|
function m.filter_to_string(filter) -- TODO belongs in filter search
|
||||||
|
|
||||||
local filter_term = filter.name or ''
|
local filter_term = filter.name or ''
|
||||||
|
|
||||||
@@ -238,6 +242,9 @@ end
|
|||||||
function m.validator(filter)
|
function m.validator(filter)
|
||||||
|
|
||||||
return function(record)
|
return function(record)
|
||||||
|
if filter.discard then
|
||||||
|
return
|
||||||
|
end
|
||||||
if filter.exact_only and record.name ~= filter.name then
|
if filter.exact_only and record.name ~= filter.name then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -148,13 +148,13 @@ function public.create(params)
|
|||||||
sort_texture:Hide()
|
sort_texture:Hide()
|
||||||
button.sort_texture = sort_texture
|
button.sort_texture = sort_texture
|
||||||
|
|
||||||
local background = content:CreateTexture(nil, 'ARTWORK')
|
-- local background = content:CreateTexture(nil, 'ARTWORK')
|
||||||
background:SetTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]])
|
-- background:SetTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]])
|
||||||
-- background:SetTextCoord(0.2, 0.9, 0, 0.9)
|
-- -- background:SetTextCoord(0.2, 0.9, 0, 0.9)
|
||||||
background:SetPoint('TOPLEFT', button, 'BOTTOMLEFT', 0, 0)
|
-- background:SetPoint('TOPLEFT', button, 'BOTTOMLEFT', 0, 0)
|
||||||
background:SetPoint('TOPRIGHT', button, 'BOTTOMRIGHT', 0, 0)
|
-- background:SetPoint('TOPRIGHT', button, 'BOTTOMRIGHT', 0, 0)
|
||||||
background:SetPoint('BOTTOM', content, 'BOTTOM', 0, 0)
|
-- background:SetPoint('BOTTOM', content, 'BOTTOM', 0, 0)
|
||||||
background:SetAlpha(0.2)
|
-- background:SetAlpha(0.2)
|
||||||
|
|
||||||
label:SetPoint('TOPLEFT', button, 'TOPLEFT', 0, 0)
|
label:SetPoint('TOPLEFT', button, 'TOPLEFT', 0, 0)
|
||||||
label:SetPoint('BOTTOMRIGHT', button, 'BOTTOMRIGHT', 0, 0)
|
label:SetPoint('BOTTOMRIGHT', button, 'BOTTOMRIGHT', 0, 0)
|
||||||
|
|||||||
+84153
-78894
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user