Package parpg :: Package gui :: Module inventorygui :: Class _InventoryGUI
[hide private]
[frames] | no frames]

Class _InventoryGUI

source code

                        object --+    
                                 |    
containergui_base.ContainerGUIBase --+
                                     |
                                    _InventoryGUI

Inventory GUI class

Instance Methods [hide private]
 
__init__(self, controller, inventory, callbacks)
Initialise the instance.
source code
 
updateImages(self) source code
 
updateInventoryButtons(self) source code
 
updateImage(self, button) source code
 
closeInventory(self)
Close the inventory.
source code
 
closeInventoryAndToggle(self)
Close the inventory screen.
source code
 
toggleInventory(self, toggleImage=True)
Pause the game and enter the inventory screen, or close the inventory screen and resume the game.
source code
 
showInventory(self)
Show the inventory.
source code
 
dragObject(self, obj)
Drag the selected object.
source code
 
dropObject(self, obj)
Drops the object being dropped
source code
 
createMenuItems(self, item, actions)
Creates context menu items for the InventoryGUI
source code
 
getImage(self, name)
Return a current image from the inventory
source code

Inherited from containergui_base.ContainerGUIBase: dragDrop, executeMenuItem, showContextMenu

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, controller, inventory, callbacks)
(Constructor)

source code 
Initialise the instance.
@param controller: Current Controller
@type controller: Class derived from ControllerBase
@type inventory: Inventory
@param inventory: An inventory object to be displayed and manipulated
@type callbacks: dict
@param callbacks: a dict of callbacks
    refreshReadyImages:
        Function that will make the ready slots on the HUD
        reflect those within the inventory
    toggleInventoryButton:
        Function that will toggle the state of the inventory button
@return: None

Overrides: object.__init__

updateImages(self)

source code 
Overrides: containergui_base.ContainerGUIBase.updateImages

closeInventory(self)

source code 

Close the inventory.

Returns:
None

closeInventoryAndToggle(self)

source code 

Close the inventory screen.

Returns:
None

toggleInventory(self, toggleImage=True)

source code 

Pause the game and enter the inventory screen, or close the inventory screen and resume the game.

Parameters:
  • toggleImage (bool) - Call toggleInventoryCallback if True. Toggling via a keypress requires that we toggle the Hud inventory image explicitly. Clicking on the Hud inventory button toggles the image implicitly, so we don't change it.
Returns:
None

showInventory(self)

source code 

Show the inventory.

Returns:
None

dragObject(self, obj)

source code 

Drag the selected object.

Parameters:
  • obj (string) - The name of the object within the dictionary 'self.buttons'
Returns:
None
Overrides: containergui_base.ContainerGUIBase.dragObject

dropObject(self, obj)

source code 

Drops the object being dropped

Parameters:
  • obj (string) - The name of the object within the dictionary 'self.buttons'
Returns:
None
Overrides: containergui_base.ContainerGUIBase.dropObject

createMenuItems(self, item, actions)

source code 

Creates context menu items for the InventoryGUI

Overrides: containergui_base.ContainerGUIBase.createMenuItems

getImage(self, name)

source code 

Return a current image from the inventory

Parameters:
  • name (string) - name of image to get
Returns:
None