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)
- AI 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:
Many thanks for the explanation sylvanaar. 😀
first of all thanks for this addon.. im using it for many years now.. i have an issue though these days.. all of the sudden when i type a msg and i try to use left or right directional keys to edit something it does not move anymore.... is there any thing i can try to fix it? thanks in advance :)
In reply to Forge_User_23196289:
I can't reproduce this issue. It is working fine here.
Not sure if the addon is causing this, but the font size in my editbox has changed and is now different than my chat font size. Mildly annoying! Any ideas on how I can change the size of the editbox text?
In reply to slargy767:
Noticing same.
In reply to Myrishka:
Good to know it's not just me then. Hopefully someone can help.
In reply to slargy767:
I went back to 3.7.5.0 for now (Jan 26 2020 version). Edit box font issue "fixed."
In reply to slargy767:
Same problem here. Reverting
In reply to slargy767:
There were a couple changes that affected this which have been reverted. Check the latest release.
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.