feat: 成就通知自动关闭选项

代替右键清空

link to #13343, #13323, #13345
This commit is contained in:
Sakurapainting
2025-07-24 11:12:34 +08:00
committed by status102
parent 76f46837f8
commit 777e10ea1f
9 changed files with 30 additions and 3 deletions

View File

@@ -322,6 +322,8 @@ namespace MaaWpfGui.Constants
public const string MiniGameTaskName = "MiniGame.TaskName";
public const string AchievementBubbleAutoClose = "Achievement.BubbleAutoClose";
// public const string AnnouncementInfo = "Announcement.AnnouncementInfo";// 已迁移
// public const string DoNotRemindThisAnnouncementAgain = "Announcement.DoNotRemindThisAnnouncementAgain";// 已迁移
// public const string DoNotShowAnnouncement = "Announcement.DoNotShowAnnouncement";// 已迁移

View File

@@ -189,7 +189,8 @@ namespace MaaWpfGui.Helper
{
IsCustom = true,
Message = $"{LocalizationHelper.GetString("AchievementCelebrate")}: {achievement.Title}\n{achievement.Description}",
StaysOpen = staysOpen,
StaysOpen = staysOpen && !SettingsViewModel.AchievementSettings.AchievementBubbleAutoClose,
WaitTime = 15,
IconKey = "HangoverGeometry",
IconBrushKey = achievement.MedalBrushKey,
};

View File

@@ -1133,6 +1133,7 @@ If you want to run multiple MAA at the same time, please copy the whole MAA and
<system:String x:Key="AchievementBackupSuccess">Backed up to</system:String>
<system:String x:Key="AchievementRestoreSuccess">Achievement progress restored</system:String>
<system:String x:Key="AchievementRestoreFailed">Restore failed, invalid file format</system:String>
<system:String x:Key="AchievementBubbleAutoClose">Achievement bubble will disappear after a short time</system:String>
<system:String x:Key="Achievement.SanitySpender1.Title">Tactical Practice</system:String>
<system:String x:Key="Achievement.SanitySpender1.Description">You've got the hang of it</system:String>

View File

@@ -1133,6 +1133,7 @@ MAA を複数開くには、新しい MAA を他のフォルダにコピーし
<system:String x:Key="AchievementBackupSuccess">バックアップした</system:String>
<system:String x:Key="AchievementRestoreSuccess">実績の進捗が復元されました</system:String>
<system:String x:Key="AchievementRestoreFailed">復元に失敗しました、ファイル形式が無効です</system:String>
<system:String x:Key="AchievementBubbleAutoClose">実績バブルはしばらくすると自動的に消えます</system:String>
<system:String x:Key="Achievement.SanitySpender1.Title">戦術実戦</system:String>
<system:String x:Key="Achievement.SanitySpender1.Description">あなたはすでに始めました。</system:String>

View File

@@ -1130,6 +1130,7 @@ Microsoft Visual C++ redistributable 2015-2022(x64) 가 설치되지 않았거
<system:String x:Key="AchievementBackupSuccess">백업 완료</system:String>
<system:String x:Key="AchievementRestoreSuccess">도전과제 진행도 복원 완료</system:String>
<system:String x:Key="AchievementRestoreFailed">복원 실패, 파일 형식이 유효하지 않음</system:String>
<system:String x:Key="AchievementBubbleAutoClose">업적 알림이 잠시 후 자동으로 사라집니다</system:String>
<system:String x:Key="Achievement.SanitySpender1.Title">뉴비</system:String>
<system:String x:Key="Achievement.SanitySpender1.Description">이제 감이 잡혔네요</system:String>

View File

@@ -1133,6 +1133,7 @@ C:\\leidian\\LDPlayer9。\n
<system:String x:Key="AchievementBackupSuccess">已备份到</system:String>
<system:String x:Key="AchievementRestoreSuccess">已恢复成就进度</system:String>
<system:String x:Key="AchievementRestoreFailed">恢复失败,文件格式无效</system:String>
<system:String x:Key="AchievementBubbleAutoClose">成就气泡弹出后一段时间消失</system:String>
<system:String x:Key="Achievement.SanitySpender1.Title">战术实战</system:String>
<system:String x:Key="Achievement.SanitySpender1.Description">你已经上手了。</system:String>

View File

@@ -1132,6 +1132,7 @@ C:\\leidian\\LDPlayer9。\n
<system:String x:Key="AchievementBackupSuccess">已備份到</system:String>
<system:String x:Key="AchievementRestoreSuccess">已恢復成就進度</system:String>
<system:String x:Key="AchievementRestoreFailed">恢復失敗,檔格式無效</system:String>
<system:String x:Key="AchievementBubbleAutoClose">成就氣泡彈出後一段時間消失</system:String>
<system:String x:Key="Achievement.SanitySpender1.Title">戰術實戰</system:String>
<system:String x:Key="Achievement.SanitySpender1.Description">你已經上手了。</system:String>

View File

@@ -15,11 +15,11 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Media;
using HandyControl.Controls;
using HandyControl.Data;
using MaaWpfGui.Constants;
using MaaWpfGui.Helper;
using MaaWpfGui.Models;
using MaaWpfGui.Views.UI;
@@ -207,4 +207,19 @@ public class AchievementSettingsUserControlModel : PropertyChangedBase
{
AchievementTrackerHelper.Instance.LockAll();
}
private bool _achievementBubbleAutoClose = ConfigurationHelper.GetValue(ConfigurationKeys.AchievementBubbleAutoClose, false);
/// <summary>
/// Gets or sets a value indicating whether achievement bubbles should auto-close after some time.
/// </summary>
public bool AchievementBubbleAutoClose
{
get => _achievementBubbleAutoClose;
set
{
SetAndNotify(ref _achievementBubbleAutoClose, value);
ConfigurationHelper.SetValue(ConfigurationKeys.AchievementBubbleAutoClose, value.ToString());
}
}
}

View File

@@ -51,7 +51,11 @@
Fill="{Binding MedalBrush}"
Stretch="Uniform" />
</Border>
<CheckBox
Margin="5"
HorizontalAlignment="Center"
Content="{DynamicResource AchievementBubbleAutoClose}"
IsChecked="{Binding AchievementBubbleAutoClose}" />
<StackPanel HorizontalAlignment="Center" Visibility="{c:Binding IsDebugVersion}">
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<Button