WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Search/Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=6)
-   -   Color RealID whispers by class? (https://www.wowinterface.com/forums/showthread.php?t=48740)

Wimpface 12-29-13 05:18 PM

Color RealID whispers by class?
 
Google searched yielded nothing but ElvUI and ShestakUI links.

I'm looking for a standalone addon that colors RealID whispers by class. RealID whispers aren't that confusing to tell apart because they use real names, but Battle Tags really get to me for some reason. Many times now have I sent a whisper to the wrong person because I'm whispering different battle tags and they're all similar length and same color. Just coloring the name would go a long way for me.

Does anyone know if such an addon exists?

Xrystal 12-29-13 05:49 PM

Try PhanxChat. The description I read on that addon says that it replaces RealID names with character names. Its possible that it also colors by class or this change makes the color by class option in the default blizz chat settings work for them as well.

Apart from that I don't see a specific addon that does just what you want, but it might be worth trying out the chat addons to see if they do what you want as well as other stuff.

Wimpface 12-29-13 05:57 PM

Quote:

Originally Posted by Xrystal (Post 288895)
Try PhanxChat. The description I read on that addon says that it replaces RealID names with character names. Its possible that it also colors by class or this change makes the color by class option in the default blizz chat settings work for them as well.

Apart from that I don't see a specific addon that does just what you want, but it might be worth trying out the chat addons to see if they do what you want as well as other stuff.

Last time I checked, Phanx was not a big fan of having his/her addons included in compilations, something that is an issue for me.

I'm also fairly happy with my current chat addon, and this is the only functionality I sorely miss. I cut Chatter for this because I felt Chatter was too cluttered for my needs, not to mention the bugs with channel name replacements.

I tried looking into adding the functionality by ripping some code out of ElvUI, but that ended up horribly confusing.

Xrystal 12-29-13 06:08 PM

Ah, didn't realise you wanted to add it to a compilation.

I'll have a dabble before I head off to bed to see if I can rig up something small.

Wimpface 12-29-13 06:32 PM

Quote:

Originally Posted by Xrystal (Post 288897)
Ah, didn't realise you wanted to add it to a compilation.

Unfortunately, but I'm not even sure I wouldn't be here asking either way.

Quote:

Originally Posted by Xrystal (Post 288897)
I'll have a dabble before I head off to bed to see if I can rig up something small.

This would be very nice! I'd really appreciate that. I can wait, however, so don't feel pressured on time if you'd rather sleep. I'm in no hurry.

Xrystal 12-29-13 08:00 PM

1 Attachment(s)
Give this a whirl. I couldn't test it properly as the person I usually chat to for hours on end wasn't in game today. And my only other bnet friend online was in and out of dungeons and it bugged out on the only message I got rofl.

Did some tweaking and added some messages for debugging purposes. Just set debugMessages to false and the messages will stop appearing on the next UI reload.

Let me know if it still doesn't work and send a screenshot of those debug messages in that instance and I'll spend some time on it when my chatty friend next logs in, before start playing.

Phanx 12-29-13 08:24 PM

Yes, you can include my addons in compilations, but you cannot modify them in any way.

If you want to modify one of my addons for your compilation, you have to rename it, removing all traces of the original name, so it cannot possibly be confused with the original addon, and nobody will come to me looking for help if/when it breaks.

If you want an addon that just colors RealID names by class, you are also free to copy the code from PhanxChat that does that, and use it to write your own addon.

All of this is clearly spelled out in the LICENSE.txt file in the addon folder, by the way.

Wimpface 12-29-13 08:39 PM

Quote:

Originally Posted by Phanx (Post 288905)
Yes, you can include my addons in compilations, but you cannot modify them in any way.

If you want to modify one of my addons for your compilation, you have to rename it, removing all traces of the original name, so it cannot possibly be confused with the original addon, and nobody will come to me looking for help if/when it breaks.

If you want an addon that just colors RealID names by class, you are also free to copy the code from PhanxChat that does that, and use it to write your own addon.

All of this is clearly spelled out in the LICENSE.txt file in the addon folder, by the way.

That clears up a lot, my information was based on the word of a friend who had to pull PhanxChat from his UI a few years ago. I've never run into this issue myself, though.

And it would've been modified, good to know that you prefer renaming the addon completely rather than pulling the addon.

I'll try out the addon Xrystal, and report back on any issues I come across after this flex. Thanks a ton!

Phanx 12-30-13 12:02 AM

Quote:

Originally Posted by Wimpface (Post 288907)
And it would've been modified, good to know that you prefer renaming the addon completely rather than pulling the addon.

Basically I don't give a flying potato what anyone does with code I wrote, I just don't want people pestering me with bug reports for bugs in code I didn't write. It's annoying enough when people claim to be using "the latest version" and I waste my time investigating a bug that turns out to be caused by them running a 3-year-old version of the addon. :mad:

Wimpface 12-30-13 12:18 AM

Quote:

Originally Posted by Phanx (Post 288912)
Basically I don't give a flying potato what anyone does with code I wrote, I just don't want people pestering me with bug reports for bugs in code I didn't write. It's annoying enough when people claim to be using "the latest version" and I waste my time investigating a bug that turns out to be caused by them running a 3-year-old version of the addon. :mad:

Completely understandable and seems to be a common stance. I misunderstood your opinion on this, sorry for my faulty assumption. :)

