From 17ec962a220de50ec259d464086a5cba35debd62 Mon Sep 17 00:00:00 2001 From: DLmaster361 Date: Sun, 4 May 2025 03:14:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E4=BF=AE=E5=A4=8D=E8=BD=AF=E4=BB=B6?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E7=9B=B8=E5=85=B3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复软件窗口最大化异常问题 - 修复异常操作导致窗口离开屏幕后难以复原的问题 - 修正剩余理智关卡文案 - 主窗口显示版本号 --- app/core/config.py | 2 +- app/ui/main_window.py | 59 +++++++++++++++++++++++++++------------- app/ui/member_manager.py | 34 +++++++++++++++++------ app/ui/setting.py | 4 +-- resources/version.json | 12 +++++++- 5 files changed, 79 insertions(+), 32 deletions(-) diff --git a/app/core/config.py b/app/core/config.py index 9b52fad..0115f82 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -614,7 +614,7 @@ class MaaUserConfig(QConfig): class AppConfig(GlobalConfig): - VERSION = "4.3.6.1" + VERSION = "4.3.6.2" gameid_refreshed = Signal() PASSWORD_refreshed = Signal() diff --git a/app/ui/main_window.py b/app/ui/main_window.py index e5dbc24..0b9b599 100644 --- a/app/ui/main_window.py +++ b/app/ui/main_window.py @@ -26,7 +26,7 @@ v4.3 """ from loguru import logger -from PySide6.QtWidgets import QSystemTrayIcon +from PySide6.QtWidgets import QApplication, QSystemTrayIcon from qfluentwidgets import ( qconfig, Action, @@ -62,7 +62,15 @@ class AUTO_MAA(MSFluentWindow): super().__init__() self.setWindowIcon(QIcon(str(Config.app_path / "resources/icons/AUTO_MAA.ico"))) - self.setWindowTitle("AUTO_MAA") + + version_numb = list(map(int, Config.VERSION.split("."))) + version_text = ( + f"v{'.'.join(str(_) for _ in version_numb[0:3])}" + if version_numb[3] == 0 + else f"v{'.'.join(str(_) for _ in version_numb[0:3])}-beta.{version_numb[3]}" + ) + + self.setWindowTitle(f"AUTO_MAA - {version_text}") self.switch_theme() @@ -180,6 +188,8 @@ class AUTO_MAA(MSFluentWindow): self.tray.setContextMenu(self.tray_menu) self.tray.activated.connect(self.on_tray_activated) + self.set_min_method() + Config.user_info_changed.connect(self.member_manager.refresh_dashboard) TaskManager.create_gui.connect(self.dispatch_center.add_board) TaskManager.connect_gui.connect(self.dispatch_center.connect_main_board) @@ -347,27 +357,37 @@ class AUTO_MAA(MSFluentWindow): if mode == "显示主窗口": # 配置主窗口 - size = list( - map( - int, - Config.get(Config.ui_size).split("x"), + if not self.window().isVisible(): + size = list( + map( + int, + Config.get(Config.ui_size).split("x"), + ) ) - ) - location = list( - map( - int, - Config.get(Config.ui_location).split("x"), + location = list( + map( + int, + Config.get(Config.ui_location).split("x"), + ) ) - ) - self.window().setGeometry(location[0], location[1], size[0], size[1]) - self.window().show() + if self.window().isMaximized(): + self.window().showNormal() + self.window().setGeometry(location[0], location[1], size[0], size[1]) + self.window().show() + if not if_quick: + if Config.get(Config.ui_maximized): + self.titleBar.maxBtn.click() + self.show_ui("配置托盘") + + if not any( + self.window().geometry().intersects(screen.availableGeometry()) + for screen in QApplication.screens() + ): + self.window().showNormal() + self.window().setGeometry(100, 100, 1200, 700) + self.window().raise_() self.window().activateWindow() - if not if_quick: - if Config.get(Config.ui_maximized): - self.window().showMaximized() - self.set_min_method() - self.show_ui("配置托盘") elif mode == "配置托盘": @@ -389,6 +409,7 @@ class AUTO_MAA(MSFluentWindow): Config.ui_location, f"{self.geometry().x()}x{self.geometry().y()}", ) + Config.set(Config.ui_maximized, self.window().isMaximized()) Config.save() diff --git a/app/ui/member_manager.py b/app/ui/member_manager.py index 2fef2e9..467345d 100644 --- a/app/ui/member_manager.py +++ b/app/ui/member_manager.py @@ -1207,14 +1207,24 @@ class MemberManager(QWidget): int(name[3:]) - 1, 9, QTableWidgetItem( - Config.gameid_dict["ALL"]["text"][ - Config.gameid_dict["ALL"]["value"].index( - config.get(config.Info_GameId_Remain) + "不使用" + if config.get(config.Info_GameId_Remain) == "-" + else ( + ( + Config.gameid_dict["ALL"]["text"][ + Config.gameid_dict["ALL"][ + "value" + ].index( + config.get( + config.Info_GameId_Remain + ) + ) + ] ) - ] - if config.get(config.Info_GameId_Remain) - in Config.gameid_dict["ALL"]["value"] - else config.get(config.Info_GameId_Remain) + if config.get(config.Info_GameId_Remain) + in Config.gameid_dict["ALL"]["value"] + else config.get(config.Info_GameId_Remain) + ) ), ) self.dashboard.setCellWidget( @@ -1403,7 +1413,10 @@ class MemberManager(QWidget): title="剩余理智关卡", content="按下回车以添加自定义关卡号", value=Config.gameid_dict["ALL"]["value"], - texts=Config.gameid_dict["ALL"]["text"], + texts=[ + "不使用" if _ == "当前/上次" else _ + for _ in Config.gameid_dict["ALL"]["text"] + ], qconfig=self.config, configItem=self.config.Info_GameId_Remain, parent=self, @@ -1513,7 +1526,10 @@ class MemberManager(QWidget): ) self.card_GameId_Remain.reLoadOptions( Config.gameid_dict["ALL"]["value"], - Config.gameid_dict["ALL"]["text"], + [ + "不使用" if _ == "当前/上次" else _ + for _ in Config.gameid_dict["ALL"]["text"] + ], ) def refresh_password(self): diff --git a/app/ui/setting.py b/app/ui/setting.py index a6780df..d07bfa4 100644 --- a/app/ui/setting.py +++ b/app/ui/setting.py @@ -998,9 +998,9 @@ class OtherSettingCard(HeaderCardWidget): ) self.card_UserDocs = HyperlinkCard( url="https://clozya.github.io/AUTOMAA_docs", - text="访问", + text="查看指南", icon=FluentIcon.PAGE_RIGHT, - title="AUTO_MAA官方文档站", + title="用户指南", content="访问AUTO_MAA的官方文档站,获取使用指南和项目相关信息", parent=self, ) diff --git a/resources/version.json b/resources/version.json index a827b60..a074111 100644 --- a/resources/version.json +++ b/resources/version.json @@ -1,8 +1,18 @@ { - "main_version": "4.3.6.1", + "main_version": "4.3.6.2", "updater_version": "1.0.0.0", "announcement": "\n## 新增功能\n- 屏蔽MuMu模拟器开屏广告功能上线\n- 更新器支持多线程下载\n- 添加强制关闭ADB与模拟器等增强任务项\n## 修复BUG\n- 修复统计信息HTML模板公招匹配错误\n- 修复密码显示按钮动画异常\n- 修复`检测到MAA未能实际执行任务`报错被异常屏蔽\n- 修复MAA超时判定异常失效\n## 程序优化\n- 关机等电源操作添加100s倒计时\n- 人工排查弹窗方法优化\n- 人工排查时自动屏蔽静默操作\n- 公告样式优化", "version_info": { + "4.3.6.2": { + "修复BUG": [ + "修复软件窗口最大化异常问题", + "修复异常操作导致窗口离开屏幕后难以复原的问题", + "修正剩余理智关卡文案" + ], + "程序优化": [ + "主窗口显示版本号" + ] + }, "4.3.6.1": { "新增功能": [ "单次自动代理任务中,已完成的子任务在重复执行时不再启用"