Changeset 206


Ignore:
Timestamp:
07/11/09 15:15:27 (10 years ago)
Author:
bretzel_parpg
Message:

Added a new game button to the main menu. At the moment it doesn't do anything except print "new game"

Location:
trunk/PARPG
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/PARPG/gui/hud_main_menu.xml

    r113 r206  
    1 <Container position_technique="center:center" size="145,153"> 
    2   <Button name="resumeButton" text="Resume Game" position="42,10" max_size="65,20"/> 
    3   <Button name="saveButton" text="Save Game" position="46,33" max_size="60,20"/> 
    4   <Button name="loadButton" text="Load Game" position="46,56" max_size="60,20"/> 
    5   <Button name="optionsButton" text="Options" position="53,79" max_size="45,20"/> 
    6   <Button name="helpButton" text="Help" position="60,102" max_size="40,20" /> 
    7   <Button name="quitButton" text="Quit" position="60,125" max_size="40,20" /> 
     1<Container position_technique="center:center" size="145,173"> 
     2  <Button name="newButton" text="New Game" position="47,7" max_size="65,20" /> 
     3  <Button name="resumeButton" text="Resume Game" position="42,30" max_size="65,20"/> 
     4  <Button name="saveButton" text="Save Game" position="46,53" max_size="60,20"/> 
     5  <Button name="loadButton" text="Load Game" position="46,76" max_size="60,20"/> 
     6  <Button name="optionsButton" text="Options" position="53,99" max_size="45,20"/> 
     7  <Button name="helpButton" text="Help" position="60,122" max_size="40,20" /> 
     8  <Button name="quitButton" text="Quit" position="60,145" max_size="40,20" /> 
    89</Container> 
  • trunk/PARPG/scripts/world.py

    r205 r206  
    7777            self.hud.events_to_map[item] = cbwa(self.hud.readyAction, item) 
    7878        self.hud.hud.mapEvents(self.hud.events_to_map) 
     79        self.hud.menu_events["newButton"] = self.newGame 
    7980        self.hud.menu_events["quitButton"] = self.quitGame 
    8081        self.hud.menu_events["saveButton"] = self.saveGame 
     
    364365            delattr(self, "context_menu") 
    365366 
     367    def newGame(self): 
     368        """Called when user request to start a new game. 
     369           @return: None""" 
     370        print "new game" 
     371 
    366372    def quitGame(self): 
    367373        """Called when user requests to quit game. 
Note: See TracChangeset for help on using the changeset viewer.