chore: 隐藏未解锁的隐藏成就

This commit is contained in:
uye
2025-06-04 16:32:03 +08:00
parent f6d17f98ec
commit ce07929aff
3 changed files with 16 additions and 8 deletions

View File

@@ -35,9 +35,6 @@
"ScheduleMaster2": {
"Id": "ScheduleMaster2"
},
"Irreplaceable": {
"Id": "Irreplaceable"
},
"UseCopilot1": {
"Id": "UseCopilot1"
},
@@ -80,6 +77,9 @@
"PioneerSuperTest": {
"Id": "PioneerSuperTest"
},
"Irreplaceable": {
"Id": "Irreplaceable"
},
"MapOutdated": {
"Id": "MapOutdated"
},

View File

@@ -36,9 +36,19 @@ namespace MaaWpfGui.Helper
set
{
SetAndNotify(ref _achievements, value);
NotifyOfPropertyChange(nameof(UnlockedCount));
NotifyOfPropertyChange(nameof(VisibleAchievements));
}
}
// 已解锁及非隐藏的未解锁成就
public Dictionary<string, Achievement> VisibleAchievements
{
get => Achievements
.Where(kv => kv.Value.IsUnlocked || !kv.Value.IsHidden)
.ToDictionary(kv => kv.Key, kv => kv.Value);
}
public int UnlockedCount => Achievements.Count(a => a.Value.IsUnlocked);
public static AchievementTrackerHelper Instance { get; } = new();
@@ -130,8 +140,6 @@ namespace MaaWpfGui.Helper
achievement.IsNewUnlock = true;
Save();
NotifyOfPropertyChange(nameof(UnlockedCount));
var growlInfo = new GrowlInfo
{
IsCustom = true,
@@ -318,7 +326,7 @@ namespace MaaWpfGui.Helper
AutoBattle(id: AchievementIds.UseCopilot3, target: 100),
AutoBattle(id: AchievementIds.MapOutdated, isHidden: true), // 提示需要更新地图资源
AutoBattle(id: AchievementIds.Irreplaceable), // 自动编队缺少至少两名干员
AutoBattle(id: AchievementIds.Irreplaceable, isHidden: true), // 自动编队缺少至少两名干员
#endregion
#region 搞笑/梗类成就

View File

@@ -11,13 +11,13 @@
MinWidth="250">
<Grid>
<ListBox
ItemsSource="{Binding Achievements.Values, Source={x:Static helper:AchievementTrackerHelper.Instance}}"
ItemsSource="{Binding VisibleAchievements.Values, Source={x:Static helper:AchievementTrackerHelper.Instance}}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
Style="{DynamicResource NoSelectedHighlightListBoxStyle}"
VirtualizingPanel.ScrollUnit="Pixel">
<ListBox.ItemTemplate>
<DataTemplate>
<VirtualizingStackPanel Orientation="Horizontal">
<VirtualizingStackPanel Orientation="Horizontal" Visibility="{c:Binding 'IsUnlocked or !IsHidden'}">
<Path
Width="40"
Height="40"