Update the player inventory when opening the menu/loading the game, fixes #72

This commit is contained in:
Yohann D'ANELLO 2021-01-10 19:52:28 +01:00
parent 2efa9d4575
commit 5694dd4dff
2 changed files with 2 additions and 0 deletions

View File

@ -162,6 +162,7 @@ class PlayerInventoryDisplay(MenuDisplay):
def update(self, game: Game) -> None: def update(self, game: Game) -> None:
self.player = game.player self.player = game.player
self.update_menu(game.inventory_menu) self.update_menu(game.inventory_menu)
game.inventory_menu.update_player(self.player)
self.store_mode = game.state == GameMode.STORE self.store_mode = game.state == GameMode.STORE
self.chest_mode = game.state == GameMode.CHEST self.chest_mode = game.state == GameMode.CHEST
self.selected = game.state == GameMode.INVENTORY \ self.selected = game.state == GameMode.INVENTORY \

View File

@ -435,6 +435,7 @@ class Game:
return return
self.player = players[0] self.player = players[0]
self.inventory_menu.update_player(self.player)
self.map.compute_visibility(self.player.y, self.player.x, self.map.compute_visibility(self.player.y, self.player.x,
self.player.vision) self.player.vision)
self.display_actions(DisplayActions.UPDATE) self.display_actions(DisplayActions.UPDATE)