- map_lines_split += [[c + ' ' for c
- in self.game.map_content[start:end]]]
- if self.map_mode == 'terrain + annotations':
- for p in self.game.info_hints:
- map_lines_split[p.y][p.x] = 'A '
- elif self.map_mode == 'terrain + things':
- for p in self.game.portals.keys():
- original = map_lines_split[p.y][p.x]
- map_lines_split[p.y][p.x] = original[0] + 'P'
- used_positions = []
- for t in self.game.things:
- symbol = self.game.thing_types[t.type_]
- meta_char = ' '
- if hasattr(t, 'thing_char'):
- meta_char = t.thing_char
- if t.position in used_positions:
- meta_char = '+'
- map_lines_split[t.position.y][t.position.x] = symbol + meta_char
- used_positions += [t.position]
- player = self.game.get_thing(self.game.player_id)
- if self.mode.shows_info or self.mode.name == 'control_tile_draw':
- map_lines_split[self.explorer.y][self.explorer.x] = '??'
- elif self.map_mode != 'terrain + things':
- map_lines_split[player.position.y][player.position.x] = '??'
- map_lines = []
- if type(self.game.map_geometry) == MapGeometryHex:
- indent = 0
- for line in map_lines_split:
- map_lines += [indent * ' ' + ''.join(line)]
- indent = 0 if indent else 1
- else:
- for line in map_lines_split:
- map_lines += [''.join(line)]
- window_center = YX(int(self.size.y / 2),
- int(self.window_width / 2))
- center = player.position
- if self.mode.shows_info or self.mode.name == 'control_tile_draw':
- center = self.explorer
- center = YX(center.y, center.x * 2)
- offset = center - window_center
- if type(self.game.map_geometry) == MapGeometryHex and offset.y % 2:
- offset += YX(0, 1)
- term_y = max(0, -offset.y)
- term_x = max(0, -offset.x)
- map_y = max(0, offset.y)
- map_x = max(0, offset.x)
+ for line in map_lines_split:
+ self.map_lines += [''.join(line)]
+ window_center = YX(int(self.size.y / 2),
+ int(self.window_width / 2))
+ center = player.position
+ if self.mode.shows_info or self.mode.name == 'control_tile_draw':
+ center = self.explorer
+ center = YX(center.y, center.x * 2)
+ self.offset = center - window_center
+ if type(self.game.map_geometry) == MapGeometryHex and self.offset.y % 2:
+ self.offset += YX(0, 1)
+ term_y = max(0, -self.offset.y)
+ term_x = max(0, -self.offset.x)
+ map_y = max(0, self.offset.y)
+ map_x = max(0, self.offset.x)