From ee171705da2e955f28d760d2f5da545a44bcd681 Mon Sep 17 00:00:00 2001 From: Mathieu Comandon Date: Mon, 15 Dec 2014 22:31:20 +0100 Subject: [PATCH] Add system option to disable runtime --- lutris/game.py | 9 ++++++++- lutris/sysoptions.py | 9 +++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lutris/game.py b/lutris/game.py index e2b392ba48..3d9c18ebab 100644 --- a/lutris/game.py +++ b/lutris/game.py @@ -99,6 +99,13 @@ def prelaunch(self): return self.runner.prelaunch() return True + def use_runtime(self, system_config): + disable_runtime = system_config.get('disable_runtime') + env_runtime = os.getenv('LUTRIS_RUNTIME') + if env_runtime and env_runtime.lower() in ('0', 'off'): + disable_runtime = True + return not disable_runtime + def play(self): """Launch the game.""" if not self.runner: @@ -145,7 +152,7 @@ def play(self): launch_arguments.insert(0, 'LD_PRELOAD="{}"'.format(ld_preload)) ld_library_path = [] - if os.getenv("LUTRIS_RUNTIME", 1) == 1: + if self.use_runtime(system_config): runtime64_path = os.path.join(settings.RUNTIME_DIR, "lib64") if os.path.exists(runtime64_path): ld_library_path.append(runtime64_path) diff --git a/lutris/sysoptions.py b/lutris/sysoptions.py index 766faf10e3..754ebcc126 100644 --- a/lutris/sysoptions.py +++ b/lutris/sysoptions.py @@ -25,6 +25,15 @@ "Lutris uses it to propose you a default path when you \n" "install a new game.") }, + { + 'option': 'disable_runtime', + 'type': 'bool', + 'label': 'Disable Lutris Runtime', + 'default': False, + 'help': ("The Lutris Runtime loads some libraries before running the " + "game. Which can cause some conflicts in some cases (mostly " + "with Steam). Check this option to diasble it.") + }, { 'option': 'resolution', 'type': 'choice',