Fix --skip-update-check option for launch helper
This commit is contained in:
parent
e6bbb2035b
commit
4cadc263e6
|
@ -51,8 +51,6 @@ def main():
|
|||
metavar="<App Name>", action="store")
|
||||
launch_minimal_parser.add_argument("--offline", help="Launch game offline",
|
||||
action="store_true")
|
||||
launch_minimal_parser.add_argument("--skip_update_check", help="Do not check for updates",
|
||||
action="store_true")
|
||||
launch_minimal_parser.add_argument('--wine-bin', dest='wine_bin', action='store', metavar='<wine binary>',
|
||||
default=os.environ.get('LGDRY_WINE_BINARY', None),
|
||||
help='Set WINE binary to use to launch the app')
|
||||
|
@ -61,6 +59,8 @@ def main():
|
|||
help='Set WINE prefix to use')
|
||||
launch_minimal_parser.add_argument("--ask-alyways-sync", help="Ask for cloud saves",
|
||||
action="store_true")
|
||||
launch_minimal_parser.add_argument("--skip-update-check", help="Do not check for updates",
|
||||
action="store_true")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
|
|
|
@ -32,16 +32,17 @@ class PreLaunchThread(QRunnable):
|
|||
self.core = core
|
||||
self.app_name = args.app_name
|
||||
self.signals = self.Signals()
|
||||
self.args = args
|
||||
|
||||
def run(self) -> None:
|
||||
args = self.prepare_launch(self.app_name)
|
||||
args = self.prepare_launch(self.args)
|
||||
if not args:
|
||||
return
|
||||
self.signals.ready_to_launch.emit(args)
|
||||
|
||||
def prepare_launch(self, app_name) -> Union[LaunchArgs, None]:
|
||||
def prepare_launch(self, args: InitArgs) -> Union[LaunchArgs, None]:
|
||||
try:
|
||||
args = get_launch_args(self.core, InitArgs(app_name))
|
||||
args = get_launch_args(self.core, args)
|
||||
except Exception as e:
|
||||
self.signals.error_occurred.emit(str(e))
|
||||
return None
|
||||
|
|
|
@ -23,17 +23,18 @@ class InitArgs:
|
|||
app_name: str
|
||||
debug: bool = False
|
||||
offline: bool = False
|
||||
skip_version_check: bool = False
|
||||
skip_update_check: bool = False
|
||||
wine_prefix: str = ""
|
||||
wine_bin: str = ""
|
||||
|
||||
@classmethod
|
||||
def from_argparse(cls, args):
|
||||
print(args.skip_update_check)
|
||||
return cls(
|
||||
app_name=args.app_name,
|
||||
debug=args.debug,
|
||||
offline=args.offline,
|
||||
skip_version_check=args.skip_update_check,
|
||||
skip_update_check=args.skip_update_check,
|
||||
wine_bin=args.wine_bin,
|
||||
wine_prefix=args.wine_pfx,
|
||||
)
|
||||
|
@ -81,7 +82,8 @@ def get_origin_params(core: LegendaryCore, app_name, offline: bool,
|
|||
def get_game_params(core: LegendaryCore, igame: InstalledGame, args: InitArgs,
|
||||
launch_args: LaunchArgs) -> LaunchArgs:
|
||||
if not args.offline: # skip for update
|
||||
if not args.skip_version_check and not core.is_noupdate_game(igame.app_name):
|
||||
if not args.skip_update_check and not core.is_noupdate_game(igame.app_name):
|
||||
print("Checking for updates...")
|
||||
# check updates
|
||||
try:
|
||||
latest = core.get_asset(
|
||||
|
|
Loading…
Reference in a new issue