diff options
| author | David Skoland <davidskoland@gmail.com> | 2023-11-23 19:58:38 +0100 |
|---|---|---|
| committer | David Skoland <davidskoland@gmail.com> | 2023-11-23 19:58:38 +0100 |
| commit | c599fe02347d5dd26a97edc6eedc6cee3d74e3e2 (patch) | |
| tree | 06fabb6661e6a99241423c4da22464982296e0f3 /webAO | |
| parent | 0bde1984c08414688554dedfd5714a343dfbf76c (diff) | |
Formatting
Diffstat (limited to 'webAO')
| -rw-r--r-- | webAO/packets/handlers/handleMS.ts | 8 | ||||
| -rw-r--r-- | webAO/viewport/utils/handleICSpeaking.ts | 36 |
2 files changed, 22 insertions, 22 deletions
diff --git a/webAO/packets/handlers/handleMS.ts b/webAO/packets/handlers/handleMS.ts index 8464942..894db3b 100644 --- a/webAO/packets/handlers/handleMS.ts +++ b/webAO/packets/handlers/handleMS.ts @@ -78,7 +78,7 @@ export const handleMS = (args: string[]) => { speed: UPDATE_INTERVAL, }; - if (args.length>16) { + if (args.length > 16) { const extra_cccc = { showname: prepChat(args[16]), other_charid: Number(args[17]), @@ -91,7 +91,7 @@ export const handleMS = (args: string[]) => { }; chatmsg = Object.assign(extra_cccc, chatmsg); - if (args.length>24) { + if (args.length > 24) { const extra_27 = { looping_sfx: Number(args[24]), screenshake: Number(args[25]), @@ -101,7 +101,7 @@ export const handleMS = (args: string[]) => { }; chatmsg = Object.assign(extra_27, chatmsg); - if (args.length>29) { + if (args.length > 29) { const extra_28 = { additive: Number(args[29]), effects: args[30].split("|"), @@ -169,4 +169,4 @@ export const handleMS = (args: string[]) => { handle_ic_speaking(chatmsg); // no await } } -}
\ No newline at end of file +} diff --git a/webAO/viewport/utils/handleICSpeaking.ts b/webAO/viewport/utils/handleICSpeaking.ts index 2cea926..e2b8a29 100644 --- a/webAO/viewport/utils/handleICSpeaking.ts +++ b/webAO/viewport/utils/handleICSpeaking.ts @@ -15,11 +15,11 @@ import mlConfig from "../../utils/aoml"; const attorneyMarkdown = mlConfig(AO_HOST); export let startFirstTickCheck: boolean; -export const setStartFirstTickCheck = (val: boolean) => {startFirstTickCheck = val} +export const setStartFirstTickCheck = (val: boolean) => { startFirstTickCheck = val } export let startSecondTickCheck: boolean; -export const setStartSecondTickCheck = (val: boolean) => {startSecondTickCheck = val} +export const setStartSecondTickCheck = (val: boolean) => { startSecondTickCheck = val } export let startThirdTickCheck: boolean; -export const setStartThirdTickCheck = (val: boolean) => {startThirdTickCheck = val} +export const setStartThirdTickCheck = (val: boolean) => { startThirdTickCheck = val } /** * Sets a new emote. * This sets up everything before the tick() loops starts @@ -73,7 +73,7 @@ export const handle_ic_speaking = async (playerChatMsg: ChatMsg) => { const displayname = (<HTMLInputElement>document.getElementById("showname")).checked && - client.viewport.getChatmsg().showname !== "" + client.viewport.getChatmsg().showname !== "" ? client.viewport.getChatmsg().showname! : client.viewport.getChatmsg().nameplate!; @@ -91,7 +91,7 @@ export const handle_ic_speaking = async (playerChatMsg: ChatMsg) => { appendICLog(client.viewport.getChatmsg().content, client.viewport.getChatmsg().showname, client.viewport.getChatmsg().nameplate); checkCallword(client.viewport.getChatmsg().content, client.viewport.getSfxAudio()); - + setEmote( AO_HOST, client, @@ -118,7 +118,7 @@ export const handle_ic_speaking = async (playerChatMsg: ChatMsg) => { const shoutSprite = <HTMLImageElement>( document.getElementById("client_shout") ); - + const shout = SHOUTS[client.viewport.getChatmsg().objection]; if (shout) { // Hide message box @@ -148,7 +148,7 @@ export const handle_ic_speaking = async (playerChatMsg: ChatMsg) => { if (client.viewport.getChatmsg().type === 1 && client.viewport.getChatmsg().preanim !== "-") { //we have a preanim chatContainerBox.style.opacity = "0"; - + gifLength = await getAnimLength( `${AO_HOST}characters/${encodeURI( client.viewport.getChatmsg().name!.toLowerCase() @@ -217,9 +217,9 @@ export const handle_ic_speaking = async (playerChatMsg: ChatMsg) => { if (!skipoffset) { // Flip the character charLayers.style.transform = - client.viewport.getChatmsg().flip === 1 ? "scaleX(-1)" : "scaleX(1)"; + client.viewport.getChatmsg().flip === 1 ? "scaleX(-1)" : "scaleX(1)"; pairLayers.style.transform = - client.viewport.getChatmsg().other_flip === 1 ? "scaleX(-1)" : "scaleX(1)"; + client.viewport.getChatmsg().other_flip === 1 ? "scaleX(-1)" : "scaleX(1)"; // Shift by the horizontal offset switch (client.viewport.getChatmsg().side) { @@ -244,9 +244,9 @@ export const handle_ic_speaking = async (playerChatMsg: ChatMsg) => { client.viewport.blipChannels.forEach( (channel: HTMLAudioElement) => - (channel.src = `${AO_HOST}sounds/blips/${encodeURI( - client.viewport.getChatmsg().blips.toLowerCase() - )}.opus`) + (channel.src = `${AO_HOST}sounds/blips/${encodeURI( + client.viewport.getChatmsg().blips.toLowerCase() + )}.opus`) ); // process markup @@ -293,20 +293,20 @@ export const handle_ic_speaking = async (playerChatMsg: ChatMsg) => { fg.src = transparentPng; } - + charLayers.style.opacity = "1"; const soundChecks = ["0", "1", "", undefined]; if (soundChecks.some((check) => client.viewport.getChatmsg().sound === check)) { client.viewport.getChatmsg().sound = client.viewport.getChatmsg().effects[2]; } - + try { client.viewport.getChatmsg().parsed = await attorneyMarkdown.applyMarkdown( client.viewport.getChatmsg().content, - + COLORS[client.viewport.getChatmsg().color] - + ); } catch (error) { console.warn("markdown failed"); @@ -319,6 +319,6 @@ export const handle_ic_speaking = async (playerChatMsg: ChatMsg) => { } client.viewport.getChatmsg().parsed = output; } - + client.viewport.chat_tick(); -};
\ No newline at end of file +}; |
