aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom
diff options
context:
space:
mode:
Diffstat (limited to 'webAO/dom')
-rw-r--r--webAO/dom/muteListClick.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/webAO/dom/muteListClick.ts b/webAO/dom/muteListClick.ts
new file mode 100644
index 0000000..e7c9357
--- /dev/null
+++ b/webAO/dom/muteListClick.ts
@@ -0,0 +1,19 @@
+import { client } from "../client";
+/**
+ * Triggered when a character in the mute list is clicked
+ * @param {MouseEvent} event
+ */
+export function mutelist_click(_event: Event) {
+ const mutelist = <HTMLSelectElement>(document.getElementById('mute_select'));
+ const selected_character = mutelist.options[mutelist.selectedIndex];
+
+ if (client.chars[selected_character.value].muted === false) {
+ client.chars[selected_character.value].muted = true;
+ selected_character.text = `${client.chars[selected_character.value].name} (muted)`;
+ console.info(`muted ${client.chars[selected_character.value].name}`);
+ } else {
+ client.chars[selected_character.value].muted = false;
+ selected_character.text = client.chars[selected_character.value].name;
+ }
+}
+window.mutelist_click = mutelist_click; \ No newline at end of file