From 4fd5dd0fc931c79c50c322ea0af2a3d5765c71e3 Mon Sep 17 00:00:00 2001 From: FURRO404 Date: Thu, 18 Jun 2026 03:27:03 -0700 Subject: [PATCH] meow --- frontend/src/App.jsx | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index da2bdac..c748aec 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -2876,14 +2876,19 @@ function structuredBattleEvents(eventLog) { ].sort((a, b) => Number(a.time || 0) - Number(b.time || 0)) } +function chatTypeClass(type, senderClassName) { + return String(type || 'ALL').toUpperCase() === 'ALL' ? 'text-warning' : senderClassName +} + function parseFormattedChatLine(line) { - const match = String(line || '').match(/^([+-]?)(\[\d{2}:\d{2}\]\s+\[[^\]]+\]\s+)\[[^\]]*\]\s+`([^`]*)`:\s?(.*)$/) + const match = String(line || '').match(/^([+-]?)(\[\d{2}:\d{2}\])\s+\[([^\]]+)\]\s+\[[^\]]*\]\s+`([^`]*)`:\s?(.*)$/) if (!match) return null return { prefix: match[1], - head: match[2], - name: match[3], - message: match[4], + time: match[2], + type: match[3], + name: match[4], + message: match[5], } } @@ -3127,10 +3132,13 @@ function FormattedChatLine({ line, players }) { const className = player?.className || battleLineColor(parsed.prefix) const team = player?.team || '??' const name = player?.name || parsed.name + const typeClassName = chatTypeClass(parsed.type, className) return ( -
- {parsed.head}[{team}] `{name}`: {parsed.message} +
+ {parsed.time} + [{parsed.type}] + [{team}] `{name}`: {parsed.message}
) } @@ -3166,9 +3174,13 @@ function BattleEventLine({ event, players }) { function ChatEventLine({ event, players }) { const player = logPlayer(players, event.uid) + const type = event.type || 'ALL' + const typeClassName = chatTypeClass(type, player.className) return ( -
- [{formatLogTime(event.time)}] [{event.type || 'ALL'}] [{player.team}] `{player.name}`: {event.message || ''} +
+ [{formatLogTime(event.time)}] + [{type}] + [{player.team}] `{player.name}`: {event.message || ''}
) }