From c2ae5b7367d11e917d11d2bfe9de40991c6394fb Mon Sep 17 00:00:00 2001 From: derrod Date: Sat, 18 Apr 2020 05:14:49 +0200 Subject: [PATCH] [core] Allow default env/wine overrides in config --- legendary/core.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/legendary/core.py b/legendary/core.py index a89d728..aa7ee2a 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -206,7 +206,11 @@ class LegendaryCore: params = [] if os.name != 'nt': - params.append(self.lgd.config.get(app_name, 'wine_executable', fallback='wine')) + # check if there's a default override + wine_binary = self.lgd.config.get('default', 'wine_executable', fallback='wine') + # check if there's a game specific override + wine_binary = self.lgd.config.get(app_name, 'wine_executable', fallback=wine_binary) + params.append(wine_binary) params.append(game_exe) @@ -247,6 +251,8 @@ class LegendaryCore: env = None if f'{app_name}.env' in self.lgd.config: env = dict(self.lgd.config[f'{app_name}.env']) + elif 'default.env' in self.lgd.config: + env = dict(self.lgd.config['default.env']) return params, working_dir, env