From b70ad90b60647ddc235df03ccae5355ff711be5a Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Sat, 5 Mar 2016 13:41:35 +0100 Subject: [PATCH] automatically clearing filter --- core.lua | 2 +- search_frame.lua | 17 +++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/core.lua b/core.lua index 4badd5b..31faa59 100644 --- a/core.lua +++ b/core.lua @@ -1,5 +1,5 @@ Aux = { - version = '2.6.7', + version = '2.6.8', blizzard_ui_shown = false, orig = {}, } diff --git a/search_frame.lua b/search_frame.lua index 6b99c89..6a660ea 100644 --- a/search_frame.lua +++ b/search_frame.lua @@ -106,7 +106,7 @@ function private.add_filter(filter_string, replace) private.search_box:SetText((old_filter_string or '')..filter_string) end -function private.clear_filter() +function private.clear_form() AuxSearchFrameFilterNameInputBox:SetText('') AuxSearchFrameFilterExactCheckButton:SetChecked(nil) AuxSearchFrameFilterMinLevel:SetText('') @@ -116,14 +116,6 @@ function private.clear_filter() UIDropDownMenu_ClearAll(private.slot_dropdown) UIDropDownMenu_ClearAll(private.quality_dropdown) AuxSearchFrameFilterUsableCheckButton:SetChecked(nil) - private.max_buyout_price:SetText('') - private.max_percent:SetText('') - private.tooltip1:SetText('') - private.tooltip2:SetText('') - private.tooltip3:SetText('') - private.tooltip4:SetText('') - private.tooltip5:SetText('') - private.tooltip6:SetText('') end function private.get_form_filter() @@ -306,6 +298,7 @@ function public.on_load() btn1:SetScript('OnClick', function() private.search_box:SetText('') private.add_filter() + private.clear_form() public.start_search() end) @@ -314,7 +307,10 @@ function public.on_load() btn2:SetWidth(80) btn2:SetHeight(24) btn2:SetText('Add') - btn2:SetScript('OnClick', private.add_filter) + btn2:SetScript('OnClick', function() + private.add_filter() + private.clear_form() + end) local btn3 = Aux.gui.button(AuxSearchFrameFilter, 16) btn3:SetPoint('LEFT', btn2, 'RIGHT', 5, 0) @@ -323,6 +319,7 @@ function public.on_load() btn3:SetText('Replace') btn3:SetScript('OnClick', function() private.add_filter(nil, true) + private.clear_form() end) end do