Add possibility to define the background color of entities (black in ASCII, white in Unicode)

This commit is contained in:
Yohann D'ANELLO
2020-11-10 22:30:55 +01:00
parent ec6b90fba2
commit a8223aab2e
5 changed files with 32 additions and 7 deletions

View File

@ -15,10 +15,13 @@ class MapDisplay(Display):
self.pad = self.newpad(m.height, self.pack.tile_width * m.width + 1)
def update_pad(self) -> None:
self.pad.addstr(0, 0, self.map.draw_string(self.pack))
self.init_pair(1, self.pack.tile_fg_color, self.pack.tile_bg_color)
self.init_pair(2, self.pack.entity_fg_color, self.pack.entity_bg_color)
self.pad.addstr(0, 0, self.map.draw_string(self.pack),
self.color_pair(1))
for e in self.map.entities:
self.pad.addstr(e.y, self.pack.tile_width * e.x,
self.pack[e.name.upper()])
self.pack[e.name.upper()], self.color_pair(2))
def display(self) -> None:
y, x = self.map.currenty, self.map.currentx