home · contact · privacy
Enable map mode toggling in admin mode.
authorChristian Heller <c.heller@plomlompom.de>
Fri, 18 Dec 2020 22:19:23 +0000 (23:19 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Fri, 18 Dec 2020 22:19:23 +0000 (23:19 +0100)
rogue_chat.html
rogue_chat_curses.py

index a09892dbc86576e8db2d437a29e22212e09508c2..45f04a6ccf70e8e384f2e47d72fa358ce8382c2f 100644 (file)
@@ -745,7 +745,7 @@ let tui = {
       this.mode_admin.available_modes = ["admin_thing_protect", "control_pw_type",
                                          "control_tile_type", "chat",
                                          "study", "play", "edit"]
-      this.mode_admin.available_actions = ["move"];
+      this.mode_admin.available_actions = ["move", "toggle_map_mode"];
       this.mode_control_tile_draw.available_modes = ["admin_enter"]
       this.mode_control_tile_draw.available_actions = ["toggle_tile_draw"];
       this.mode_edit.available_modes = ["write", "annotate", "portal", "name_thing",
@@ -1716,6 +1716,8 @@ tui.inputEl.addEventListener('keydown', (event) => {
     } else if (tui.mode.name == 'admin') {
         if (tui.mode.mode_switch_on_key(event)) {
               null;
+        } else if (event.key == tui.keys.toggle_map_mode) {
+            tui.toggle_map_mode();
         } else if (event.key in tui.movement_keys && tui.task_action_on('move')) {
             server.send(['TASK:MOVE', tui.movement_keys[event.key]]);
         };
index 57c3750892c9049081ba255b8e77f42b5d46f4e6..72fc0a7dddf94ed5ba1baff57c68f723e20d0b64 100755 (executable)
@@ -518,7 +518,7 @@ class TUI:
         self.mode_admin.available_modes = ["admin_thing_protect", "control_pw_type",
                                            "control_tile_type", "chat",
                                            "study", "play", "edit"]
-        self.mode_admin.available_actions = ["move"]
+        self.mode_admin.available_actions = ["move", "toggle_map_mode"]
         self.mode_control_tile_draw.available_modes = ["admin_enter"]
         self.mode_control_tile_draw.available_actions = ["move_explorer",
                                                          "toggle_tile_draw"]
@@ -1364,6 +1364,8 @@ class TUI:
             elif self.mode.name == 'admin':
                 if self.mode.mode_switch_on_key(self, key):
                     continue
+                elif key == self.keys['toggle_map_mode']:
+                    self.toggle_map_mode()
                 elif key in self.movement_keys and task_action_on('move'):
                     self.send('TASK:MOVE ' + self.movement_keys[key])
             elif self.mode.name == 'edit':