diff scripts/pytouhou @ 548:1e9ea6519f3c

Make EoSDInterface separate from EoSD game.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 21 May 2014 20:56:53 +0200
parents e35bef07290d
children 56bca8ce4b68
line wrap: on
line diff
--- a/scripts/pytouhou
+++ b/scripts/pytouhou
@@ -38,6 +38,7 @@ game_group.add_argument('-r', '--rank', 
 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).')
 game_group.add_argument('-b', '--boss-rush', action='store_true', help='Fight only bosses.')
 game_group.add_argument('--game', metavar='GAME', choices=['EoSD'], default='EoSD', help='Select the game engine to use.')
+game_group.add_argument('--interface', metavar='INTERFACE', choices=['EoSD'], default='EoSD', help='Select the interface to use.')
 game_group.add_argument('--hints', metavar='HINTS', default=None, help='Hints file, to display text while playing.')
 
 replay_group = parser.add_argument_group('Replay options')
@@ -69,6 +70,9 @@ import logging
 if args.game == 'EoSD':
     from pytouhou.games.eosd import EoSDCommon as Common, EoSDGame as Game
 
+if args.interface == 'EoSD':
+    from pytouhou.interfaces.eosd import EoSDInterface as Interface
+
 
 from pytouhou.lib.sdl import SDL, show_simple_message_box
 from pytouhou.ui.window import Window
@@ -188,6 +192,8 @@ def main(window, path, data, stage_num, 
     game_class = GameBossRush if boss_rush else Game
 
     common = Common(resource_loader, characters, continues, stage_num - 1)
+    interface = Interface(resource_loader, common.players[0]) #XXX
+    common.interface = interface #XXX
     renderer = GameRenderer(resource_loader, window)
     runner = GameRunner(window, renderer, common, resource_loader, skip_replay, con)
     window.set_runner(runner)