From 1899c8058fde577318c1911a35108ea8d91cd1a7 Mon Sep 17 00:00:00 2001 From: "caleb.mabry.15@cnu.edu" Date: Thu, 17 Mar 2022 20:00:07 -0400 Subject: Adding blip sounds to actual audio tags --- webAO/client.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 8bac1cc..7e82d91 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -1674,15 +1674,8 @@ class Viewport { ]; // Allocate multiple blip audio channels to make blips less jittery - - this.blipChannels = new Array( - new Audio(`${AO_HOST}sounds/general/sfx-blipmale.opus`), - new Audio(`${AO_HOST}sounds/general/sfx-blipmale.opus`), - new Audio(`${AO_HOST}sounds/general/sfx-blipmale.opus`), - new Audio(`${AO_HOST}sounds/general/sfx-blipmale.opus`), - new Audio(`${AO_HOST}sounds/general/sfx-blipmale.opus`), - new Audio(`${AO_HOST}sounds/general/sfx-blipmale.opus`), - ); + const blipSelectors = document.getElementsByClassName('blipSound') + this.blipChannels = [...blipSelectors]; this.blipChannels.forEach((channel) => channel.volume = 0.5); this.blipChannels.forEach((channel) => channel.onerror = opusCheck(channel)); this.currentBlipChannel = 0; -- cgit From 47ab340c76e6174f0f94fb4cbfec1540b6a18807 Mon Sep 17 00:00:00 2001 From: "caleb.mabry.15@cnu.edu" Date: Fri, 18 Mar 2022 00:06:11 -0400 Subject: Moving to audio tags --- webAO/client.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 34a1b4b..739f170 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -1698,12 +1698,8 @@ class Viewport { this.testimonyAudio = document.getElementById('client_testimonyaudio'); this.testimonyAudio.src = `${AO_HOST}sounds/general/sfx-guilty.opus`; - this.music = new Array( - new Audio(`${AO_HOST}sounds/music/trial (aa).opus`), - new Audio(`${AO_HOST}sounds/music/trial (aa).opus`), - new Audio(`${AO_HOST}sounds/music/trial (aa).opus`), - new Audio(`${AO_HOST}sounds/music/trial (aa).opus`), - ); + const audioChannels = document.getElementsByClassName('audioChannel') + this.music = [...audioChannels]; this.music.forEach((channel) => channel.volume = 0.5); this.music.forEach((channel) => channel.onerror = opusCheck(channel)); @@ -2621,6 +2617,10 @@ window.imgError = imgError; * @param {HTMLImageElement} image the element containing the missing sound */ export function opusCheck(channel) { + const audio = channel.src + if (audio === '') { + return + } console.info(`failed to load sound ${channel.src}`); let oldsrc = ''; oldsrc = channel.src; -- cgit From 38739ca7ad89a3b743696e9b3b95c26d1a50b07a Mon Sep 17 00:00:00 2001 From: "caleb.mabry.15@cnu.edu" Date: Sun, 20 Mar 2022 14:08:10 -0400 Subject: Adding custom markdown based on asset file --- webAO/client.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 14bfd08..a59508e 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -10,7 +10,7 @@ import fileExistsSync from './utils/fileExistsSync'; import { escapeChat, encodeChat, prepChat, safeTags, } from './encoding.js'; - +import mlConfig from './utils/aoml'; // Load some defaults for the background and evidence dropdowns import vanilla_character_arr from './constants/characters.js'; import vanilla_music_arr from './constants/music.js'; @@ -43,6 +43,8 @@ const DEFAULT_HOST = 'http://attorneyoffline.de/base/'; let AO_HOST = asset || DEFAULT_HOST; const THEME = theme || 'default'; +const attorneyMarkdown = mlConfig(AO_HOST) + const UPDATE_INTERVAL = 60; /** @@ -1938,6 +1940,7 @@ class Viewport { * @param {object} chatmsg the new chat message */ async say(chatmsg) { + this.chatmsg = chatmsg; this.textnow = ''; this.sfxplayed = 0; @@ -2089,7 +2092,7 @@ class Viewport { if (soundChecks.some((check) => this.chatmsg.sound === check)) { this.chatmsg.sound = this.chatmsg.effects[2]; } - + this.chatmsg.parsed = attorneyMarkdown.applyMarkdown(chatmsg.content) this.tick(); } @@ -2242,7 +2245,7 @@ class Viewport { } this.textnow = this.chatmsg.content.substring(0, this.textnow.length + 1); - chatBoxInner.innerText = this.textnow; + chatBoxInner.appendChild(this.chatmsg.parsed[this.textnow.length - 1]); // scroll to bottom chatBox.scrollTop = chatBox.scrollHeight; @@ -2325,6 +2328,7 @@ export function onEnter(event) { if (emote_mod === 0) { emote_mod = 1; } } else if (emote_mod === 1) { emote_mod = 0; } + client.sendIC( 'chat', myemo.preanim, -- cgit From 79db229a94aa3f407399158470e3d027d2b035e8 Mon Sep 17 00:00:00 2001 From: "caleb.mabry.15@cnu.edu" Date: Mon, 21 Mar 2022 17:26:05 -0400 Subject: Fixing bugs --- webAO/client.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index a59508e..87db272 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -2092,7 +2092,7 @@ class Viewport { if (soundChecks.some((check) => this.chatmsg.sound === check)) { this.chatmsg.sound = this.chatmsg.effects[2]; } - this.chatmsg.parsed = attorneyMarkdown.applyMarkdown(chatmsg.content) + this.chatmsg.parsed = attorneyMarkdown.applyMarkdown(chatmsg.content, this.colors[this.chatmsg.color]) this.tick(); } @@ -2244,7 +2244,6 @@ class Viewport { this.currentBlipChannel %= this.blipChannels.length; } this.textnow = this.chatmsg.content.substring(0, this.textnow.length + 1); - chatBoxInner.appendChild(this.chatmsg.parsed[this.textnow.length - 1]); // scroll to bottom -- cgit From 4d09a4a7105de76189fae41e86c9186ba7ff76fd Mon Sep 17 00:00:00 2001 From: "caleb.mabry.15@cnu.edu" Date: Tue, 22 Mar 2022 00:16:52 -0400 Subject: ez error handling --- 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 87db272..44cc8bd 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -2244,7 +2244,10 @@ class Viewport { this.currentBlipChannel %= this.blipChannels.length; } this.textnow = this.chatmsg.content.substring(0, this.textnow.length + 1); - chatBoxInner.appendChild(this.chatmsg.parsed[this.textnow.length - 1]); + const characterElement = this.chatmsg.parsed[this.textnow.length - 1] + if (characterElement) { + chatBoxInner.appendChild(this.chatmsg.parsed[this.textnow.length - 1]); + } // scroll to bottom chatBox.scrollTop = chatBox.scrollHeight; -- cgit From 7c88c0bcca6e47cca4e2632df8ced778fa38c341 Mon Sep 17 00:00:00 2001 From: "caleb.mabry.15@cnu.edu" Date: Wed, 23 Mar 2022 00:33:18 -0400 Subject: Final commit --- 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 44cc8bd..eed1293 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -2092,7 +2092,7 @@ class Viewport { if (soundChecks.some((check) => this.chatmsg.sound === check)) { this.chatmsg.sound = this.chatmsg.effects[2]; } - this.chatmsg.parsed = attorneyMarkdown.applyMarkdown(chatmsg.content, this.colors[this.chatmsg.color]) + this.chatmsg.parsed = await attorneyMarkdown.applyMarkdown(chatmsg.content, this.colors[this.chatmsg.color]) this.tick(); } -- cgit From 415eff55a9db8da9077e0e1dd5d3c3672ff66e8a Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Wed, 23 Mar 2022 21:45:57 +0100 Subject: remove unused settings --- webAO/client.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index dfba169..6a2947c 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -9,7 +9,7 @@ import { EventEmitter } from 'events'; import fileExistsSync from './utils/fileExistsSync'; import { escapeChat, encodeChat, prepChat, safeTags, -} from './encoding.js'; +} from './encoding'; import mlConfig from './utils/aoml'; // Load some defaults for the background and evidence dropdowns import vanilla_character_arr from './constants/characters.js'; @@ -2957,7 +2957,7 @@ window.updateActionCommands = updateActionCommands; */ export function changeBackgroundOOC() { const selectedBG = document.getElementById('bg_select'); - const changeBGCommand = document.getElementById('bg_command').value; + const changeBGCommand = "bg $1"; const bgFilename = document.getElementById('bg_filename'); let filename = ''; @@ -2987,7 +2987,7 @@ window.changeRoleOOC = changeRoleOOC; * Random character via OOC. */ export function randomCharacterOOC() { - client.sendOOC(`/${document.getElementById('randomchar_command').value}`); + client.sendOOC(`/randomchar`); } window.randomCharacterOOC = randomCharacterOOC; -- cgit