home · contact · privacy
Client, plugins: Make window scroll hints optional.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 13 Mar 2016 11:07:39 +0000 (12:07 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 13 Mar 2016 11:07:39 +0000 (12:07 +0100)
client/config/windows.py
client/window_management.py
plugins/client/PleaseTheIslandGod.py
plugins/client/TheCrawlingEater.py

index 676d94c9b864397c95af40d4a11273a1fb4d4fdb..2e0c7b8a5b4a135a82662c9532b3f368693d4832 100644 (file)
@@ -7,9 +7,24 @@ from client.windows import win_info, win_log, win_inventory, win_look, win_map
 
 
 windows_config = [
-    {"config": [1, 33], "func": win_info, "title": "Info"},
-    {"config": [-7, 33], "func": win_log, "title": "Log"},
-    {"config": [4, 16], "func": win_inventory, "title": "Inventory"},
-    {"config": [4, 16], "func": win_look, "title": "Things here"},
-    {"config": [0, -34], "func": win_map, "title": "Map"}
+    {"config": [1, 33],
+     "func": win_info,
+     "scroll_hints": True,
+     "title": "Info"},
+    {"config": [-7, 33],
+     "func": win_log,
+     "scroll_hints": True,
+     "title": "Log"},
+    {"config": [4, 16],
+     "func": win_inventory,
+     "scroll_hints": True,
+     "title": "Inventory"},
+    {"config": [4, 16],
+     "func": win_look,
+     "scroll_hints": True,
+     "title": "Things here"},
+    {"config": [0, -34],
+     "func": win_map,
+     "scroll_hints": True,
+      "title": "Map"}
 ]
index 610764b5402bf69fd83b57c5ad94243acf64b616..4d6a403281bbd9bb1a412a222d1060c94de64440 100644 (file)
@@ -18,10 +18,11 @@ screen_size = [0,0]
 
 
 class Window:
-    def __init__(self, title, draw_function, size):
+    def __init__(self, title, draw_function, size, draw_scroll_hints):
         self.title = title
         self.draw = types.MethodType(draw_function, self)
         self.size = size
+        self.draw_scroll_hints = draw_scroll_hints
 
 
 def set_windows():
@@ -99,7 +100,8 @@ def set_windows():
     windows = []
     for config in windows_config:
         size = size_window(config["config"])
-        window = Window(config["title"], config["func"], size)
+        window = Window(config["title"], config["func"], size,
+                        config["scroll_hints"])
         windows.append(window)
         place_window(window)
     redraw_windows = True
@@ -211,7 +213,8 @@ def draw_screen():
         for win in windows:
             offset, winmap_size, winmap = win.draw()
             draw_winmap()
-            draw_scroll_hints()
+            if win.draw_scroll_hints:
+                draw_scroll_hints()
 
     stdscr.erase()
     draw_window_border_lines()
index 18a0f64dcb41cee4dc093906a64e883e66f94189..7348e76256b8cbbe660d2bed80323cb1c667a581 100644 (file)
@@ -142,11 +142,26 @@ def win_map(self):
 from client.config.windows import windows_config
 from client.windows import win_log, win_inventory, win_look
 windows_config[:] = [
-    {"config": [1, 33], "func": win_info, "title": "Stats"},
-    {"config": [-7, 33], "func": win_log, "title": "Log"},
-    {"config": [4, 16], "func": win_inventory, "title": "Inventory"},
-    {"config": [4, 16], "func": win_look, "title": "Things here"},
-    {"config": [0, -34], "func": win_map, "title": "PLEASE THE ISLAND GOD"}
+    {"config": [1, 33],
+     "func": win_info,
+     "scroll_hints": True,
+     "title": "Stats"},
+    {"config": [-7, 33],
+     "func": win_log,
+     "scroll_hints": True,
+     "title": "Log"},
+    {"config": [4, 16],
+     "func": win_inventory,
+     "scroll_hints": True,
+     "title": "Inventory"},
+    {"config": [4, 16],
+     "func": win_look,
+     "scroll_hints": True,
+     "title": "Things here"},
+    {"config": [0, -34],
+     "func": win_map,
+     "scroll_hints": True,
+     "title": "PLEASE THE ISLAND GOD"}
 ]
 from client.window_management import set_windows
 set_windows()
index 86115e38ee3ed429299c8f9a8e9ec0c47e8e3ec1..63c4136b9ac9fa7fa4d990be7dbe8e0364ef2b52 100644 (file)
@@ -140,21 +140,27 @@ from client.windows import win_log
 windows_config[:] = [
     {"config": [0, -34],
      "func": win_map,
+     "scroll_hints": False,
       "title": "The Crawling Eater"},
     {"config": [1, 33],
      "func": win_bar_maker(77, "%", "stomach"),
+     "scroll_hints": False,
      "title": "stomach"},
     {"config": [1, 33],
      "func": win_bar_maker(79, "~", "kidney"),
+     "scroll_hints": False,
       "title": "kidney"},
     {"config": [1, 33],
      "func": win_bar_maker(78, "%", "bowel"),
+     "scroll_hints": False,
      "title": "bowel"},
     {"config": [1, 33],
      "func": win_bar_maker(80, "~", "bladder"),
+     "scroll_hints": False,
       "title": "bladder"},
     {"config": [-8, 33],
      "func": win_log,
+     "scroll_hints": False,
      "title": "log"}
 ]
 from client.window_management import set_windows