From 98ce8ca67b27473cc5a00646a1752bbd2ce6347a Mon Sep 17 00:00:00 2001 From: Caleb Mabry <36182383+caleb-mabry@users.noreply.github.com> Date: Sun, 29 Sep 2024 13:28:36 -0400 Subject: [PATCH 1/2] HandleMS should only be in charge of parsing chat message. --- webAO/packets/handlers/handleMS.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/webAO/packets/handlers/handleMS.ts b/webAO/packets/handlers/handleMS.ts index 1c30d55e..0c54a57d 100644 --- a/webAO/packets/handlers/handleMS.ts +++ b/webAO/packets/handlers/handleMS.ts @@ -4,16 +4,14 @@ import { client, extrafeatures, UPDATE_INTERVAL } from "../../client"; import { handleCharacterInfo } from "../../client/handleCharacterInfo"; import { resetICParams } from "../../client/resetICParams"; import { prepChat, safeTags } from "../../encoding"; -import { handle_ic_speaking } from '../../viewport/utils/handleICSpeaking' +import { handle_ic_speaking } from "../../viewport/utils/handleICSpeaking"; /** - * Handles an in-character chat message. - * @param {*} args packet arguments - */ + * Handles an in-character chat message. + * @param {*} args packet arguments + */ export const handleMS = (args: string[]) => { // TODO: this if-statement might be a bug. if (args[4] !== client.viewport.getChatmsg().content) { - document.getElementById("client_inner_chat")!.innerHTML = ""; - const char_id = Number(args[9]); const char_name = safeTags(args[3]); From 7ef85f836cd75f668d4c555a88d791f35574b38d Mon Sep 17 00:00:00 2001 From: Caleb Mabry <36182383+caleb-mabry@users.noreply.github.com> Date: Sun, 29 Sep 2024 13:28:51 -0400 Subject: [PATCH 2/2] Dont clear the text box if the message is an additive --- webAO/viewport/utils/handleICSpeaking.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webAO/viewport/utils/handleICSpeaking.ts b/webAO/viewport/utils/handleICSpeaking.ts index 4fe68d30..d5bd29f2 100644 --- a/webAO/viewport/utils/handleICSpeaking.ts +++ b/webAO/viewport/utils/handleICSpeaking.ts @@ -78,7 +78,9 @@ export const handle_ic_speaking = async (playerChatMsg: ChatMsg) => { : client.viewport.getChatmsg().nameplate!; // Clear out the last message - chatBoxInner.innerText = client.viewport.getTextNow(); + if (!client.viewport.getChatmsg().additive) { + chatBoxInner.innerText = client.viewport.getTextNow(); + } nameBoxInner.innerText = displayname; if (client.viewport.getLastCharacter() !== client.viewport.getChatmsg().name) {