Changeset 629


Ignore:
Timestamp:
08/06/10 19:46:37 (9 years ago)
Author:
beliar
Message:

Patch by Beliar.

  • Scrolling the map with the mouse will not affect the mouse cursor when dragging an item.
  • Pressing <Space> will center the camera on the player
  • Pausing the game actually works again
Location:
trunk/game/scripts
Files:
2 edited

Legend:

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

    r625 r629  
    5757                               "view":self.app_listener.view,\ 
    5858                               "engine":self.app_listener.engine} 
    59        
    60         self.console = code.InteractiveConsole(self.console_locals) 
     59 
     60        self.console = code.InteractiveConsole(self.console_locals) 
    6161 
    6262    def handleQuit(self, command): 
     
    7373           @param command: The command to run 
    7474           @return: The resultstring""" 
    75         self.view.togglePause() 
     75        self.model.togglePause() 
    7676        return "Game (un)paused" 
    77      
     77 
    7878    def handleGrid(self, command): 
    7979        """Implements the grid console command  
     
    9595            self.app_listener.model.pc_run = 1 
    9696            return "PC is now running" 
    97              
     97 
    9898    def handleHelp(self, command): 
    9999        """Implements the help console command  
     
    110110 
    111111        codeOut = StringIO() 
    112          
     112 
    113113        #make stdout and stderr write to our file, not the terminal 
    114114        sys.stdout = codeOut 
     
    125125        else: 
    126126            output =  "..." 
    127          
     127 
    128128 
    129129        #restore stdout and stderr 
     
    134134        output = "" 
    135135        counter = 0 
    136          
     136 
    137137        #Make the output fit in the console screen 
    138138        for char in temp_output: 
  • trunk/game/scripts/gamescenecontroller.py

    r626 r629  
    141141        if(key_val == key.PAUSE): 
    142142            # Pause pause/unpause the game  
    143             self.view.togglePause() 
     143            self.model.togglePause() 
     144        if(key_val == key.SPACE): 
     145            #This centers the camera on the player 
     146            camera = self.model.active_map.cameras[self.model.active_map.my_cam_id] 
     147            player_agent = self.model.game_state.player_character.behaviour.agent 
     148            camera.setLocation(player_agent.getLocation()) 
    144149 
    145150    def setMouseCursor(self, image, dummy_image, mc_type="native"):  
     
    272277            image = settings.get("PARPG", "CursorLeft") 
    273278         
    274         if image != None: 
     279        if image != None and not data_drag.dragging: 
    275280            self.setMouseCursor(image, image) 
    276281        
     
    410415            else:  
    411416                self.scroll_timer.stop() 
    412                 self.resetMouseCursor() 
     417                if not data_drag.dragging: 
     418                    self.resetMouseCursor() 
    413419                 
    414420        self.handleCommands() 
Note: See TracChangeset for help on using the changeset viewer.