From 8d28945e8b91a47f9392d961c01a7db909ee2c2f Mon Sep 17 00:00:00 2001 From: derrod Date: Fri, 7 Jan 2022 16:38:52 +0100 Subject: [PATCH] [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. --- legendary/cli.py | 3 +++ legendary/core.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/legendary/cli.py b/legendary/cli.py index 462e693..235c103 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -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: diff --git a/legendary/core.py b/legendary/core.py index 1e86924..6777654 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -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}'