diff eosd @ 262:8fa660da5f0c

Automatically search data files using different names.
author Thibaut Girka <thib@sitedethib.com>
date Mon, 23 Jan 2012 00:58:03 +0100
parents c417bb6c98bf
children 0aab9b34299e
line wrap: on
line diff
--- a/eosd
+++ b/eosd
@@ -41,6 +41,7 @@ def main(path, stage_num, rank, characte
         prng = None
 
     resource_loader = Loader(path)
+
     resource_loader.scan_archives(data)
     game = EoSDGame(resource_loader, [PlayerState(character=character)], stage_num, rank, 16,
                     prng=prng)
@@ -56,9 +57,14 @@ def main(path, stage_num, rank, characte
     runner.start()
 
 
+default_data = ('CM.DAT:th06*_CM.DAT:*CM.DAT:*cm.dat',
+                'ST.DAT:th6*ST.DAT:*ST.DAT:*st.dat',
+                '102h.exe:102*.exe:東方紅魔郷.exe:*.exe')
+
+
 parser = argparse.ArgumentParser(description='Libre reimplementation of the Touhou 6 engine.')
 
-parser.add_argument('data', metavar='DAT', default=('CM.DAT', 'ST.DAT'), nargs='*', help='Game’s .DAT data files')
+parser.add_argument('data', metavar='DAT', default=default_data, nargs='*', help='Game’s data files')
 parser.add_argument('-p', '--path', metavar='DIRECTORY', default='.', help='Game directory path.')
 parser.add_argument('-s', '--stage', metavar='STAGE', type=int, required=True, help='Stage, 1 to 7 (Extra).')
 parser.add_argument('-r', '--rank', metavar='RANK', type=int, default=0, help='Rank, from 0 (Easy, default) to 3 (Lunatic).')