Skip to content

Commit

Permalink
chatcopy: escape to close chatcopy mode
Browse files Browse the repository at this point in the history
  • Loading branch information
shikulja authored Jul 26, 2024
1 parent 8d35a13 commit 9a40ca7
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions modules/chatcopy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9a40ca7

Please sign in to comment.