home · contact · privacy
Minor key effect fixes in clients.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 11 Nov 2020 23:42:48 +0000 (00:42 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 11 Nov 2020 23:42:48 +0000 (00:42 +0100)
rogue_chat_curses.py
rogue_chat_nocanvas_monochrome.html

index 946c8ae3315e86f5c645d002dc0a1ca6138923d6..33b2750788c4c9b241158c9943ff428d726c9a8e 100755 (executable)
@@ -495,8 +495,8 @@ class TUI:
                 map_y += 1
 
         def draw_help():
-            content = "%s mode help (hit any key to disappear)\n\n%s\n\n" % (self.mode.name,
-                                                            self.mode.help_intro)
+            content = "%s mode help\n\n%s\n\n" % (self.mode.name,
+                                                  self.mode.help_intro)
             if self.mode == self.mode_play:
                 content += "Available actions:\n"
                 if 'MOVE' in self.game.tasks:
index 1e3653bb0df50eab39df6f6b52b4ff213dfab588..e5bef1aa4d8a55ea2450874ab81def6e346b078b 100644 (file)
@@ -520,7 +520,7 @@ let tui = {
   },
   draw_help: function() {
       let movement_keys_desc = Object.keys(this.movement_keys).join(',');
-      let content = this.mode.name + " mode help (hit any key to disappear)\n\n" + this.mode.help_intro + "\n\n";
+      let content = this.mode.name + " mode help\n\n" + this.mode.help_intro + "\n\n";
       if (this.mode == mode_play) {
           content += "Available actions:\n";
           if (game.tasks.includes('MOVE')) {
@@ -661,7 +661,6 @@ let explorer = {
         if (target) {
             this.position = target
             this.query_info();
-            tui.full_refresh();
         } else {
             terminal.blink_screen();
         };
@@ -726,18 +725,11 @@ tui.inputEl.addEventListener('input', (event) => {
             tui.inputEl.value = tui.inputEl.value.slice(0, max_length);
         };
         tui.recalc_input_lines();
-        tui.full_refresh();
     } else if (tui.mode == mode_edit && tui.inputEl.value.length > 0) {
         server.send(["TASK:WRITE", tui.inputEl.value[0], tui.password]);
         tui.switch_mode(mode_play);
-    } else if (tui.mode == mode_teleport) {
-        if (['Y', 'y'].includes(tui.inputEl.value[0])) {
-            server.reconnect_to(tui.teleport_target);
-       } else {
-            tui.log_msg("@ teleportation aborted");
-            tui.switch_mode(mode_play);
-       }
     }
+    tui.full_refresh();
 }, false);
 tui.inputEl.addEventListener('keydown', (event) => {
     tui.show_help = false;
@@ -748,10 +740,8 @@ tui.inputEl.addEventListener('keydown', (event) => {
         tui.show_help = true;
         tui.empty_input();
         tui.restore_input_values();
-        tui.full_refresh();
     } else if (!tui.mode.has_input_prompt && event.key == tui.keys.help) {
         tui.show_help = true;
-        tui.full_refresh();
     } else if (tui.mode == mode_login && event.key == 'Enter') {
         tui.login_name = tui.inputEl.value;
         server.send(['LOGIN', tui.inputEl.value]);
@@ -812,7 +802,6 @@ tui.inputEl.addEventListener('keydown', (event) => {
                server.send(['ALL', tui.inputEl.value]);
         }
         tui.empty_input();
-        tui.full_refresh();
     } else if (tui.mode == mode_play) {
           if (event.key === tui.keys.switch_to_chat) {
               event.preventDefault();
@@ -853,9 +842,9 @@ tui.inputEl.addEventListener('keydown', (event) => {
             } else {
                 tui.map_mode = 'terrain';
             }
-            tui.full_refresh();
         };
     }
+    tui.full_refresh();
 }, false);
 
 rows_selector.addEventListener('input', function() {