1
0
mirror of https://github.com/lutris/lutris synced 2024-07-05 08:28:41 +00:00

Add working_dir setting to Wine and Linux runners

This commit is contained in:
Xodetaetl 2014-08-21 20:05:12 +02:00 committed by Mathieu Comandon
parent 90c8dbe0bb
commit 657bd5018a
3 changed files with 27 additions and 3 deletions

View File

@ -57,11 +57,17 @@ Presetting game parameters
The ``game`` directive lets you preset game parameters and options. Available
parameters depend on the runner:
* linux: ``args`` (optional main executable command argument)
* linux: ``args`` (optional command arguments), ``working_dir``
(optional working directory, defaults to the exe's dir).
* wine / winesteam: ``args``, ``prefix`` (optional WINEPREFIX).
* wine: ``args``, ``prefix`` (optional Wine prefix), ``working_dir`` (optional
working directory, defaults to the exe's dir).
[TODO: reference all options]
* winesteam: ``args``, ``prefix`` (optional Wine prefix).
[TODO: reference all options] Meanwhile, you can check the configuration window
of any game using the runner you're writing for to get a list of the available
options.
Example:

View File

@ -19,6 +19,12 @@ class linux(Runner):
"type": "string",
"label": "Arguments"
},
{
"option": "working_dir",
"type": "directory_chooser",
"label": "Working directory"
},
{
"option": "ld_preload",
"type": "file",
@ -54,6 +60,9 @@ class linux(Runner):
@property
def working_dir(self):
"""Return the working directory to use when running the game."""
option = self.config['game'].get('working_dir')
if option:
return option
if self.game_exe:
return os.path.dirname(self.game_exe)
else:

View File

@ -112,6 +112,12 @@ class wine(Runner):
'type': 'string',
'label': 'Arguments'
},
{
"option": "working_dir",
"type": "directory_chooser",
"label": "Working directory"
},
{
'option': 'prefix',
'type': 'directory_chooser',
@ -247,6 +253,9 @@ class wine(Runner):
@property
def working_dir(self):
"""Return the working directory to use when running the game."""
option = self.config['game'].get('working_dir')
if option:
return option
if self.game_exe:
return os.path.dirname(self.game_exe)
else: