diff --git a/BetterGenshinImpact/Core/Config/AllConfig.cs b/BetterGenshinImpact/Core/Config/AllConfig.cs
index 0a1fee99..2e179c0a 100644
--- a/BetterGenshinImpact/Core/Config/AllConfig.cs
+++ b/BetterGenshinImpact/Core/Config/AllConfig.cs
@@ -33,6 +33,11 @@ namespace BetterGenshinImpact.Core.Config
///
[ObservableProperty] private int _triggerInterval = 50;
+ ///
+ /// 不展示新版本提示的最新版本
+ ///
+ [ObservableProperty] private string _notShowNewVersionNoticeEndVersion = "";
+
///
/// 遮罩窗口配置
///
diff --git a/BetterGenshinImpact/Core/Config/Global.cs b/BetterGenshinImpact/Core/Config/Global.cs
index 54cc98d0..c419893c 100644
--- a/BetterGenshinImpact/Core/Config/Global.cs
+++ b/BetterGenshinImpact/Core/Config/Global.cs
@@ -5,7 +5,7 @@ namespace BetterGenshinImpact.Core.Config;
public class Global
{
- public static string Version = "0.16.0";
+ public static string Version = "0.13.0";
public static string StartUpPath { get; private set; } = AppContext.BaseDirectory;
@@ -26,10 +26,15 @@ public class Global
return null;
}
- public static bool IsNewVersion(string version)
+ public static bool IsNewVersion(string currentVersion)
{
- var currentVersionArr =Version.Split('.');
- var newVersionArr = version.Split('.');
+ return IsNewVersion(Version, currentVersion);
+ }
+
+ public static bool IsNewVersion(string oldVersion, string currentVersion)
+ {
+ var currentVersionArr = oldVersion.Split('.');
+ var newVersionArr = currentVersion.Split('.');
if (currentVersionArr.Length != newVersionArr.Length)
{
return false;
diff --git a/BetterGenshinImpact/ViewModel/MainWindowViewModel.cs b/BetterGenshinImpact/ViewModel/MainWindowViewModel.cs
index 44edb39b..1529a9af 100644
--- a/BetterGenshinImpact/ViewModel/MainWindowViewModel.cs
+++ b/BetterGenshinImpact/ViewModel/MainWindowViewModel.cs
@@ -25,9 +25,12 @@ namespace BetterGenshinImpact.ViewModel
private readonly IConfigService _configService;
public string Title => $"BetterGI · 更好的原神 · {Global.Version}";
+ public AllConfig Config { get; set; }
+
public MainWindowViewModel(INavigationService navigationService, IConfigService configService)
{
_configService = configService;
+ Config = configService.Get();
_logger = App.GetLogger();
}
@@ -69,6 +72,12 @@ namespace BetterGenshinImpact.ViewModel
{
if (Global.IsNewVersion(notice.Version))
{
+ if (!string.IsNullOrEmpty(Config.NotShowNewVersionNoticeEndVersion)
+ && !Global.IsNewVersion(Config.NotShowNewVersionNoticeEndVersion, notice.Version))
+ {
+ return;
+ }
+
await UIDispatcherHelper.Invoke(async () =>
{
var uiMessageBox = new Wpf.Ui.Controls.MessageBox
@@ -76,6 +85,7 @@ namespace BetterGenshinImpact.ViewModel
Title = "更新提示",
Content = $"存在最新版本 {notice.Version},点击确定前往下载页面下载最新版本",
PrimaryButtonText = "确定",
+ SecondaryButtonText = "不再提示",
CloseButtonText = "取消",
};
@@ -84,6 +94,10 @@ namespace BetterGenshinImpact.ViewModel
{
Process.Start(new ProcessStartInfo("https://bgi.huiyadan.com/download.html") { UseShellExecute = true });
}
+ else if (result == Wpf.Ui.Controls.MessageBoxResult.Secondary)
+ {
+ Config.NotShowNewVersionNoticeEndVersion = notice.Version;
+ }
});
}
}
@@ -97,6 +111,5 @@ namespace BetterGenshinImpact.ViewModel
Debug.WriteLine("MainWindowViewModel Closed");
Application.Current.Shutdown();
}
-
}
}
\ No newline at end of file
diff --git a/BetterGenshinImpact/ViewModel/Pages/TaskSettingsPageViewModel.cs b/BetterGenshinImpact/ViewModel/Pages/TaskSettingsPageViewModel.cs
index 31714041..b0cc6f68 100644
--- a/BetterGenshinImpact/ViewModel/Pages/TaskSettingsPageViewModel.cs
+++ b/BetterGenshinImpact/ViewModel/Pages/TaskSettingsPageViewModel.cs
@@ -150,7 +150,7 @@ public partial class TaskSettingsPageViewModel : ObservableObject, INavigationAw
[RelayCommand]
public void OnGoToAutoWoodUrl()
{
- Process.Start(new ProcessStartInfo("https://bgi.huiyadan.com/doc.html#%E8%87%AA%E5%8A%A8%E4%B8%83%E5%9C%A3%E5%8F%AC%E5%94%A4") { UseShellExecute = true });
+ Process.Start(new ProcessStartInfo("https://bgi.huiyadan.com/doc.html#%E8%87%AA%E5%8A%A8%E4%BC%90%E6%9C%A8") { UseShellExecute = true });
}
public static void SetSwitchAutoGeniusInvokationButtonText(bool running)