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"}
]
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():
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
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()
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()
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