Thread Tools Display Modes
12-31-13, 03:01 PM   #21
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
Originally Posted by Xrystal View Post
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.
__________________
All I see is strobe lights blinding me in my hindsight.
  Reply With Quote
12-31-13, 03:22 PM   #22
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
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.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
12-31-13, 03:47 PM   #23
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
Originally Posted by Xrystal View Post
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.
__________________
All I see is strobe lights blinding me in my hindsight.
  Reply With Quote
12-31-13, 04:06 PM   #24
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
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.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818

Last edited by Xrystal : 12-31-13 at 04:51 PM.
  Reply With Quote
12-31-13, 05:23 PM   #25
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
Originally Posted by Xrystal View Post
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
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.
__________________
All I see is strobe lights blinding me in my hindsight.

Last edited by Wimpface : 12-31-13 at 07:40 PM.
  Reply With Quote
12-31-13, 08:12 PM   #26
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
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.
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_123113_052733.jpg
Views:	222
Size:	294.2 KB
ID:	7984  
Attached Files
File Type: zip XRealIDColors.zip (1.4 KB, 139 views)
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818

Last edited by Xrystal : 12-31-13 at 08:15 PM.
  Reply With Quote
12-31-13, 08:43 PM   #27
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.

Originally Posted by Wimpface View Post
Is line 80 supposed to read like that? Won't this throw an error?
Yes, and your correction is correct.

Originally Posted by Xrystal View Post
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.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
12-31-13, 09:50 PM   #28
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
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
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.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
12-31-13, 11:39 PM   #29
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Xrystal View Post
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.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
01-01-14, 10:13 AM   #30
pelf
Sentient Plasmoid
 
pelf's Avatar
Premium Member
Join Date: May 2008
Posts: 133
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.
  Reply With Quote
01-01-14, 01:40 PM   #31
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
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.
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_010114_183104.jpg
Views:	211
Size:	356.6 KB
ID:	7985  Click image for larger version

Name:	WoWScrnShot_010114_183702.jpg
Views:	220
Size:	330.3 KB
ID:	7986  
Attached Files
File Type: zip XRealIDColors.zip (2.8 KB, 149 views)
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
01-01-14, 02:13 PM   #32
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
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.

EDIT: Found a conflict, haste's iiLinks.
__________________
All I see is strobe lights blinding me in my hindsight.

Last edited by Wimpface : 01-01-14 at 02:20 PM.
  Reply With Quote
01-01-14, 02:44 PM   #33
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
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.
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_010114_212242.jpg
Views:	204
Size:	328.8 KB
ID:	7988  
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818

Last edited by Xrystal : 01-01-14 at 03:30 PM.
  Reply With Quote
01-01-14, 03:26 PM   #34
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
Originally Posted by Xrystal View Post
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.
__________________
All I see is strobe lights blinding me in my hindsight.
  Reply With Quote
01-01-14, 03:49 PM   #35
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
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.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
01-01-14, 03:55 PM   #36
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
Originally Posted by Xrystal View Post
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.
__________________
All I see is strobe lights blinding me in my hindsight.
  Reply With Quote
01-04-14, 04:40 PM   #37
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
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.
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_010414_222915.jpg
Views:	205
Size:	980.6 KB
ID:	7990  Click image for larger version

Name:	WoWScrnShot_010414_222912.jpg
Views:	203
Size:	1.01 MB
ID:	7991  
Attached Files
File Type: zip XRealIDColors.zip (3.0 KB, 161 views)
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
01-05-14, 03:03 AM   #38
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
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.
__________________
All I see is strobe lights blinding me in my hindsight.

Last edited by Wimpface : 01-05-14 at 04:03 AM.
  Reply With Quote
01-05-14, 08:27 AM   #39
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
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.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
01-05-14, 08:47 AM   #40
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
Originally Posted by Xrystal View Post
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?

Originally Posted by Xrystal View Post
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).
__________________
All I see is strobe lights blinding me in my hindsight.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Color RealID whispers by class?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off