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

index 4ea33d6b2b715b1c9f115dd0064bb5e4bb271bec..105866376f1f40df2f6dd76e8d7709d6598fb582 100644 (file)
@@ -599,16 +599,8 @@ let tui = {
     }
     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;
-        if (game.map_geometry == 'Hex') {
-            document.getElementById("move_upleft").disabled = false;
-            document.getElementById("move_upright").disabled = false;
-            document.getElementById("move_downleft").disabled = false;
-            document.getElementById("move_downright").disabled = false;
-        } else {
-            document.getElementById("move_up").disabled = false;
-            document.getElementById("move_down").disabled = false;
+        for (const move_key of document.querySelectorAll('[id^="move_"]')) {
+            move_key.disabled = false;
         }
     }
     if (!this.mode.is_intro && this.mode.name != 'play') {