home · contact · privacy
Client: Minor refactorings.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 27 Jan 2016 21:20:49 +0000 (22:20 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 27 Jan 2016 21:20:49 +0000 (22:20 +0100)
client/window_management.py
roguelike-client

index b1f68c24f44b5fa805bbeba32928f58f04850a96..141cc656b6e92fa81427b704f9c87e006eabd570 100644 (file)
@@ -19,7 +19,7 @@ class Window:
         self.size = size
 
 
-def set_window_geometries():
+def set_windows():
 
     def size_window(config):
         size = [0, 0]
index 309d265d5bb52e739e1229015815adf271e030c6..8e18515354b05267c441b9349d9fff36ec4a41cc 100755 (executable)
@@ -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()