mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-04-24 17:59:59 +08:00
Add: auto change state of options (default select and single means state)
This commit is contained in:
@@ -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