Changeset 446 for trunk/game/scripts/console.py
- Timestamp:
- 12/13/09 16:23:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/game/scripts/console.py
r416 r446 24 24 @param appListener: ApplicationListener object providing a link with 25 25 the engine, the world and the model""" 26 exit_help = "Terminate application"27 grid_help = "Toggle grid display"28 run_help = "Toggle player run/walk"29 help_help = "Show this help string"30 load_help = "load directory file"26 exit_help = "Terminate application" 27 grid_help = "Toggle grid display" 28 run_help = "Toggle player run/walk" 29 help_help = "Show this help string" 30 load_help = "Usage: load directory file" 31 31 python_help = "Run some python code" 32 quit_help = "Terminate application" 33 save_help = "save directory file" 32 quit_help = "Terminate application" 33 save_help = "Usage: save directory file" 34 pause_help = "Pause/Unpause the game" 34 35 35 36 self.commands = [ 36 37 {"cmd":"exit" ,"callback":self.handleQuit ,"help": exit_help}, 37 38 {"cmd":"grid" ,"callback":self.handleGrid ,"help": grid_help}, 38 {"cmd":"run" ,"callback":self.handleRun ,"help": run_help},39 39 {"cmd":"help" ,"callback":self.handleHelp ,"help": help_help}, 40 40 {"cmd":"load" ,"callback":self.handleLoad ,"help": load_help}, 41 {"cmd":"pause" ,"callback":self.handlePause ,"help": pause_help}, 41 42 {"cmd":"python","callback":self.handlePython,"help": python_help}, 43 {"cmd":"run" ,"callback":self.handleRun ,"help": run_help}, 44 {"cmd":"save" ,"callback":self.handleSave ,"help": save_help}, 42 45 {"cmd":"quit" ,"callback":self.handleQuit ,"help": quit_help}, 43 {"cmd":"save" ,"callback":self.handleSave ,"help": save_help},44 46 ] 45 47 self.app_listener = app_listener … … 58 60 return "Terminating ..." 59 61 62 def handlePause(self, command): 63 """ 64 Implements the pause console command 65 @type command: string 66 @param command: The command to run 67 @return: The resultstring""" 68 69 self.world.togglePause() 70 return "Game (un)paused" 71 60 72 def handleGrid(self, command): 61 73 """
Note: See TracChangeset
for help on using the changeset viewer.