Ignore:
Timestamp:
09/08/09 00:39:15 (10 years ago)
Author:
orlandov
Message:

Ticket #79: Move the container display and examine popup code from World to Hud

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/world.py

    r270 r277  
    7474        self.action_number = 1 
    7575 
    76         self.boxOpen = False 
    77         self.boxCreated = False 
    78          
    7976        # init the sound 
    8077        self.sounds = SoundEngine(engine) 
     
    202199 
    203200    def onWalk(self, click): 
    204         """Callback sample for the context menu. 
    205         """ 
     201        """Callback sample for the context menu.""" 
    206202        self.hud.hideContainer() 
    207203        self.data.gameState.PC.run(click) 
     
    241237        return location 
    242238 
    243     def createBoxGUI(self, title): 
    244         """ 
    245         Creates a window to display the contents of a box 
    246  
    247         @type title: string 
    248         @param title: The title for the window 
    249         @return: None 
    250         """ 
    251         if ((self.boxCreated == True) and (self.boxOpen == False)): 
    252             # if it has already been created, just show it 
    253             self.box_container.showContainer() 
    254             self.boxOpen = True 
    255         else: 
    256             # otherwise create it then show it 
    257             data = ["dagger01", "empty", "empty", "empty", "empty", 
    258                     "empty", "empty", "empty", "empty"] 
    259             self.box_container = ContainerGUI(self.engine, unicode(title), data) 
    260             def close_and_delete(): 
    261                 self.box_container.hideContainer() 
    262                 self.boxOpen = False 
    263             events = {'takeAllButton':close_and_delete, 
    264                       'closeButton':close_and_delete} 
    265             self.box_container.container_gui.mapEvents(events) 
    266             self.box_container.showContainer() 
    267             self.boxOpen = True 
    268             self.boxCreated = True 
    269  
    270     def createExamineBox(self, title, desc): 
    271         self.examineBox = ExaminePopup(self.engine, title, desc) 
    272         self.examineBox.showPopUp() 
    273  
    274239    def pump(self): 
    275240        """Routine called during each frame. Our main loop is in ./run.py 
Note: See TracChangeset for help on using the changeset viewer.