EDIT: As for the addon, all my RealID friends logged out when I wanted to test it, so it'll have to wait until tomorrow.

EDIT#2: Okay, I've done some testing with a friend. With the addon enabled, I don't even see his messages. They're just completely gone. Without it, it displays just fine.

He's on the same server as me.
He's a RealID friend, not a BattleTag friend.
He does not have any special characters in his name or character name, or realm name. No apostrophes, nothing.
I tried with my chat addon enabled and disabled, no change.
Debug messages seem to work fine. I've blocked out his name, but that's it. It does show as Player Name (CharName-Server Name) in classcolor under that block.

That is the entire message I get when he sends a whisper to me with debugging on. It doesn't show the actual whisper still, but I'm unsure if that's intentional or not when debugging.

ravagernl 12-30-13 02:22 PM

Quote:

Originally Posted by Wimpface (Post 288914)
EDIT#2: Okay, I've done some testing with a friend. With the addon enabled, I don't even see his messages. They're just completely gone. Without it, it displays just fine.(...)

IIRC from playing with ChatFrame_AddMessageEventFilter, the first return value of ChatFrame_AddMessageEventFilter is checked in boolean mode, that means if the first value equates to true, the message is filtered(and being prevented from passing towards the :AddMessage() method). The first return value in the code in XRealIDColors.lua(horrible name by the way :D) on line 54 is always passing the third argument passed to the function(message), which always equates to true, as a result, the message is hidden.

The correct way to do it, is AFAIK the following:
lua Code:
  1. return false, message, sender, ...
instead of
lua Code:
  1. return message, sender, ...

Aside from that, the code creates 2 tables for each bnet whisper. Blegh :P

Xrystal 12-30-13 02:48 PM

1 Attachment(s)
hmm, thought I had the correct return values, but perhaps not .. will take another look. And monitor my bnet friend messages today.

Oops, yes, forgot to add in the false value at the front of the 2 return lines to make sure the messages get output again. Brain was working but fingers weren't rofl.

Version attached to this message contains that extra change. Will see what I see happening tonight and will report back if it is doing what I am expecting it to do based on your initial post.

Based on your post after testing it sounds like the only problem was due to the missing false/true value as to whether to filter the message away. Adding that false in should make it work.

edit (after testing) : Well good news is that coloring seems to work, bad news is it is display extra stuff so it could be the way I am formatting the color that is wrong.

Phanx 12-30-13 06:18 PM

