From: Christian Heller Date: Wed, 11 Nov 2020 23:42:48 +0000 (+0100) Subject: Minor key effect fixes in clients. X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/%7B%7Bdb.prefix%7D%7D/%7B%7Btodo.date%7D%7D?a=commitdiff_plain;h=6bf479a40acf55042c5ea4834701d09073af172c;p=plomrogue2 Minor key effect fixes in clients. --- diff --git a/rogue_chat_curses.py b/rogue_chat_curses.py index 946c8ae..33b2750 100755 --- a/rogue_chat_curses.py +++ b/rogue_chat_curses.py @@ -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: diff --git a/rogue_chat_nocanvas_monochrome.html b/rogue_chat_nocanvas_monochrome.html index 1e3653b..e5bef1a 100644 --- a/rogue_chat_nocanvas_monochrome.html +++ b/rogue_chat_nocanvas_monochrome.html @@ -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() {