mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-04-24 13:20:00 +08:00
Add: auto change state of options (default select and single means state)
This commit is contained in:
@@ -1922,7 +1922,7 @@
|
||||
"value": "12-4"
|
||||
},
|
||||
"Event": {
|
||||
"type": "state",
|
||||
"type": "select",
|
||||
"value": "campaign_main",
|
||||
"option": [
|
||||
"event_20220915_cn",
|
||||
@@ -2319,7 +2319,7 @@
|
||||
"value": "12-4"
|
||||
},
|
||||
"Event": {
|
||||
"type": "state",
|
||||
"type": "select",
|
||||
"value": "campaign_main",
|
||||
"option": [
|
||||
"event_20220915_cn",
|
||||
@@ -2733,7 +2733,7 @@
|
||||
"display": "hide"
|
||||
},
|
||||
"Event": {
|
||||
"type": "state",
|
||||
"type": "select",
|
||||
"value": "campaign_main",
|
||||
"option": [
|
||||
"raid_20260212"
|
||||
@@ -3132,7 +3132,7 @@
|
||||
"display": "hide"
|
||||
},
|
||||
"Event": {
|
||||
"type": "state",
|
||||
"type": "select",
|
||||
"value": "campaign_main",
|
||||
"option": [
|
||||
"coalition_20260122"
|
||||
@@ -4046,7 +4046,7 @@
|
||||
"display": "hide"
|
||||
},
|
||||
"Event": {
|
||||
"type": "state",
|
||||
"type": "select",
|
||||
"value": "campaign_main",
|
||||
"option": [
|
||||
"event_20220915_cn",
|
||||
@@ -4460,7 +4460,7 @@
|
||||
"display": "hide"
|
||||
},
|
||||
"Event": {
|
||||
"type": "state",
|
||||
"type": "select",
|
||||
"value": "campaign_main",
|
||||
"option": [
|
||||
"event_20220915_cn",
|
||||
@@ -4874,7 +4874,7 @@
|
||||
"display": "hide"
|
||||
},
|
||||
"Event": {
|
||||
"type": "state",
|
||||
"type": "select",
|
||||
"value": "campaign_main",
|
||||
"option": [
|
||||
"event_20220915_cn",
|
||||
@@ -5288,7 +5288,7 @@
|
||||
"display": "hide"
|
||||
},
|
||||
"Event": {
|
||||
"type": "state",
|
||||
"type": "select",
|
||||
"value": "campaign_main",
|
||||
"option": [
|
||||
"event_20220915_cn",
|
||||
@@ -5692,7 +5692,7 @@
|
||||
"display": "hide"
|
||||
},
|
||||
"Event": {
|
||||
"type": "state",
|
||||
"type": "select",
|
||||
"value": "campaign_main",
|
||||
"option": [
|
||||
"event_20220915_cn",
|
||||
@@ -6103,7 +6103,7 @@
|
||||
"display": "hide"
|
||||
},
|
||||
"Event": {
|
||||
"type": "state",
|
||||
"type": "select",
|
||||
"value": "campaign_main",
|
||||
"option": [
|
||||
"raid_20260212"
|
||||
@@ -6330,7 +6330,7 @@
|
||||
"display": "hide"
|
||||
},
|
||||
"Event": {
|
||||
"type": "state",
|
||||
"type": "select",
|
||||
"value": "campaign_main",
|
||||
"option": [
|
||||
"coalition_20260122"
|
||||
|
||||
@@ -52,14 +52,10 @@ GemsFarming:
|
||||
Event:
|
||||
Campaign:
|
||||
Mode: normal
|
||||
Event:
|
||||
type: state
|
||||
AmbushEvade: true
|
||||
Event2:
|
||||
Campaign:
|
||||
Mode: normal
|
||||
Event:
|
||||
type: state
|
||||
AmbushEvade: true
|
||||
EventA:
|
||||
Scheduler:
|
||||
@@ -68,8 +64,6 @@ EventA:
|
||||
ServerUpdate: 00:00
|
||||
Campaign:
|
||||
Name: dynamic
|
||||
Event:
|
||||
type: state
|
||||
Mode: normal
|
||||
Use2xBook: false
|
||||
AmbushEvade: true
|
||||
@@ -86,8 +80,6 @@ EventB:
|
||||
ServerUpdate: 00:00
|
||||
Campaign:
|
||||
Name: dynamic
|
||||
Event:
|
||||
type: state
|
||||
Mode: normal
|
||||
Use2xBook: false
|
||||
AmbushEvade: true
|
||||
@@ -104,8 +96,6 @@ EventC:
|
||||
ServerUpdate: 00:00
|
||||
Campaign:
|
||||
Name: dynamic
|
||||
Event:
|
||||
type: state
|
||||
Mode: normal
|
||||
Use2xBook: false
|
||||
AmbushEvade: true
|
||||
@@ -122,8 +112,6 @@ EventD:
|
||||
ServerUpdate: 00:00
|
||||
Campaign:
|
||||
Name: dynamic
|
||||
Event:
|
||||
type: state
|
||||
Mode: normal
|
||||
Use2xBook: false
|
||||
AmbushEvade: true
|
||||
@@ -140,8 +128,6 @@ EventSp:
|
||||
ServerUpdate: 00:00
|
||||
Campaign:
|
||||
Name: sp
|
||||
Event:
|
||||
type: state
|
||||
Mode: normal
|
||||
Use2xBook: false
|
||||
AmbushEvade: true
|
||||
@@ -156,8 +142,6 @@ EventSp:
|
||||
Raid:
|
||||
Campaign:
|
||||
Name: dynamic
|
||||
Event:
|
||||
type: state
|
||||
Mode: normal
|
||||
UseClearMode: true
|
||||
UseFleetLock: true
|
||||
@@ -198,8 +182,6 @@ RaidDaily:
|
||||
ServerUpdate: 00:00
|
||||
Campaign:
|
||||
Name: dynamic
|
||||
Event:
|
||||
type: state
|
||||
Mode: normal
|
||||
UseClearMode: true
|
||||
UseFleetLock: true
|
||||
@@ -229,8 +211,6 @@ Coalition:
|
||||
FailureInterval: 30
|
||||
ServerUpdate: 00:00
|
||||
Campaign:
|
||||
Event:
|
||||
type: state
|
||||
Name: dynamic
|
||||
Mode: normal
|
||||
UseClearMode: true
|
||||
@@ -259,8 +239,6 @@ CoalitionSp:
|
||||
ServerUpdate: 00:00
|
||||
Campaign:
|
||||
Name: sp
|
||||
Event:
|
||||
type: state
|
||||
Mode: normal
|
||||
UseClearMode: true
|
||||
UseFleetLock: true
|
||||
|
||||
@@ -43,6 +43,7 @@ import module.webui.lang as lang
|
||||
from module.config.config import AzurLaneConfig, Function
|
||||
from module.config.deep import deep_get, deep_iter, deep_set
|
||||
from module.config.env import IS_ON_PHONE_CLOUD
|
||||
from module.config.server import to_server
|
||||
from module.config.utils import (
|
||||
alas_instance,
|
||||
alas_template,
|
||||
@@ -312,6 +313,7 @@ class AlasGUI(Frame):
|
||||
@use_scope("groups")
|
||||
def set_group(self, group, arg_dict, config, task):
|
||||
group_name = group[0]
|
||||
server = to_server(deep_get(config, "Alas.Emulator.PackageName", "cn"))
|
||||
|
||||
output_list: List[Output] = []
|
||||
for arg, arg_dict in deep_iter(arg_dict, depth=1):
|
||||
@@ -342,7 +344,15 @@ class AlasGUI(Frame):
|
||||
# Default value
|
||||
output_kwargs["value"] = value
|
||||
# Options
|
||||
output_kwargs["options"] = options = output_kwargs.pop("option", [])
|
||||
options = output_kwargs.pop("option", [])
|
||||
server_options = output_kwargs.get(f"option_{server}")
|
||||
if output_kwargs["widget_type"] == "select" and isinstance(server_options, list) and server_options:
|
||||
options = server_options
|
||||
output_kwargs["options"] = options
|
||||
if output_kwargs["widget_type"] == "select" and len(options) == 1:
|
||||
only_option = options[0]
|
||||
if only_option in output_kwargs.get("option_bold", []):
|
||||
output_kwargs["widget_type"] = "state"
|
||||
# Options label
|
||||
options_label = []
|
||||
for opt in options:
|
||||
|
||||
Reference in New Issue
Block a user