From a2a9d3458d19e81a06eb67a21d49e72d16b8d7ea Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Fri, 5 Apr 2013 00:36:38 +0100 Subject: [PATCH] add highlight to SYSTEM_NARROWCAST (your X on Y was destroyed by Z) messages --- code/chat.js | 10 +++++++--- style.css | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/code/chat.js b/code/chat.js index 420b2cf4..67c23ed8 100644 --- a/code/chat.js +++ b/code/chat.js @@ -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 = ''; if ( msgToPlayer ) { - t = '
' + t + '
'; + t = '
' + t + '
'; + } + if (systemNarrowcast) + { + msg = '
' + msg + '
'; } var s = 'style="cursor:pointer; color:'+COLORS[team]+'"'; var title = nick.length >= 8 ? 'title="'+nick+'" class="help"' : ''; diff --git a/style.css b/style.css index 96ae1e92..d9feb73a 100644 --- a/style.css +++ b/style.css @@ -249,6 +249,10 @@ em { white-space: nowrap; } +#chat td .system_narrowcast { + color: #f66 !important; +} + mark { background: transparent; }