From 0d5dbd69d9e0fb1460a7663b24a6fba8f958ced5 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Sun, 13 Dec 2020 05:43:40 +0100
Subject: [PATCH] In hat and face edit, use existing value as default input.

---
 rogue_chat.html      | 4 ++++
 rogue_chat_curses.py | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/rogue_chat.html b/rogue_chat.html
index 26322e9..d86eec5 100644
--- a/rogue_chat.html
+++ b/rogue_chat.html
@@ -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() {
diff --git a/rogue_chat_curses.py b/rogue_chat_curses.py
index 9519a95..41ad640 100755
--- a/rogue_chat_curses.py
+++ b/rogue_chat_curses.py
@@ -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' %
-- 
2.30.2