home · contact · privacy
In hat and face edit, use existing value as default input.
[plomrogue2] / rogue_chat_curses.py
index e9f7f6b93c21936d37e783eb9d2d651553e8fc0d..41ad640d509a123774d47033e182156d664af583 100755 (executable)
@@ -652,6 +652,10 @@ class TUI:
         elif self.mode.name == 'admin_thing_protect':
             if hasattr(self.thing_selected, 'protection'):
                 self.input_ = self.thing_selected.protection
+        elif self.mode.name == 'enter_face':
+            self.input_ = self.game.player.face
+        elif self.mode.name == 'enter_hat':
+            self.input_ = self.game.player.hat
 
     def send_tile_control_command(self):
         self.send('SET_TILE_CONTROL %s %s' %
@@ -686,6 +690,8 @@ class TUI:
             return fail('already carrying something')
         if mode_name == 'drop_thing' and not self.game.player.carrying:
             return fail('not carrying anything droppable')
+        if mode_name == 'enter_hat' and not hasattr(self.game.player, 'hat'):
+            return fail('not wearing hat to edit', 'edit')
         if mode_name == 'admin_enter' and self.is_admin:
             mode_name = 'admin'
         elif mode_name in {'name_thing', 'admin_thing_protect'}: