|
43 | 43 | from module.config.config import AzurLaneConfig, Function |
44 | 44 | from module.config.deep import deep_get, deep_iter, deep_set |
45 | 45 | from module.config.env import IS_ON_PHONE_CLOUD |
| 46 | +from module.config.server import to_server |
46 | 47 | from module.config.utils import ( |
47 | 48 | alas_instance, |
48 | 49 | alas_template, |
@@ -312,6 +313,7 @@ def alas_set_group(self, task: str) -> None: |
312 | 313 | @use_scope("groups") |
313 | 314 | def set_group(self, group, arg_dict, config, task): |
314 | 315 | group_name = group[0] |
| 316 | + server = to_server(deep_get(config, "Alas.Emulator.PackageName", "cn")) |
315 | 317 |
|
316 | 318 | output_list: List[Output] = [] |
317 | 319 | for arg, arg_dict in deep_iter(arg_dict, depth=1): |
@@ -342,7 +344,15 @@ def set_group(self, group, arg_dict, config, task): |
342 | 344 | # Default value |
343 | 345 | output_kwargs["value"] = value |
344 | 346 | # Options |
345 | | - output_kwargs["options"] = options = output_kwargs.pop("option", []) |
| 347 | + options = output_kwargs.pop("option", []) |
| 348 | + server_options = output_kwargs.get(f"option_{server}") |
| 349 | + if output_kwargs["widget_type"] == "select" and isinstance(server_options, list) and server_options: |
| 350 | + options = server_options |
| 351 | + output_kwargs["options"] = options |
| 352 | + if output_kwargs["widget_type"] == "select" and len(options) == 1: |
| 353 | + only_option = options[0] |
| 354 | + if only_option in output_kwargs.get("option_bold", []): |
| 355 | + output_kwargs["widget_type"] = "state" |
346 | 356 | # Options label |
347 | 357 | options_label = [] |
348 | 358 | for opt in options: |
|
0 commit comments