Changeset 167


Ignore:
Timestamp:
06/29/09 04:36:15 (10 years ago)
Author:
bretzel_parpg
Message:

The ready slots on the HUD now do something when you click on them. All it is at the moment is saying
something in the "actions" box.

Location:
trunk/PARPG/scripts
Files:
2 edited

Legend:

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

    r159 r167  
    107107    def addAction(self, action): 
    108108        """Add an action to the actions box. 
    109            @type action: ??? 
    110            @param action: ??? 
     109           @type action: string 
     110           @param action: The text that you want to display in the actions box 
    111111           @return: None""" 
    112112        self.actionsText.insert(0, action) 
     
    346346            button.toggled = 0 
    347347 
     348    def readyAction(self, ready_button): 
     349        """ Called when the user selects a ready button from the HUD """ 
     350        text = "Used the item from %s" % ready_button 
     351        self.addAction(text) 
     352         
  • trunk/PARPG/scripts/world.py

    r163 r167  
    7575        self.hud.events_to_map["saveButton"] = self.saveGame 
    7676        self.hud.events_to_map["loadButton"] = self.loadGame 
     77        hud_ready_buttons = ["hudReady1", "hudReady2", "hudReady3", "hudReady4"] 
     78        for item in hud_ready_buttons: 
     79            self.hud.events_to_map[item] = cbwa(self.hud.readyAction, item) 
    7780        self.hud.hud.mapEvents(self.hud.events_to_map) 
    7881        self.hud.menu_events["quitButton"] = self.quitGame 
Note: See TracChangeset for help on using the changeset viewer.