Code:

local function ColorBNetWhispers(self,event,message,sender,...)
        local args = { ... }
        ...
        local toonInfo = { BNGetToonInfo(presenceID) }

What is this, I don't even... why on earth are you creating all these tables instead of just using variables?! ಠ_ಠ

Code:

local function ColorBNetWhispers(self, event, message, sender, _, _, _, flags, _, _, _, _, lineID, _, presenceID)
        ...
        local hasFocus, toonName, client, realmName, realmID, faction, race, class, guild, zoneName, level, gameText, broadcastText, broadcastTime, canSoR, toonID = BNGetToonInfo(presenceID)


Wimpface 12-30-13 08:11 PM

Quote:

Originally Posted by Xrystal (Post 288923)
edit (after testing) : Well good news is that coloring seems to work, bad news is it is display extra stuff so it could be the way I am formatting the color that is wrong.

This doesn't appear to be the only issue left. I think the way it's formatted also screws up being able to click on the player name to send a message. It also messes with replying using the 'r' key, so to speak. It will try to send to the formatted player and won't find it.

When trying to reply to a player, currently, it'll return "Unable to whisper 'ExamplePlayer (Example-Example Server)'.", classcolored and all. I'm unsure if this is a problem with the formatting, or if it'll be a lasting issue.

Phanx 12-30-13 08:33 PM

You're going to have to pre-hook the chat frame's AddMessage method instead of using a chat filter. Chat filters are intended for changing the message text only; changing other values will have other (mostly undesirable) effects on how the chat system processes the message before displaying it in the chat frame. See PhanxChat for a working example.

Xrystal 12-30-13 09:04 PM

1 Attachment(s)
Thanks Phanx, will do.

Edit: Okay, gonna take me a while to figure this out ... Any time I try to adjust AddMessage function it crashes wow, so I guess I am doing something wrong somewhere rofl.

Edit2: Good News is it now color codes the Names and shows the Toon Name and Server based on toggle setting to do so. Bad News is that it currently crashes if you log in / reload and you don't have any realID friends online or seems to go into an infinite loop and crashes if your realID friend logs off. Phanx or anyone else, is there anything you can see in this code that may cause that as I can't seem to see anything that I am not covering myself for so that it simply returns an unformatted message string.

Removed the toast test since the crashing/hanging etc as it isn't really need in this instance so will see if that might be the cause of the issue but just in case it isn't the cause, here is the code in its entirety and a download version if you prefer.

