mirror of
https://github.com/lutris/lutris
synced 2024-10-04 14:59:37 +00:00
Add working_dir setting to Wine and Linux runners
This commit is contained in:
parent
90c8dbe0bb
commit
657bd5018a
|
@ -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:
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue