home · contact · privacy
Minor refactoring.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 22 Nov 2020 03:16:25 +0000 (04:16 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 22 Nov 2020 03:16:25 +0000 (04:16 +0100)
rogue_chat_nocanvas_monochrome.html

index 381b0f2c3679a0c146dddac02caa69f6037a8f80..b1dd9929700724c57004413edc17bd5432476c08 100644 (file)
@@ -167,8 +167,7 @@ let key_selectors = document.querySelectorAll('[id^="key_"]');
 
 for (const key_switch_selector of document.querySelectorAll('[id^="key_switch_to_"]')) {
     const action = key_switch_selector.id.slice("key_switch_to_".length);
-    const msg = "[" + mode_helps[action].short + "]: ";
-    key_switch_selector.parentNode.prepend(msg);
+    key_switch_selector.parentNode.prepend(mode_helps[action].short + ': ');
 }
 
 function restore_selector_value(selector) {
@@ -582,29 +581,10 @@ let tui = {
     }
     this.empty_input();
     this.restore_input_values();
-    document.getElementById("take_thing").disabled = true;
-    document.getElementById("drop_thing").disabled = true;
-    document.getElementById("flatten").disabled = true;
-    document.getElementById("teleport").disabled = true;
-    document.getElementById("toggle_map_mode").disabled = true;
-    document.getElementById("switch_to_chat").disabled = true;
-    document.getElementById("switch_to_play").disabled = true;
-    document.getElementById("switch_to_study").disabled = true;
-    document.getElementById("switch_to_edit").disabled = true;
-    document.getElementById("switch_to_portal").disabled = true;
-    document.getElementById("switch_to_annotate").disabled = true;
-    document.getElementById("switch_to_password").disabled = true;
-    document.getElementById("switch_to_admin").disabled = true;
-    document.getElementById("switch_to_control_pw_type").disabled = true;
-    document.getElementById("switch_to_control_tile_type").disabled = true;
-    document.getElementById("move_left").disabled = true;
-    document.getElementById("move_upleft").disabled = true;
-    document.getElementById("move_up").disabled = true;
-    document.getElementById("move_upright").disabled = true;
-    document.getElementById("move_downleft").disabled = true;
-    document.getElementById("move_down").disabled = true;
-    document.getElementById("move_downright").disabled = true;
-    document.getElementById("move_right").disabled = true;
+    for (let el of document.getElementsByTagName("button")) {
+        el.disabled = true;
+    }
+    document.getElementById("help").disabled = false;
     if (this.mode.name == 'play' || this.mode.name == 'study' || this.mode.name == 'control_tile_draw') {
         document.getElementById("move_left").disabled = false;
         document.getElementById("move_right").disabled = false;