The inventory is a popup

This commit is contained in:
Yohann D'ANELLO 2020-12-04 14:51:41 +01:00
parent 39af791012
commit 067570fd1a
1 changed files with 7 additions and 3 deletions

View File

@ -53,7 +53,8 @@ class DisplayManager:
self.messagedisplay.update_message(self.game.message)
def refresh(self) -> None:
if self.game.state == GameMode.PLAY:
if self.game.state == GameMode.PLAY \
or self.game.state == GameMode.INVENTORY:
# The map pad has already the good size
self.mapdisplay.refresh(0, 0, self.rows * 4 // 5,
self.mapdisplay.pack.tile_width
@ -66,8 +67,11 @@ class DisplayManager:
self.rows // 5 - 1, self.cols * 4 // 5)
self.hbar.refresh(self.rows * 4 // 5, 0, 1, self.cols * 4 // 5)
self.vbar.refresh(0, self.cols * 4 // 5, self.rows, 1)
elif self.game.state == GameMode.INVENTORY:
self.inventorydisplay.refresh(0, 0, self.rows, self.cols)
if self.game.state == GameMode.INVENTORY:
self.inventorydisplay.refresh(self.rows // 10,
self.cols // 2,
8 * self.rows // 10,
2 * self.cols // 5)
elif self.game.state == GameMode.MAINMENU:
self.mainmenudisplay.refresh(0, 0, self.rows, self.cols)
elif self.game.state == GameMode.SETTINGS: