Changeset 125


Ignore:
Timestamp:
06/11/09 23:19:00 (10 years ago)
Author:
bretzel_parpg
Message:

Removed displayHelp, as that is part of the GUI. Since we now display the object names on mouseover, I removed the option to do that from the context menu and added a simple placeholder function

File:
1 edited

Legend:

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

    r121 r125  
    244244                self.context_menu.vbox.hide() 
    245245                delattr(self, "context_menu") 
    246                 data = [["DisplayObjectID", "Display Object ID", 
    247                          cbwa(self.contextDisplayObjectText, click)]] 
     246                data = [["Placeholder", "Placeholder Button", self.placeHolderFunction, click]] 
    248247                pos = (evt.getX(), evt.getY()) 
    249248                self.context_menu = ContextMenu(self.engine, data, pos) 
    250249 
    251250            else: 
    252                 data = [["DisplayObjectID", "Display Object ID", 
    253                          cbwa(self.contextDisplayObjectText, click)]] 
     251                data = [["Placeholder", "Placeholder Button", self.placeHolderFunction, click]] 
    254252                pos = (evt.getX(), evt.getY()) 
    255253                self.context_menu = ContextMenu(self.engine, data, pos) 
    256254 
    257     def contextDisplayObjectText(self, click): 
    258         # although the engine code knows, fife can be more accurate 
    259         i=self.cameras['main'].getMatchingInstances(click, self.agent_layer) 
    260         if(i != ()): 
    261             for obj in i: 
    262                 # check to see if this is an active item 
    263                 if(self.data.objectActive(obj.getId()) != False): 
    264                     # finally, display the text     
    265                     self.context_menu.vbox.hide() 
    266                     delattr(self, "context_menu") 
    267                 else: 
    268                     self.context_menu.vbox.hide() 
    269                     delattr(self, "context_menu") 
    270             else: 
    271                 self.context_menu.vbox.hide() 
    272                 delattr(self, "context_menu") 
     255    def placeHolderFunction(self): 
     256        """Just a simple function to make the PC say "Place Holder Function!" 
     257           It's in here because we needed some sort of function to test the context 
     258           menu with""" 
     259        self.agent_layer.getInstance("PC").say("Place Holder Function!", 1000) 
     260        self.context_menu.vbox.hide() 
     261        delattr(self, "context_menu") 
    273262 
    274263    def mouseMoved(self, evt): 
     
    296285        renderer.setEnabled(not renderer.isEnabled()) 
    297286 
    298     def displayHelp(self): 
    299         """Displays the pop-up info and help screen""" 
    300         print "Help not yet coded" 
    301  
    302287    def quitGame(self): 
    303288        """Called when user requests to quit game 
Note: See TracChangeset for help on using the changeset viewer.