comparison src/parpg/gui/hud.py @ 149:eab3e1e52497

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 140e5e93f026
children 3fc7cfa80771
comparison
equal deleted inserted replaced
148:5756e615b029 149:eab3e1e52497
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 = \