5 if world_data["map_center"][i] * (i + 1) > win_size[i] / 2 and \
6 win_size[i] < world_data["map_size"] * (i + 1):
7 if world_data["map_center"][i] * (i + 1) \
8 < world_data["map_size"] * (i + 1) - win_size[i] / 2:
9 offset[i] = world_data["map_center"][i] * (i + 1) \
10 - int(win_size[i] / 2)
12 offset[1] = offset[1] + world_data["map_center"][0] % 2
14 offset[i] = world_data["map_size"] * (i + 1) - win_size[i] + i
15 winmap_size = [world_data["map_size"], world_data["map_size"] * 2 + 1]
17 curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLACK)
18 curses.init_pair(2, curses.COLOR_BLUE, curses.COLOR_BLACK)
19 curses.init_pair(3, curses.COLOR_RED, curses.COLOR_BLACK)
20 curses.init_pair(4, curses.COLOR_YELLOW, curses.COLOR_BLACK)
21 col_unknown = curses.color_pair(1)
22 col_mem_obstacle = curses.color_pair(2)
23 col_mem = curses.color_pair(2)
24 col_ground = curses.color_pair(3)
25 col_stone = curses.color_pair(4)
26 col_earth = curses.color_pair(3)
27 col_player = curses.color_pair(1)
28 for y in range(world_data["map_size"]):
29 for x in range(world_data["map_size"]):
30 pos = y * world_data["map_size"] + x
31 char = world_data["fov_map"][pos]
32 if world_data["look_mode"] and y == world_data["map_center"][0] \
33 and x == world_data["map_center"][1]:
35 char = world_data["mem_map"][pos]
36 winmap += [(char, curses.A_REVERSE), ("?", curses.A_REVERSE)]
39 char = world_data["mem_map"][pos]
42 attribute = col_unknown
43 elif char == "X" or char == "#":
44 attribute = col_mem_obstacle
45 bonus = (" ", attribute)
46 winmap += [(char, attribute), bonus]
50 attribute = col_ground
54 attribute = col_player
55 bonus = (" ", attribute)
56 winmap += [(char, attribute), bonus]
59 return offset, winmap_size, winmap
61 from client.config.windows import windows_config
62 from client.windows import win_log, win_inventory, win_look, win_info
64 {"config": [1, 33], "func": win_info, "title": "Stats"},
65 {"config": [-7, 33], "func": win_log, "title": "Log"},
66 {"config": [4, 16], "func": win_inventory, "title": "Inventory"},
67 {"config": [4, 16], "func": win_look, "title": "Things here"},
68 {"config": [0, -34], "func": win_map, "title": "The Crawling Eater"}
70 from client.window_management import set_windows