mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-15 17:30:27 +08:00
feat: suppress pop-up changelog and announcements
[skip changelog]
This commit is contained in:
@@ -241,6 +241,7 @@ namespace MaaWpfGui.Constants
|
||||
public const string VersionUpdateBody = "VersionUpdate.body";
|
||||
public const string VersionUpdateIsFirstBoot = "VersionUpdate.isfirstboot";
|
||||
public const string VersionUpdatePackage = "VersionUpdate.package";
|
||||
public const string VersionUpdateDoNotShowUpdate = "VersionUpdate.doNotShowUpdate";
|
||||
|
||||
public const string OperBoxData = "OperBox.Data";
|
||||
|
||||
@@ -254,5 +255,6 @@ namespace MaaWpfGui.Constants
|
||||
|
||||
public const string AnnouncementInfo = "Announcement.AnnouncementInfo";
|
||||
public const string DoNotRemindThisAnnouncementAgain = "Announcement.DoNotRemindThisAnnouncementAgain";
|
||||
public const string DoNotShowAnnouncement = "Announcement.DoNotShowAnnouncement";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,21 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
}
|
||||
}
|
||||
|
||||
private bool _doNotShowAnnouncement = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.DoNotShowAnnouncement, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to show the update.
|
||||
/// </summary>
|
||||
public bool DoNotShowAnnouncement
|
||||
{
|
||||
get => _doNotShowAnnouncement;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _doNotShowAnnouncement, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.DoNotShowAnnouncement, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查更新
|
||||
/// </summary>
|
||||
|
||||
@@ -47,6 +47,11 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
return;
|
||||
}
|
||||
|
||||
if (Instances.AnnouncementViewModel.DoNotShowAnnouncement)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_ = Execute.OnUIThreadAsync(() => Instances.WindowManager.ShowWindow(Instances.AnnouncementViewModel));
|
||||
});
|
||||
Instances.VersionUpdateViewModel.ShowUpdateOrDownload();
|
||||
|
||||
@@ -404,6 +404,21 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
Native,
|
||||
}
|
||||
|
||||
private bool _doNotShowUpdate = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.VersionUpdateDoNotShowUpdate, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to show the update.
|
||||
/// </summary>
|
||||
public bool DoNotShowUpdate
|
||||
{
|
||||
get => _doNotShowUpdate;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _doNotShowUpdate, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.VersionUpdateDoNotShowUpdate, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 如果是在更新后第一次启动,显示ReleaseNote弹窗,否则检查更新并下载更新包。
|
||||
/// </summary>
|
||||
@@ -412,7 +427,10 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
if (IsFirstBootAfterUpdate)
|
||||
{
|
||||
IsFirstBootAfterUpdate = false;
|
||||
Instances.WindowManager.ShowWindow(this);
|
||||
if (!DoNotShowUpdate)
|
||||
{
|
||||
Instances.WindowManager.ShowWindow(this);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user