Changeset 232

Show
Ignore:
Timestamp:
01/04/07 03:18:42 (5 years ago)
Author:
mg
Message:

Bugfix: after remapping the controls the old keys used to continue to
perform the same actions.

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/NEWS.txt

    r231 r232  
    22 
    33  - Show an animation (expanding bubble) when ships respawn. 
     4  - Bugfix: after remapping the controls the old keys used to continue to 
     5    perform the same actions. 
    46 
    57December 25, 2006: Released version 0.9.3: the Christmas release. 
  • trunk/src/pyspacewar/ui.py

    r231 r232  
    21502150        """Change a key mapping""" 
    21512151        if key in self.rev_controls: 
     2152            # key was previously bound to something else 
    21522153            old_action = self.rev_controls[key] 
    21532154            self.controls[old_action] = None 
     2155        old_key = self.controls[action] 
     2156        if old_key: 
     2157            # some other key was previously bound to this action 
     2158            del self.rev_controls[old_key] 
    21542159        self.controls[action] = key 
    2155         self.rev_controls[key] = action 
     2160        if key is not None: 
     2161            self.rev_controls[key] = action 
    21562162 
    21572163    def zoom_in(self):