comparison src/parpg/gui/hud.py @ 150:3fc7cfa80771

Modified InventoryGrid to set a name for each slot containing the index. Added getSlot method to InventoryGrid. Renamed InventoryGUI class to CharacterGUI. Added InventoryGUI class which handles the inventory part of the CharacterGUI. An InventoryGUI instance is now created in CharacterGUI.
author KarstenBock@gmx.net
date Wed, 05 Oct 2011 12:59:22 +0200
parents eab3e1e52497
children 04de7f38429a
comparison
equal deleted inserted replaced
149:eab3e1e52497 150:3fc7cfa80771
24 from parpg.gui.menus import ContextMenu, SettingsMenu 24 from parpg.gui.menus import ContextMenu, SettingsMenu
25 from parpg.gui.popups import ExaminePopup 25 from parpg.gui.popups import ExaminePopup
26 from parpg.gui.containergui import ContainerGUI 26 from parpg.gui.containergui import ContainerGUI
27 from parpg.gui.dialoguegui import DialogueGUI 27 from parpg.gui.dialoguegui import DialogueGUI
28 from parpg.gui import drag_drop_data as data_drag 28 from parpg.gui import drag_drop_data as data_drag
29 from parpg.gui.inventorygui import InventoryGUI 29 from parpg.gui.inventorygui import CharacterGUI
30 from actionsbox import ActionsBox 30 from actionsbox import ActionsBox
31 from parpg.components import container 31 from parpg.components import container
32 logger = logging.getLogger('hud') 32 logger = logging.getLogger('hud')
33 class Hud(object): 33 class Hud(object):
34 """Main Hud class""" 34 """Main Hud class"""
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 player = self.model.game_state.getObjectById("PlayerCharacter") 160 player = self.model.game_state.getObjectById("PlayerCharacter")
161 self.inventory = InventoryGUI(self.controller, xml_file, 161 self.inventory = CharacterGUI(self.controller, xml_file,
162 player.container, player.equip, None) 162 player.container, player.equip, None)
163 # inv_callbacks = { 163 # inv_callbacks = {
164 # 'refreshReadyImages': self.refreshReadyImages, 164 # 'refreshReadyImages': self.refreshReadyImages,
165 # 'toggleInventoryButton': self.toggleInventoryButton, 165 # 'toggleInventoryButton': self.toggleInventoryButton,
166 # } 166 # }