When playing a game, easily see the team to which a player belongs by looking at the colored rectangle found in front of their name! Here is a screen cap showing what it looks like when the AI talks to one another: Thanks to @mikeyh and @cola_colin for helping me make this mod. I would also like to thank @reptarking for all the love and support.
I used to love the idea of the old coloured chat mod, but it constantly broke chat. Hopefully this one won't
Do you mean the name being entirely colored instead of just the indicator? That's actually quite possible but it is not as flexible, since some colors make the name really hard to read.
I really love small but handy and good looking changes ^^ So @jables, maybe add something like this to the 'to do' list? Or allow yourselves to implement user mods
Oh, I think the better option would be to promote PAMM on the PA Main panel. Saves work for Uber and shows other obvious advantages
Code: api.panels.chat.message('update_player_color_index', primary_map); Should be guarded in case the chat panel does not exit. Shorthand would be `api.panels.chat &&`
Good suggestion, thanks. I've updated the mod. Did you notice anything else that I may need to guard? In other words, please forgive me for this horrendous hack and do you think there is a way around it? Code: model.getMessageFlairColor = function(data) { var color_map = model.color_map(); if (data.isServer()) { var message = data.message; // using substring to see if I can find the player name in the message, since the the actual player field has been stripped out :( for (var i = message.length; i >= 0; i--) { var _name = message.substring(0, i); /////////////////////////////////////////////////////////////////////////////////////// // it works....but it may fail if someone has an odd name like "x has disconnected" and // someone else also has the name x if (_name in color_map) { return color_map[_name].color; } } } if (data.isGlobal()) { if (data.player_name in color_map) { return color_map[data.player_name].color; } } return ''; }
Caution is a good virtue for a programmer; I probably check fewer things than I should. I noticed this one because I often turn off panels when I'm reloading a lot for mod dev. Uber has a couple of these unguarded messages as well, so you're in good company ;^)