sniping mode finished

This commit is contained in:
Manuel Simon Hirsig
2016-07-15 06:33:39 +02:00
parent e9fda02615
commit fcae6bccac
7 changed files with 128 additions and 107 deletions
+40 -17
View File
@@ -1,7 +1,30 @@
function Aux.search_frame.create_frames(private, public)
do
local btn = Aux.gui.button(AuxSearchFrame, 26)
local btn = Aux.gui.button(AuxSearchFrame, 22)
btn:SetPoint('TOPLEFT', 5, -8)
btn:SetWidth(70)
btn:SetHeight(25)
btn:SetText('Snipe')
btn:SetScript('OnClick', function()
this.enabled = not this.enabled
if this.enabled then
this:LockHighlight()
else
this:UnlockHighlight()
end
if private.current_search().continuation and private.current_search().snipe == private.snipe_button.enabled then
private.enable_resume()
else
private.disable_resume()
end
end)
btn.enabled = false
private.snipe_button = btn
end
Aux.gui.vertical_line(AuxSearchFrame, 80, nil, 408)
do
local btn = Aux.gui.button(AuxSearchFrame, 26)
btn:SetPoint('LEFT', private.snipe_button, 'RIGHT', 12, 0)
btn:SetWidth(30)
btn:SetHeight(25)
btn:SetText('<')
@@ -22,21 +45,20 @@ function Aux.search_frame.create_frames(private, public)
btn:SetPoint('TOPRIGHT', -5, -8)
btn:SetWidth(70)
btn:SetHeight(25)
btn:SetText('Refresh')
btn:SetText('Start')
btn:SetScript('OnClick', function()
public.execute('refresh')
public.execute(private.snipe_button.enabled)
end)
btn:Disable()
private.refresh_button = btn
private.start_button = btn
end
do
local btn = Aux.gui.button(AuxSearchFrame, 22)
btn:SetPoint('RIGHT', private.refresh_button, 'LEFT', -4, 0)
btn:SetPoint('RIGHT', private.start_button, 'LEFT', -4, 0)
btn:SetWidth(70)
btn:SetHeight(25)
btn:SetText(GREEN_FONT_COLOR_CODE..'Resume'..FONT_COLOR_CODE_CLOSE)
btn:SetScript('OnClick', function()
public.execute('resume')
public.execute(private.snipe_button.enabled, true)
end)
private.resume_button = btn
end
@@ -45,7 +67,7 @@ function Aux.search_frame.create_frames(private, public)
editbox:SetMaxLetters(nil)
editbox:EnableMouse(1)
editbox.complete = Aux.completion.complete
editbox:SetPoint('RIGHT', private.refresh_button, 'LEFT', -4, 0)
editbox:SetPoint('RIGHT', private.start_button, 'LEFT', -4, 0)
editbox:SetHeight(25)
editbox:SetScript('OnChar', function()
this:complete()
@@ -56,12 +78,13 @@ function Aux.search_frame.create_frames(private, public)
editbox:SetScript('OnEnterPressed', function()
this:HighlightText(0, 0)
this:ClearFocus()
public.execute('search')
public.execute(private.snipe_button.enabled)
end)
editbox:SetScript('OnReceiveDrag', function()
local item_info = Aux.cursor_item() and Aux.info.item(Aux.cursor_item().item_id)
if item_info then
public.execute('search', strlower(item_info.name)..'/exact')
public.set_filter(strlower(item_info.name)..'/exact')
public.execute(private.snipe_button.enabled)
end
ClearCursor()
end)
@@ -162,7 +185,7 @@ function Aux.search_frame.create_frames(private, public)
private.search_box:SetText('')
private.add_filter()
private.clear_form()
public.execute('search')
public.execute(private.snipe_button.enabled)
end)
local btn2 = Aux.gui.button(AuxSearchFrameFilter, 16)
@@ -204,7 +227,7 @@ function Aux.search_frame.create_frames(private, public)
end)
editbox:SetScript('OnEnterPressed', function()
this:ClearFocus()
public.execute('search')
public.execute(private.snipe_button.enabled)
end)
local label = Aux.gui.label(editbox, 13)
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
@@ -235,7 +258,7 @@ function Aux.search_frame.create_frames(private, public)
end)
editbox:SetScript('OnEnterPressed', function()
this:ClearFocus()
public.execute('search')
public.execute(private.snipe_button.enabled)
end)
local label = Aux.gui.label(editbox, 13)
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
@@ -256,7 +279,7 @@ function Aux.search_frame.create_frames(private, public)
end)
editbox:SetScript('OnEnterPressed', function()
this:ClearFocus()
public.execute('search')
public.execute(private.snipe_button.enabled)
end)
local label = Aux.gui.label(editbox, 13)
label:SetPoint('RIGHT', editbox, 'LEFT', -4, 0)
@@ -343,7 +366,7 @@ function Aux.search_frame.create_frames(private, public)
end)
editbox:SetScript('OnEnterPressed', function()
this:ClearFocus()
public.execute('search')
public.execute(private.snipe_button.enabled)
end)
local label = Aux.gui.label(editbox, 13)
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
@@ -365,7 +388,7 @@ function Aux.search_frame.create_frames(private, public)
end)
editbox:SetScript('OnEnterPressed', function()
this:ClearFocus()
public.execute('search')
public.execute(private.snipe_button.enabled)
end)
local label = Aux.gui.label(editbox, 13)
label:SetPoint('RIGHT', editbox, 'LEFT', -4, 0)
@@ -605,7 +628,7 @@ function Aux.search_frame.create_frames(private, public)
end
elseif button == 'LeftButton' then
private.search_box:SetText(data.search.filter_string)
public.execute('search')
public.execute(private.snipe_button.enabled)
elseif button == 'RightButton' then
if st == private.recent_searches_listing then
tinsert(aux_favorite_searches, 1, data.search)