Lua Code:
  1. local addonName, addonData = ...
  2.  
  3. local showToonName = true
  4. local showRealmName = showToonName and true
  5. local debugMessages = true
  6.  
  7. local bnNameFormat = "%s"
  8. local playerBNFormat = "|HBNplayer:%s|h" .. bnNameFormat .. "%s|h"
  9. local playerBNPattern = "|HBNplayer:(.-)|h%[(|Kf(%d+).-)%](.*)|h"
  10.  
  11. local function RGB_TO_HEX(rgb)
  12.     return string.format("%02x%02x%02x", rgb.r*255, rgb.g*255, rgb.b*255)
  13. end
  14.  
  15. local function ColorToonName(chatFrame,message,...)
  16.     local bnData, bnName, bnID, bnExtra = string.match(message, playerBNPattern)
  17.  
  18.     if bnData then
  19.         local toonInfo = { BNGetToonInfo(bnID) }
  20.         local link = string.format(playerBNFormat, bnData, bnName, bnExtra or "")
  21.  
  22.         if toonInfo[3] ~= "WoW" or toonInfo[3] == nil then
  23.             message = string.gsub(message, playerBNPattern, link)
  24.         else
  25.             local toonName = toonInfo[2]
  26.             local realmName = toonInfo[4]
  27.             local class = toonInfo[8]
  28.  
  29.             local color = RAID_CLASS_COLORS[class]
  30.             local classToken = addonData.ClassNames[class]
  31.             if not color then
  32.                 color = RAID_CLASS_COLORS[classToken]
  33.             end
  34.             local colorHex = RGB_TO_HEX(color)
  35.  
  36.             if showToonName then
  37.                 if showRealmName then
  38.                     coloredSender = string.format("|cff%s %s (%s-%s)|r",colorHex,bnName,toonName,realmName)
  39.                 else
  40.                     coloredSender = string.format("|cff%s %s (%s)|r",colorHex,bnName,toonName)
  41.                 end
  42.             else
  43.                 coloredSender = string.format("|cff%s %s|r",colorHex,bnName)
  44.             end
  45.  
  46.             link = string.format(playerBNFormat, bnData, coloredSender, bnExtra or "")
  47.             message = string.gsub(message, playerBNPattern, link)
  48.  
  49.         end
  50.     end
  51.     return message
  52. end
  53.  
  54. local function AddMessage(chatFrame, message, ...)
  55.     if type(message) == "string" then
  56.         local bnData, bnName, bnID, bnExtra = strmatch(message, playerBNPattern)
  57.         if bnData then
  58.             message = ColorToonName(chatFrame,message,...)
  59.         end
  60.     end
  61.     addonData[chatFrame].AddMessage(chatFrame,message, ...)
  62. end
  63.  
  64. addonData.XRICEvents = CreateFrame("Frame")
  65. addonData.XRICEvents:RegisterEvent("ADDON_LOADED")
  66. addonData.XRICEvents:SetScript("OnEvent",function(self,event,...)
  67.  
  68.     local args = { ... }
  69.  
  70.     if event == "ADDON_LOADED" and args[1] == addonName then
  71.         addonData.ClassNames = {}
  72.         for k, v in pairs(LOCALIZED_CLASS_NAMES_MALE) do
  73.                 addonData.ClassNames[v] = k
  74.         end
  75.         for k, v in pairs(LOCALIZED_CLASS_NAMES_FEMALE) do
  76.                 addonData.ClassNames[v] = k
  77.         end
  78.  
  79.         for i = 1, NUM_CHAT_WINDOWS do
  80.             local chatFrame = _G["ChatFrame" .. i]
  81.             addonData[chatFrame] = addonData[chatFrame] or {}
  82.             if ( not addonData[chatFrame].AddMessage ) then
  83.                 addonData[chatFrame].AddMessage = chatFrame.AddMessage
  84.                 chatFrame.AddMessage = AddMessage
  85.             end
  86.         end
  87.     end
  88.  
  89. end)

Phanx 12-31-13 01:38 AM

Code:

