From: Christian Heller Date: Wed, 27 Jan 2016 21:20:49 +0000 (+0100) Subject: Client: Minor refactorings. X-Git-Tag: tce~214 X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/static/%7B%7Bdb.prefix%7D%7D/day?a=commitdiff_plain;h=9bcbd39430580783f9ec32a30d4998fca7309a20;p=plomrogue Client: Minor refactorings. --- diff --git a/client/window_management.py b/client/window_management.py index b1f68c2..141cc65 100644 --- a/client/window_management.py +++ b/client/window_management.py @@ -19,7 +19,7 @@ class Window: self.size = size -def set_window_geometries(): +def set_windows(): def size_window(config): size = [0, 0] diff --git a/roguelike-client b/roguelike-client index 309d265..8e18515 100755 --- a/roguelike-client +++ b/roguelike-client @@ -9,8 +9,8 @@ import time from client.config.world_data import world_data from client.config.io import io from client.config.commands import commands -from client.window_management import redraw_windows, set_window_geometries, \ - stdscr, draw_screen +from client.window_management import redraw_windows, set_windows, draw_screen, \ + stdscr from client.query_mapcell import query_mapcell @@ -122,12 +122,13 @@ def cursed_main(stdscr): curses.noecho() curses.curs_set(False) signal.signal(signal.SIGWINCH, - lambda ignore_1, ignore_2: set_window_geometries()) - set_window_geometries() + lambda ignore_1, ignore_2: set_windows()) + set_windows() delay = 1 while True: stdscr.timeout(int(delay)) - delay = delay * 1.1 if delay < 1000 else delay + if delay < 1000: + delay = delay * 1.1 if redraw_windows: delay = 1 draw_screen() @@ -138,10 +139,9 @@ def cursed_main(stdscr): if char in commands: if len(commands[char]) == 1 or not world_data["look_mode"]: commands[char][0]() - redraw_windows = True else: commands[char][1]() - redraw_windows = True + redraw_windows = True new_data_from_server = io["file_in"].read() ping_test() read_into_message_queue()