This commit is contained in:
Yohann D'ANELLO
2020-11-08 22:48:50 +01:00
parent e0366b4719
commit 933385e79d
2 changed files with 37 additions and 34 deletions

View File

@ -15,7 +15,7 @@ class StatsDisplay:
def update_pad(self) -> None:
string = ""
for i in range(self.width-1) :
for i in range(self.width - 1):
string = string + "-"
string = string
self.pad.addstr(0, 0, string)
@ -23,20 +23,20 @@ class StatsDisplay:
.format(self.player.level, self.player.current_xp,
self.player.max_xp, self.player.health,
self.player.maxhealth)
for i in range(self.width-len(string2)-1) :
for i in range(self.width - len(string2) - 1):
string2 = string2 + " "
self.pad.addstr(1, 0, string2)
string3 = "Stats : STR {} INT {} CHR {} DEX {} CON {}"\
.format(self.player.strength,
self.player.intelligence, self.player.charisma,
self.player.dexterity, self.player.constitution)
for i in range(self.width-len(string3)-1) :
for i in range(self.width - len(string3) - 1):
string3 = string3 + " "
self.pad.addstr(2, 0, string3)
self.pad.addstr(2, 0, string3)
def refresh(self) -> None:
self.pad.clear()
self.update_pad()
self.pad.refresh(0, 0, self.toplefty, self.topleftx,
2+ self.toplefty,
self.width+ self.topleftx)
2 + self.toplefty,
self.width + self.topleftx)