add highlight to SYSTEM_NARROWCAST (your X on Y was destroyed by Z) messages

This commit is contained in:
Jon Atkins 2013-04-05 00:36:38 +01:00
parent 1d55fc5d31
commit a2a9d3458d
2 changed files with 11 additions and 3 deletions

View File

@ -315,7 +315,7 @@ window.chat.writeDataToHash = function(newData, storageHash, skipSecureMsgs) {
if(skipThisEntry) return true;
// format: timestamp, autogenerated, HTML message, player guid
storageHash.data[json[0]] = [json[1], auto, chat.renderMsg(msg, nick, time, team, msgToPlayer), pguid];
storageHash.data[json[0]] = [json[1], auto, chat.renderMsg(msg, nick, time, team, msgToPlayer, systemNarrowcast), pguid];
window.setPlayerName(pguid, nick); // free nick name resolves
});
@ -365,14 +365,18 @@ window.chat.renderDivider = function(text) {
}
window.chat.renderMsg = function(msg, nick, time, team, msgToPlayer) {
window.chat.renderMsg = function(msg, nick, time, team, msgToPlayer, systemNarrowcast) {
var ta = unixTimeToHHmm(time);
var tb = unixTimeToString(time, true);
// help cursor via “#chat time”
var t = '<time title="'+tb+'" data-timestamp="'+time+'">'+ta+'</time>';
if ( msgToPlayer )
{
t = '<div class="pl_nudge_date">' + t + '</div><div class="pl_nudge_pointy_spacer"></div>';
t = '<div class="pl_nudge_date">' + t + '</div><div class="pl_nudge_pointy_spacer"></div>';
}
if (systemNarrowcast)
{
msg = '<div class="system_narrowcast">' + msg + '</div>';
}
var s = 'style="cursor:pointer; color:'+COLORS[team]+'"';
var title = nick.length >= 8 ? 'title="'+nick+'" class="help"' : '';

View File

@ -249,6 +249,10 @@ em {
white-space: nowrap;
}
#chat td .system_narrowcast {
color: #f66 !important;
}
mark {
background: transparent;
}