[cli/core/utils] Re-enable SDL for Mac platform

Currently, this only affects Fortnite and UE.
This commit is contained in:
derrod 2021-12-17 01:25:24 +01:00
parent 6c35504058
commit c3ade2994e
3 changed files with 8 additions and 6 deletions

View file

@ -787,13 +787,9 @@ class LegendaryCLI:
elif config_disable_sdl or args.disable_sdl:
sdl_enabled = False
# Disable SDL for non-Windows (for now, as no Mac SDL files are available right now)
if args.platform not in ('Win32', 'Windows'):
sdl_enabled = False
if sdl_enabled and ((sdl_name := get_sdl_appname(game.app_name)) is not None):
if not self.core.is_installed(game.app_name) or config_tags is None or args.reset_sdl:
sdl_data = self.core.get_sdl_data(sdl_name)
sdl_data = self.core.get_sdl_data(sdl_name, platform=args.platform)
if sdl_data:
if args.skip_sdl:
args.install_tag = ['']

View file

@ -287,7 +287,10 @@ class LegendaryCore:
def get_update_info(self):
return self.lgd.get_cached_version()['data'].get('release_info')
def get_sdl_data(self, app_name):
def get_sdl_data(self, app_name, platform='Windows'):
if platform not in ('Win32', 'Windows'):
app_name = f'{app_name}_{platform}'
if app_name not in sdl_games:
return None
# load hardcoded data as fallback

View file

@ -33,6 +33,9 @@ games = {
def get_sdl_appname(app_name):
for k in games.keys():
if k.endswith('_Mac'):
continue
if app_name.startswith(k):
return k
return None