diff options
| author | stonedDiscord <Tukz@gmx.de> | 2023-09-20 13:10:36 +0200 |
|---|---|---|
| committer | stonedDiscord <Tukz@gmx.de> | 2023-09-20 13:10:36 +0200 |
| commit | dda92bd41f4bee11e2cc5de265ce4fbf5221f1ff (patch) | |
| tree | bcb0f8121955ff815758b30ec4e24a1e6bde4fba /webAO/dom/onEnter.ts | |
| parent | 59028dd4046ad0715d80be8d1ed0031f20f05b7a (diff) | |
autoformat with eslint
Diffstat (limited to 'webAO/dom/onEnter.ts')
| -rw-r--r-- | webAO/dom/onEnter.ts | 183 |
1 files changed, 91 insertions, 92 deletions
diff --git a/webAO/dom/onEnter.ts b/webAO/dom/onEnter.ts index 5ab532c..4948783 100644 --- a/webAO/dom/onEnter.ts +++ b/webAO/dom/onEnter.ts @@ -1,103 +1,102 @@ import { client, selectedShout } from "../client"; import { escapeChat } from "../encoding"; - /** * Triggered when the Return key is pressed on the in-character chat input box. * @param {KeyboardEvent} event */ - export function onEnter(event: KeyboardEvent) { +export function onEnter(event: KeyboardEvent) { if (event.keyCode === 13) { - const mychar = client.character; - const myemo = client.emote; - const evi = client.evidence; - const flip = Boolean( - document.getElementById("button_flip")!.classList.contains("dark") - ); - const flash = Boolean( - document.getElementById("button_flash")!.classList.contains("dark") - ); - const screenshake = Boolean( - document.getElementById("button_shake")!.classList.contains("dark") - ); - const noninterrupting_preanim = Boolean( - (<HTMLInputElement>document.getElementById("check_nonint")).checked - ); - const looping_sfx = Boolean( - (<HTMLInputElement>document.getElementById("check_loopsfx")).checked - ); - const color = Number( - (<HTMLInputElement>document.getElementById("textcolor")).value - ); - const showname = escapeChat( - (<HTMLInputElement>document.getElementById("ic_chat_name")).value - ); - const text = (<HTMLInputElement>document.getElementById("client_inputbox")) - .value; - const pairchar = (<HTMLInputElement>document.getElementById("pair_select")) - .value; - const pairoffset = Number( - (<HTMLInputElement>document.getElementById("pair_offset")).value - ); - const pairyoffset = Number( - (<HTMLInputElement>document.getElementById("pair_y_offset")).value - ); - const myrole = (<HTMLInputElement>document.getElementById("role_select")) - .value - ? (<HTMLInputElement>document.getElementById("role_select")).value - : mychar.side; - const additive = Boolean( - (<HTMLInputElement>document.getElementById("check_additive")).checked - ); - const effect = (<HTMLInputElement>document.getElementById("effect_select")) - .value; - - let sfxname = "0"; - let sfxdelay = 0; - let emote_mod = myemo.zoom; - if ((<HTMLInputElement>document.getElementById("sendsfx")).checked) { - sfxname = myemo.sfx; - sfxdelay = myemo.sfxdelay; - } - - // not to overwrite a 5 from the ini or anything else - if ((<HTMLInputElement>document.getElementById("sendpreanim")).checked) { - if (emote_mod === 0) { - emote_mod = 1; + const mychar = client.character; + const myemo = client.emote; + const evi = client.evidence; + const flip = Boolean( + document.getElementById("button_flip")!.classList.contains("dark") + ); + const flash = Boolean( + document.getElementById("button_flash")!.classList.contains("dark") + ); + const screenshake = Boolean( + document.getElementById("button_shake")!.classList.contains("dark") + ); + const noninterrupting_preanim = Boolean( + (<HTMLInputElement>document.getElementById("check_nonint")).checked + ); + const looping_sfx = Boolean( + (<HTMLInputElement>document.getElementById("check_loopsfx")).checked + ); + const color = Number( + (<HTMLInputElement>document.getElementById("textcolor")).value + ); + const showname = escapeChat( + (<HTMLInputElement>document.getElementById("ic_chat_name")).value + ); + const text = (<HTMLInputElement>document.getElementById("client_inputbox")) + .value; + const pairchar = (<HTMLInputElement>document.getElementById("pair_select")) + .value; + const pairoffset = Number( + (<HTMLInputElement>document.getElementById("pair_offset")).value + ); + const pairyoffset = Number( + (<HTMLInputElement>document.getElementById("pair_y_offset")).value + ); + const myrole = (<HTMLInputElement>document.getElementById("role_select")) + .value + ? (<HTMLInputElement>document.getElementById("role_select")).value + : mychar.side; + const additive = Boolean( + (<HTMLInputElement>document.getElementById("check_additive")).checked + ); + const effect = (<HTMLInputElement>document.getElementById("effect_select")) + .value; + + let sfxname = "0"; + let sfxdelay = 0; + let emote_mod = myemo.zoom; + if ((<HTMLInputElement>document.getElementById("sendsfx")).checked) { + sfxname = myemo.sfx; + sfxdelay = myemo.sfxdelay; } - } else if (emote_mod === 1) { - emote_mod = 0; - } - - client.sender.sendIC( - myemo.deskmod, - myemo.preanim, - mychar.name, - myemo.emote, - text, - myrole, - sfxname, - emote_mod, - sfxdelay, - selectedShout, - evi, - flip, - flash, - color, - showname, - pairchar, - pairoffset, - pairyoffset, - noninterrupting_preanim, - looping_sfx, - screenshake, - "-", - "-", - "-", - additive, - effect - ); + + // not to overwrite a 5 from the ini or anything else + if ((<HTMLInputElement>document.getElementById("sendpreanim")).checked) { + if (emote_mod === 0) { + emote_mod = 1; + } + } else if (emote_mod === 1) { + emote_mod = 0; + } + + client.sender.sendIC( + myemo.deskmod, + myemo.preanim, + mychar.name, + myemo.emote, + text, + myrole, + sfxname, + emote_mod, + sfxdelay, + selectedShout, + evi, + flip, + flash, + color, + showname, + pairchar, + pairoffset, + pairyoffset, + noninterrupting_preanim, + looping_sfx, + screenshake, + "-", + "-", + "-", + additive, + effect + ); } return false; - } - window.onEnter = onEnter;
\ No newline at end of file +} +window.onEnter = onEnter; |
