X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;f=rogue_chat_curses.py;h=5046de199ce0f7c6db4f31bd176eded30235d002;hb=fbce872bf4a04ac7be7d965061dabe441258999c;hp=f75877aff1af88ca76cdf0e228c58cac01a69f1c;hpb=836f37cfc14cd1a27ac5aee1f8465925a7ed87c4;p=plomrogue2 diff --git a/rogue_chat_curses.py b/rogue_chat_curses.py index f75877a..5046de1 100755 --- a/rogue_chat_curses.py +++ b/rogue_chat_curses.py @@ -475,10 +475,11 @@ class TUI: self.mode_control_tile_draw.available_modes = ["admin_enter"] self.mode_control_tile_draw.available_actions = ["move_explorer", "toggle_tile_draw"] - self.mode_edit.available_modes = ["write", "annotate", "portal", "name_thing", - "password", "chat", "study", "play", - "admin_enter", "enter_face"] - self.mode_edit.available_actions = ["move", "flatten", "toggle_map_mode"] + self.mode_edit.available_modes = ["write", "annotate", "portal", + "name_thing", "enter_face", "password", + "chat", "study", "play", "admin_enter"] + self.mode_edit.available_actions = ["move", "flatten", "install", + "toggle_map_mode"] self.mode = None self.host = host self.game = Game() @@ -629,10 +630,10 @@ class TUI: def switch_mode(self, mode_name): - def fail(msg): + def fail(msg, return_mode='play'): self.log_msg('? ' + msg) self.flash = True - self.switch_mode('play') + self.switch_mode(return_mode) if self.mode and self.mode.name == 'control_tile_draw': self.log_msg('@ finished tile protection drawing.') @@ -655,7 +656,7 @@ class TUI: thing = t break if not thing: - return fail('not standing over thing') + return fail('not standing over thing', 'edit') else: self.thing_selected = thing self.mode = getattr(self, 'mode_' + mode_name) @@ -1087,6 +1088,7 @@ class TUI: keycode = None if len(key) == 1: keycode = ord(key) + self.show_help = False if key == 'KEY_RESIZE': reset_screen_size() elif self.mode.has_input_prompt and key == 'KEY_BACKSPACE': @@ -1214,8 +1216,6 @@ class TUI: self.send('TASK:DOOR') elif key == self.keys['consume'] and task_action_on('consume'): self.send('TASK:INTOXICATE') - elif key == self.keys['install'] and task_action_on('install'): - self.send('TASK:INSTALL') elif key == self.keys['wear'] and task_action_on('wear'): self.send('TASK:WEAR') elif key == self.keys['spin'] and task_action_on('spin'): @@ -1249,6 +1249,8 @@ class TUI: continue elif key == self.keys['flatten'] and task_action_on('flatten'): self.send('TASK:FLATTEN_SURROUNDINGS ' + quote(self.password)) + elif key == self.keys['install'] and task_action_on('install'): + self.send('TASK:INSTALL %s' % quote(self.password)) elif key == self.keys['toggle_map_mode']: self.toggle_map_mode() elif key in self.movement_keys and task_action_on('move'):