From 5893aa24265de15f0d2b4ff41cb144ec7f729db7 Mon Sep 17 00:00:00 2001 From: DLmaster361 Date: Fri, 9 May 2025 19:54:07 +0800 Subject: [PATCH] =?UTF-8?q?feat(ui):=20=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E5=9F=BA=E5=BB=BA=E6=98=BE=E7=A4=BA=E9=85=8D=E7=BD=AE=E5=90=8D?= =?UTF-8?q?=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/core/config.py | 2 +- app/ui/member_manager.py | 29 ++++++++++++++++++++++++++++- app/utils/package.py | 2 +- main.py | 1 + resources/version.json | 7 ++++++- 5 files changed, 37 insertions(+), 4 deletions(-) diff --git a/app/core/config.py b/app/core/config.py index f9b27a9..6705348 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -622,7 +622,7 @@ class MaaUserConfig(QConfig): class AppConfig(GlobalConfig): - VERSION = "4.3.7.0" + VERSION = "4.3.8.1" gameid_refreshed = Signal() PASSWORD_refreshed = Signal() diff --git a/app/ui/member_manager.py b/app/ui/member_manager.py index 6f31289..32a00d6 100644 --- a/app/ui/member_manager.py +++ b/app/ui/member_manager.py @@ -55,6 +55,7 @@ from functools import partial from pathlib import Path from typing import List import shutil +import json from app.core import Config, MainInfoBar, TaskManager, MaaConfig, MaaUserConfig, Network from app.services import Crypto @@ -1398,7 +1399,7 @@ class MemberManager(QWidget): self.card_InfrastMode = PushAndComboBoxSettingCard( icon=FluentIcon.CAFE, title="基建模式", - content="配置文件仅在自定义基建中生效", + content="自定义基建配置文件未生效", text="选择配置文件", texts=[ "常规模式", @@ -1549,6 +1550,9 @@ class MemberManager(QWidget): self.card_Mode.comboBox.currentIndexChanged.connect( self.switch_mode ) + self.card_InfrastMode.comboBox.currentIndexChanged.connect( + self.switch_infrastructure + ) self.card_Annihilation.clicked.connect( lambda: self.set_maa("Annihilation") ) @@ -1562,6 +1566,7 @@ class MemberManager(QWidget): Config.PASSWORD_refreshed.connect(self.refresh_password) self.switch_mode() + self.switch_infrastructure() def switch_mode(self) -> None: @@ -1579,6 +1584,27 @@ class MemberManager(QWidget): self.card_Annihilation.button.setVisible(True) self.card_Routine.setVisible(True) + def switch_infrastructure(self) -> None: + + if ( + self.config.get(self.config.Info_InfrastMode) + == "Custom" + ): + self.card_InfrastMode.button.setVisible(True) + with ( + self.user_path + / "Infrastructure/infrastructure.json" + ).open(mode="r", encoding="utf-8") as f: + infrastructure = json.load(f) + self.card_InfrastMode.setContent( + f"当前基建配置:{infrastructure.get("title","未命名")}" + ) + else: + self.card_InfrastMode.button.setVisible(False) + self.card_InfrastMode.setContent( + "自定义基建配置文件未生效" + ) + def refresh_gameid(self): self.card_GameId.reLoadOptions( @@ -1634,6 +1660,7 @@ class MemberManager(QWidget): self.user_path / "Infrastructure/infrastructure.json", ) + self.switch_infrastructure() else: logger.warning("未选择自定义基建文件") MainInfoBar.push_info_bar( diff --git a/app/utils/package.py b/app/utils/package.py index 101808e..0bf49bf 100644 --- a/app/utils/package.py +++ b/app/utils/package.py @@ -120,7 +120,7 @@ if __name__ == "__main__": shutil.make_archive( base_name=root_path / f"AUTO_MAA_{version_text(main_version_numb)}", format="zip", - root_dir=root_path / "AUTO_MAA", + root_dir=root_path / "AUTO_MAA_Setup", base_dir=".", ) diff --git a/main.py b/main.py index f605263..d38ec7d 100644 --- a/main.py +++ b/main.py @@ -43,6 +43,7 @@ def main(): window = AUTO_MAA() window.show_ui("显示主窗口") + window.show_ui("配置托盘") window.start_up_task() sys.exit(application.exec()) diff --git a/resources/version.json b/resources/version.json index d786155..54b20d8 100644 --- a/resources/version.json +++ b/resources/version.json @@ -1,7 +1,12 @@ { - "main_version": "4.3.7.0", + "main_version": "4.3.8.1", "updater_version": "1.0.0.0", "version_info": { + "4.3.8.1": { + "新增功能": [ + "自定义基建显示配置名称" + ] + }, "4.3.7.0": { "新增功能": [ "下载器支持完整mirrorc列表"