diff --git a/core.lua b/core.lua index 768657f..af0d41a 100644 --- a/core.lua +++ b/core.lua @@ -1,5 +1,5 @@ Aux = { - version = '2.12.0', + version = '2.12.1', blizzard_ui_shown = false, orig = {}, } diff --git a/gui.lua b/gui.lua index 34c5865..559eea4 100644 --- a/gui.lua +++ b/gui.lua @@ -292,17 +292,24 @@ function m.editbox(parent, name) this:ClearFocus() end) - local last_time, last_x, last_y - editbox:SetScript('OnMouseUp', function() - local x, y = GetCursorPosition() - if last_time and last_time > GetTime() - .5 and abs(x - last_x) < 10 and abs(y - last_y) < 10 then + do + local last_time, last_x, last_y + + editbox:SetScript('OnEditFocusGained', function() this:HighlightText() - last_time = nil - else - last_time = GetTime() - last_x, last_y = GetCursorPosition() - end - end) + end) + + editbox:SetScript('OnMouseUp', function() + local x, y = GetCursorPosition() + if last_time and last_time > GetTime() - .5 and abs(x - last_x) < 10 and abs(y - last_y) < 10 then + this:HighlightText() + last_time = nil + else + last_time = GetTime() + last_x, last_y = GetCursorPosition() + end + end) + end -- local label = frame:CreateFontString(nil, 'OVERLAY') -- label:SetPoint('TOPLEFT', 0, -2) diff --git a/post_frame.lua b/post_frame.lua index 552dddd..e84df98 100644 --- a/post_frame.lua +++ b/post_frame.lua @@ -368,6 +368,7 @@ function public.on_load() this:ClearFocus() end) editbox:SetScript('OnEditFocusGained', function() + this:HighlightText() this.pretty:Hide() end) editbox:SetScript('OnEditFocusLost', function() @@ -411,6 +412,7 @@ function public.on_load() this:ClearFocus() end) editbox:SetScript('OnEditFocusGained', function() + this:HighlightText() this.pretty:Hide() end) editbox:SetScript('OnEditFocusLost', function()