From 7e86f2f89e35b70c2450ec217e4fb0f69fab5e50 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Thu, 4 Feb 2016 04:04:09 +0100 Subject: [PATCH] fixed several bugs --- core.lua | 2 +- scan_util.lua | 11 ++++++- search_frame.lua | 79 +++++++++++++++++++++++++++++++++++------------- 3 files changed, 69 insertions(+), 23 deletions(-) diff --git a/core.lua b/core.lua index 0d97d2a..d353db1 100644 --- a/core.lua +++ b/core.lua @@ -1,4 +1,4 @@ -AuxVersion = '2.4.3' +AuxVersion = '2.4.4' AuxAuthors = 'shirsig; Zerf; Zirco (Auctionator); Nimeral (Auctionator backport)' Aux = { diff --git a/scan_util.lua b/scan_util.lua index 830f653..b97d3c7 100644 --- a/scan_util.lua +++ b/scan_util.lua @@ -175,7 +175,16 @@ function m.filter_from_string(filter_term) end if filter.exact then - if filter.min_level or filter.max_level or filter.class or filter.subclass or filter.slot or filter.quality or filter.usable or not Aux.static.auctionable_items[strupper(filter.name)] then + if filter.min_level + or filter.max_level + or filter.class + or filter.subclass + or filter.slot + or filter.quality + or filter.usable + or not filter.name + or not Aux.static.auctionable_items[strupper(filter.name)] + then return false, 'Erroneous Exact Only Modifier' end end diff --git a/search_frame.lua b/search_frame.lua index 90bb7d1..4520422 100644 --- a/search_frame.lua +++ b/search_frame.lua @@ -146,10 +146,10 @@ function private.get_form_filter() exact = AuxFilterSearchFrameFilterExactCheckButton:GetChecked(), min_level = not exact and tonumber(AuxFilterSearchFrameFilterMinLevel:GetText()), max_level = not exact and tonumber(AuxFilterSearchFrameFilterMaxLevel:GetText()), - class = not exact and UIDropDownMenu_GetSelectedValue(private.class_dropdown), - subclass = not exact and UIDropDownMenu_GetSelectedValue(private.subclass_dropdown), - slot = not exact and UIDropDownMenu_GetSelectedValue(private.slot_dropdown), - quality = not exact and UIDropDownMenu_GetSelectedValue(private.quality_dropdown), + class = not exact and UIDropDownMenu_GetSelectedValue(private.class_dropdown) ~= 0 and UIDropDownMenu_GetSelectedValue(private.class_dropdown), + subclass = not exact and UIDropDownMenu_GetSelectedValue(private.subclass_dropdown) ~= 0 and UIDropDownMenu_GetSelectedValue(private.subclass_dropdown), + slot = not exact and UIDropDownMenu_GetSelectedValue(private.slot_dropdown) ~= 0 and UIDropDownMenu_GetSelectedValue(private.slot_dropdown), + quality = not exact and UIDropDownMenu_GetSelectedValue(private.quality_dropdown) ~= 0 and UIDropDownMenu_GetSelectedValue(private.quality_dropdown), usable = not exact and AuxFilterSearchFrameFilterUsableCheckButton:GetChecked(), discard = AuxFilterSearchFrameFilterDiscardCheckButton:GetChecked(), max_price = max_price > 0 and max_price, @@ -324,7 +324,7 @@ function public.on_load() end) editbox:SetScript('OnTabPressed', function() if IsShiftKeyDown() then - getglobal(this:GetParent():GetName()..'TooltipInputBox4'):SetFocus() + private.tooltip6:SetFocus() else getglobal(this:GetParent():GetName()..'MinLevel'):SetFocus() end @@ -336,6 +336,9 @@ function public.on_load() editbox:SetScript('OnEscapePressed', function() this:ClearFocus() end) + editbox:SetScript('OnEditFocusGained', function() + this:HighlightText() + end) local label = Aux.gui.label(editbox, 13) label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1) label:SetText('Name') @@ -360,6 +363,9 @@ do editbox:SetScript('OnEscapePressed', function() this:ClearFocus() end) + editbox:SetScript('OnEditFocusGained', function() + this:HighlightText() + end) local label = Aux.gui.label(editbox, 13) label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1) label:SetText('Level Range') @@ -374,7 +380,7 @@ do if IsShiftKeyDown() then getglobal(this:GetParent():GetName()..'MinLevel'):SetFocus() else - getglobal(this:GetParent():GetName()..'TooltipInputBox1'):SetFocus() + private.max_buyout_price:SetFocus() end end) editbox:SetScript('OnEnterPressed', function() @@ -384,6 +390,9 @@ do editbox:SetScript('OnEscapePressed', function() this:ClearFocus() end) + editbox:SetScript('OnEditFocusGained', function() + this:HighlightText() + end) local label = Aux.gui.label(editbox, 13) label:SetPoint('RIGHT', editbox, 'LEFT', -4, 0) label:SetText('-') @@ -466,8 +475,11 @@ end editbox:SetPoint('TOPRIGHT', -14, -20) editbox:SetWidth(300) editbox:SetScript('OnTabPressed', function() - private.start_price:SetFocus() - private.start_price:HighlightText() + if IsShiftKeyDown() then + getglobal(this:GetParent():GetName()..'MaxLevel'):SetFocus() + else + private.max_percent:SetFocus() + end end) editbox:SetScript('OnEnterPressed', function() this:ClearFocus() @@ -493,9 +505,9 @@ end editbox:SetWidth(300) editbox:SetScript('OnTabPressed', function() if IsShiftKeyDown() then - getglobal(this:GetParent():GetName()..'NameInputBox'):SetFocus() + private.max_buyout_price:SetFocus() else - getglobal(this:GetParent():GetName()..'MaxLevel'):SetFocus() + private.tooltip1:SetFocus() end end) editbox:SetScript('OnEnterPressed', function() @@ -505,6 +517,9 @@ end editbox:SetScript('OnEscapePressed', function() this:ClearFocus() end) + editbox:SetScript('OnEditFocusGained', function() + this:HighlightText() + end) local label = Aux.gui.label(editbox, 13) label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1) label:SetText('Max % Market Value') @@ -516,9 +531,9 @@ end editbox:SetWidth(300) editbox:SetScript('OnTabPressed', function() if IsShiftKeyDown() then - getglobal(this:GetParent():GetName()..'MaxLevel'):SetFocus() + private.max_percent:SetFocus() else - getglobal(this:GetParent():GetName()..'Tooltip1InputBox2'):SetFocus() + private.tooltip2:SetFocus() end end) editbox:SetScript('OnEnterPressed', function() @@ -528,6 +543,9 @@ end editbox:SetScript('OnEscapePressed', function() this:ClearFocus() end) + editbox:SetScript('OnEditFocusGained', function() + this:HighlightText() + end) local label = Aux.gui.label(editbox, 13) label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1) label:SetText('Tooltip') @@ -539,9 +557,9 @@ end editbox:SetWidth(300) editbox:SetScript('OnTabPressed', function() if IsShiftKeyDown() then - getglobal(this:GetParent():GetName()..'Tooltip1InputBox1'):SetFocus() + private.tooltip1:SetFocus() else - getglobal(this:GetParent():GetName()..'Tooltip1InputBox3'):SetFocus() + private.tooltip3:SetFocus() end end) editbox:SetScript('OnEnterPressed', function() @@ -551,6 +569,9 @@ end editbox:SetScript('OnEscapePressed', function() this:ClearFocus() end) + editbox:SetScript('OnEditFocusGained', function() + this:HighlightText() + end) private.tooltip2 = editbox end do @@ -559,9 +580,9 @@ end editbox:SetWidth(300) editbox:SetScript('OnTabPressed', function() if IsShiftKeyDown() then - getglobal(this:GetParent():GetName()..'Tooltip1InputBox2'):SetFocus() + private.tooltip2:SetFocus() else - getglobal(this:GetParent():GetName()..'Tooltip1InputBox4'):SetFocus() + private.tooltip4:SetFocus() end end) editbox:SetScript('OnEnterPressed', function() @@ -571,6 +592,9 @@ end editbox:SetScript('OnEscapePressed', function() this:ClearFocus() end) + editbox:SetScript('OnEditFocusGained', function() + this:HighlightText() + end) private.tooltip3 = editbox end do @@ -579,9 +603,9 @@ end editbox:SetWidth(300) editbox:SetScript('OnTabPressed', function() if IsShiftKeyDown() then - getglobal(this:GetParent():GetName()..'Tooltip1InputBox3'):SetFocus() + private.tooltip3:SetFocus() else - getglobal(this:GetParent():GetName()..'NameInputBox'):SetFocus() + private.tooltip5:SetFocus() end end) editbox:SetScript('OnEnterPressed', function() @@ -591,6 +615,9 @@ end editbox:SetScript('OnEscapePressed', function() this:ClearFocus() end) + editbox:SetScript('OnEditFocusGained', function() + this:HighlightText() + end) private.tooltip4 = editbox end do @@ -599,9 +626,9 @@ end editbox:SetWidth(300) editbox:SetScript('OnTabPressed', function() if IsShiftKeyDown() then - getglobal(this:GetParent():GetName()..'Tooltip1InputBox3'):SetFocus() + private.tooltip4:SetFocus() else - getglobal(this:GetParent():GetName()..'NameInputBox'):SetFocus() + private.tooltip6:SetFocus() end end) editbox:SetScript('OnEnterPressed', function() @@ -611,6 +638,9 @@ end editbox:SetScript('OnEscapePressed', function() this:ClearFocus() end) + editbox:SetScript('OnEditFocusGained', function() + this:HighlightText() + end) private.tooltip5 = editbox end do @@ -619,7 +649,7 @@ end editbox:SetWidth(300) editbox:SetScript('OnTabPressed', function() if IsShiftKeyDown() then - getglobal(this:GetParent():GetName()..'Tooltip1InputBox3'):SetFocus() + private.tooltip5:SetFocus() else getglobal(this:GetParent():GetName()..'NameInputBox'):SetFocus() end @@ -631,6 +661,9 @@ end editbox:SetScript('OnEscapePressed', function() this:ClearFocus() end) + editbox:SetScript('OnEditFocusGained', function() + this:HighlightText() + end) private.tooltip6 = editbox end @@ -922,6 +955,7 @@ function private.initialize_class_dropdown() UIDropDownMenu_AddButton{ text = ALL, + value = 0, func = on_click, } @@ -948,6 +982,7 @@ function private.initialize_subclass_dropdown() if class_index and GetAuctionItemSubClasses(class_index) then UIDropDownMenu_AddButton{ text = ALL, + value = 0, func = on_click, } @@ -973,6 +1008,7 @@ function private.initialize_slot_dropdown() if class_index and subclass_index and GetAuctionInvTypes(class_index, subclass_index) then UIDropDownMenu_AddButton{ text = ALL, + value = 0, func = on_click, } @@ -995,6 +1031,7 @@ function private.initialize_quality_dropdown() UIDropDownMenu_AddButton{ text = ALL, + value = 0, func = on_click, } for i=0,4 do