From 3f8d0974b327e663328bc36cd97f1ba1855a2269 Mon Sep 17 00:00:00 2001 From: Caleb Date: Wed, 7 Sep 2022 17:01:25 -0400 Subject: Added more functions --- webAO/dom/pickEmotion.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 webAO/dom/pickEmotion.ts (limited to 'webAO/dom/pickEmotion.ts') diff --git a/webAO/dom/pickEmotion.ts b/webAO/dom/pickEmotion.ts new file mode 100644 index 0000000..b72583f --- /dev/null +++ b/webAO/dom/pickEmotion.ts @@ -0,0 +1,24 @@ +import { client } from '../client' +/** + * Highlights and selects an emotion for in-character chat. + * @param {string} emo the new emotion to be selected + */ +export function pickEmotion(emo: number) { + try { + if (client.selectedEmote !== -1) { + document.getElementById(`emo_${client.selectedEmote}`)!.className = + "emote_button"; + } + } catch (err) { + // do nothing + } + client.selectedEmote = emo; + document.getElementById(`emo_${emo}`)!.className = "emote_button dark"; + + (document.getElementById("sendsfx")).checked = + client.emote.sfx.length > 1; + + (document.getElementById("sendpreanim")).checked = + client.emote.zoom == 1; +} +window.pickEmotion = pickEmotion; \ No newline at end of file -- cgit