Add ui updates on player pickup in EventManager

This commit is contained in:
Michał Czekański 2020-04-06 13:13:47 +02:00
parent 01511757a0
commit 156f9977e0

View File

@ -35,8 +35,6 @@ class EventManager:
self.handlePlayerControls(keys) self.handlePlayerControls(keys)
self.keyTimeout = 0 self.keyTimeout = 0
self.game.screen.ui.updateBasedOnPlayerStats(self.player.statistics)
def handlePlayerControls(self, keys): def handlePlayerControls(self, keys):
# Key names are temporary # Key names are temporary
# TODO: Load key bindings from JSON # TODO: Load key bindings from JSON
@ -48,6 +46,7 @@ class EventManager:
# Picked up item gets removed from the map # Picked up item gets removed from the map
if type(object) is Pickupable: if type(object) is Pickupable:
object.on_interaction(self.player) object.on_interaction(self.player)
self.game.screen.ui.updateOnPlayerPickup(self.player.statistics, object)
self.game.map.removeSpriteFromMap(object) self.game.map.removeSpriteFromMap(object)
elif type(object) is Interactable: elif type(object) is Interactable:
object.on_interaction(self.player) object.on_interaction(self.player)