Ignore:
Timestamp:
07/28/10 19:10:36 (9 years ago)
Author:
beliar
Message:

Patch by Beliar.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/objects/action.py

    r601 r602  
    177177        print action_text 
    178178 
     179class ExamineItemAction(Action): 
     180    """Examine an item.""" 
     181    def __init__(self, controller, examine_name, examine_desc, commands = None): 
     182        """ 
     183        @param controller: A reference to the GameSceneController. 
     184        @type controller: scripts.GameSceneController 
     185        @param commands: Special commands that are executed 
     186        @type commands: Dictionary  
     187        @type view: class derived from scripts.ViewBase 
     188        @param view: The view 
     189        @type examine_name: String 
     190        @param examine_name: Name of the object to be examined. 
     191        @type examine_name: String 
     192        @param examine_name: Description of the object to be examined. 
     193        """ 
     194        super(ExamineItemAction, self).__init__(controller, commands) 
     195        self.view = controller.view 
     196        self.examine_name = examine_name 
     197        self.examine_desc = examine_desc 
     198         
     199    def execute(self): 
     200        """Display the text.""" 
     201        action_text = unicode(self.examine_desc) 
     202        self.view.hud.addAction(action_text) 
     203        print action_text 
     204 
    179205class ReadAction(Action): 
    180206    """Read a text.""" 
     
    349375           "Unlock":UnlockBoxAction, 
    350376           "Lock":LockBoxAction, 
     377           "ExamineItem":ExamineItemAction, 
    351378           "Examine":ExamineAction, 
    352            "Look":ExamineAction, 
     379           "Look":ExamineItemAction, 
    353380           "Read":ReadAction, 
    354381           "Talk":TalkAction, 
Note: See TracChangeset for help on using the changeset viewer.