WoWInterface (
-   Tutorials & Other Helpful Info. (
-   -   Enabling The Default UI Chat Copying Feature (

sylvanaar 05-24-20 03:32 PM

Enabling The Default UI Chat Copying Feature
I have recently gotten back into modding for a bit. I have been working to clean up and freshen up Prat as much as I can.

On the way I have discovered lots of new API's built into the game which are letting me do new and cool things.

I wanted to share this one, because I know how much the folks here like simple modifications. This one is so simple I was surprised myself.

Have a look at the demo first:

There was a time where that would have been extremely difficult to implement. Luckily, Blizzard has done all the work. All you have to do is make a couple API calls to enable it!

Here is the code that I am using in Prat. If you copy/paste it to try it, leave off the "module:"

Lua Code:
  1. function module:EnterSelectMode(frame)
  2.     frame = frame or SELECTED_CHAT_FRAME
  4.     frame:SetTextCopyable(true)
  5.     frame:EnableMouse(true)
  6.     frame:SetOnTextCopiedCallback(function(frame, text, num_copied)
  7.       frame:SetTextCopyable(false)
  8.       frame:EnableMouse(false)
  9.       frame:SetOnTextCopiedCallback(nil)
  10.     end)
  11.   end

I hope you find lots of uses for it!

All times are GMT -6. The time now is 06:12 AM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI