From c8b09b259e188e235bd4b5aeb627c451e5f7ae46 Mon Sep 17 00:00:00 2001 From: Sattva Date: Sat, 30 Dec 2023 01:53:34 +0300 Subject: [PATCH] Weblink #2 - hide link frame if WASD sent by user --- Changelog and Notes.txt | 4 ---- Leatrix_Plus.lua | 32 +++++++++++++++++++------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/Changelog and Notes.txt b/Changelog and Notes.txt index 8e563c9..1152e39 100644 --- a/Changelog and Notes.txt +++ b/Changelog and Notes.txt @@ -10,10 +10,6 @@ AhExtras - Need to make new description for alt click, tab confirm. And do lo Tooltip - FIX center popup when closed the leatrix window, its still staying... -WebLink - Fix ruRU encoding!!! - -WebLink - WASD should close the weblink window. - FlightTimers - fix report window editbox Manage Quest Tracker (under minimap) - let user move it. diff --git a/Leatrix_Plus.lua b/Leatrix_Plus.lua index b300161..ff4d208 100644 --- a/Leatrix_Plus.lua +++ b/Leatrix_Plus.lua @@ -193,18 +193,18 @@ eFrame.t:SetBackdropColor(1.0, 1.0, 1.0, 0.3) -- Handler -- it doesnt work in 3.3.5 - eFrame.b:SetScript("OnKeyDown", function(void, key) - if key == "c" and IsControlKeyDown() then - LibCompat.After(0.1, function() - eFrame:Hide() - ActionStatus_DisplayMessage(L["Copied to clipboard."], true) - if LeaPlusLC.FactoryEditBoxFocusChat then - local eBox = ChatEdit_ChooseBoxForSend() - ChatEdit_ActivateChat(eBox) - end - end) - end - end) + --eFrame.b:SetScript("OnKeyDown", function(void, key) + -- if key == "c" and IsControlKeyDown() then + -- LibCompat.After(0.1, function() + -- eFrame:Hide() + -- ActionStatus_DisplayMessage(L["Copied to clipboard."], true) + -- if LeaPlusLC.FactoryEditBoxFocusChat then + -- local eBox = ChatEdit_ChooseBoxForSend() + -- ChatEdit_ActivateChat(eBox) + -- end + -- end) + -- end + --end) -- Prevent changes -- eFrame.b:SetScript("OnEscapePressed", function() eFrame:Hide() end) -- eFrame.b:SetScript("OnEnterPressed", eFrame.b.HighlightText) @@ -221,7 +221,13 @@ LeaPlusLC.FactoryEditBox:Show() LeaPlusLC.FactoryEditBox.b:SetText(word) LeaPlusLC.FactoryEditBox.b:HighlightText() - LeaPlusLC.FactoryEditBox.b:SetScript("OnChar", function() LeaPlusLC.FactoryEditBox.b:SetFocus(true) LeaPlusLC.FactoryEditBox.b:SetText(word) LeaPlusLC.FactoryEditBox.b:HighlightText() end) + LeaPlusLC.FactoryEditBox.b:SetScript("OnChar", function(_, char) + if char == 'w' or char == 'a' or char == 's' or char == 'd' then + LeaPlusLC.FactoryEditBox:Hide() + --LeaPlusLC.FactoryEditBox:SetFocus(false) + end + LeaPlusLC.FactoryEditBox.b:SetFocus(true) LeaPlusLC.FactoryEditBox.b:SetText(word) LeaPlusLC.FactoryEditBox.b:HighlightText() + end) LeaPlusLC.FactoryEditBox.b:SetScript("OnKeyUp", function() LeaPlusLC.FactoryEditBox.b:SetFocus(true) LeaPlusLC.FactoryEditBox.b:SetText(word) LeaPlusLC.FactoryEditBox.b:HighlightText() end) end