From: Christian Heller Date: Wed, 25 Nov 2020 02:51:06 +0000 (+0100) Subject: Minor refactor. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/task?a=commitdiff_plain;h=eb5f4bf45f5af3791a0280745038b625737b9f57;p=plomrogue2 Minor refactor. --- diff --git a/rogue_chat_curses.py b/rogue_chat_curses.py index a6e05ab..562c9c7 100755 --- a/rogue_chat_curses.py +++ b/rogue_chat_curses.py @@ -533,6 +533,7 @@ class TUI: self.log_msg('@ enter tile control password for "%s":' % self.tile_control_char) elif self.mode.name == 'control_tile_draw': self.log_msg('@ can draw tile control character "%s", turn drawing on/off with [%s], finish with [%s].' % (self.tile_control_char, self.keys['toggle_tile_draw'], self.keys['switch_to_admin_enter'])) + self.input_ = "" self.restore_input_values() def loop(self, stdscr): @@ -855,35 +856,28 @@ class TUI: self.log_msg('@ aborted') else: self.send('SET_MAP_CONTROL_PASSWORD ' + quote(self.tile_control_char) + ' ' + quote(self.input_)) - self.input_ = "" self.switch_mode('admin') elif self.mode.name == 'password' and key == '\n': if self.input_ == '': self.input_ = ' ' self.password = self.input_ - self.input_ = "" self.switch_mode('edit') elif self.mode.name == 'admin_enter' and key == '\n': self.send('BECOME_ADMIN ' + quote(self.input_)) - self.input_ = "" self.switch_mode('play') elif self.mode.name == 'control_pw_type' and key == '\n': if len(self.input_) != 1: self.log_msg('@ entered non-single-char, therefore aborted') self.switch_mode('admin') - self.input_ = "" else: self.tile_control_char = self.input_ - self.input_ = "" self.switch_mode('control_pw_pw') elif self.mode.name == 'control_tile_type' and key == '\n': if len(self.input_) != 1: self.log_msg('@ entered non-single-char, therefore aborted') self.switch_mode('admin') - self.input_ = "" else: self.tile_control_char = self.input_ - self.input_ = "" self.switch_mode('control_tile_draw') elif self.mode.name == 'chat' and key == '\n': if self.input_ == '': @@ -913,14 +907,12 @@ class TUI: self.input_ = ' ' self.send('ANNOTATE %s %s %s' % (self.explorer, quote(self.input_), quote(self.password))) - self.input_ = "" self.switch_mode('edit') elif self.mode.name == 'portal' and key == '\n': if self.input_ == '': self.input_ = ' ' self.send('PORTAL %s %s %s' % (self.explorer, quote(self.input_), quote(self.password))) - self.input_ = "" self.switch_mode('edit') elif self.mode.name == 'study': if self.mode.mode_switch_on_key(self, key):