From 4c851b999a2d5e0b23263dbb1a8769490d675312 Mon Sep 17 00:00:00 2001 From: tretrauit Date: Thu, 25 Jan 2024 20:18:56 +0700 Subject: [PATCH] fix(hsr): proper implement --noconfirm --- vollerei/cli/hsr.py | 19 +++++++++++++++++-- vollerei/cli/utils.py | 1 + 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/vollerei/cli/hsr.py b/vollerei/cli/hsr.py index 58e6bbc..9b142a9 100644 --- a/vollerei/cli/hsr.py +++ b/vollerei/cli/hsr.py @@ -25,7 +25,7 @@ default_options = [ option("patch-type", "p", description="Patch type", flag=False), option("temporary-path", "t", description="Temporary path", flag=False), option("silent", "s", description="Silent mode"), - option("noconfirm", "y", description="Do not ask for confirmation"), + option("noconfirm", "y", description="Do not ask for confirmation (yes to all)"), ] @@ -62,6 +62,16 @@ def callback( utils.silent_message = silent if noconfirm: utils.no_confirm = noconfirm + + def confirm( + question: str, default: bool = False, true_answer_regex: str = r"(?i)^y" + ): + command.line( + f"{question} (yes/no) [{'yes' if default else 'no'}] y" + ) + return True + + command.confirm = confirm command.add_style("warn", fg="yellow") @@ -116,8 +126,13 @@ class PatchInstallCommand(Command): self.line( "You need to run the game using Jadeite to use the patch." ) + self.line(f'E.g: {exe_path} "{State.game.path}"') + print() self.line( - f'E.g: I_WANT_A_BAN=1 {exe_path} "{State.game.path}"' + "To activate the experimental patching method, set the environment variable BREAK_CATHACK=1" + ) + self.line( + "Read more about it here: https://codeberg.org/mkrsym1/jadeite/issues/37" ) print() self.line( diff --git a/vollerei/cli/utils.py b/vollerei/cli/utils.py index 3f64a1e..7e991b6 100644 --- a/vollerei/cli/utils.py +++ b/vollerei/cli/utils.py @@ -47,6 +47,7 @@ class ProgressIndicator: interval=interval, values=values ) self.thread = Thread(target=self.auto_advance) + self.thread.daemon = True def start(self, message: str): """