aboutsummaryrefslogtreecommitdiff
path: root/webAO/client.ts
diff options
context:
space:
mode:
authorCaleb Mabry <36182383+caleb-mabry@users.noreply.github.com>2022-07-17 20:23:38 -0400
committerCaleb Mabry <36182383+caleb-mabry@users.noreply.github.com>2022-07-17 20:23:38 -0400
commit0a5641f1c437993cf49958a77831056792b0c872 (patch)
tree12201d53a0a21ff22f469c53786d6a942e49969b /webAO/client.ts
parent03aa72eda907a1586baf3664a0be71191d898b9b (diff)
Updating to use getters and setters
Diffstat (limited to 'webAO/client.ts')
-rw-r--r--webAO/client.ts21
1 files changed, 11 insertions, 10 deletions
diff --git a/webAO/client.ts b/webAO/client.ts
index 18b173c..569b0e8 100644
--- a/webAO/client.ts
+++ b/webAO/client.ts
@@ -1515,15 +1515,16 @@ class Client extends EventEmitter {
*/
handleBN(args: string[]) {
- this.viewport.bgname = safeTags(args[1]);
- const bgfolder = this.viewport.bgFolder;
- const bg_index = getIndexFromSelect("bg_select", this.viewport.bgname);
+ const bgFromArgs = safeTags(args[1]);
+ this.viewport.changeBgName(bgFromArgs);
+ const bgfolder = this.viewport.bgFolder();
+ const bg_index = getIndexFromSelect("bg_select", this.viewport.bgName());
(<HTMLSelectElement>document.getElementById("bg_select")).selectedIndex =
bg_index;
updateBackgroundPreview();
if (bg_index === 0) {
(<HTMLInputElement>document.getElementById("bg_filename")).value =
- this.viewport.bgname;
+ this.viewport.bgName();
}
tryUrls(
@@ -1659,12 +1660,12 @@ class Client extends EventEmitter {
oocLog.scrollTop = oocLog.scrollHeight;
}
- this.viewport.sfxaudio.pause();
- const oldvolume = this.viewport.sfxaudio.volume;
- this.viewport.sfxaudio.volume = 1;
- this.viewport.sfxaudio.src = `${AO_HOST}sounds/general/sfx-gallery.opus`;
- this.viewport.sfxaudio.play();
- this.viewport.sfxaudio.volume = oldvolume;
+ this.viewport.sfxAudio().pause();
+ const oldvolume = this.viewport.sfxAudio().volume;
+ this.viewport.sfxAudio().volume = 1;
+ this.viewport.sfxAudio().src = `${AO_HOST}sounds/general/sfx-gallery.opus`;
+ this.viewport.sfxAudio().play();
+ this.viewport.sfxAudio().volume = oldvolume;
}
/**