From f571b0da2a3fe44c646bb5934df1346ec8c11501 Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Sun, 26 Jul 2020 21:38:04 -0500 Subject: Temporarily switch to Cloudflare IPFS --- webAO/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index d9acaad..8b42907 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -33,7 +33,7 @@ const serverIP = queryDict.ip; let mode = queryDict.mode; // Unless there is an asset URL specified, use the wasabi one -const DEFAULT_HOST = location.hostname ? "https://webao-full.animatedchatroom.net/base/" : "base/"; +const DEFAULT_HOST = location.hostname ? "https://cf-ipfs.com/ipfs/QmQA8xshtWveXG2uLNyFjNmzs9npvQM1voah8DDMnRXzeA/" : "base/"; const AO_HOST = queryDict.asset || DEFAULT_HOST; const THEME = queryDict.theme || "default"; const MUSIC_HOST = AO_HOST + "sounds/music/"; -- cgit From fb2129043d3c9e3483a8de3f4988a235310eb462 Mon Sep 17 00:00:00 2001 From: sD Date: Tue, 28 Jul 2020 18:47:11 +0200 Subject: fill iniedit list from charlist --- webAO/client.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 8b42907..070e7f1 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -9,7 +9,6 @@ import Fingerprint2 from 'fingerprintjs2'; import { escapeChat, encodeChat, prepChat, safe_tags } from './encoding.js'; // Load some defaults for the background and evidence dropdowns -import character_arr from "./characters.js"; import background_arr from "./backgrounds.js"; import evidence_arr from "./evidence.js"; import sfx_arr from "./sounds.js"; @@ -380,12 +379,6 @@ class Client extends EventEmitter { loadResources() { document.getElementById("client_version").innerText = "version " + version; - // Load iniedit character array to select - const iniedit_select = document.getElementById("client_ininame"); - character_arr.forEach(inicharacter => { - iniedit_select.add(new Option(inicharacter)); - }); - // Load background array to select const background_select = document.getElementById("bg_select"); background_select.add(new Option("Custom", 0)); @@ -720,6 +713,8 @@ class Client extends EventEmitter { mute_select.add(new Option(safe_tags(chargs[0]), charid)); const pair_select = document.getElementById("pair_select"); pair_select.add(new Option(safe_tags(chargs[0]), charid)); + const iniedit_select = document.getElementById("client_ininame"); + iniedit_select.add(new Option(safe_tags(chargs[0]))); // sometimes ini files lack important settings const default_options = { -- cgit From 2a405b291a6b45f97ebe80c2cf62e96ae6471a44 Mon Sep 17 00:00:00 2001 From: sD Date: Fri, 31 Jul 2020 20:50:15 +0200 Subject: add 2.8 lmao --- webAO/client.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 070e7f1..515af14 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -261,6 +261,7 @@ class Client extends EventEmitter { sendIC(deskmod, preanim, name, emote, message, side, sfx_name, emote_modifier, sfx_delay, objection_modifier, evidence, flip, realization, text_color, showname, other_charid, self_offset, noninterrupting_preanim, looping_sfx, screenshake) { let extra_cccc = ``; let extra_27 = ``; + let extra_28 = ``; if (extrafeatures.includes("cccc_ic_support")) { extra_cccc = `${showname}#${other_charid}#${self_offset}#${noninterrupting_preanim}#`; @@ -271,12 +272,18 @@ class Client extends EventEmitter { const frame_sfx = ""; extra_27 = `${looping_sfx}#${screenshake}#${frame_screenshake}#${frame_realization}#${frame_sfx}#`; + if (extrafeatures.includes("effects")) { + const additive = 0; + const effect = ""; + + extra_28 = `${additive}#${effect}#`; + } } } const serverMessage = `MS#${deskmod}#${preanim}#${name}#${emote}` + `#${escapeChat(encodeChat(message))}#${side}#${sfx_name}#${emote_modifier}` + - `#${this.charID}#${sfx_delay}#${objection_modifier}#${evidence}#${flip}#${realization}#${text_color}#${extra_cccc}${extra_27}%`; + `#${this.charID}#${sfx_delay}#${objection_modifier}#${evidence}#${flip}#${realization}#${text_color}#${extra_cccc}${extra_27}${extra_28}%`; console.log(serverMessage); -- cgit From b0b4e666a42b324beb0b00c930999aad8aace93c Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Fri, 31 Jul 2020 22:12:46 -0500 Subject: Fix being unable to talk in 2.8 This is actually caused by a server-side issue, but changing empty strings to '-' for the IC packet extensions will temporarily fix the problem on the client side. --- webAO/client.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 515af14..e075c90 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -267,14 +267,14 @@ class Client extends EventEmitter { extra_cccc = `${showname}#${other_charid}#${self_offset}#${noninterrupting_preanim}#`; if (extrafeatures.includes("looping_sfx")) { - const frame_screenshake = ""; - const frame_realization = ""; - const frame_sfx = ""; + const frame_screenshake = "-"; + const frame_realization = "-"; + const frame_sfx = "-"; extra_27 = `${looping_sfx}#${screenshake}#${frame_screenshake}#${frame_realization}#${frame_sfx}#`; if (extrafeatures.includes("effects")) { const additive = 0; - const effect = ""; + const effect = "-"; extra_28 = `${additive}#${effect}#`; } -- cgit From 0b4c03d19f4ab083495b16d1e3c2f4f8474bb5fe Mon Sep 17 00:00:00 2001 From: sD Date: Mon, 10 Aug 2020 19:43:22 +0200 Subject: add objections, speedlines, G/NG --- webAO/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index e075c90..b4932a6 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -32,7 +32,7 @@ const serverIP = queryDict.ip; let mode = queryDict.mode; // Unless there is an asset URL specified, use the wasabi one -const DEFAULT_HOST = location.hostname ? "https://cf-ipfs.com/ipfs/QmQA8xshtWveXG2uLNyFjNmzs9npvQM1voah8DDMnRXzeA/" : "base/"; +const DEFAULT_HOST = location.hostname ? "https://cf-ipfs.com/ipfs/QmZSdhjX8RUKBTER8hyVNHnK2ByLXusYc99FRS6RztDKUF/" : "base/"; const AO_HOST = queryDict.asset || DEFAULT_HOST; const THEME = queryDict.theme || "default"; const MUSIC_HOST = AO_HOST + "sounds/music/"; -- cgit From a73d855bf8cc49f2bf47e660aa48b2a0d460fd5e Mon Sep 17 00:00:00 2001 From: sD Date: Mon, 10 Aug 2020 21:23:09 +0200 Subject: just load all of them in the img --- webAO/client.js | 95 ++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 57 insertions(+), 38 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index b4932a6..d7fc215 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -1599,6 +1599,27 @@ async changeBackground(position) { clearTimeout(this.testimonyUpdater); } + /** + * Sets all the img tags to the right sources + * @param {*} chatmsg + */ + setEmote(charactername, emotename, prefix, pair) { + const pairID = pair ? "pair" : "char"; + const characterFolder = AO_HOST + "characters/"; + + const gif_s = document.getElementById("client_" + pairID + "_gif"); + const png_s = document.getElementById("client_" + pairID + "_png"); + const apng_s = document.getElementById("client_" + pairID +"_apng"); + + //hide the last sprite + gif_s.src = transparentPNG; + png_s.src = transparentPNG; + apng_s.src = transparentPNG; + + gif_s.src = characterFolder + `${encodeURI(charactername)}/${encodeURI(prefix)}${encodeURI(emotename)}.gif`; + png_s.src = characterFolder + `${encodeURI(charactername)}/${encodeURI(emotename)}.png`; + apng_s.src = characterFolder + `${encodeURI(charactername)}/${encodeURI(prefix)}${encodeURI(emotename)}.apng`; + } /** * Sets a new emote. @@ -1634,8 +1655,8 @@ async changeBackground(position) { } this.lastEvi = this.chatmsg.evidence; - const charSprite = document.getElementById("client_char"); - const pairSprite = document.getElementById("client_pair_char"); + const charLayers = document.getElementById("client_char"); + const pairLayers = document.getElementById("client_pair_char"); const chatContainerBox = document.getElementById("client_chatcontainer"); const nameBoxInner = document.getElementById("client_inner_name"); @@ -1648,10 +1669,8 @@ async changeBackground(position) { nameBoxInner.innerText = displayname; if (this.lastChar !== this.chatmsg.name) { - charSprite.style.opacity = 0; - charSprite.src = transparentPNG; - pairSprite.style.opacity = 0; - pairSprite.src = transparentPNG; + charLayers.style.opacity = 0; + pairLayers.style.opacity = 0; } this.lastChar = this.chatmsg.name; @@ -1751,16 +1770,16 @@ async changeBackground(position) { // Flip the character if (this.chatmsg.flip === 1) { - charSprite.style.transform = "scaleX(-1)"; + charLayers.style.transform = "scaleX(-1)"; } else { - charSprite.style.transform = "scaleX(1)"; + charLayers.style.transform = "scaleX(1)"; } // flip the paired character if (this.chatmsg.other_flip === 1) { - pairSprite.style.transform = "scaleX(-1)"; + pairLayers.style.transform = "scaleX(-1)"; } else { - pairSprite.style.transform = "scaleX(1)"; + pairLayers.style.transform = "scaleX(1)"; } this.blipChannels.forEach(channel => channel.src = `${AO_HOST}sounds/general/sfx-blip${encodeURI(this.chatmsg.blips.toLowerCase())}.wav`); @@ -1812,13 +1831,19 @@ async changeBackground(position) { const gamewindow = document.getElementById("client_gamewindow"); const waitingBox = document.getElementById("client_chatwaiting"); - const charSprite = document.getElementById("client_char"); - const pairSprite = document.getElementById("client_pair_char"); + const charLayers = document.getElementById("client_char"); + const pairLayers = document.getElementById("client_pair_char"); const eviBox = document.getElementById("client_evi"); const shoutSprite = document.getElementById("client_shout"); const chatBoxInner = document.getElementById("client_inner_chat"); const chatBox = document.getElementById("client_chat"); + const charName = this.chatmsg.name.toLowerCase(); + const charEmote = this.chatmsg.sprite.toLowerCase(); + + const pairName = this.chatmsg.other_name.toLowerCase(); + const pairEmote = this.chatmsg.other_emote.toLowerCase(); + // TODO: preanims sometimes play when they're not supposed to if (this.textTimer >= this.shoutTimer && this.chatmsg.startpreanim) { // Effect stuff @@ -1836,23 +1861,19 @@ async changeBackground(position) { // Pre-animation stuff if (this.chatmsg.preanimdelay > 0) { shoutSprite.style.opacity = 0; - shoutSprite.style.animation = ""; - const charName = this.chatmsg.name.toLowerCase(); + shoutSprite.style.animation = ""; const preanim = this.chatmsg.preanim.toLowerCase(); - charSprite.src = `${AO_HOST}characters/${encodeURI(charName)}/${encodeURI(preanim)}.gif`; - charSprite.style.opacity = 1; + this.setEmote(charName,preanim,"",false); + charLayers.style.opacity = 1; } if (this.chatmsg.other_name) { - const pairName = this.chatmsg.other_name.toLowerCase(); - const pairEmote = this.chatmsg.other_emote.toLowerCase(); - pairSprite.style.left = this.chatmsg.other_offset + "%"; - charSprite.style.left = this.chatmsg.self_offset + "%"; - pairSprite.src = this.pairSilent; - pairSprite.style.opacity = 1; + pairLayers.style.left = this.chatmsg.other_offset + "%"; + charLayers.style.left = this.chatmsg.self_offset + "%"; + pairLayers.style.opacity = 1; } else { - pairSprite.style.opacity = 0; - charSprite.style.left = 0; + pairLayers.style.opacity = 0; + charLayers.style.left = 0; } this.chatmsg.startpreanim = false; @@ -1893,24 +1914,22 @@ async changeBackground(position) { if (extrafeatures.includes("cccc_ic_support")) { if (this.chatmsg.other_name) { - const pairName = this.chatmsg.other_name.toLowerCase(); - const pairEmote = this.chatmsg.other_emote.toLowerCase(); - pairSprite.style.left = this.chatmsg.other_offset + "%"; - charSprite.style.left = this.chatmsg.self_offset + "%"; - pairSprite.src = this.pairSilent; - pairSprite.style.opacity = 1; + pairLayers.style.left = this.chatmsg.other_offset + "%"; + charLayers.style.left = this.chatmsg.self_offset + "%"; + this.setEmote(pairName,pairEmote,"(a)",true); + pairLayers.style.opacity = 1; } else { - pairSprite.style.opacity = 0; - charSprite.style.left = 0; + pairLayers.style.opacity = 0; + charLayers.style.left = 0; } } - charSprite.src = this.speakingSprite; - charSprite.style.opacity = 1; + this.setEmote(charName,charEmote,"(b)",false); + charLayers.style.opacity = 1; if (this.textnow === this.chatmsg.content) { - charSprite.src = this.silentSprite; - charSprite.style.opacity = 1; + this.setEmote(charName,charEmote,"(a)",false); + charLayers.style.opacity = 1; waitingBox.style.opacity = 1; this._animating = false; clearTimeout(this.updater); @@ -1931,8 +1950,8 @@ async changeBackground(position) { if (this.textnow === this.chatmsg.content) { this._animating = false; - charSprite.src = this.silentSprite; - charSprite.style.opacity = 1; + this.setEmote(charName,charEmote,"(a)",false); + charLayers.style.opacity = 1; waitingBox.style.opacity = 1; clearTimeout(this.updater); } -- cgit From 27f0055d083eb8b5753d4a3730efc9accb04b683 Mon Sep 17 00:00:00 2001 From: sD Date: Mon, 10 Aug 2020 21:41:47 +0200 Subject: drop this file checking bs --- webAO/client.js | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index d7fc215..bdf372f 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -1678,37 +1678,11 @@ async changeBackground(position) { checkCallword(this.chatmsg.content); - // start checking the files - try { - const { url: speakUrl } = await this.oneSuccess([ - this.rejectOnError(fetch(AO_HOST + "characters/" + encodeURI(this.chatmsg.name.toLowerCase()) + "/" + this.chatmsg.sprite + ".png")), - this.rejectOnError(fetch(AO_HOST + "characters/" + encodeURI(this.chatmsg.name.toLowerCase()) + "/(b)" + this.chatmsg.sprite + ".gif")) - ]); - this.speakingSprite = speakUrl ? speakUrl : transparentPNG; - } catch (error) { - this.speakingSprite = AO_HOST + "characters/" + encodeURI(this.chatmsg.name.toLowerCase()) + "/(b)" + this.chatmsg.sprite + ".gif"; - } - - try { - const { url: silentUrl } = await this.oneSuccess([ - this.rejectOnError(fetch(AO_HOST + "characters/" + encodeURI(this.chatmsg.name.toLowerCase()) + "/" + this.chatmsg.sprite + ".png")), - this.rejectOnError(fetch(AO_HOST + "characters/" + encodeURI(this.chatmsg.name.toLowerCase()) + "/(a)" + this.chatmsg.sprite + ".gif")) - ]); - this.silentSprite = silentUrl ? silentUrl : transparentPNG; - } catch (error) { - this.silentSprite = AO_HOST + "characters/" + encodeURI(this.chatmsg.name.toLowerCase()) + "/(a)" + this.chatmsg.sprite + ".gif"; - } + this.setEmote(this.chatmsg.name.toLowerCase(), this.chatmsg.sprite, "(b)", false); + this.setEmote(this.chatmsg.name.toLowerCase(), this.chatmsg.sprite, "(a)", false); if (this.chatmsg.other_name) { - try { - const { url: pairUrl } = await this.oneSuccess([ - this.rejectOnError(fetch(AO_HOST + "characters/" + encodeURI(this.chatmsg.other_name.toLowerCase()) + "/" + this.chatmsg.other_emote + ".png")), - this.rejectOnError(fetch(AO_HOST + "characters/" + encodeURI(this.chatmsg.other_name.toLowerCase()) + "/(a)" + this.chatmsg.other_emote + ".gif")) - ]); - this.pairSilent = pairUrl ? pairUrl : transparentPNG; - } catch (error) { - this.pairSilent = AO_HOST + "characters/" + encodeURI(this.chatmsg.other_name.toLowerCase()) + "/(a)" + this.chatmsg.other_emote + ".gif"; - } + this.setEmote(this.chatmsg.other_name.toLowerCase(), this.chatmsg.other_emote, "(a)", false); } // gets which shout shall played @@ -2318,7 +2292,7 @@ window.changeCharacter = changeCharacter; */ export function charError(image) { console.warn(image.src + " is missing from webAO"); - //image.src = transparentPNG; + image.src = transparentPNG; return true; } window.charError = charError; -- cgit From a40fa4a48643b1026a3890e143592c32f930547c Mon Sep 17 00:00:00 2001 From: sD Date: Tue, 11 Aug 2020 17:32:43 +0200 Subject: add 2.8 position changing #65 --- webAO/client.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index b4932a6..8d59ec5 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -2053,6 +2053,8 @@ export function onEnter(event) { const text = document.getElementById("client_inputbox").value; const pairchar = document.getElementById("pair_select").value; const pairoffset = document.getElementById("pair_offset").value; + const myrole = document.getElementById("role_select").value ? document.getElementById("role_select").value : mychar.side; + let sfxname = "0"; let sfxdelay = 0; let preanim = "-"; @@ -2066,7 +2068,7 @@ export function onEnter(event) { } client.sendIC("chat", preanim, mychar.name, myemo.emote, - text, mychar.side, + text, myrole, sfxname, myemo.zoom, sfxdelay, selectedShout, evi, flip, flash, color, showname, pairchar, pairoffset, noninterrupting_preanim, looping_sfx, screenshake); } @@ -2736,11 +2738,11 @@ window.changeBackgroundOOC = changeBackgroundOOC; * Change role via OOC. */ export function changeRoleOOC() { - const role_select = document.getElementById("role_select"); - const role_command = document.getElementById("role_command").value; + const new_role = document.getElementById("role_select").value; - client.sendOOC("/" + role_command.replace("$1", role_select.value)); - updateActionCommands(role_select.value); + client.sendOOC("/pos " + new_role); + client.sendServer("SP#" + new_role + "#%"); + updateActionCommands(new_role); } window.changeRoleOOC = changeRoleOOC; -- cgit From c310b764c26627af7ca08b9eea3906943d201928 Mon Sep 17 00:00:00 2001 From: sD Date: Tue, 11 Aug 2020 17:59:38 +0200 Subject: cf-ipfs is dead, long live cloudflare-ipfs --- webAO/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 8d59ec5..0a66b44 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -32,7 +32,7 @@ const serverIP = queryDict.ip; let mode = queryDict.mode; // Unless there is an asset URL specified, use the wasabi one -const DEFAULT_HOST = location.hostname ? "https://cf-ipfs.com/ipfs/QmZSdhjX8RUKBTER8hyVNHnK2ByLXusYc99FRS6RztDKUF/" : "base/"; +const DEFAULT_HOST = location.hostname ? "https://cloudflare-ipfs.com/ipfs/QmZSdhjX8RUKBTER8hyVNHnK2ByLXusYc99FRS6RztDKUF/" : "base/"; const AO_HOST = queryDict.asset || DEFAULT_HOST; const THEME = queryDict.theme || "default"; const MUSIC_HOST = AO_HOST + "sounds/music/"; -- cgit From c4f9470c16969fad19731ec11d4b3a8d82bd5c5f Mon Sep 17 00:00:00 2001 From: sD Date: Tue, 11 Aug 2020 18:06:21 +0200 Subject: fix old loading progress --- webAO/client.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 0a66b44..7d4796e 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -767,11 +767,10 @@ class Client extends EventEmitter { * @param {Array} args packet arguments */ handleCI(args) { - document.getElementById("client_loadingtext").innerHTML = "Loading Character " + args[1]; // Loop through the 10 characters that were sent for (let i = 2; i <= args.length - 2; i++) { if (i % 2 === 0) { - document.getElementById("client_loadingtext").innerHTML = `Loading Character ${i}/${this.char_list_length}`; + document.getElementById("client_loadingtext").innerHTML = `Loading Character ${args[1]}/${this.char_list_length}`; const chargs = args[i].split("&"); const charid = args[i - 1]; setTimeout(() => this.handleCharacterInfo(chargs, charid), charid*10); @@ -904,7 +903,7 @@ class Client extends EventEmitter { for (let i = 2; i < args.length - 1; i++) { if (i % 2 === 0) { - document.getElementById("client_loadingtext").innerHTML = `Loading Music ${i}/${this.music_list_length}`; + document.getElementById("client_loadingtext").innerHTML = `Loading Music ${args[1]}/${this.music_list_length}`; this.handleMusicInfo(args[i-1],safe_tags(args[i])); } } -- cgit From a85a728176156342409d6283d6630e3d6075ec56 Mon Sep 17 00:00:00 2001 From: sD Date: Tue, 11 Aug 2020 19:48:29 +0200 Subject: parse 2.8 stuff and autoformat handleMS --- webAO/client.js | 163 +++++++++++++++++++++++++++++++------------------------- 1 file changed, 91 insertions(+), 72 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 7d4796e..82427a5 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -536,12 +536,12 @@ class Client extends EventEmitter { msg_nameplate = this.chars[char_id].showname; msg_blips = this.chars[char_id].gender; char_chatbox = this.chars[char_id].chat; - char_muted = this.chars[char_id].muted; + char_muted = this.chars[char_id].muted; - if(this.chars[char_id].name !== char_name) { + if (this.chars[char_id].name !== char_name) { console.info(this.chars[char_id].name + " is iniediting to " + char_name); const chargs = (char_name + "&" + "iniediter").split("&"); - this.handleCharacterInfo(chargs,char_id); + this.handleCharacterInfo(chargs, char_id); } } catch (e) { msg_nameplate = args[3]; @@ -553,79 +553,94 @@ class Client extends EventEmitter { if (char_muted === false) { - let chatmsg = { - deskmod: safe_tags(args[1]).toLowerCase(), - preanim: safe_tags(args[2]).toLowerCase(), // get preanim - nameplate: msg_nameplate, - chatbox: char_chatbox, - name: char_name, - sprite: safe_tags(args[4]).toLowerCase(), - content: prepChat(args[5]), // Escape HTML tags - side: args[6].toLowerCase(), - sound: safe_tags(args[7]).toLowerCase(), - blips: safe_tags(msg_blips), - type: Number(args[8]), - charid: char_id, - snddelay: Number(args[10]), - objection: Number(args[11]), - evidence: safe_tags(args[12]), - flip: Number(args[13]), - flash: Number(args[14]), - color: Number(args[15]) - }; - - if (extrafeatures.includes("cccc_ic_support")) { - const extra_cccc = { - showname: safe_tags(args[16]), - other_charid: Number(args[17]), - other_name: safe_tags(args[18]), - other_emote: safe_tags(args[19]), - self_offset: Number(args[20]), - other_offset: Number(args[21]), - other_flip: Number(args[22]), - noninterrupting_preanim: Number(args[23]) + let chatmsg = { + deskmod: safe_tags(args[1]).toLowerCase(), + preanim: safe_tags(args[2]).toLowerCase(), // get preanim + nameplate: msg_nameplate, + chatbox: char_chatbox, + name: char_name, + sprite: safe_tags(args[4]).toLowerCase(), + content: prepChat(args[5]), // Escape HTML tags + side: args[6].toLowerCase(), + sound: safe_tags(args[7]).toLowerCase(), + blips: safe_tags(msg_blips), + type: Number(args[8]), + charid: char_id, + snddelay: Number(args[10]), + objection: Number(args[11]), + evidence: safe_tags(args[12]), + flip: Number(args[13]), + flash: Number(args[14]), + color: Number(args[15]) }; - chatmsg = Object.assign(extra_cccc, chatmsg); - - if (extrafeatures.includes("looping_sfx")) { - const extra_27 = { - looping_sfx: Number(args[24]), - screenshake: Number(args[25]), - frame_screenshake: safe_tags(args[26]), - frame_realization: safe_tags(args[27]), - frame_sfx: safe_tags(args[28]) + + if (extrafeatures.includes("cccc_ic_support")) { + const extra_cccc = { + showname: safe_tags(args[16]), + other_charid: Number(args[17]), + other_name: safe_tags(args[18]), + other_emote: safe_tags(args[19]), + self_offset: Number(args[20]), + other_offset: Number(args[21]), + other_flip: Number(args[22]), + noninterrupting_preanim: Number(args[23]) }; - chatmsg = Object.assign(extra_27, chatmsg); + chatmsg = Object.assign(extra_cccc, chatmsg); + + if (extrafeatures.includes("looping_sfx")) { + const extra_27 = { + looping_sfx: Number(args[24]), + screenshake: Number(args[25]), + frame_screenshake: safe_tags(args[26]), + frame_realization: safe_tags(args[27]), + frame_sfx: safe_tags(args[28]) + }; + chatmsg = Object.assign(extra_27, chatmsg); + + if (extrafeatures.includes("effects")) { + const extra_28 = { + additive: Number(args[29]), + effects: safe_tags(args[30]) + }; + chatmsg = Object.assign(extra_28, chatmsg); + } else { + const extra_28 = { + additive: 0, + effects: "" + }; + chatmsg = Object.assign(extra_28, chatmsg); + } + + } else { + const extra_27 = { + looping_sfx: 0, + screenshake: 0, + frame_screenshake: "", + frame_realization: "", + frame_sfx: "" + }; + chatmsg = Object.assign(extra_27, chatmsg); + } } else { - const extra_27 = { - looping_sfx: 0, - screenshake: 0, - frame_screenshake: "", - frame_realization: "", - frame_sfx: "" + const extra_cccc = { + showname: "", + other_charid: 0, + other_name: "", + other_emote: "", + self_offset: 0, + other_offset: 0, + other_flip: 0, + noninterrupting_preanim: 0 }; - chatmsg = Object.assign(extra_27, chatmsg); - } - } else { - const extra_cccc = { - showname: "", - other_charid: 0, - other_name: "", - other_emote: "", - self_offset: 0, - other_offset: 0, - other_flip: 0, - noninterrupting_preanim: 0 - }; - chatmsg = Object.assign(extra_cccc, chatmsg); - } + chatmsg = Object.assign(extra_cccc, chatmsg); + } - // our own message appeared, reset the buttons - if (chatmsg.charid === this.charID) { - resetICParams(); - } + // our own message appeared, reset the buttons + if (chatmsg.charid === this.charID) { + resetICParams(); + } - viewport.say(chatmsg); // no await + viewport.say(chatmsg); // no await } } } @@ -1621,7 +1636,6 @@ async changeBackground(position) { const waitingBox = document.getElementById("client_chatwaiting"); // Reset CSS animation - fg.style.animation = ""; gamewindow.style.animation = ""; waitingBox.style.opacity = 0; @@ -1772,6 +1786,10 @@ async changeBackground(position) { chatBoxInner.style.textAlign = "inherit"; } + // apply effects + fg.style.animation = ""; + fg.src = transparentPNG; + this.tick(); } @@ -1817,6 +1835,7 @@ async changeBackground(position) { const shoutSprite = document.getElementById("client_shout"); const chatBoxInner = document.getElementById("client_inner_chat"); const chatBox = document.getElementById("client_chat"); + const effectlayer = document.getElementById("client_fg"); // TODO: preanims sometimes play when they're not supposed to if (this.textTimer >= this.shoutTimer && this.chatmsg.startpreanim) { @@ -1829,7 +1848,7 @@ async changeBackground(position) { if (this.chatmsg.flash === 1) { // Flash screen this.playSFX(AO_HOST + "sounds/general/sfx-realization.wav"); - document.getElementById("client_fg").style.animation = "flash 0.4s 1"; + effectlayer.style.animation = "flash 0.4s 1"; } // Pre-animation stuff -- cgit From 5ab213af6caa0ef3e3d2b9143f00bad95510e03e Mon Sep 17 00:00:00 2001 From: sD Date: Tue, 11 Aug 2020 19:52:48 +0200 Subject: apply the effects --- webAO/client.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 82427a5..0cefa5c 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -1787,8 +1787,13 @@ async changeBackground(position) { } // apply effects + const effectinfo = this.chatmsg.effects.split('|'); fg.style.animation = ""; - fg.src = transparentPNG; + + if (effectinfo[0]) + fg.src = `${AO_HOST}themes/default/effects/${encodeURI(effectinfo[0].toLowerCase())}.webp`; + else + fg.src = transparentPNG; this.tick(); } -- cgit From f756da675213c9937259d07a0166a179656a1284 Mon Sep 17 00:00:00 2001 From: sD Date: Tue, 11 Aug 2020 20:09:31 +0200 Subject: play effect sfx if there isn't another already --- webAO/client.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 0cefa5c..f65d3d8 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -1793,7 +1793,10 @@ async changeBackground(position) { if (effectinfo[0]) fg.src = `${AO_HOST}themes/default/effects/${encodeURI(effectinfo[0].toLowerCase())}.webp`; else - fg.src = transparentPNG; + fg.src = transparentPNG; + + if (this.chatmsg.sound === "0" || this.chatmsg.sound === "1" || this.chatmsg.sound === "" || this.chatmsg.sound === undefined) + this.chatmsg.sound = effectinfo[2]; this.tick(); } -- cgit From b0fb74ce9cb02291df59f15be526d0ee2a147fd7 Mon Sep 17 00:00:00 2001 From: sD Date: Mon, 17 Aug 2020 20:02:04 +0200 Subject: add sfx to evidence popup --- webAO/client.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index bdf372f..6d6a3a7 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -1336,7 +1336,7 @@ class Viewport { this.shoutaudio.src = `${AO_HOST}misc/default/objection.wav`; this.testimonyAudio = document.getElementById("client_testimonyaudio"); - this.testimonyAudio.src = `${AO_HOST}sounds/general/sfx-notguilty.wav`; + this.testimonyAudio.src = `${AO_HOST}sounds/general/sfx-guilty.wav`; this.music = document.getElementById("client_musicaudio"); this.music.src = `${AO_HOST}sounds/music/trial (aa).mp3`; @@ -1862,6 +1862,9 @@ async changeBackground(position) { eviBox.style.height = "36.5%"; eviBox.style.opacity = 1; + this.testimonyAudio.src = AO_HOST + "sounds/general/sfx-evidenceshoop.wav"; + this.testimonyAudio.play(); + if (this.chatmsg.side === "def") { // Only def show evidence on right eviBox.style.right = "1em"; -- cgit From 089af7e22a00d0e725b38006c5c5f149bda1f759 Mon Sep 17 00:00:00 2001 From: sD Date: Mon, 17 Aug 2020 20:07:01 +0200 Subject: sfx spam got fixed in 2.8 --- webAO/client.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 6d6a3a7..ad07670 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -1730,8 +1730,6 @@ async changeBackground(position) { // case 5: // zoom default: - // due to a retarded client bug, we need to strip the sfx from the MS, if the preanim isn't playing - this.chatmsg.sound = ""; this.chatmsg.startspeaking = true; break; } -- cgit From c48e3a93c514ae94da86a79b7794dcbdfd4abc55 Mon Sep 17 00:00:00 2001 From: sD Date: Mon, 17 Aug 2020 20:26:26 +0200 Subject: ignore empty overlays --- webAO/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 2b2699b..e1842ba 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -1781,7 +1781,7 @@ async changeBackground(position) { const effectinfo = this.chatmsg.effects.split('|'); fg.style.animation = ""; - if (effectinfo[0]) + if (effectinfo[0] && effectinfo[0] !== "-") fg.src = `${AO_HOST}themes/default/effects/${encodeURI(effectinfo[0].toLowerCase())}.webp`; else fg.src = transparentPNG; -- cgit From 2622d9b7b5db30e1a6efc2de1411d7d599ee725c Mon Sep 17 00:00:00 2001 From: sD Date: Tue, 18 Aug 2020 00:28:00 +0200 Subject: add defaults for non 2.8 servers --- webAO/client.js | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index e1842ba..d9b27a3 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -620,6 +620,11 @@ class Client extends EventEmitter { frame_sfx: "" }; chatmsg = Object.assign(extra_27, chatmsg); + const extra_28 = { + additive: 0, + effects: "" + }; + chatmsg = Object.assign(extra_28, chatmsg); } } else { const extra_cccc = { @@ -633,6 +638,19 @@ class Client extends EventEmitter { noninterrupting_preanim: 0 }; chatmsg = Object.assign(extra_cccc, chatmsg); + const extra_27 = { + looping_sfx: 0, + screenshake: 0, + frame_screenshake: "", + frame_realization: "", + frame_sfx: "" + }; + chatmsg = Object.assign(extra_27, chatmsg); + const extra_28 = { + additive: 0, + effects: "" + }; + chatmsg = Object.assign(extra_28, chatmsg); } // our own message appeared, reset the buttons @@ -1625,10 +1643,12 @@ async changeBackground(position) { const png_s = document.getElementById("client_" + pairID + "_png"); const apng_s = document.getElementById("client_" + pairID +"_apng"); - //hide the last sprite - gif_s.src = transparentPNG; - png_s.src = transparentPNG; - apng_s.src = transparentPNG; + if (this.lastChar !== this.chatmsg.name) { + //hide the last sprite + gif_s.src = transparentPNG; + png_s.src = transparentPNG; + apng_s.src = transparentPNG; + } gif_s.src = characterFolder + `${encodeURI(charactername)}/${encodeURI(prefix)}${encodeURI(emotename)}.gif`; png_s.src = characterFolder + `${encodeURI(charactername)}/${encodeURI(emotename)}.png`; @@ -1689,9 +1709,8 @@ async changeBackground(position) { appendICLog(this.chatmsg.content, displayname); - checkCallword(this.chatmsg.content); + checkCallword(this.chatmsg.content); - this.setEmote(this.chatmsg.name.toLowerCase(), this.chatmsg.sprite, "(b)", false); this.setEmote(this.chatmsg.name.toLowerCase(), this.chatmsg.sprite, "(a)", false); if (this.chatmsg.other_name) { -- cgit From 82eaeeddb422968a66fb75b16e3451db566c19de Mon Sep 17 00:00:00 2001 From: sD Date: Tue, 1 Sep 2020 12:46:04 +0200 Subject: add effects --- webAO/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index d9b27a3..1150f15 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -32,7 +32,7 @@ const serverIP = queryDict.ip; let mode = queryDict.mode; // Unless there is an asset URL specified, use the wasabi one -const DEFAULT_HOST = location.hostname ? "https://cloudflare-ipfs.com/ipfs/QmZSdhjX8RUKBTER8hyVNHnK2ByLXusYc99FRS6RztDKUF/" : "base/"; +const DEFAULT_HOST = location.hostname ? "https://cloudflare-ipfs.com/ipfs/QmeWK7nB1xjS3zQRwqwGYrKcbiNUKYiWHYCryXzrJF336c/" : "base/"; const AO_HOST = queryDict.asset || DEFAULT_HOST; const THEME = queryDict.theme || "default"; const MUSIC_HOST = AO_HOST + "sounds/music/"; -- cgit