From: Christian Heller Date: Wed, 18 Nov 2020 03:42:04 +0000 (+0100) Subject: Fix bug that emptied annotation input on pre-existing annotation. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/%7B%7Byoutube_prefix%7D%7D%7B%7Bvideo_id%7D%7D?a=commitdiff_plain;h=43591a0ee2c85a98730aac730aded8c0a8cdba57;p=plomrogue2 Fix bug that emptied annotation input on pre-existing annotation. --- diff --git a/rogue_chat_curses.py b/rogue_chat_curses.py index 8c629a5..15f4cd2 100755 --- a/rogue_chat_curses.py +++ b/rogue_chat_curses.py @@ -155,6 +155,7 @@ cmd_ARGUMENT_ERROR.argtypes = 'string' def cmd_ANNOTATION(game, position, msg): game.info_db[position] = msg + game.tui.restore_input_values() if game.tui.mode.shows_info: game.tui.do_refresh = True cmd_ANNOTATION.argtypes = 'yx_tuple:nonneg string' @@ -366,6 +367,7 @@ class TUI: if self.mode.shows_info: player = self.game.get_thing(self.game.player_id) self.explorer = YX(player.position.y, player.position.x) + self.query_info() if self.mode.name == 'waiting_for_server': self.log_msg('@ waiting for server …') if self.mode.name == 'edit': diff --git a/rogue_chat_nocanvas_monochrome.html b/rogue_chat_nocanvas_monochrome.html index c50a12f..a5b2d69 100644 --- a/rogue_chat_nocanvas_monochrome.html +++ b/rogue_chat_nocanvas_monochrome.html @@ -277,6 +277,8 @@ let server = { } else if (tokens[0] === 'ANNOTATION') { let position = parser.parse_yx(tokens[1]); explorer.update_info_db(position, tokens[2]); + tui.restore_input_values(); + tui.full_refresh(); } else if (tokens[0] === 'UNHANDLED_INPUT') { tui.log_msg('? unknown command'); } else if (tokens[0] === 'PLAY_ERROR') { @@ -386,6 +388,7 @@ let tui = { this.map_mode = 'terrain'; if (mode.shows_info && game.player_id in game.things) { explorer.position = game.things[game.player_id].position; + explorer.query_info(); } this.mode = mode; this.empty_input();