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:
https://www.screencast.com/t/OHH4fg97ul9U
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:
function module:EnterSelectMode(frame)
frame = frame or SELECTED_CHAT_FRAME
frame:SetTextCopyable(true)
frame:EnableMouse(true)
frame:SetOnTextCopiedCallback(function(frame, text, num_copied)
frame:SetTextCopyable(false)
frame:EnableMouse(false)
frame:SetOnTextCopiedCallback(nil)
end)
end
I hope you find lots of uses for it!