From ea2b678218e3ddbf070ecab8f38d2f8ab816dd7b Mon Sep 17 00:00:00 2001 From: 0O0o0oOoO00 <11174151+0O0o0oOoO00@users.noreply.github.com> Date: Sat, 30 Aug 2025 22:17:06 +0800 Subject: [PATCH] add: better global speedup for alas control --- config/template.json | 1 + module/config/argument/args.json | 4 ++++ module/config/argument/argument.yaml | 1 + module/config/config_generated.py | 1 + module/config/i18n/en-US.json | 4 ++++ module/config/i18n/ja-JP.json | 4 ++++ module/config/i18n/zh-CN.json | 6 +++++- module/config/i18n/zh-TW.json | 4 ++++ module/luahook/api.py | 12 ++++++++++++ module/luahook/crack.py | 11 +++++++++++ module/luahook/op.py | 6 ++++++ 11 files changed, 53 insertions(+), 1 deletion(-) diff --git a/config/template.json b/config/template.json index c1b0349e5..491997b32 100644 --- a/config/template.json +++ b/config/template.json @@ -248,6 +248,7 @@ }, "Misc": { "GlobalSpeedup": 1.0, + "BetterGlobalSpeedup": 1.0, "ChapterMove": false, "OpsiMove": false, "RemoveHardMapLimit": "disable", diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 92d9f81d8..0a1011218 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -980,6 +980,10 @@ "type": "input", "value": 1.0 }, + "BetterGlobalSpeedup": { + "type": "input", + "value": 1.0 + }, "ChapterMove": { "type": "checkbox", "value": false diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index 5dfe69d92..4ea14d99f 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -198,6 +198,7 @@ FakePlayer: Id: "" Misc: GlobalSpeedup: 1.0 + BetterGlobalSpeedup: 1.0 ChapterMove: false OpsiMove: false RemoveHardMapLimit: diff --git a/module/config/config_generated.py b/module/config/config_generated.py index fed7fbb46..2b5be9b90 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -119,6 +119,7 @@ class GeneratedConfig: # Group `Misc` Misc_GlobalSpeedup = 1.0 + Misc_BetterGlobalSpeedup = 1.0 Misc_ChapterMove = False Misc_OpsiMove = False Misc_RemoveHardMapLimit = 'disable' # disable, remove_ship_properties_limit, remove_ship_type_limit, remove_both diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index abb9de353..c5c3442bc 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -939,6 +939,10 @@ "name": "Misc.GlobalSpeedup.name", "help": "Misc.GlobalSpeedup.help" }, + "BetterGlobalSpeedup": { + "name": "Misc.BetterGlobalSpeedup.name", + "help": "Misc.BetterGlobalSpeedup.help" + }, "ChapterMove": { "name": "Misc.ChapterMove.name", "help": "Misc.ChapterMove.help" diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index 054e798fd..88593dbf0 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -939,6 +939,10 @@ "name": "Misc.GlobalSpeedup.name", "help": "Misc.GlobalSpeedup.help" }, + "BetterGlobalSpeedup": { + "name": "Misc.BetterGlobalSpeedup.name", + "help": "Misc.BetterGlobalSpeedup.help" + }, "ChapterMove": { "name": "Misc.ChapterMove.name", "help": "Misc.ChapterMove.help" diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index 6fd408d1a..ee8878e1b 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -937,7 +937,11 @@ }, "GlobalSpeedup": { "name": "全局加速", - "help": "1表示不使用,不要开太高!" + "help": "1表示不使用,不要开太高!!\n两个全局加速用一个就行了" + }, + "BetterGlobalSpeedup": { + "name": "更好的全局加速", + "help": "1表示不使用,不要开太高!\n两个全局加速用一个就行了" }, "ChapterMove": { "name": "章节图移动加速", diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index 615b67f7e..9cb737001 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -939,6 +939,10 @@ "name": "Misc.GlobalSpeedup.name", "help": "Misc.GlobalSpeedup.help" }, + "BetterGlobalSpeedup": { + "name": "Misc.BetterGlobalSpeedup.name", + "help": "Misc.BetterGlobalSpeedup.help" + }, "ChapterMove": { "name": "Misc.ChapterMove.name", "help": "Misc.ChapterMove.help" diff --git a/module/luahook/api.py b/module/luahook/api.py index 50b9f0b8f..d52314240 100644 --- a/module/luahook/api.py +++ b/module/luahook/api.py @@ -47,6 +47,9 @@ class CrackApi: class GlobalSpeedupRate(BaseModel): rate: float + class BetterGlobalSpeedupRate(BaseModel): + rate: float + class ExerciseMorePowerRate(BaseModel): rate: float @@ -251,6 +254,15 @@ class CrackApi: def disable_global_speedup(self): self.post("disable_global_speedup") + def enable_better_global_speedup(self): + self.post("enable_better_global_speedup") + + def update_better_global_speedup_rate(self, rate: BetterGlobalSpeedupRate): + self.post("update_better_global_speedup_rate", data=rate.json()) + + def disable_better_global_speedup(self): + self.post("disable_better_global_speedup") + def is_alive(self): self.post("is_alive") diff --git a/module/luahook/crack.py b/module/luahook/crack.py index 9e5bd3369..a50f35d1c 100644 --- a/module/luahook/crack.py +++ b/module/luahook/crack.py @@ -28,6 +28,7 @@ ALL_ENABLE_OPS = [ CrackOp.EnableRemoveHardModeShipPropertiesLimit, CrackOp.EnableGGFactor, CrackOp.EnableGlobalSpeedup, + CrackOp.EnableBetterGlobalSpeedup, CrackOp.EnableExerciseGodMod, CrackOp.EnableExerciseMorePower, CrackOp.EnableFastWave, @@ -193,6 +194,14 @@ def do_crack_op(config: AzurLaneConfig, device: Device, ops: Union[Type[CrackOp. api.enable_global_speedup() elif op == CrackOp.DisableGlobalSpeedup: api.disable_global_speedup() + elif op == CrackOp.EnableBetterGlobalSpeedup: + rate = float(deep_get(config.data, "Hook.Misc.BetterGlobalSpeedup", 1.0)) + if rate == 1.0: + continue + api.update_better_global_speedup_rate(CrackApi.BetterGlobalSpeedupRate(rate=rate)) + api.enable_better_global_speedup() + elif op == CrackOp.DisableBetterGlobalSpeedup: + api.disable_better_global_speedup() elif op == CrackOp.EnableExerciseGodMod: if deep_get(config.data, "Hook.Misc.ExerciseGodMod", False): api.enable_exercise_god_mode() @@ -266,6 +275,7 @@ CHAPTER_CRACK_OPS = [ CrackOp.EnableFakePlayer, CrackOp.EnableGGFactor, CrackOp.EnableGlobalSpeedup, + CrackOp.EnableBetterGlobalSpeedup, CrackOp.EnableFastWave, CrackOp.EnableMonsterKillSelf, CrackOp.EnableSkipBattleCelebrate, @@ -288,6 +298,7 @@ OPSI_CRACK_OPS = [ CrackOp.EnableFakePlayer, CrackOp.EnableGGFactor, CrackOp.EnableGlobalSpeedup, + CrackOp.EnableBetterGlobalSpeedup, CrackOp.EnableFastWave, CrackOp.EnableMonsterKillSelf, CrackOp.EnableSkipBattleCelebrate, diff --git a/module/luahook/op.py b/module/luahook/op.py index 7dfae0d74..a0b7370db 100644 --- a/module/luahook/op.py +++ b/module/luahook/op.py @@ -56,6 +56,12 @@ class CrackOp: class DisableGlobalSpeedup(Op): ... + class EnableBetterGlobalSpeedup(Op): + ... + + class DisableBetterGlobalSpeedup(Op): + ... + class EnableNoBBAnimation(Op): ...