Prat 3.0
In loving memory of Jon Akthar (Sylvanaar)
Hello WoW community, I'm LuciferCatnip, Sylvanaar was my coworker and my mentor. It goes without saying that Jon was an amazingly talented individual. He always seemed to know everything… but he once said to me "It's not about knowing the answers, it's about asking the right questions", he always challenged me to ask me the right questions until I would arrive at the answer on my own terms. Jon was also a champion of the open source movement, and so with special thanks to Gil from Curseforge as well as Sylvanaar's family, there's no better way to honor Sylvanaar's legacy than to keep his project going strong in the community.
If you'd like to help maintain Prat, please reach out to MysticalOS or LuciferCatnip directly. Thank you so much.
About
Prat-3.0 is a chat enhancement addon for World of Warcraft.
It is made up of 30+ smaller "modules" which each provide additional functionality, and can be enabled or disabled individually.
In game, type /prat for a menu. Or use the icon on one of the many data broker hosts.
Prat has just about every feature you can think of, and then some. Really. When I get some more time, I'll try and put together a full list (Even I have lost count)
(Thanks to Dreamsight for this partial list)
- Sync your chat settings across your account (Beta)
- Machine learning powered spam filter (Beta)
- Change arrows, buttons, mouse scroll for chat scroll, scroll speed
- you can add player color per channel, color per level, color per class
- timestamps (styled)
- whether to show timestamp (what format the timestamp should be in)
- whether to show players level
- you can select the option for channel "stickys" (last channel you used you auto use when hitting enter, that sort of thing – or last thing someone said)
- change the looks of the chat's editbox - as well as where it appears (you can even undock it and move it to where you'd like it to be)
- chat fading, fading delay
- You can change the font to a list of fonts, add an outline to it, monochrome it (if you don’t mind messing with files a bit you could probably even add other fonts to that list)
- change the chat frame/chat box appearance
- Keep chat history between game sessions
- Set channel abbreviations
- set brackets and color(or something instead of brackets)round player/lvl
- alt invite option (press keyboard “alt” button and click on the player’s name to auto inv them)
- raid icon
- invite links - click them to invite the person
- URL copying
- Full chat copying + copy button
- Click timestamp to copy line
- Configurable alerts when your name or other word is mentioned
- enables tell target /tt which whispers your target
- Alias options - make macros into short commands
- See names of players Alt characters
- change chat sounds (incoming and outgoing as well as per channel)
- Achievements info and grats
- Full chat search and search box
- Customizable filters for advanced users
- Show item icon next to item links and player class icon next to player names
- Icon-only options for newcomers chat
- Optional flashing or font color change for chat tabs when a new message comes in.
You can enable/disable all Prat modules - don't have to have the ones you don't use running
While trying to reduce resource utilization, it is also important to note that some people prefer the features, and don't care that an addon uses 500k more.
In reply to sylvanaar:
I think that addressed it. Thank you!
In reply to sylvanaar:
Lovely stuff. Thanks for that.
Special characters still break the font styling in the chat window. How long has this been an issue for?
In reply to Zewks:
Can you explain a bit more?
Hi, I would like to know if there is a way to add a temporary community channel in the sounds tab in order to be able to play sounds when a message is in that chat, in the "incoming" section. Is this possible? Unfortunately I only see the normal channels, but not the new created ones... Thanks!
To clarify more, I have a community linked to a chat window, like the Looking For group channel, I added a community channel as chat window.
I see options for the looking for group and general in the Sounds/Custom Channels subtab, but I don't see any other channel nor a way to add it (though in the code it seems to suggest you could add a custom channel if you wanted to).
Maybe there is something I can setup, even if I had to touch any of the files, I have no idea, but would be great to be able to set these sounds specifically for this community channel I have added.
Thanks!
This is the part of the code I think it suggests for adding sounds to custom channels:
L = {L = { ["Sounds"] = { ["A module to play sounds on certain chat messages."] = true, ["Add a custom channel"] = true, ["bn_whisper_desc"] = "Sound for %s Battle.Net whisper messages", ["bn_whisper_name"] = "Battle.Net Whisper", ["Custom Channels"] = true, ["group_lead_desc"] = "Sound for %s raid leader, party leader or dungeon guide messages", ["group_lead_name"] = "Group Leader", ["guild_desc"] = "Sound for %s guild messages", ["guild_name"] = "Guild", ["incoming"] = true, ["Incoming Sounds"] = true, ["officer_desc"] = "Sound for %s officer channel messages", ["officer_name"] = "Officer", ["outgoing"] = true, ["Outgoing Sounds"] = true, ["party_desc"] = "Sound for %s party messages", ["party_name"] = "Party", ["Play a sound for a certain channel name (can be a substring)"] = true, ["raid_desc"] = "Sound for %s raid or battleground group/leader messages", ["raid_name"] = "Raid", ["Remove a custom channel"] = true, ["Reset settings"] = true, ["Restore default settings and resets custom channel list"] = true, ["Sound selection for incoming chat messages"] = true, ["Sound selection for outgoing (from you) chat messages"] = true, ["Sounds"] = true, ["whisper_desc"] = "Sound for %s whisper messages", ["whisper_name"] = "Whisper", }}
Starts at line 79 in the Sounds.lua file.
In reply to wen_amarth:
I found a bug in prat which explains why the channel wasn't showing up. That will be fixed in today's release.
I will look into supporting more community chat features
In reply to sylvanaar:
Thanks a lot for looking into this!!
Let me know if you need testing on this, I am willing to help!
In reply to sylvanaar:
Btw, I went into your github folders, found the service you changed, and copied it into my addon folder, it works, I can see the channels, however, though I have assigned "Heart" as the sound, it does not play it whenever I receive or I send messages to that community.
Maybe I jumped too fast to see the change, and you have something else to modify, in any case, I tried to test it, hope it helped.
Just in case, this community has 2 sub-groups, I have added 1 of this sub groups into the chat window and is the one I am looking to "hear".
edit - 3 hours later - So, I checked again and again, and it identifies the ID of the community, which I guess is correct, however, it has the ID number of the community, and still the sound is not being played. I wonder if it can "listen" to it, or should it be converted to something else, I mean, lookingforgroup works just fine, but the communities have "community:98765489758:1" (for example) , I wonder if that humber is no appropriate for the listener api used for the "normal" channels... just a thought, I hope I am not confusing you.
In reply to sylvanaar:
To the sounds.lua file, in the core function sections, i have added the following:
elseif msgtype == "COMMUNITIES_CHANNEL" then
print("channel: "..msgtype );
local chan = string.lower(message.ORG.CHANNEL)
print ("chan: "..chan.." - event: "..event);
for cname, value in pairs(self.db.profile.customlist) do
print ("cname: "..cname.." - value: "..value);
if strlen(cname) > 0 and chan == cname:lower() then
self:PlaySound(value)
end
end
To undestand better what is going on, and what I can attest is that chan brings the text of the channel, while what has been set in the self.db.profile.customlist is the "COMMUNITY:123123231:1" - ID - of the channel. They do not match, so what is missing here is a way to match the values...
I will keep researching to see if I can help on this one =)
In reply to sylvanaar:
Ok, found a solution, I am sure is not the best solution, and you surely will be able to make it better...
1- I changed "chatsections.lua" (in the Services subfolder), and to the SplitMessageSrc & SplitMessageIdx added this, right after "PRE"
COMM_CHAN = "",
&
"COMM_CHAN",
respectively. this way it could be mentioned as message.ORG.COMM_CHAN, the undesired effect (but useful anyways) is that it adds the comm_chan info before the channel name, to the channel, everytime anyone sends a message to it. IT is useful in the way that the service channelapi, for selecting the custom channels and setting them a specific sound, brings the channel as "COMMUNITY:1234567:1"instead of "My Community - General Chat", where the message.ORG.CHANNEL brings the "My Community - General Chat" and not the "COMMUNITY:1234567:1", which is the reason they do not match.
Then, in this same file I changed the bit of code starting with:
elseif chatGroup == "COMMUNITIES_CHANNEL" then
local starpos, endpos = string.find(arg4, ".")
local starpos, endpos = string.find(arg4, ".")
s.cC = "["
s.Cc = "] "
-- for some reason the starpos must be a +2 to take out whatever is before .
-- since the community name shows as "7. COMMUNITY:1234567:1"
local comm_chan = string.upper(string.sub(arg4, starpos + 2))
-- also took out all spaces to make sure had none
s.COMM_CHAN = comm_chan:gsub("%s+", "")
s.CHANNEL = _G.ChatFrame_ResolvePrefixedChannelName(arg4):match("%d%.%s+(.+)")
So a community channel will have - previous to the message itself - "COMMUNITY:1234567:1 [7. My Community - General Chat]"
2- The other change I did was on file Sounds.lua (insisde modules subfolder).
Inside:
function module:Prat_PostAddMessage(info, message, frame, event, text, r, g, b, id)
After the "question" of if msgtype = channel.. and before the current else...
if msgtype == "CHANNEL" then
...
elseif msgtype == "COMMUNITIES_CHANNEL" then
local chan = message.ORG.COMM_CHAN
for cname, value in pairs(self.db.profile.customlist) do
-- now both values, chan and cname are in upper.
if strlen(cname) > 0 and chan == cname then
self:PlaySound(value)
end
end
else
...
Probably best would be to have the original message.ORG.CHANNEL populated in the options to setup the sounds, and then no need to add the COMM_CHAN to the message bit. But I did not know how to do that ,how to retrieve the same name rather than the community:ID ... this is the first time I look into and change code in any addon... sorry about yours being the 1st =(
In any case, I hope this helps in order to understand and fix the issue for which the sound is not playing.
Thanks again!
In reply to wen_amarth:
Hey I love how much you have dug into this issue. Add-on coding can be a lot of fun!
When I was testing community chat after the fix in the morning I ran into a few of the issues you discovered, so I decided to sit on the fix I had written to see if I could think of anything simpler.
It looks like you worked most of it out yourself, that's awesome. You might be a future add-on author!
I'll push my fix once I have tested it a bit, and we can compare notes. The fix I think I may go with has one problem in that it can't tell the difference between a community chat channel and a regular chat channel (they can have the same names). I think its a weakness I might accept because I won't have to rewrite all the custom channel handing. Let's see - I would love to hear your feedback once I get it out this evening.
In reply to sylvanaar:
I do not fully understand the channel api lua script, but the message one is able to determine what channel it is, all communities start with community:ID:subchanel_ID
This is what I have understood from all the prints I have been adding around, though for the services I have been unable to see prints or know how to debug it, to see the values that are being assigned to the variables (i do work as a coder for the most part, so i understand logic, but on a new language, and new object concepts, I need a lot of research to understand this better, heh).
In any case, I do not see how the channel can be related to the channel name assigned for when you add it to a chat, and there might not be a solution to it =(
Thus the only thing I could think of, is transform the message part into the community ID needed in order to match the setups.
I just do not know where to start research for this... to help if I can to pin point best way to get the names ... though, if you have lots of code looking at the channel names, might mean a lot of changes would have to be done, if it would be possible to geht the ID + the name, both things would have to be taken into account in order to check whether an action has to be taken...
Anyways, looking forward to see your fix, I am sure you will find a better solution to this =)
In reply to wen_amarth:
I just pushed the change. The solution I came up with is really simple. It needs a bit more testing so I probably wont' release it today, but you can certainly pull it and try it.
The fix I put in is really simple as you can see - but it affects a few things, so they will all need some testing.
In reply to sylvanaar:
Needs to be tested thoroughly, but I think there is a relation between:
/run jj_id1, jj_name1, jj_disbld1, jj_id2, jj_name2, jj_disbld2, jj_id3, jj_name3, jj_disbld3, jj_id4, jj_name4, jj_disbld4 = GetChannelList();
/run ListChannels()
in the 4th jj_name4 position was the COMMUNITY:ID:subch
And in the 4th position in ListChannels() was the name corresponding to it "[4. My Community - General Chat".
Perhaps there is a relationship in there that can be exploted to get a data table of the getchannelName + the "ListChannels" position which would help to match and put the name of the chat in the options...
In reply to wen_amarth:
One thing that might help you is to take the Prat_Debug folder in the pullouts directory and pull it out into your addon folder.
You will get a lot of use out of the /pratdebugmsg slash command after that - plus it has all my cool debug stuff like tab complete on the lua environment and the pretty printing of lua tables.
Also you can get the wow ui source yourself to learn more. You can get it straight from the game, but also here from github: https://github.com/Gethe/wow-ui-source
Did you see the fix i posted - I am really curious if it fixed the problem without breaking anything
In reply to sylvanaar:
hey! Will look into it right now. It is 8.25 am here where I am xD
Will let you know as soon as I test it
In reply to sylvanaar:
In reply to sylvanaar:
Hey, I copied the 2 files you changed, but now I do not see the sounds option under the extra stuff tab. Am I missing something here?
Edit - copied the whole thing into the addon folder and worked out =)
In reply to sylvanaar:
In reply to sylvanaar:
In reply to sylvanaar:
Since I copied the whole thing I noticed now the debug, is there a way to disable it? Like an ON - OFF switch ? Or I would need to delete the pullouts directory ?
In reply to sylvanaar:
In reply to sylvanaar:
In reply to sylvanaar:
In reply to sylvanaar:
Ok, this is what I have teted...
I am in a community example "My community", it has the "General" subchannel and the "Special" subchannel.
I made sure to select "none" as the sound options and have no channel added to any chat window.
Exit the game, relog (at first I saw like thre was an option for a "my comunnity - " without adding the subchannel name, but I made sure everything set to none, and then it dissappeared - at first I assigned to it something but did not work , somehow was not really connected but showing like that).
So, with all cleaned up, when I add the channel to a chat window /prat won't show it till a RELOAD.
I just added the special subchannel to the chat window.
Once I reloaded, /prat, see the channel added as "My community - Special" and assigned a sound. And it worked just fine! =)
Errors I got, is when trying to create my own comunity, and a subchannel, something interefered with prat, and got a popup suggestion of disabling prat in order to be able to create the subchannel, then reload with prat on, and things kept working.
In reply to wen_amarth:
You can disable Prat_Debug in the addon control panel.