Changeset 228
- Timestamp:
- 12/25/06 19:26:16 (5 years ago)
- Location:
- trunk
- Files:
-
- 3 modified
-
NEWS.txt (modified) (1 diff)
-
src/pyspacewar/main.py (modified) (2 diffs)
-
src/pyspacewar/ui.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEWS.txt
r224 r228 1 December 25, 2006: 1 December 25, 2006: The Christmas release. 2 2 3 3 - Keyboard controls can now be customized. 4 - Keyboard controls and video mode options are stored in a config file. 5 - Added the -w command line option, in case you desire to override the config 6 file. 4 7 5 8 February 20, 2006: Released version 0.9.2 (also known as the "a month of -
trunk/src/pyspacewar/main.py
r227 r228 26 26 ui.load_settings() 27 27 parser = optparse.OptionParser() 28 parser.add_option('-f', '--fullscreen', default= False,28 parser.add_option('-f', '--fullscreen', default=None, 29 29 help='start in full-screen mode', 30 30 action='store_true', dest='fullscreen') 31 parser.add_option('-w', '--windowed', 32 help='start in windowed mode', 33 action='store_false', dest='fullscreen') 31 34 parser.add_option('-d', '--debug', default=False, 32 35 help='show debug timings', … … 38 41 action='store', dest='mode') 39 42 opts, args = parser.parse_args() 40 ui.fullscreen = opts.fullscreen 41 ui.show_debug_info = opts.debug 43 if opts.fullscreen is not None: 44 ui.fullscreen = opts.fullscreen 45 if opts.debug is not None: 46 ui.show_debug_info = opts.debug 42 47 if opts.mode: 43 48 try: -
trunk/src/pyspacewar/ui.py
r227 r228 1757 1757 config = self.get_config_parser() 1758 1758 config.read([filename]) 1759 self.fullscreen = config.getboolean('video', 'fullscreen') 1760 mode = config.get('video', 'mode') 1761 try: 1762 w, h = mode.split('x') 1763 self.fullscreen_mode = int(w), int(h) 1764 except ValueError: 1765 self.fullscreen_mode = None 1766 self.show_missile_trails = config.getboolean('video', 1767 'show_missile_trails') 1759 1768 for action in self.controls: 1760 1769 key = config.get('controls', action) … … 1775 1784 """Create a ConfigParser initialized with current settings.""" 1776 1785 config = ConfigParser.RawConfigParser() 1786 config.add_section('video') 1787 config.set('video', 'fullscreen', str(self.fullscreen)) 1788 if self.fullscreen_mode: 1789 config.set('video', 'mode', '%dx%d' % self.fullscreen_mode) 1790 else: 1791 config.set('video', 'mode', '') 1792 config.set('video', 'show_missile_trails', 1793 str(self.show_missile_trails)) 1777 1794 config.add_section('controls') 1778 1795 for action, key in self.controls.items():