addonData.XRICEvents:SetScript("OnEvent",function(self,event,...)
    local args = { ... }

Stop doing this! Tables bad. Variables good. Use variables. No use tables.

See here for a quick and untested (but clean) conversion of the relevant parts of PhanxChat into a standalone addon:
http://www.wowace.com/paste/lmszetyg58bn621q/

Xrystal 12-31-13 07:30 AM

Thanks for the input Phanx. Did a bit of research on the difference between table based variables and standalone variables and there is a slight improvement on performance and of course readability. I am guessing that is why you are saying not to use them, you weren't clear there. I will of course take it under advisement when finalising the addon beyond this testing phase.

Looking at your extracted example I am assuming the temporary window element is required due to the fact that you can move a RealID conversation into a separate chat frame. Will add that element in and test it. Thanks again.

As to the initial crashing of the game when no one was online, removing the unnecessary toast test seemed to stop that from happening. Next test is to see what happens when a friend logs in and then out. So time to wait.

Wimpface 12-31-13 02:37 PM

Quote:

Originally Posted by Phanx (Post 288956)
Code:

addonData.XRICEvents:SetScript("OnEvent",function(self,event,...)
    local args = { ... }

Stop doing this! Tables bad. Variables good. Use variables. No use tables.

See here for a quick and untested (but clean) conversion of the relevant parts of PhanxChat into a standalone addon:
http://www.wowace.com/paste/lmszetyg58bn621q/

Is line 80 supposed to read like that? Won't this throw an error?
Code:

local firstName = local short = gsub(realName, "|Kf", "|Kg")
EDIT: Shouldn't it be
Code:

local firstName = gsub(realName, "|Kf", "|Kg")

Xrystal 12-31-13 02:46 PM

So far my version is working fine now apart from temporary chat frames. Still need to test and fix that scenario. But friends logging in and out don't seem to be crashing the game and neither does not having a friend online ( which at the moment seems to be 90% of the time nowadays rofl ).

Wimpface 12-31-13 03:01 PM

Quote:

Originally Posted by Xrystal (Post 288969)
So far my version is working fine now apart from temporary chat frames. Still need to test and fix that scenario. But friends logging in and out don't seem to be crashing the game and neither does not having a friend online ( which at the moment seems to be 90% of the time nowadays rofl ).

Is it the version you last provided in this thread? Or is there a newer one after that? I don't use temporary chat frames, so it would be fine for me to use it with a lack of that functionality, until if/when you decide to release a complete version.

If you don't mind, ofcourse.

Xrystal 12-31-13 03:22 PM

Yeah the last one attached was the version that didn't seem to crash anymore so give it a whirl again. The version I have been tested just has the changes for the temporary chat frame to test .. but sure go ahead and use what's here. Let me know if something else goes gaga on it or you spot something that isn't doing what you expected. I'll update the thread once I have a proper addon up and running that's been properly tested.

Wimpface 12-31-13 03:47 PM

Quote:

Originally Posted by Xrystal (Post 288971)
Yeah the last one attached was the version that didn't seem to crash anymore so give it a whirl again. The version I have been tested just has the changes for the temporary chat frame to test .. but sure go ahead and use what's here. Let me know if something else goes gaga on it or you spot something that isn't doing what you expected. I'll update the thread once I have a proper addon up and running that's been properly tested.

Last version doesn't seem to affect BattleTags, unsure about RealID because none of my RealID friends are online. It's almost new years here in Europe, so not too surprising that it's tough to test today. :p

Xrystal 12-31-13 04:06 PM

Hmm, my battle tag friends haven't logged in for months .. only have a few real id friends so that's all I've been able to test with. And yeah, I can hear the fireworks outside already. My friends are in the states so I usually get to see them later in the day but today probably not much at all. I'll try and find some battle tag friends amongst the regular guildies and look into that element.

Does it show Battle Tags as the name when chatting to them ? All my friends have names that display so never have seen the battle tags appearing.

Wimpface 12-31-13 05:23 PM

Quote:

Originally Posted by Xrystal (Post 288973)
Hmm, my battle tag friends haven't logged in for months .. only have a few real id friends so that's all I've been able to test with. And yeah, I can hear the fireworks outside already. My friends are in the states so I usually get to see them later in the day but today probably not much at all. I'll try and find some battle tag friends amongst the regular guildies and look into that element.

Does it show Battle Tags as the name when chatting to them ? All my friends have names that display so never have seen the battle tags appearing.

If I whisper someone with a battle tag, it'll just show their tag, like nothing's changed at all. It's not colored, just the regular message.

If I whisper someone with the battle tag MrExample, it'll show as
Quote:

12:34 to MrExample > Hi, how are you?
... Without classcolor. :(

EDIT: Why write it when a picture says a thousand words?


EDIT#2: A RealID friend logged in, and I tested it further. I get the same result with RealID friends, no classcolor on the name. The login message is classcolored, through.

Xrystal 12-31-13 08:12 PM

2 Attachment(s)
Hmm, very weird. I don't think I made any more changes since the last post to the messaging. I guess more tests and screenshots. No friends online at the moment so I can't test yet.

Well here's the latest I have with the added attempt at it working in the Temporary Chat Frame as well which the last test it didn't work but tests against 2 of my realID friends after I last posted the files showed their real name/character and realm names were all colored with that character's class. And here's the last screenshot I took when I last uploaded that file.

Just in case it is affecting it .. are you using a chat addon that formats the output ? Perhaps it is overriding my changes with its own.

Phanx 12-31-13 08:43 PM

Xrystal, the main problem with your implmentation (aside from questionable coding practices) is that you're spending CPU and memory re-coloring the same name with the same color every time you get a message. It's more efficient to just update a static list whenever a friend's status changes, so you can just do a simple table lookup for each message, instead of needing to call functions and format strings.

Quote:

Originally Posted by Wimpface (Post 288968)
Is line 80 supposed to read like that? Won't this throw an error?

Yes, and your correction is correct.

Quote:

Originally Posted by Xrystal (Post 288965)
Thanks for the input Phanx. Did a bit of research on the difference between table based variables and standalone variables and there is a slight improvement on performance and of course readability. I am guessing that is why you are saying not to use them, you weren't clear there. I will of course take it under advisement when finalising the addon beyond this testing phase.

Creating a variable is basically free, as the value already exists in memory, and you're just pointing to it. Creating a table is not free, as the object does not already exist, and creating it takes up space in memory. Discarding a table is also more expensive than discarding a variable, since in addition to the values, the garbage collector must also collect the table object containing them. Finally, looking up a value in a table is more expensive that simply reading a variable. Between all this, and the fact that there's absolutely no upside to using a table like this, and the fact that you have to remember what each value in the argument list was instead of being able to give them descriptive names, there's just no reason to ever use a table this way. I cringe just imagining whatever nightmarish cesspool of terrible example code you got that idea from in the first place. :(

Xrystal 12-31-13 09:50 PM

Thanks Phanx,

I appreciate your input regarding my programming practices.

I found that usage somewhere in a lua tutorial or another addon somewhere during a hunt to investigate something a few months back and found it useful for my event argument tracking.

http://www.lua.org/pil/5.1.html
Quote:

function foo0 () end -- returns no results
function foo1 () return 'a' end -- returns 1 result
function foo2 () return 'a','b' end -- returns 2 results

A constructor also collects all results from a call, without any adjustments:
a = {foo0()} -- a = {} (an empty table)
a = {foo1()} -- a = {'a'}
a = {foo2()} -- a = {'a', 'b'}

There is nothing there that says this should not be used for single variables, as you can see they even show it as an example. Granted other sites have commented that tables are slightly more memory hoggers than individual values so I will monitor my usage of this type of thing to make sure it doesn't get out of hand.

At the time when I saw that being demonstrated I felt that 1 line holding the values of whatever arguments that current event needed would be a lot better than several lines of specific values being used. In this instance, however, at least so far, it doesn't look to be needed, and will if it stays that way be rectified. So please don't look at one piece of code and question my programming practice on what is essentially a beta version when you come to think of it.

I agree with your notice of the fact I am recoloring every time a chat is sent and received, in my case that is minimal but in the instance of someone playing one toon and chatting significantly I can see the flaw in it. Will look into changing that ready for my next test session.

Phanx 12-31-13 11:39 PM

Quote:

Originally Posted by Xrystal (Post 288980)
http://www.lua.org/pil/5.1.html ... There is nothing there that says this should not be used for single variables, as you can see they even show it as an example. Granted other sites have commented that tables are slightly more memory hoggers than individual values so I will monitor my usage of this type of thing to make sure it doesn't get out of hand.

The actual Lua language documentation is pretty technical, and most of the examples there are more "this is how the language works" and not necessarily "this is how you should use the language". Kind of like when you're learning a human language and you find examples like "the bird drinks the milk" or "the sock is on the roof" or "the external teacher arrives" in your textbook, even though those are not real sentences anyone would ever say.

pelf 01-01-14 10:13 AM

I wouldn't say that it's unreasonable to expect a beginning programmer (who doesn't event know the phrase "best practices") to assume that the official documentation is exemplary in both what one can do and how one should do it. Lord knows I wasn't filtering examples through any kind of sanity filter when I was learning BASIC, HTML and JavaScript back in middle school and high school -- I didn't have a programming sanity filter at that point.

Xrystal 01-01-14 01:40 PM

3 Attachment(s)
Thanks pelf. I'm not a novice programmer but the only lua programming I have done is with wow, and programming I did 20 years ago is somewhat outdated now, and definitely rusty. The way lua uses tables is different to the way that other programming languages I have used. Hence, why I usually make some changes when I am pointed away from it.

Some of the coding I have seen in addon's blow my head away but I use those to find out how they do what they do which then makes me realise that some of my addons are due a rewrite rofl.

Anyway, thanks to Cooper's ( on these forums ) assistance I have managed to rewrite the addon so that as much as possible is done when the player logs in or their friends logs in so that the AddMessage function just has to print it.

Please find the new version with all the changes including the temporary chat window part with a couple of screenshots.

Let me know if this is working for you now Wimpface.

Wimpface 01-01-14 02:13 PM

It seems to be working fine! I'll do more extensive testing and report back if I find any issues.

Thanks a ton, Xrystal. Saved me from many misstells. :D

EDIT: Found a conflict, haste's iiLinks.

Xrystal 01-01-14 02:44 PM

1 Attachment(s)
What happens when that addon is active ? Does what it do get ignored because mine overrides it or does mine get ignored because it overrides mine ?

A quick look at their code it sounds like what is probably happening is that by the time my addon gets to using it's version of AddMessage iiLinks version has changed what message is now there which means the pattern matching and formatting I have is now broken. This probably explains why there are no small addons that do little bits and pieces of the chatframe as it is more likely to be overwritten by others that are also installed and changing the same functionality.

Will have to monitor and check to see what happens when someone logs in ..

Edit: Well a real id friend logging in message was not affected by the ilinks addon so far. Here is a picture showing the iLinks addon working on an item link and the playerBNLink apparently working fine when my friend logs in. But can see that messages sent messes up ... then I get logged out .. weird.

Wimpface 01-01-14 03:26 PM

Quote:

Originally Posted by Xrystal (Post 289024)
What happens when that addon is active ? Does what it do get ignored because mine overrides it or does mine get ignored because it overrides mine ?

A quick look at their code it sounds like what is probably happening is that by the time my addon gets to using it's version of AddMessage iiLinks version has changed what message is now there which means the pattern matching and formatting I have is now broken. This probably explains why there are no small addons that do little bits and pieces of the chatframe as it is more likely to be overwritten by others that are also installed and changing the same functionality.

Will have to monitor and check to see what happens when someone logs in ..

Edit: Well a real id friend logging in message was not affected by the ilinks addon so far.

A friend logging in doesn't affect it, but messages are affected. iiLinks overrides XRealIDColors making it do nothing.

Xrystal 01-01-14 03:49 PM

Looks like I need to reverse this block of code :

local AddMessage = function(self, text,...)
if(type(text) == "string") then

text = text:gsub("|H(.-)|h%[(.-)%]|h", "|H%1|h%2|h")
end


return origs[self](self, text, ...)
end


so that my addon is back to using the default player link or add in a check so that it ignores BNPlayer links. And again my friends log off, so will take a break for now and see who is online later before I head off to bed.

Wimpface 01-01-14 03:55 PM

Quote:

Originally Posted by Xrystal (Post 289030)
Looks like I need to reverse this block of code :

Code:

        local AddMessage = function(self, text,...)
                if(type(text) == "string") then
                       
                        text = text:gsub("|H(.-)|h%[(.-)%]|h", "|H%1|h%2|h")
                end


                return origs[self](self, text, ...)
        end

so that my addon is back to using the default player link or add in a check so that it ignores BNPlayer links. And again my friends log off, so will take a break for now and see who is online later before I head off to bed.

Cool, if you were on EU I could've been your friend and tester. :(

Xrystal 01-04-14 04:40 PM

3 Attachment(s)
Okay, thankfully I have a couple of cool Battle Net friends that are quite happy with me sending them test messages while they run dungeons and stuff rofl, so finally got it figured out and with the help of this thread : http://www.wowinterface.com/forums/s...ad.php?t=38821 I learnt what pattern change I needed to make.

It now works whether iiLinks is loaded or not.

New version and screenshots attached. Let me know if this works now for you Wimpface.

Wimpface 01-05-14 03:03 AM

Sorry for the late response, I'll try it out together with iiLinks as soon as a friend logs on.

Don't know how to thank you!

EDIT: It works! I found a teeny tiny bug if you're a perfectionist, but it's barely noticeable. I'm super happy right now. The login-message has brackets and isn't classcolored. I'm going to try with different options turned off and on.



God what a wonderful person you are.

Xrystal 01-05-14 08:27 AM

Yeah I noticed the login message had stopped being coloured and added it to the list of things to figure out.

I also noticed that for some reason when my friend was toon hopping it wasn't recognising the realmName which was somehow "" rather than nil or a value so it displayed the "-" separator but not the realm itself so changed that, but now it seems that it doesn't show the realm at all, at least for toon hoppers.

And the brackets are probably an after affect of the iiLinks addon removing them and me adding them to make my addon work, was hoping iiLinks would remove the ones I added after making my change but maybe not. I didn't notice them at my end but will check it out over the next week or so.

Let me know if something crops up over the next few days or so and I'll add it to my list of things to figure out.

Wimpface 01-05-14 08:47 AM

Quote:

Originally Posted by Xrystal (Post 289263)
And the brackets are probably an after affect of the iiLinks addon removing them and me adding them to make my addon work, was hoping iiLinks would remove the ones I added after making my change but maybe not. I didn't notice them at my end but will check it out over the next week or so.

If that's the issue, could it not potentially be solved by something as simple as making XRealIDColor load before iiLinks? Just changing the name should, if so, solve it. Correct?

Quote:

Originally Posted by Xrystal (Post 289263)
Let me know if something crops up over the next few days or so and I'll add it to my list of things to figure out.

Will do, but I don't think there's much more to figure out. I'll keep an eye out, loving it though. I'll keep an eye out for toon hopping issues too, although I don't display realm name so that issue will pass me by unfortunately (or fortunately). :)

Xrystal 01-05-14 12:08 PM

I don't think that's it, I think the fact that both problems exist on just that element means that the fix I did for the normal chat display doesn't catch the log in and log out segments. So it adds the brackets but because it isn't processing them properly for some reason they never get removed again, like the regular chat ones do.

So, at present I'm monitoring the actual log in and log out events to see what is different.

Xrystal 01-05-14 03:18 PM

3 Attachment(s)
As I suspected it was just a case of trapping the logging in message so that I don't add the brackets in as iiLinks ignores it, similar to the Temporary Chat Frame.

Think its at the point where it is pretty much doing what you want consistently, and as you can see sometimes the realm name does appear, so my trap to validate before displaying just stops unknown realms from displaying until it gets updated later on.

So, final version and more screenshots added. Will post up an official version over the next day or so, which will only include allowing customisation of the settings in the game and saving them if I decide to add that facility.

edit: Rereading that last paragraph doesn't come across the way I meant .. I meant that the only addition to this code will be if I allow customisation of the settings.

Wimpface 01-05-14 08:55 PM

You're a saint Xrystal, thank you so much for taking the time and effort to do this. :)

Stanzilla 06-18-16 06:01 PM

Is this still possible? Can't figure it out atm :/


All times are GMT -6. The time now is 05:56 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI