Package parpg :: Package gui :: Module hud :: Class Hud
[hide private]
[frames] | no frames]

Class Hud

source code

object --+
         |
        Hud

Main Hud class

Instance Methods [hide private]
 
__init__(self, controller, settings, callbacks)
Initialise the instance.
source code
 
_getEnabled(self)
"Returns whether the gui widget is enabled or not
source code
 
_setEnabled(self, enabled)
"Sets whether the gui widget is enabled or not
source code
 
initializeHud(self)
Initialize and show the main HUD
source code
 
addAction(self, action)
Add an action to the actions box.
source code
 
showHUD(self)
Show the HUD.
source code
 
hideHUD(self)
Hide the HUD.
source code
 
initializeInventory(self)
Initialize the inventory
source code
 
initializeCharacterScreen(self)
Initialize the character screen.
source code
 
initializeContextMenu(self)
Initialize the Context Menu
source code
 
showContextMenu(self, data, pos)
Display the Context Menu with model at pos
source code
 
hideContextMenu(self)
Hides the context menu
source code
 
initializeMainMenu(self)
Initalize the main menu.
source code
 
displayMenu(self)
Displays the main in-game menu.
source code
 
hideMenu(self)
Hides the main in-game menu.
source code
 
initializeSettingsMenu(self) source code
 
displaySettings(self) source code
 
initializeHelpMenu(self)
Initialize the help menu
source code
 
displayHelp(self)
Display the help screen.
source code
 
saveGame(self)
Called when the user wants to save the game.
source code
 
stopActions(self)
This method stops/resets actions that are currently performed like dragging an item.
source code
 
newGame(self)
Called when user request to start a new game.
source code
 
loadsave_close(self)
Called when the load/save filebrowser was closed without a file selected
source code
 
loadGame(self)
Called when the user wants to load a game.
source code
 
initializeQuitDialog(self)
Creates the quit confirmation dialog
source code
 
quitGame(self)
Called when user requests to quit game.
source code
 
toggleInventoryButton(self)
Manually toggles the inventory button.
source code
 
toggleInventory(self, toggle_image=True)
Displays the inventory screen
source code
 
toggleCharacterScreen(self) source code
 
refreshReadyImages(self)
Make the Ready slot images on the HUD be the same as those on the inventory
source code
 
setImages(self, widget, image)
Set the up, down, and hover images of an Imagebutton.
source code
 
initializeEvents(self)
Intialize Hud events
source code
 
readyAction(self, ready_button)
Called when the user selects a ready button from the HUD
source code
 
createBoxGUI(self, title, container)
Creates a window to display the contents of a box
source code
 
hideContainer(self)
Hide the container box
source code
 
createExamineBox(self, title, desc)
Create an examine box.
source code
 
showDialogue(self, npc)
Show the NPC dialogue window
source code

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

Class Variables [hide private]
  enabled = property(_getEnabled, _setEnabled)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

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

source code 

Initialise the instance.

Parameters:
  • controller (Class derived from ControllerBase) - The current controller
  • settings (settings.Setting) - The settings
  • callbacks (dict) - a dict of callbacks saveGame: called when the user clicks on Save loadGame: called when the user clicks on Load quitGame: called when the user clicks on Quit
  • inv_model (dict)
Returns:
None
Overrides: object.__init__

initializeHud(self)

source code 

Initialize and show the main HUD

Returns:
None

addAction(self, action)

source code 

Add an action to the actions box.

Parameters:
  • action ((unicode) string) - The text that you want to display in the actions box
Returns:
None

showHUD(self)

source code 

Show the HUD.

Returns:
None

hideHUD(self)

source code 

Hide the HUD.

Returns:
None

initializeContextMenu(self)

source code 

Initialize the Context Menu

Returns:
None

showContextMenu(self, data, pos)

source code 

Display the Context Menu with model at pos

Parameters:
  • model (list) - model to pass to context menu
  • pos (tuple) - tuple of x and y coordinates
Returns:
None

hideContextMenu(self)

source code 

Hides the context menu

Returns:
None

initializeMainMenu(self)

source code 

Initalize the main menu.

Returns:
None

displayMenu(self)

source code 

Displays the main in-game menu.

Returns:
None

hideMenu(self)

source code 

Hides the main in-game menu.

Returns:
None

initializeHelpMenu(self)

source code 

Initialize the help menu

Returns:
None

displayHelp(self)

source code 

Display the help screen.

Returns:
None

saveGame(self)

source code 

Called when the user wants to save the game.

Returns:
None

stopActions(self)

source code 

This method stops/resets actions that are currently performed like dragging an item. This is done to be able to savely perform other actions that might interfere with current running ones.

newGame(self)

source code 

Called when user request to start a new game.

Returns:
None

loadGame(self)

source code 

Called when the user wants to load a game.

Returns:
None

initializeQuitDialog(self)

source code 

Creates the quit confirmation dialog

Returns:
None

quitGame(self)

source code 

Called when user requests to quit game.

Returns:
None

toggleInventoryButton(self)

source code 

Manually toggles the inventory button.

Returns:
None

toggleInventory(self, toggle_image=True)

source code 

Displays the inventory screen

Returns:
None

refreshReadyImages(self)

source code 

Make the Ready slot images on the HUD be the same as those on the inventory

Returns:
None

setImages(self, widget, image)

source code 

Set the up, down, and hover images of an Imagebutton.

Parameters:
  • widget (pychan.widget) - widget to set
  • image (string) - image to use
Returns:
None

initializeEvents(self)

source code 

Intialize Hud events

Returns:
None

createBoxGUI(self, title, container)

source code 

Creates a window to display the contents of a box

Parameters:
  • title (string) - The title for the window
  • items - The box to display
Returns:
A new ContainerGui

hideContainer(self)

source code 

Hide the container box

Returns:
None

createExamineBox(self, title, desc)

source code 

Create an examine box. It displays some textual description of an object

Parameters:
  • title (string) - The title of the examine box
  • desc (string) - The main body of the examine box
Returns:
None

showDialogue(self, npc)

source code 

Show the NPC dialogue window

Parameters:
  • npc (actors.NonPlayerCharacter) - the npc that we are having a dialogue with
Returns:
The dialogue