From 71da6fd996214e6f5a9c436fab42ef1317d556fa Mon Sep 17 00:00:00 2001 From: YoursFunny Date: Thu, 30 Nov 2023 14:21:19 +0800 Subject: [PATCH] feat: add auto select for bounty and scrimmage --- config/template.json | 12 ++++++------ module/config/argument/args.json | 18 ++++++++++++------ module/config/argument/argument.yaml | 24 ++++++++++++------------ module/config/config_generated.py | 12 ++++++------ module/config/i18n/en-US.json | 6 ++++++ module/config/i18n/zh-CN.json | 6 ++++++ tasks/bounty/ui.py | 2 ++ tasks/scrimmage/ui.py | 2 ++ 8 files changed, 52 insertions(+), 30 deletions(-) diff --git a/config/template.json b/config/template.json index 34a9935..a41942a 100644 --- a/config/template.json +++ b/config/template.json @@ -81,15 +81,15 @@ "OnError": "skip" }, "Highway": { - "Stage": 1, + "Stage": 0, "Count": 2 }, "DesertRailroad": { - "Stage": 1, + "Stage": 0, "Count": 2 }, "Schoolhouse": { - "Stage": 1, + "Stage": 0, "Count": 2 } }, @@ -104,15 +104,15 @@ "OnError": "skip" }, "Trinity": { - "Stage": 1, + "Stage": 0, "Count": 2 }, "Gehenna": { - "Stage": 1, + "Stage": 0, "Count": 2 }, "Millennium": { - "Stage": 1, + "Stage": 0, "Count": 2 } }, diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 8970715..85d4080 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -332,8 +332,9 @@ "Highway": { "Stage": { "type": "select", - "value": 1, + "value": 0, "option": [ + 0, 1, 2, 3, @@ -353,8 +354,9 @@ "DesertRailroad": { "Stage": { "type": "select", - "value": 1, + "value": 0, "option": [ + 0, 1, 2, 3, @@ -374,8 +376,9 @@ "Schoolhouse": { "Stage": { "type": "select", - "value": 1, + "value": 0, "option": [ + 0, 1, 2, 3, @@ -432,8 +435,9 @@ "Trinity": { "Stage": { "type": "select", - "value": 1, + "value": 0, "option": [ + 0, 1, 2, 3, @@ -448,8 +452,9 @@ "Gehenna": { "Stage": { "type": "select", - "value": 1, + "value": 0, "option": [ + 0, 1, 2, 3, @@ -464,8 +469,9 @@ "Millennium": { "Stage": { "type": "select", - "value": 1, + "value": 0, "option": [ + 0, 1, 2, 3, diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index 93fa836..a973c08 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -100,18 +100,18 @@ Bounty: Highway: Stage: - value: 1 - option: [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] + value: 0 + option: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] Count: 2 DesertRailroad: Stage: - value: 1 - option: [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] + value: 0 + option: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] Count: 2 Schoolhouse: Stage: - value: 1 - option: [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] + value: 0 + option: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] Count: 2 Scrimmage: @@ -121,18 +121,18 @@ Scrimmage: Trinity: Stage: - value: 1 - option: [ 1, 2, 3, 4 ] + value: 0 + option: [ 0, 1, 2, 3, 4 ] Count: 2 Gehenna: Stage: - value: 1 - option: [ 1, 2, 3, 4 ] + value: 0 + option: [ 0, 1, 2, 3, 4 ] Count: 2 Millennium: Stage: - value: 1 - option: [ 1, 2, 3, 4 ] + value: 0 + option: [ 0, 1, 2, 3, 4 ] Count: 2 TacticalChallenge: diff --git a/module/config/config_generated.py b/module/config/config_generated.py index 418d4d0..0d0553f 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -56,30 +56,30 @@ class GeneratedConfig: Bounty_OnError = 'skip' # stop, skip # Group `Highway` - Highway_Stage = 1 # 1, 2, 3, 4, 5, 6, 7, 8, 9 + Highway_Stage = 0 # 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Highway_Count = 2 # Group `DesertRailroad` - DesertRailroad_Stage = 1 # 1, 2, 3, 4, 5, 6, 7, 8, 9 + DesertRailroad_Stage = 0 # 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 DesertRailroad_Count = 2 # Group `Schoolhouse` - Schoolhouse_Stage = 1 # 1, 2, 3, 4, 5, 6, 7, 8, 9 + Schoolhouse_Stage = 0 # 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Schoolhouse_Count = 2 # Group `Scrimmage` Scrimmage_OnError = 'skip' # stop, skip # Group `Trinity` - Trinity_Stage = 1 # 1, 2, 3, 4 + Trinity_Stage = 0 # 0, 1, 2, 3, 4 Trinity_Count = 2 # Group `Gehenna` - Gehenna_Stage = 1 # 1, 2, 3, 4 + Gehenna_Stage = 0 # 0, 1, 2, 3, 4 Gehenna_Count = 2 # Group `Millennium` - Millennium_Stage = 1 # 1, 2, 3, 4 + Millennium_Stage = 0 # 0, 1, 2, 3, 4 Millennium_Count = 2 # Group `TacticalChallenge` diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index ee39969..13c3fc5 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -273,6 +273,7 @@ "Stage": { "name": "Select Stage", "help": "", + "0": "Auto select", "1": "01 - Overpass A", "2": "02 - Overpass B", "3": "03 - Overpass C", @@ -296,6 +297,7 @@ "Stage": { "name": "Select Stage", "help": "", + "0": "Auto select", "1": "01 - Abandoned Train A", "2": "02 - Abandoned Train B", "3": "03 - Abandoned Train C", @@ -319,6 +321,7 @@ "Stage": { "name": "Select Stage", "help": "", + "0": "Auto select", "1": "01 - Besieged Classroom A", "2": "02 - Besieged Classroom B", "3": "03 - Besieged Classroom C", @@ -354,6 +357,7 @@ "Stage": { "name": "Select Stage", "help": "", + "0": "Auto select", "1": "01 - Trinity A", "2": "02 - Trinity B", "3": "03 - Trinity C", @@ -372,6 +376,7 @@ "Stage": { "name": "Select Stage", "help": "", + "0": "Auto select", "1": "01 - Gehenna A", "2": "02 - Gehenna B", "3": "03 - Gehenna C", @@ -390,6 +395,7 @@ "Stage": { "name": "Select Stage", "help": "", + "0": "Auto select", "1": "01 - Millennium A", "2": "02 - Millennium B", "3": "03 - Millennium C", diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index e0b4d6a..7592686 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -273,6 +273,7 @@ "Stage": { "name": "选择关卡", "help": "", + "0": "自动选择", "1": "01 - 高架公路 A", "2": "02 - 高架公路 B", "3": "03 - 高架公路 C", @@ -296,6 +297,7 @@ "Stage": { "name": "选择关卡", "help": "", + "0": "自动选择", "1": "01 - 被遗弃的列车 A", "2": "02 - 被遗弃的列车 B", "3": "03 - 被遗弃的列车 C", @@ -319,6 +321,7 @@ "Stage": { "name": "选择关卡", "help": "", + "0": "自动选择", "1": "01 - 被袭击的教室 A", "2": "02 - 被袭击的教室 B", "3": "03 - 被袭击的教室 C", @@ -354,6 +357,7 @@ "Stage": { "name": "选择关卡", "help": "", + "0": "自动选择", "1": "01 - 三一 A", "2": "02 - 三一 B", "3": "03 - 三一 C", @@ -372,6 +376,7 @@ "Stage": { "name": "选择关卡", "help": "", + "0": "自动选择", "1": "01 - 格黑娜 A", "2": "02 - 格黑娜 B", "3": "03 - 格黑娜 C", @@ -390,6 +395,7 @@ "Stage": { "name": "选择关卡", "help": "", + "0": "自动选择", "1": "01 - 千年 A", "2": "02 - 千年 B", "3": "03 - 千年 C", diff --git a/tasks/bounty/ui.py b/tasks/bounty/ui.py index 54b3330..fda0e18 100644 --- a/tasks/bounty/ui.py +++ b/tasks/bounty/ui.py @@ -22,6 +22,8 @@ class BountyUI(UI): return False def enter_stage(self, index: int) -> bool: + if not index: + index = BOUNTY_LIST.insight_max_sweepable_index(self) if BOUNTY_LIST.select_index_enter(self, index): return True return False diff --git a/tasks/scrimmage/ui.py b/tasks/scrimmage/ui.py index ddb9383..c405fce 100644 --- a/tasks/scrimmage/ui.py +++ b/tasks/scrimmage/ui.py @@ -22,6 +22,8 @@ class ScrimmageUI(UI): return False def enter_stage(self, index: int) -> bool: + if not index: + index = SCRIMMAGE_LIST.insight_max_sweepable_index(self) if SCRIMMAGE_LIST.select_index_enter(self, index, insight=False): return True return False