Redirect System Messages
A long time ago there was this mod:
http://www.wowinterface.com/download...ntrolTool.html I would like to know if there is a way to resurrect some portion of it. To be specific I want to make a new window for all system messages and then redirect a few things to the main chat window (guild member logon/off as an example). New window is the easy part but I don't have the knowledge to do any more than that. Thanks in advance ;) |
I do something similar in my personal addon where I hide and redirect LocalDefense spam to print() so that it doesn't trigger the channel sound I have set in Prat. With some minor tweaks, this should work for your usage.
What I have: lua Code:
What should work for you: lua Code:
To reroute more system messages, just add another strmatch line to both blocks as shown above. Make sure to remove the -- at the beginning of the line for things you add. If you are not familiar with making an addon, paste the above into http://addon.bool.no and it'll give you a zip file you can install like any other addon. |
Quote:
Then you run into another problem, which is that simply passing ERR_FRIEND_OFFLINE_S to string.match won't match "Kanegasi has come online." because the ERR_FRIEND_OFFLINE_S contains a formatting token -- "%s" means "insert string here" and is used to mark where the player name goes. However, in string matching, "%s" means "look for one whitespace character". If you want to use Blizzard's global strings for string matching, you have to "translate" the formatting tokens into pattern-matching tokens first: Code:
local function topattern(str) Code:
local patterns = { Code:
for i = 1, #patterns do Code:
ChatFrame_AddMessageEventFilter("CHAT_MSG_SYSTEM",function(_,_,msg) Code:
local color = ChatTypeColor.SYSTEM Code:
local function topattern(str) |
I didn't think about just using the actual strings. I even use your method of filtering %s in my Decliner addon. Also, the localdefense filter I have carries the yellow color over through print(), but probably because the |c code is in the message itself.
|
All times are GMT -6. The time now is 12:50 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI