Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11d5ba385f | ||
|
|
dc1fc52c33 | ||
|
|
6b37ba0ce3 | ||
| 23b3691a13 | |||
|
|
0755d34903 |
@@ -176,13 +176,8 @@ func compareVersions(v1, v2 string) int {
|
||||
parts1 := parseVersionParts(v1)
|
||||
parts2 := parseVersionParts(v2)
|
||||
|
||||
// 比较每个组件
|
||||
maxLen := len(parts1)
|
||||
if len(parts2) > maxLen {
|
||||
maxLen = len(parts2)
|
||||
}
|
||||
|
||||
for i := 0; i < maxLen; i++ {
|
||||
// 比较前三个组件 (major.minor.patch)
|
||||
for i := 0; i < 3; i++ {
|
||||
var p1, p2 int
|
||||
if i < len(parts1) {
|
||||
p1 = parts1[i]
|
||||
@@ -198,6 +193,32 @@ func compareVersions(v1, v2 string) int {
|
||||
}
|
||||
}
|
||||
|
||||
// 如果前三个组件相同,比较beta版本号
|
||||
var beta1, beta2 int
|
||||
if len(parts1) > 3 {
|
||||
beta1 = parts1[3]
|
||||
}
|
||||
if len(parts2) > 3 {
|
||||
beta2 = parts2[3]
|
||||
}
|
||||
|
||||
// 特殊处理beta版本比较:
|
||||
// - 如果一个是正式版(beta=0),另一个是beta版(beta>0),正式版更新
|
||||
// - 如果都是beta版,比较beta版本号
|
||||
if beta1 == 0 && beta2 > 0 {
|
||||
return 1 // 正式版比beta版更新
|
||||
}
|
||||
if beta1 > 0 && beta2 == 0 {
|
||||
return -1 // beta版比正式版旧
|
||||
}
|
||||
|
||||
// 都是正式版或都是beta版,直接比较
|
||||
if beta1 < beta2 {
|
||||
return -1
|
||||
} else if beta1 > beta2 {
|
||||
return 1
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -265,6 +286,7 @@ func parseVersionParts(version string) []int {
|
||||
break
|
||||
}
|
||||
}
|
||||
// Beta版本号保持正数,但在比较时会特殊处理
|
||||
parts = append(parts, betaNum)
|
||||
} else {
|
||||
// 非beta版本,添加0作为beta版本号
|
||||
|
||||
@@ -563,7 +563,7 @@ func (app *Application) executeCheckingState() (UpdateState, error) {
|
||||
default:
|
||||
fmt.Printf("检查更新类别:%v\n", updateChannel)
|
||||
}
|
||||
fmt.Printf("当前版本:%v\n", currentVer)
|
||||
fmt.Printf("当前版本:%s\n", app.formatVersionForDisplay(currentVer))
|
||||
app.logger.Info("当前更新类别:" + updateChannel + ";当前版本:" + currentVer)
|
||||
if err != nil {
|
||||
app.logger.Error("检查更新失败: %v", err)
|
||||
@@ -599,7 +599,7 @@ func (app *Application) executeCheckingState() (UpdateState, error) {
|
||||
}
|
||||
|
||||
app.logger.Info("有可用更新: %s -> %s", currentVer, response.Data.VersionName)
|
||||
fmt.Printf("发现新版本: %s -> %s\n", currentVer, response.Data.VersionName)
|
||||
fmt.Printf("发现新版本: %s -> %s\n", app.formatVersionForDisplay(currentVer), response.Data.VersionName)
|
||||
|
||||
return StateUpdateAvailable, nil
|
||||
}
|
||||
@@ -813,6 +813,20 @@ func (app *Application) formatBytes(bytes int64) string {
|
||||
return fmt.Sprintf("%.1f %cB", float64(bytes)/float64(div), "KMGTPE"[exp])
|
||||
}
|
||||
|
||||
// formatVersionForDisplay 将版本格式转换为用户友好的显示格式
|
||||
// 例如: "4.4.1.3" -> "4.4.1-beta3", "4.4.1.0" -> "4.4.1"
|
||||
func (app *Application) formatVersionForDisplay(version string) string {
|
||||
// 尝试解析版本
|
||||
parsedVersion, err := appversion.ParseVersion(version)
|
||||
if err != nil {
|
||||
// 如果解析失败,返回原始版本
|
||||
return version
|
||||
}
|
||||
|
||||
// 使用 ToDisplayVersion 方法转换为显示格式
|
||||
return parsedVersion.ToDisplayVersion()
|
||||
}
|
||||
|
||||
// handleUserInteraction 处理 GUI 模式的用户交互
|
||||
func (app *Application) handleUserInteraction(action string) {
|
||||
switch action {
|
||||
|
||||
@@ -147,12 +147,12 @@ func (pv *ParsedVersion) ToVersionString() string {
|
||||
return fmt.Sprintf("%d.%d.%d.%d", pv.Major, pv.Minor, pv.Patch, pv.Beta)
|
||||
}
|
||||
|
||||
// ToDisplayVersion 将版本转换为显示格式 (v4.4.0 或 v4.4.1-beta3)
|
||||
// ToDisplayVersion 将版本转换为显示格式 (4.4.0 或 4.4.1-beta3)
|
||||
func (pv *ParsedVersion) ToDisplayVersion() string {
|
||||
if pv.Beta == 0 {
|
||||
return fmt.Sprintf("v%d.%d.%d", pv.Major, pv.Minor, pv.Patch)
|
||||
return fmt.Sprintf("%d.%d.%d", pv.Major, pv.Minor, pv.Patch)
|
||||
}
|
||||
return fmt.Sprintf("v%d.%d.%d-beta%d", pv.Major, pv.Minor, pv.Patch, pv.Beta)
|
||||
return fmt.Sprintf("%d.%d.%d-beta%d", pv.Major, pv.Minor, pv.Patch, pv.Beta)
|
||||
}
|
||||
|
||||
// GetChannel 根据版本返回渠道 (stable 或 beta)
|
||||
@@ -174,5 +174,16 @@ func (pv *ParsedVersion) IsNewer(other *ParsedVersion) bool {
|
||||
if pv.Patch != other.Patch {
|
||||
return pv.Patch > other.Patch
|
||||
}
|
||||
|
||||
// 对于相同的主版本号,正式版本(Beta=0)比beta版本(Beta>0)更新
|
||||
// 例如:4.4.1.0(正式版)> 4.4.1.3(beta3)
|
||||
if pv.Beta == 0 && other.Beta > 0 {
|
||||
return true // 正式版比beta版更新
|
||||
}
|
||||
if pv.Beta > 0 && other.Beta == 0 {
|
||||
return false // beta版比正式版旧
|
||||
}
|
||||
|
||||
// 如果都是beta版本,比较beta版本号
|
||||
return pv.Beta > other.Beta
|
||||
}
|
||||
|
||||
@@ -704,7 +704,7 @@ class GeneralSubConfig(LQConfig):
|
||||
|
||||
class AppConfig(GlobalConfig):
|
||||
|
||||
VERSION = "4.4.1.0"
|
||||
VERSION = "4.4.3.0"
|
||||
|
||||
stage_refreshed = Signal()
|
||||
PASSWORD_refreshed = Signal()
|
||||
|
||||
@@ -1232,12 +1232,12 @@ class MaaManager(QObject):
|
||||
"自动代理_日常": "RoutineTimeLimit",
|
||||
}
|
||||
|
||||
if self.log_check_mode == "自动代理_剿灭" and "剿灭任务失败" in log:
|
||||
if self.log_check_mode == "自动代理_剿灭" and "任务出错: 刷理智" in log:
|
||||
self.weekly_annihilation_limit_reached = True
|
||||
else:
|
||||
self.weekly_annihilation_limit_reached = False
|
||||
|
||||
if "任务出错: StartUp" in log:
|
||||
if "任务出错: StartUp" in log or "任务出错: 开始唤醒" in log:
|
||||
self.maa_result = "MAA未能正确登录PRTS"
|
||||
|
||||
elif "任务已全部完成!" in log:
|
||||
@@ -1251,7 +1251,10 @@ class MaaManager(QObject):
|
||||
if (
|
||||
"完成任务: Fight" in log
|
||||
or "完成任务: 刷理智" in log
|
||||
or "剿灭任务失败" in log
|
||||
or (
|
||||
self.log_check_mode == "自动代理_剿灭"
|
||||
and "任务出错: 刷理智" in log
|
||||
)
|
||||
):
|
||||
self.task_dict["Combat"] = "False"
|
||||
if "完成任务: Mall" in log or "完成任务: 获取信用及购物" in log:
|
||||
|
||||
@@ -281,9 +281,9 @@ class NoticeMessageBox(MessageBoxBase):
|
||||
super().__init__(parent)
|
||||
self.setTitle(title)
|
||||
|
||||
self.Layout = QVBoxLayout()
|
||||
self.viewLayout.addLayout(self.Layout)
|
||||
self.viewLayout.setContentsMargins(3, 0, 3, 3)
|
||||
content_widget = QWidget()
|
||||
self.Layout = QVBoxLayout(content_widget)
|
||||
self.Layout.setContentsMargins(0, 0, 11, 0)
|
||||
|
||||
self.index_cards: List[QuantifiedItemCard] = []
|
||||
|
||||
@@ -301,6 +301,16 @@ class NoticeMessageBox(MessageBoxBase):
|
||||
|
||||
self.Layout.addStretch(1)
|
||||
|
||||
scrollArea = ScrollArea()
|
||||
scrollArea.setWidgetResizable(True)
|
||||
scrollArea.setContentsMargins(0, 0, 0, 0)
|
||||
scrollArea.setStyleSheet("background: transparent; border: none;")
|
||||
scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||
scrollArea.setWidget(content_widget)
|
||||
|
||||
self.viewLayout.addWidget(scrollArea)
|
||||
self.viewLayout.setContentsMargins(3, 0, 3, 3)
|
||||
|
||||
|
||||
class SettingFlyoutView(FlyoutViewBase):
|
||||
"""设置卡二级菜单弹出组件"""
|
||||
|
||||
@@ -41,7 +41,7 @@ from qfluentwidgets import (
|
||||
ZhDatePicker,
|
||||
SubtitleLabel,
|
||||
)
|
||||
from PySide6.QtCore import Signal, QDate
|
||||
from PySide6.QtCore import Signal, QDate, Qt
|
||||
import os
|
||||
import subprocess
|
||||
from datetime import datetime, timedelta
|
||||
@@ -330,10 +330,11 @@ class History(QWidget):
|
||||
def __init__(self, history_list: List[Path], parent=None):
|
||||
super().__init__(parent)
|
||||
self.setTitle("记录条目")
|
||||
self.setFixedHeight(500)
|
||||
|
||||
self.Layout = QVBoxLayout()
|
||||
self.viewLayout.addLayout(self.Layout)
|
||||
self.viewLayout.setContentsMargins(3, 0, 3, 3)
|
||||
content_widget = QWidget()
|
||||
self.Layout = QVBoxLayout(content_widget)
|
||||
self.Layout.setContentsMargins(0, 0, 11, 0)
|
||||
|
||||
self.index_cards: List[StatefulItemCard] = []
|
||||
|
||||
@@ -352,16 +353,27 @@ class History(QWidget):
|
||||
|
||||
self.Layout.addStretch(1)
|
||||
|
||||
scrollArea = ScrollArea()
|
||||
scrollArea.setWidgetResizable(True)
|
||||
scrollArea.setContentsMargins(0, 0, 0, 0)
|
||||
scrollArea.setStyleSheet("background: transparent; border: none;")
|
||||
scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||
scrollArea.setWidget(content_widget)
|
||||
|
||||
self.viewLayout.addWidget(scrollArea)
|
||||
self.viewLayout.setContentsMargins(3, 0, 3, 3)
|
||||
|
||||
class StatisticsCard(HeaderCardWidget):
|
||||
"""历史记录统计信息卡片组"""
|
||||
|
||||
def __init__(self, name: str, item_list: list, parent=None):
|
||||
super().__init__(parent)
|
||||
self.setTitle(name)
|
||||
self.setFixedHeight(500)
|
||||
|
||||
self.Layout = QVBoxLayout()
|
||||
self.viewLayout.addLayout(self.Layout)
|
||||
self.viewLayout.setContentsMargins(3, 0, 3, 3)
|
||||
content_widget = QWidget()
|
||||
self.Layout = QVBoxLayout(content_widget)
|
||||
self.Layout.setContentsMargins(0, 0, 11, 0)
|
||||
|
||||
self.item_cards: List[QuantifiedItemCard] = []
|
||||
|
||||
@@ -375,12 +387,23 @@ class History(QWidget):
|
||||
|
||||
self.Layout.addStretch(1)
|
||||
|
||||
scrollArea = ScrollArea()
|
||||
scrollArea.setWidgetResizable(True)
|
||||
scrollArea.setContentsMargins(0, 0, 0, 0)
|
||||
scrollArea.setStyleSheet("background: transparent; border: none;")
|
||||
scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||
scrollArea.setWidget(content_widget)
|
||||
|
||||
self.viewLayout.addWidget(scrollArea)
|
||||
self.viewLayout.setContentsMargins(3, 0, 3, 3)
|
||||
|
||||
class LogCard(HeaderCardWidget):
|
||||
"""历史记录日志卡片"""
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
self.setTitle("日志")
|
||||
self.setFixedHeight(500)
|
||||
|
||||
self.text = TextBrowser(self)
|
||||
self.open_file = PushButton("打开日志文件", self)
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
{
|
||||
"main_version": "4.4.1.0",
|
||||
"main_version": "4.4.3.0",
|
||||
"version_info": {
|
||||
"4.4.3.0": {
|
||||
"修复BUG": [
|
||||
"适配 MAA 剿灭关卡任务出错日志"
|
||||
]
|
||||
},
|
||||
"4.4.2.0": {
|
||||
"修复BUG": [
|
||||
"修复独立更新器版本号比对问题",
|
||||
"修复 MAA 开始唤醒识别错误问题"
|
||||
],
|
||||
"程序优化": [
|
||||
"历史记录显示效果优化"
|
||||
]
|
||||
},
|
||||
"4.4.1.0": {
|
||||
"新增功能": [
|
||||
"启动时支持直接运行复数调度队列"
|
||||
|
||||
Reference in New Issue
Block a user