aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/changeBackgroundOOC.ts
diff options
context:
space:
mode:
Diffstat (limited to 'webAO/dom/changeBackgroundOOC.ts')
-rw-r--r--webAO/dom/changeBackgroundOOC.ts38
1 files changed, 18 insertions, 20 deletions
diff --git a/webAO/dom/changeBackgroundOOC.ts b/webAO/dom/changeBackgroundOOC.ts
index 55ce238..c90ecba 100644
--- a/webAO/dom/changeBackgroundOOC.ts
+++ b/webAO/dom/changeBackgroundOOC.ts
@@ -1,28 +1,26 @@
-
-import queryParser from '../utils/queryParser'
-import { client } from '../client'
-const { mode } = queryParser()
+import queryParser from "../utils/queryParser";
+import { client } from "../client";
+const { mode } = queryParser();
/**
* Change background via OOC.
*/
export function changeBackgroundOOC() {
- const selectedBG = <HTMLSelectElement>document.getElementById("bg_select");
- const changeBGCommand = "bg $1";
- const bgFilename = <HTMLInputElement>document.getElementById("bg_filename");
-
- let filename = "";
- if (selectedBG.selectedIndex === 0) {
- filename = bgFilename.value;
- } else {
- filename = selectedBG.value;
- }
+ const selectedBG = <HTMLSelectElement>document.getElementById("bg_select");
+ const changeBGCommand = "bg $1";
+ const bgFilename = <HTMLInputElement>document.getElementById("bg_filename");
+ let filename = "";
+ if (selectedBG.selectedIndex === 0) {
+ filename = bgFilename.value;
+ } else {
+ filename = selectedBG.value;
+ }
- if (mode === "join") {
- client.sender.sendOOC(`/${changeBGCommand.replace("$1", filename)}`);
- } else if (mode === "replay") {
- client.sender.sendSelf(`BN#${filename}#%`);
- }
+ if (mode === "join") {
+ client.sender.sendOOC(`/${changeBGCommand.replace("$1", filename)}`);
+ } else if (mode === "replay") {
+ client.sender.sendSelf(`BN#${filename}#%`);
+ }
}
-window.changeBackgroundOOC = changeBackgroundOOC; \ No newline at end of file
+window.changeBackgroundOOC = changeBackgroundOOC;