From 8ecebef114c970b9fc2b461e18071683a6a15e4f Mon Sep 17 00:00:00 2001 From: LA-DI-DA <11174151+0O0o0oOoO00@users.noreply.github.com> Date: Sat, 11 Nov 2023 12:31:58 +0800 Subject: [PATCH] Add: higher priority option for OpsiHazard1Leveling --- config/template.json | 3 +++ module/config/argument/args.json | 6 ++++++ module/config/argument/argument.yaml | 2 ++ module/config/argument/task.yaml | 1 + module/config/config.py | 11 ++++++++++- module/config/config_generated.py | 3 +++ module/config/i18n/en-US.json | 10 ++++++++++ module/config/i18n/ja-JP.json | 10 ++++++++++ module/config/i18n/zh-CN.json | 10 ++++++++++ module/config/i18n/zh-TW.json | 10 ++++++++++ 10 files changed, 65 insertions(+), 1 deletion(-) diff --git a/config/template.json b/config/template.json index f3982d142..6803c7ac9 100644 --- a/config/template.json +++ b/config/template.json @@ -1892,6 +1892,9 @@ "FailureInterval": 60, "ServerUpdate": "00:00, 12:00" }, + "HigherPriority": { + "Enable": false + }, "OpsiHazard1Leveling": { "TargetZone": 0 }, diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 7024069d0..188db9a2f 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -9468,6 +9468,12 @@ "display": "hide" } }, + "HigherPriority": { + "Enable": { + "type": "checkbox", + "value": false + } + }, "OpsiHazard1Leveling": { "TargetZone": { "type": "select", diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index 3b15cf6cc..bf5ecaa85 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -676,6 +676,8 @@ OpsiMeowfficerFarming: option: [ 3, 4, 5, 6, 10 ] TargetZone: value: 0 +HigherPriority: + Enable: false OpsiHazard1Leveling: TargetZone: value: 0 diff --git a/module/config/argument/task.yaml b/module/config/argument/task.yaml index 2e1c0f043..d842bd784 100644 --- a/module/config/argument/task.yaml +++ b/module/config/argument/task.yaml @@ -321,6 +321,7 @@ Opsi: - OpsiFleet OpsiHazard1Leveling: - Scheduler + - HigherPriority - OpsiHazard1Leveling - OpsiFleet OpsiCrossMonth: diff --git a/module/config/config.py b/module/config/config.py index 3866d84cc..79d5150e3 100644 --- a/module/config/config.py +++ b/module/config/config.py @@ -225,7 +225,16 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher if self.pending_task: AzurLaneConfig.is_hoarding_task = False logger.info(f"Pending tasks: {[f.command for f in self.pending_task]}") - task = self.pending_task[0] + pending_task_str = [f.command for f in self.pending_task] + if self.pending_task[0].command == "GemsFarming" \ + and self.is_task_enabled("OpsiHazard1Leveling") \ + and deep_get(self.data, "OpsiHazard1Leveling.HigherPriority.Enable") \ + and "OpsiHazard1Leveling" in pending_task_str \ + and "GemsFarming" in pending_task_str \ + and len(pending_task_str) == 2: + task = self.pending_task[1] + else: + task = self.pending_task[0] logger.attr("Task", task) return task else: diff --git a/module/config/config_generated.py b/module/config/config_generated.py index 593621cb2..00b3b2fa9 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -415,6 +415,9 @@ class GeneratedConfig: OpsiMeowfficerFarming_HazardLevel = 5 # 3, 4, 5, 6, 10 OpsiMeowfficerFarming_TargetZone = 0 + # Group `HigherPriority` + HigherPriority_Enable = False + # Group `OpsiHazard1Leveling` OpsiHazard1Leveling_TargetZone = 0 # 0, 44, 22 diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index a53a610d1..e82ba3ad9 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -2384,6 +2384,16 @@ "help": "Supports either Zone ID or Name in CN/EN/JP/TW, i.e. \"51\", \"NA Ocean SE Sector E\"\nIf specified, Alas will loop on this same zone after each clear\nUse default value 0 or clear the field to remove the specification\nZone information can be acquired from <./module/os/map_data.py>" } }, + "HigherPriority": { + "_info": { + "name": "HigherPriority._info.name", + "help": "HigherPriority._info.help" + }, + "Enable": { + "name": "HigherPriority.Enable.name", + "help": "HigherPriority.Enable.help" + } + }, "OpsiHazard1Leveling": { "_info": { "name": "CL1 leveling", diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index 547149019..9c42e14ba 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -2384,6 +2384,16 @@ "help": "OpsiMeowfficerFarming.TargetZone.help" } }, + "HigherPriority": { + "_info": { + "name": "HigherPriority._info.name", + "help": "HigherPriority._info.help" + }, + "Enable": { + "name": "HigherPriority.Enable.name", + "help": "HigherPriority.Enable.help" + } + }, "OpsiHazard1Leveling": { "_info": { "name": "OpsiHazard1Leveling._info.name", diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index bc15bf5a9..afbb26d72 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -2384,6 +2384,16 @@ "help": "仅出击指定的海域,可以用来获取大世界成就星星\n支持海域ID、国服/国际服/日服/台服海域名称,例如 \"51\", \"NA海域东南E\", \"NA Ocean SE Sector E\"\n填入默认值0,或者删除数值即可取消指定" } }, + "HigherPriority": { + "_info": { + "name": "更高优先级", + "help": "开启后会将优先级调整到紧急委托前面" + }, + "Enable": { + "name": "启用", + "help": "" + } + }, "OpsiHazard1Leveling": { "_info": { "name": "侵蚀1练级", diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index 3dc74cf67..bdf85d50b 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -2384,6 +2384,16 @@ "help": "僅出擊指定的海域,可以用來獲取大世界成就星星\n自動更新的數值,填0可重置進度,重置後自動跳過已開荒的海域\n支援海域ID、國服/國際服/日服/台服海域名稱,例如 \"51\", \"NA海域東南E\", \"NA Ocean SE Sector E\"\n填入默認值0,或者刪除數值即可取消指定" } }, + "HigherPriority": { + "_info": { + "name": "HigherPriority._info.name", + "help": "HigherPriority._info.help" + }, + "Enable": { + "name": "HigherPriority.Enable.name", + "help": "HigherPriority.Enable.help" + } + }, "OpsiHazard1Leveling": { "_info": { "name": "侵蝕1練級",