chatcopy: escape to close chatcopy mode

This commit is contained in:
shikulja
2024-07-26 20:29:27 +03:00
committed by GitHub
parent 8d35a13d7e
commit 9a40ca7b9b
+14 -2
View File
@@ -106,8 +106,20 @@ pfUI:RegisterModule("chatcopy", "vanilla:tbc", function ()
editbox:SetMultiLine(true)
editbox:SetMaxLetters(0)
editbox:SetScript("OnEscapePressed", function ()
this:ClearFocus()
editbox:SetScript("OnMouseDown", function()
editbox.hasFocus = true
end)
editbox:SetScript("OnEscapePressed", function()
if editbox.hasFocus then
editbox:HighlightText(0, 0)
editbox:ClearFocus()
editbox.hasFocus = false
else
editbox:GetParent():Hide()
pfChatCopyButton.icon:SetTexture("Interface\\Buttons\\UI-GuildButton-PublicNote-Disabled")
pfChatCopyButton.state = false
end
end)
scroll:SetScrollChild(editbox)