[cli/core] Optionally show link to wiki article on game install

This is supposed to make setup easier for games with know issues.
Perhaps in the future this can also be shown on launch.
This commit is contained in:
derrod 2022-01-07 16:38:52 +01:00
parent ed1cbfc87e
commit 8d28945e8b
2 changed files with 6 additions and 0 deletions

View file

@ -1002,6 +1002,9 @@ class LegendaryCLI:
logger.info('This game supports cloud saves, syncing is handled by the "sync-saves" command.')
logger.info(f'To download saves for this game run "legendary sync-saves {args.app_name}"')
if tip_url := self.core.get_game_tip(igame.app_name):
logger.info(f'This game may require additional setup, see: {tip_url}')
old_igame = self.core.get_installed_game(game.app_name)
if old_igame and args.repair_mode and os.path.exists(repair_file):
if old_igame.needs_verification:

View file

@ -297,6 +297,9 @@ class LegendaryCore:
def get_update_info(self):
return self.lgd.get_cached_version()['data'].get('release_info')
def get_game_tip(self, app_name):
return self.lgd.get_cached_version()['data'].get('game_wiki', {}).get(app_name, {}).get(sys_platform)
def get_sdl_data(self, app_name, platform='Windows'):
if platform not in ('Win32', 'Windows'):
app_name = f'{app_name}_{platform}'