Update snes9x runner

This commit is contained in:
Mathieu Comandon 2013-06-29 18:21:37 +02:00
parent f03d145558
commit 7ba5bfb9fc
3 changed files with 15 additions and 10 deletions

View file

@ -8,6 +8,7 @@ deb-source:
deb:
debuild
mv ../lutris_0* build
changelog-add:
dch -i
@ -19,7 +20,7 @@ upload-ppa:
dput ppa:strycore/ppa ../lutris_0.3.0_i386.changes
rpm:
sudo alien ../lutris_0.3.0_all.deb --scripts --to-rpm
cd build && sudo alien lutris_0.3.0_all.deb --scripts --to-rpm
clean:
debclean

View file

@ -203,6 +203,7 @@ class ScriptInterpreter(object):
"Can't continue installation without file", file_id
)
if file_uri.startswith("file://"):
print file_uri
self.game_files[file_id] = file_uri[7:]
self.iter_game_files()
return
@ -222,7 +223,8 @@ class ScriptInterpreter(object):
self.parent.start_download(file_uri, dest_file)
def _iter_commands(self):
os.chdir(self.target_path)
if os.path.exists(self.target_path):
os.chdir(self.target_path)
self.parent.set_status("Installing game data")
self.parent.add_spinner()

View file

@ -32,7 +32,7 @@ class snes9x(Runner):
self.package = None
self.platform = "Super Nintendo"
self.is_installable = True
self.game_options = [{"option": "rom",
self.game_options = [{"option": "main_file",
"type": "file_chooser",
"default_path": "game_path",
"label": "ROM"}]
@ -58,7 +58,7 @@ class snes9x(Runner):
}
]
if settings:
self.rom = settings["game"]["rom"]
self.rom = settings["game"]["main_file"]
self.settings = settings
def options_as_dict(self):
@ -70,14 +70,16 @@ class snes9x(Runner):
def play(self):
"""Run Super Nintendo game"""
options = self.options_as_dict()
runner_options = self.settings.get('snes9x')
for option_name in options:
self.set_option(
option_name,
self.settings['snes9x'].get(
option_name, options[option_name].get('default')
if runner_options:
self.set_option(
option_name,
runner_options.get(
option_name, options[option_name].get('default')
)
)
)
return self.get_executable() + ["\"%s\"" % self.rom]
return {'command': self.get_executable() + ["\"%s\"" % self.rom]}
def get_executable(self):
local_path = os.path.join(SNES9X_RUNNER_DIR, self.executable)