aboutsummaryrefslogtreecommitdiff
path: root/webAO/viewport/utils
diff options
context:
space:
mode:
authorstonedDiscord <Tukz@gmx.de>2026-01-01 16:56:51 +0100
committerGitHub <noreply@github.com>2026-01-01 16:56:51 +0100
commit33744e44ceaf3825da451ba38281fd84b255de80 (patch)
treee6c080d7e8e6f56652c2269a380eff40b899a065 /webAO/viewport/utils
parente07fe372bc20d16eb590b68ed256007312b3801a (diff)
parent01ecb948edb015613e05bc2b6da4021137957745 (diff)
Merge pull request #286 from AttorneyOnline/bnnuy
Bnnuy
Diffstat (limited to 'webAO/viewport/utils')
-rw-r--r--webAO/viewport/utils/handleICSpeaking.ts15
1 files changed, 12 insertions, 3 deletions
diff --git a/webAO/viewport/utils/handleICSpeaking.ts b/webAO/viewport/utils/handleICSpeaking.ts
index b037e69..c0a9ae1 100644
--- a/webAO/viewport/utils/handleICSpeaking.ts
+++ b/webAO/viewport/utils/handleICSpeaking.ts
@@ -11,8 +11,17 @@ import { resizeChatbox } from "../../dom/resizeChatbox";
import transparentPng from "../../constants/transparentPng";
import { COLORS } from "../constants/colors";
import mlConfig from "../../utils/aoml";
+import request from "../../services/request";
-const attorneyMarkdown = mlConfig(AO_HOST);
+let attorneyMarkdown: ReturnType<typeof mlConfig> | null = null;
+
+const initAttorneyMarkdown = async () => {
+ if (!attorneyMarkdown) {
+ const iniContent = await request(`${AO_HOST}themes/default/chat_config.ini`);
+ attorneyMarkdown = mlConfig(iniContent);
+ }
+ return attorneyMarkdown;
+};
export let startFirstTickCheck: boolean;
export const setStartFirstTickCheck = (val: boolean) => {
@@ -337,9 +346,9 @@ export const handle_ic_speaking = async (playerChatMsg: ChatMsg) => {
}
try {
- client.viewport.getChatmsg().parsed = await attorneyMarkdown.applyMarkdown(
+ const markdown = await initAttorneyMarkdown();
+ client.viewport.getChatmsg().parsed = markdown.applyMarkdown(
client.viewport.getChatmsg().content,
-
COLORS[client.viewport.getChatmsg().color],
);
} catch (error) {