Mercurial > parpg-source
comparison gui/hud.py @ 119:2399a8c3da0c
Modified EquipmentSlot to display an image instead of a text.
Added EquipmentGui class, which handles the equipment slots of the player screen.
An EquipmentGui instance will be created in the InventoryGUI constructor.
The initializeInventory method of the Hud class supplies the players inventory and equipment to the InventoryGUI constructor.
author | KarstenBock@gmx.net |
---|---|
date | Wed, 05 Oct 2011 11:04:39 +0200 |
parents | 100a39fa64a2 |
children | adbcdb900fa9 |
comparison
equal
deleted
inserted
replaced
118:30dbbae653ad | 119:2399a8c3da0c |
---|---|
155 | 155 |
156 def initializeInventory(self): | 156 def initializeInventory(self): |
157 """Initialize the inventory""" | 157 """Initialize the inventory""" |
158 if not self.inventory: | 158 if not self.inventory: |
159 xml_file = vfs.VFS.open('gui/inventory.xml') | 159 xml_file = vfs.VFS.open('gui/inventory.xml') |
160 self.inventory = InventoryGUI(self.controller, xml_file, None) | 160 player = self.model.game_state.getObjectById("PlayerCharacter") |
161 self.inventory = InventoryGUI(self.controller, xml_file, | |
162 player.container, player.equip, None) | |
161 # inv_callbacks = { | 163 # inv_callbacks = { |
162 # 'refreshReadyImages': self.refreshReadyImages, | 164 # 'refreshReadyImages': self.refreshReadyImages, |
163 # 'toggleInventoryButton': self.toggleInventoryButton, | 165 # 'toggleInventoryButton': self.toggleInventoryButton, |
164 # } | 166 # } |
165 # self.inventory_storage = \ | 167 # self.inventory_storage = \ |