From: Christian Heller Date: Sun, 13 Dec 2020 04:43:40 +0000 (+0100) Subject: In hat and face edit, use existing value as default input. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%7B%7B%20web_path%20%7D%7D/static/condition_titles?a=commitdiff_plain;h=0d5dbd69d9e0fb1460a7663b24a6fba8f958ced5;p=plomrogue2 In hat and face edit, use existing value as default input. --- 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' %