Changeset 97 for trunk/PARPG/scripts


Ignore:
Timestamp:
06/05/09 15:36:51 (11 years ago)
Author:
bretzel_parpg
Message:

Added a simple help menu that can be accessed off of the main menu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PARPG/scripts/hud.py

    r90 r97  
    2929        self.initializeMainMenu() 
    3030        self.initializeOptionsMenu() 
     31        self.initializeHelpMenu() 
    3132 
    3233    def initializeHud(self): 
     
    5253        self.menu_events = {"resumeButton":self.hideMenu, "saveButton":self.saveGame, 
    5354                            "loadButton":self.loadGame,  
    54                             "optionsButton":self.displayOptions} 
     55                            "optionsButton":self.displayOptions, 
     56                            "helpButton":self.displayHelp} 
    5557        self.main_menu.mapEvents(self.menu_events) 
    5658 
     59    def initializeHelpMenu(self): 
     60        """Initialize the help menu""" 
     61 
     62        self.help_dialog = pychan.loadXML("gui/help.xml") 
     63        help_events = {"closeButton":self.help_dialog.hide} 
     64        self.help_dialog.mapEvents(help_events) 
     65 
     66        main_help_text = "Put help text here" 
     67 
     68        keybindings_text = "A : Add a test action to the actions display[br]I : Toggle the inventory screen[br]F5 : Take a screenshot [br]     (saves to <parpg>/screenshots/)[br]Q : Quit the game" 
     69 
     70        self.help_dialog.distributeInitialData({ 
     71                "MainHelpText":main_help_text, 
     72                "KeybindText":keybindings_text 
     73                }) 
    5774 
    5875    def initializeOptionsMenu(self): 
     
    88105        self.options_menu.hide() 
    89106 
     107    def displayHelp(self): 
     108        """ Display the help screen """ 
     109        self.help_dialog.show() 
     110 
    90111 
    91112    def refreshActionsBox(self): 
Note: See TracChangeset for help on using the changeset viewer.