# HG changeset patch # User Emmanuel Gil Peyrot # Date 1316797713 25200 # Node ID 2547df120ece87a2de81af5574bdeb3ac0f3b991 # Parent d3005ebe797a1b16d42833780ae24f31bd67d65f Add CLI rank choosing. diff --git a/eclviewer.py b/eclviewer.py --- 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)