diff options
| author | stonedDiscord <Tukz@gmx.de> | 2022-09-07 23:41:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-07 23:41:55 +0200 |
| commit | 84cdbfff31c31eff9e7ba2a1d6c73f6d08ac5e43 (patch) | |
| tree | fe9a18c8c0cdbf1ab8ef037af6f98a53b0ea018f /webAO/dom/pickEmotion.ts | |
| parent | 5362069a05b4bfbef03f37605af979aa3cf0e066 (diff) | |
| parent | 3f8d0974b327e663328bc36cd97f1ba1855a2269 (diff) | |
Merge pull request #169 from caleb-mabry/evenMoreWindowFunctions
Added more functions
Diffstat (limited to 'webAO/dom/pickEmotion.ts')
| -rw-r--r-- | webAO/dom/pickEmotion.ts | 24 |
1 files changed, 24 insertions, 0 deletions
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"; + + (<HTMLInputElement>document.getElementById("sendsfx")).checked = + client.emote.sfx.length > 1; + + (<HTMLInputElement>document.getElementById("sendpreanim")).checked = + client.emote.zoom == 1; +} +window.pickEmotion = pickEmotion;
\ No newline at end of file |
