Higher abstraction level on addmsg, fixes #43

This commit is contained in:
Yohann D'ANELLO
2020-12-12 13:46:45 +01:00
parent 48318a91fe
commit 04ae56e451
5 changed files with 97 additions and 33 deletions

View File

@ -14,7 +14,6 @@ class StatsDisplay(Display):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.pad = self.newpad(self.rows, self.cols)
self.init_pair(3, curses.COLOR_RED, curses.COLOR_BLACK)
def update_player(self, p: Player) -> None:
self.player = p
@ -50,9 +49,8 @@ class StatsDisplay(Display):
f"x{self.player.hazel}")
if self.player.dead:
self.addstr(self.pad, 11, 0, _("YOU ARE DEAD"),
curses.A_BOLD | curses.A_BLINK | curses.A_STANDOUT
| self.color_pair(3))
self.addstr(self.pad, 11, 0, _("YOU ARE DEAD"), curses.COLOR_RED,
bold=True, blink=True, standout=True)
def display(self) -> None:
self.pad.erase()