From 92b34d2670296b6012f1b667e5ee85885c830bd4 Mon Sep 17 00:00:00 2001 From: ElementalAlchemist Date: Sat, 12 Nov 2022 01:02:14 -0600 Subject: [PATCH] Initial implementation of announcement display --- thrimbletrimmer/scripts/common.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/thrimbletrimmer/scripts/common.js b/thrimbletrimmer/scripts/common.js index aff9a22..80b45af 100644 --- a/thrimbletrimmer/scripts/common.js +++ b/thrimbletrimmer/scripts/common.js @@ -604,7 +604,11 @@ function renderSystemMessages(chatMessageData) { const systemTextElement = document.createElement("div"); systemTextElement.classList.add("chat-replay-message-text"); systemTextElement.classList.add("chat-replay-message-system"); - systemTextElement.appendChild(document.createTextNode(chatMessage.tags["system-msg"])); + let systemMsg = chatMessage.tags["system-msg"]; + if (!systemMsg && chatMessage.tags["msg-id"] === "announcement") { + systemMsg = "Announcement"; + } + systemTextElement.appendChild(document.createTextNode(systemMsg)); const firstMessageContainer = createMessageContainer(chatMessageData, true); firstMessageContainer.appendChild(sendTimeElement);