X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bdeck_id%7D%7D/cards/%7B%7Bcard_id%7D%7D/static/gitweb.css?a=blobdiff_plain;f=rogue_chat_curses.py;h=6031f8e2deafc5d599e40f38991c7c4662dc809c;hb=9c3aaa1285200c1161c3beaefab464597445daf7;hp=6f136387b33f5353c1216fb13163cdb10da1ba93;hpb=52b01fc00d6ea2c053f9022981498b97ebd05839;p=plomrogue2 diff --git a/rogue_chat_curses.py b/rogue_chat_curses.py index 6f13638..6031f8e 100755 --- a/rogue_chat_curses.py +++ b/rogue_chat_curses.py @@ -356,6 +356,7 @@ class Game(GameBase): self.register_command(cmd_THING_CHAR) self.register_command(cmd_THING_FACE) self.register_command(cmd_THING_HAT) + self.register_command(cmd_THING_DESIGN) self.register_command(cmd_THING_CARRYING) self.register_command(cmd_THING_INSTALLED) self.register_command(cmd_TERRAIN) @@ -1086,15 +1087,20 @@ class TUI: self.do_refresh = True except curses.error: continue - self.show_help = False + keycode = None + if len(key) == 1: + keycode = ord(key) if key == 'KEY_RESIZE': reset_screen_size() elif self.mode.has_input_prompt and key == 'KEY_BACKSPACE': self.input_ = self.input_[:-1] - elif self.mode.has_input_prompt and key == '\n' and self.input_ == ''\ - and self.mode.name in {'chat', 'command_thing', 'take_thing', - 'drop_thing', 'admin_enter'}: - if self.mode.name != 'chat': + elif (((not self.mode.is_intro) and keycode == 27) # Escape + or (self.mode.has_input_prompt and key == '\n' + and self.input_ == ''\ + and self.mode.name in {'chat', 'command_thing', + 'take_thing', 'drop_thing', + 'admin_enter'})): + if self.mode.name not in {'chat', 'play', 'study', 'edit'}: self.log_msg('@ aborted') self.switch_mode('play') elif self.mode.has_input_prompt and key == '\n' and self.input_ == '/help':