Mercurial > touhou
comparison eosd @ 534:346cbf266856
Move options to logical groups, to make the help a bit less dry; and disable friendly-fire by default.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 05 Apr 2014 13:40:45 +0200 |
parents | a7dc55ad9380 |
children | fb837b32c3dd |
comparison
equal
deleted
inserted
replaced
533:de778a80820a | 534:346cbf266856 |
---|---|
27 | 27 |
28 parser = argparse.ArgumentParser(description='Libre reimplementation of the Touhou 6 engine.') | 28 parser = argparse.ArgumentParser(description='Libre reimplementation of the Touhou 6 engine.') |
29 | 29 |
30 parser.add_argument('data', metavar='DAT', default=default_data, nargs='*', help='Game’s data files') | 30 parser.add_argument('data', metavar='DAT', default=default_data, nargs='*', help='Game’s data files') |
31 parser.add_argument('-p', '--path', metavar='DIRECTORY', default='.', help='Game directory path.') | 31 parser.add_argument('-p', '--path', metavar='DIRECTORY', default='.', help='Game directory path.') |
32 parser.add_argument('-s', '--stage', metavar='STAGE', type=int, default=None, help='Stage, 1 to 7 (Extra).') | |
33 parser.add_argument('-r', '--rank', metavar='RANK', type=int, default=0, help='Rank, from 0 (Easy, default) to 3 (Lunatic).') | |
34 parser.add_argument('-c', '--character', metavar='CHARACTER', type=int, default=0, help='Select the character to use, from 0 (ReimuA, default) to 3 (MarisaB).') | |
35 parser.add_argument('--replay', metavar='REPLAY', help='Select a replay') | |
36 parser.add_argument('--save-replay', metavar='REPLAY', help='Save the upcoming game into a replay file') | |
37 parser.add_argument('--skip-replay', action='store_true', help='Skip the replay and start to play when it’s finished') | |
38 parser.add_argument('-b', '--boss-rush', action='store_true', help='Fight only bosses') | |
39 parser.add_argument('--single-buffer', action='store_true', help='Disable double buffering') | |
40 parser.add_argument('--fps-limit', metavar='FPS', default=-1, type=int, help='Set fps limit. A value of 0 disables fps limiting, while a negative value limits to 60 fps if and only if vsync doesn’t work.') | |
41 parser.add_argument('--debug', action='store_true', help='Set unlimited continues, and perhaps other debug features.') | 32 parser.add_argument('--debug', action='store_true', help='Set unlimited continues, and perhaps other debug features.') |
42 parser.add_argument('--fixed-pipeline', action='store_true', help='Use the fixed pipeline instead of the new programmable one.') | |
43 parser.add_argument('--no-background', action='store_false', help='Disable background display (huge performance boost on slow systems).') | |
44 parser.add_argument('--no-particles', action='store_false', help='Disable particles handling (huge performance boost on slow systems).') | |
45 parser.add_argument('--no-sound', action='store_false', help='Disable music and SFX.') | |
46 parser.add_argument('--hints', metavar='HINTS', default=None, help='Hints file, to display text while playing.') | |
47 parser.add_argument('--verbosity', metavar='VERBOSITY', choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], help='Select the wanted logging level.') | 33 parser.add_argument('--verbosity', metavar='VERBOSITY', choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'], help='Select the wanted logging level.') |
48 parser.add_argument('--game', metavar='GAME', choices=['EoSD'], default='EoSD', help='Select the game engine to use.') | 34 |
49 parser.add_argument('--port', metavar='PORT', type=int, default=0, help='Local port to use for netplay') | 35 game_group = parser.add_argument_group('Game options') |
50 parser.add_argument('--remote', metavar='REMOTE', default=None, help='Remote address') | 36 game_group.add_argument('-s', '--stage', metavar='STAGE', type=int, default=None, help='Stage, 1 to 7 (Extra), nothing means story mode.') |
51 parser.add_argument('--no-friendly-fire', action='store_false', help='Allow friendly-fire during netplay.') | 37 game_group.add_argument('-r', '--rank', metavar='RANK', type=int, default=0, help='Rank, from 0 (Easy, default) to 3 (Lunatic).') |
52 parser.add_argument('--backend', metavar='BACKEND', choices=['opengl', 'sdl'], default='opengl', help='Which backend to use (opengl or sdl for now).') | 38 game_group.add_argument('-c', '--character', metavar='CHARACTER', type=int, default=0, help='Select the character to use, from 0 (ReimuA, default) to 3 (MarisaB).') |
39 game_group.add_argument('-b', '--boss-rush', action='store_true', help='Fight only bosses.') | |
40 game_group.add_argument('--game', metavar='GAME', choices=['EoSD'], default='EoSD', help='Select the game engine to use.') | |
41 game_group.add_argument('--hints', metavar='HINTS', default=None, help='Hints file, to display text while playing.') | |
42 | |
43 replay_group = parser.add_argument_group('Replay options') | |
44 replay_group.add_argument('--replay', metavar='REPLAY', help='Select a file to replay.') | |
45 replay_group.add_argument('--save-replay', metavar='REPLAY', help='Save the upcoming game into a replay file.') | |
46 replay_group.add_argument('--skip-replay', action='store_true', help='Skip the replay and start to play when it’s finished.') | |
47 | |
48 netplay_group = parser.add_argument_group('Netplay options') | |
49 netplay_group.add_argument('--port', metavar='PORT', type=int, default=0, help='Local port to use.') | |
50 netplay_group.add_argument('--remote', metavar='REMOTE', default=None, help='Remote address.') | |
51 netplay_group.add_argument('--friendly-fire', action='store_true', help='Allow friendly-fire during netplay.') | |
52 | |
53 graphics_group = parser.add_argument_group('Graphics options') | |
54 graphics_group.add_argument('--backend', metavar='BACKEND', choices=['opengl', 'sdl'], default='opengl', help='Which backend to use (opengl or sdl for now).') | |
55 graphics_group.add_argument('--fixed-pipeline', action='store_true', help='Use the fixed pipeline instead of the new programmable one.') | |
56 graphics_group.add_argument('--single-buffer', action='store_true', help='Disable double buffering.') | |
57 graphics_group.add_argument('--fps-limit', metavar='FPS', default=-1, type=int, help='Set fps limit. A value of 0 disables fps limiting, while a negative value limits to 60 fps if and only if vsync doesn’t work.') | |
58 graphics_group.add_argument('--no-background', action='store_false', help='Disable background display (huge performance boost on slow systems).') | |
59 graphics_group.add_argument('--no-particles', action='store_false', help='Disable particles handling (huge performance boost on slow systems).') | |
60 graphics_group.add_argument('--no-sound', action='store_false', help='Disable music and sound effects.') | |
53 | 61 |
54 args = parser.parse_args() | 62 args = parser.parse_args() |
55 | 63 |
56 | 64 |
57 import sys | 65 import sys |
260 | 268 |
261 main(window, args.path, tuple(args.data), args.stage, args.rank, | 269 main(window, args.path, tuple(args.data), args.stage, args.rank, |
262 args.character, args.replay, args.save_replay, args.skip_replay, | 270 args.character, args.replay, args.save_replay, args.skip_replay, |
263 args.boss_rush, args.debug, args.no_background, args.no_particles, | 271 args.boss_rush, args.debug, args.no_background, args.no_particles, |
264 args.hints, args.verbosity, args.port, args.remote, | 272 args.hints, args.verbosity, args.port, args.remote, |
265 args.no_friendly_fire) | 273 args.friendly_fire) |
266 | 274 |
267 import gc | 275 import gc |
268 gc.collect() | 276 gc.collect() |