From: Christian Heller Date: Wed, 10 Apr 2019 00:04:59 +0000 (+0200) Subject: More comments and refactoring. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/%7B%7Bdb.prefix%7D%7D/static/day?a=commitdiff_plain;h=5ab9dc6129bb816b040a13cfdad833a0526b0f90;p=plomrogue2-experiments More comments and refactoring. --- diff --git a/new/example_client.py b/new/example_client.py index 5443546..44b0993 100755 --- a/new/example_client.py +++ b/new/example_client.py @@ -585,9 +585,12 @@ class TUI: curses.init_pair(3, curses.COLOR_BLACK, curses.COLOR_BLUE) curses.init_pair(4, curses.COLOR_BLACK, curses.COLOR_YELLOW) + # Basic curses initialization work. setup_screen(stdscr) curses.curs_set(False) # hide cursor init_colors() + + # With screen initialized, set up widgets with their curses windows. edit_widget = TextLineWidget('SEND:', self, (0, 0), (1, 20)) edit_line_widget = EditWidget(self, (0, 6), (1, 14), ['edit']) edit_widget.children += [edit_line_widget] @@ -605,10 +608,12 @@ class TUI: descriptor_widget, map_widget, inventory_widget, pickable_items_widget] popup_widget = PopUpWidget(self, (0, 0), (1, 1), visible=False) - write_mode = False + + # Ensure initial window state before loop starts. for w in top_widgets: w.ensure_freshness(True) self.socket.send('GET_GAMESTATE') + write_mode = False while True: # Draw screen.