Mercurial > touhou
diff eclviewer.py @ 137:2547df120ece
Add CLI rank choosing.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 23 Sep 2011 10:08:33 -0700 |
parents | fab7ad2f0d8b |
children | 959c8b312918 |
line wrap: on
line diff
--- a/eclviewer.py +++ b/eclviewer.py @@ -26,11 +26,11 @@ from pytouhou.game.games import EoSDGame from pytouhou.game.player import PlayerState -def main(path, stage_num): +def main(path, stage_num, rank): resource_loader = Loader() resource_loader.scan_archives(os.path.join(path, name) for name in ('CM.DAT', 'ST.DAT')) - game = EoSDGame(resource_loader, [PlayerState()], stage_num, 3, 16) + game = EoSDGame(resource_loader, [PlayerState()], stage_num, rank, 16) # Load stage data stage = resource_loader.get_stage('stage%d.std' % stage_num) @@ -47,10 +47,11 @@ def main(path, stage_num): try: - file_path, stage_num = sys.argv[1:] + file_path, stage_num, rank = sys.argv[1:] stage_num = int(stage_num) + rank = int(rank) except ValueError: - print('Usage: %s game_dir_path stage_num' % sys.argv[0]) + print('Usage: %s game_dir_path stage_num rank' % sys.argv[0]) else: - main(file_path, stage_num) + main(file_path, stage_num, rank)