home · contact · privacy
In hat and face edit, use existing value as default input.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 13 Dec 2020 04:43:40 +0000 (05:43 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 13 Dec 2020 04:43:40 +0000 (05:43 +0100)
rogue_chat.html
rogue_chat_curses.py

index 26322e94a31c3e797a07924704bfb4e3963e983c..d86eec5ee65d4c3e06f43b55ac351a22cb13f225 100644 (file)
@@ -953,6 +953,10 @@ let tui = {
           if (t && t.protection) {
               this.inputEl.value = t.protection;
           }
+      } else if (this.mode.name == 'enter_face' && game.player.face) {
+          this.inputEl.value = game.player.face;
+      } else if (this.mode.name == 'enter_hat' && game.player.hat) {
+          this.inputEl.value = game.player.hat;
       }
   },
   recalc_input_lines: function() {
index 9519a95609a82ba0f9a0fd4f7d7bca95999f756e..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' %