mirror of
https://github.com/lutris/lutris
synced 2024-10-04 14:59:37 +00:00
Move Steam DRM free mode to game options (Closes #1520)
This commit is contained in:
parent
7f1b430695
commit
8d489c9008
|
@ -63,12 +63,22 @@ class steam(Runner):
|
|||
"Ignored when Steam Big Picture mode is enabled."
|
||||
),
|
||||
},
|
||||
{
|
||||
"option": "run_without_steam",
|
||||
"label": "DRM free mode (Do not launch Steam)",
|
||||
"type": "bool",
|
||||
"default": False,
|
||||
"advanced": True,
|
||||
"help": (
|
||||
"Run the game directly without Steam, requires the game binary path to be set"
|
||||
),
|
||||
},
|
||||
{
|
||||
"option": "steamless_binary",
|
||||
"type": "file",
|
||||
"label": "Steamless binary",
|
||||
"label": "Game binary path",
|
||||
"advanced": True,
|
||||
"help": "Steamless binary for running the game directly",
|
||||
"help": "Path to the game executable (Required by DRM free mode)"
|
||||
},
|
||||
]
|
||||
runner_options = [
|
||||
|
@ -117,16 +127,6 @@ class steam(Runner):
|
|||
"https://github.com/solus-project/linux-steam-integration"
|
||||
),
|
||||
},
|
||||
{
|
||||
"option": "run_without_steam",
|
||||
"label": "Run without Steam (if possible)",
|
||||
"type": "bool",
|
||||
"default": False,
|
||||
"help": (
|
||||
"If a steamless binary is available launches the game "
|
||||
"directly instead of launching it through Steam"
|
||||
),
|
||||
},
|
||||
{
|
||||
"option": "args",
|
||||
"type": "string",
|
||||
|
@ -193,7 +193,7 @@ class steam(Runner):
|
|||
@property
|
||||
def working_dir(self):
|
||||
"""Return the working directory to use when running the game."""
|
||||
if self.runner_config["run_without_steam"]:
|
||||
if self.game_config["run_without_steam"]:
|
||||
steamless_binary = self.game_config.get("steamless_binary")
|
||||
if steamless_binary and os.path.isfile(steamless_binary):
|
||||
return os.path.dirname(steamless_binary)
|
||||
|
@ -300,13 +300,13 @@ class steam(Runner):
|
|||
def play(self):
|
||||
game_args = self.game_config.get("args") or ""
|
||||
|
||||
steamless_binary = self.game_config.get("steamless_binary")
|
||||
if self.runner_config["run_without_steam"] and steamless_binary:
|
||||
binary_path = self.game_config.get("steamless_binary")
|
||||
if self.game_config["run_without_steam"] and binary_path:
|
||||
# Start without steam
|
||||
if not system.path_exists(steamless_binary):
|
||||
return {"error": "FILE_NOT_FOUND", "file": steamless_binary}
|
||||
if not system.path_exists(binary_path):
|
||||
return {"error": "FILE_NOT_FOUND", "file": binary_path}
|
||||
self.original_steampid = None
|
||||
command = [steamless_binary]
|
||||
command = [binary_path]
|
||||
if game_args:
|
||||
for arg in shlex.split(game_args):
|
||||
command.append(arg)
|
||||
|
|
|
@ -100,13 +100,23 @@ class winesteam(wine.wine):
|
|||
"useful if a game has several launch options."
|
||||
),
|
||||
},
|
||||
{
|
||||
"option": "run_without_steam",
|
||||
"label": "DRM free mode (Do not launch Steam)",
|
||||
"type": "bool",
|
||||
"default": False,
|
||||
"advanced": True,
|
||||
"help": (
|
||||
"Run the game directly without Steam, requires the game binary path to be set"
|
||||
),
|
||||
},
|
||||
{
|
||||
"option": "steamless_binary",
|
||||
"type": "file",
|
||||
"label": "Steamless binary",
|
||||
"label": "Game binary path",
|
||||
"advanced": True,
|
||||
"help": "Steamless binary for running the game directly",
|
||||
},
|
||||
"help": "Path to the game executable (Required by DRM free mode)"
|
||||
}
|
||||
]
|
||||
|
||||
def __init__(self, config=None):
|
||||
|
@ -132,16 +142,6 @@ class winesteam(wine.wine):
|
|||
"default": True,
|
||||
"help": "Shut down Steam after the game has quit.",
|
||||
},
|
||||
{
|
||||
"option": "run_without_steam",
|
||||
"label": "Run without Steam (if possible)",
|
||||
"type": "bool",
|
||||
"default": False,
|
||||
"help": (
|
||||
"If a steamless binary is available launches the game "
|
||||
"directly instead of launching it through Steam"
|
||||
),
|
||||
},
|
||||
{
|
||||
"option": "args",
|
||||
"type": "string",
|
||||
|
@ -201,7 +201,7 @@ class winesteam(wine.wine):
|
|||
@property
|
||||
def working_dir(self):
|
||||
"""Return the working directory to use when running the game."""
|
||||
if self.runner_config["run_without_steam"]:
|
||||
if self.game_config["run_without_steam"]:
|
||||
steamless_binary = self.game_config.get("steamless_binary")
|
||||
if steamless_binary and os.path.isfile(steamless_binary):
|
||||
return os.path.dirname(steamless_binary)
|
||||
|
@ -430,7 +430,7 @@ class winesteam(wine.wine):
|
|||
self.setup_x360ce(self.runner_config["x360ce-path"])
|
||||
|
||||
steamless_binary = self.game_config.get("steamless_binary")
|
||||
if self.runner_config["run_without_steam"] and steamless_binary:
|
||||
if self.game_config["run_without_steam"] and steamless_binary:
|
||||
# Start without steam
|
||||
if not system.path_exists(steamless_binary):
|
||||
return {"error": "FILE_NOT_FOUND", "file": steamless_binary}
|
||||
|
|
Loading…
Reference in a new issue