mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
adjust achievement UI
This commit is contained in:
@@ -645,15 +645,6 @@ namespace Snap.Hutao.Resource.Localization {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 尚未选择任何用户以及角色 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
internal static string ServiceUserAndRoleUnselected {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("ServiceUserAndRoleUnselected", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 多个用户记录为选中状态 的本地化字符串。
|
/// 查找类似 多个用户记录为选中状态 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -979,7 +970,7 @@ namespace Snap.Hutao.Resource.Localization {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 设置实时便笺通知 的本地化字符串。
|
/// 查找类似 实时便笺通知设置 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string ViewDialogDailyNoteNotificationTitle {
|
internal static string ViewDialogDailyNoteNotificationTitle {
|
||||||
get {
|
get {
|
||||||
@@ -1258,7 +1249,7 @@ namespace Snap.Hutao.Resource.Localization {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 该操作是不可逆的,该存档和其内的所有成就状态会丢失。 的本地化字符串。
|
/// 查找类似 该操作是不可逆的,该存档和其内的所有成就状态会丢失 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string ViewModelAchievementRemoveArchiveContent {
|
internal static string ViewModelAchievementRemoveArchiveContent {
|
||||||
get {
|
get {
|
||||||
@@ -1285,7 +1276,7 @@ namespace Snap.Hutao.Resource.Localization {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 角色信息服务 [Enak API] 当前不可用 的本地化字符串。
|
/// 查找类似 角色信息服务 [Enka API] 当前不可用 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string ViewModelAvatarPropertyEnkaApiUnavailable {
|
internal static string ViewModelAvatarPropertyEnkaApiUnavailable {
|
||||||
get {
|
get {
|
||||||
@@ -2293,7 +2284,7 @@ namespace Snap.Hutao.Resource.Localization {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 导入从其他 App 中导出的数据 的本地化字符串。
|
/// 查找类似 导入来自其它 App 的数据 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string ViewPageGachaLogImportDescription {
|
internal static string ViewPageGachaLogImportDescription {
|
||||||
get {
|
get {
|
||||||
@@ -2806,7 +2797,7 @@ namespace Snap.Hutao.Resource.Localization {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 设置当前帧率 的本地化字符串。
|
/// 查找类似 设置帧率上限 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string ViewPageLaunchGameSetFpsHeader {
|
internal static string ViewPageLaunchGameSetFpsHeader {
|
||||||
get {
|
get {
|
||||||
|
|||||||
@@ -312,9 +312,6 @@
|
|||||||
<data name="ServiceMetadataRequestFailed" xml:space="preserve">
|
<data name="ServiceMetadataRequestFailed" xml:space="preserve">
|
||||||
<value>元数据校验文件下载失败</value>
|
<value>元数据校验文件下载失败</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ServiceUserAndRoleUnselected" xml:space="preserve">
|
|
||||||
<value>尚未选择任何用户以及角色</value>
|
|
||||||
</data>
|
|
||||||
<data name="ServiceUserCurrentMultiMatched" xml:space="preserve">
|
<data name="ServiceUserCurrentMultiMatched" xml:space="preserve">
|
||||||
<value>多个用户记录为选中状态</value>
|
<value>多个用户记录为选中状态</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ internal class GachaLogUrlStokenProvider : IGachaLogUrlProvider
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return new(false, SH.ServiceUserAndRoleUnselected);
|
return new(false, SH.MustSelectUserAndUid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
<NavigationView.MenuItems>
|
<NavigationView.MenuItems>
|
||||||
<NavigationViewItem
|
<NavigationViewItem
|
||||||
shvh:NavHelper.NavigateTo="shvp:AnnouncementPage"
|
shvh:NavHelper.NavigateTo="shvp:AnnouncementPage"
|
||||||
Content="{shcm:ResourceString ViewAnnouncementHeader}"
|
Content="{shcm:ResourceString Name=ViewAnnouncementHeader}"
|
||||||
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_BtnIcon_ActivityEntry.png}"/>
|
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_BtnIcon_ActivityEntry.png}"/>
|
||||||
|
|
||||||
<NavigationViewItemHeader Content="{shcm:ResourceString Name=ViewToolHeader}"/>
|
<NavigationViewItemHeader Content="{shcm:ResourceString Name=ViewToolHeader}"/>
|
||||||
|
|||||||
@@ -177,47 +177,49 @@
|
|||||||
CornerRadius="{ThemeResource ControlCornerRadius}">
|
CornerRadius="{ThemeResource ControlCornerRadius}">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
Grid.Column="1"
|
Grid.Column="0"
|
||||||
Margin="6,0,12,0"
|
MinWidth="0"
|
||||||
Padding="16,0,0,0"
|
MinHeight="0"
|
||||||
|
Margin="8,0"
|
||||||
|
Padding="0,0,0,0"
|
||||||
Command="{Binding Path=DataContext.SaveAchievementCommand, Source={StaticResource BindingProxy}}"
|
Command="{Binding Path=DataContext.SaveAchievementCommand, Source={StaticResource BindingProxy}}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
IsChecked="{Binding IsChecked, Mode=TwoWay}"
|
IsChecked="{Binding IsChecked, Mode=TwoWay}"/>
|
||||||
Style="{StaticResource DefaultCheckBoxStyle}">
|
<Grid Grid.Column="1" Margin="8,0,0,0">
|
||||||
<CheckBox.Content>
|
|
||||||
<StackPanel>
|
|
||||||
<TextBlock Text="{Binding Inner.Title}"/>
|
|
||||||
<TextBlock
|
|
||||||
Margin="0,2,0,0"
|
|
||||||
Style="{StaticResource SecondaryTextStyle}"
|
|
||||||
Text="{Binding Inner.Description}"
|
|
||||||
TextTrimming="CharacterEllipsis"/>
|
|
||||||
</StackPanel>
|
|
||||||
</CheckBox.Content>
|
|
||||||
</CheckBox>
|
|
||||||
<Grid Grid.Column="3">
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
|
<!-- text -->
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
<ColumnDefinition/>
|
<!-- time -->
|
||||||
|
<ColumnDefinition Width="auto"/>
|
||||||
|
<!-- pic -->
|
||||||
|
<ColumnDefinition Width="auto"/>
|
||||||
|
<!-- count -->
|
||||||
<ColumnDefinition Width="32"/>
|
<ColumnDefinition Width="32"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{Binding Inner.Title}"/>
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,2,0,0"
|
||||||
|
Style="{StaticResource SecondaryTextStyle}"
|
||||||
|
Text="{Binding Inner.Description}"
|
||||||
|
TextTrimming="CharacterEllipsis"/>
|
||||||
|
</StackPanel>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Column="0"
|
Grid.Column="1"
|
||||||
Margin="12,0,12,0"
|
Margin="12,0,12,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="{Binding Time}"
|
Text="{Binding Time}"
|
||||||
Visibility="{Binding IsChecked, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
Visibility="{Binding IsChecked, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||||
<Image
|
<Image
|
||||||
Grid.Column="1"
|
Grid.Column="2"
|
||||||
Height="32"
|
Height="32"
|
||||||
Source="ms-appx:///Resource/Icon/UI_ItemIcon_201.png"/>
|
Source="ms-appx:///Resource/Icon/UI_ItemIcon_201.png"/>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Column="2"
|
Grid.Column="3"
|
||||||
Margin="12,0,0,0"
|
Margin="12,0,0,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="{Binding Inner.FinishReward.Count}"/>
|
Text="{Binding Inner.FinishReward.Count}"/>
|
||||||
|
|||||||
@@ -175,7 +175,7 @@
|
|||||||
<wsc:Setting
|
<wsc:Setting
|
||||||
Background="{ThemeResource SystemFillColorCriticalBackgroundBrush}"
|
Background="{ThemeResource SystemFillColorCriticalBackgroundBrush}"
|
||||||
Description="{shcm:ResourceString Name=ViewPageSettingDeleteTaskDescription}"
|
Description="{shcm:ResourceString Name=ViewPageSettingDeleteTaskDescription}"
|
||||||
Header="{shcm:ResourceString ViewPageSettingDeleteTaskHeader}"
|
Header="{shcm:ResourceString Name=ViewPageSettingDeleteTaskHeader}"
|
||||||
Icon="">
|
Icon="">
|
||||||
<wsc:Setting.ActionContent>
|
<wsc:Setting.ActionContent>
|
||||||
<Button Command="{Binding Experimental.DeleteAllScheduleTasksCommand}" Content="{shcm:ResourceString Name=ViewPageSettingDangerousAction}"/>
|
<Button Command="{Binding Experimental.DeleteAllScheduleTasksCommand}" Content="{shcm:ResourceString Name=ViewPageSettingDangerousAction}"/>
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ using Snap.Hutao.View.Dialog;
|
|||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using Windows.Storage.Pickers;
|
using Windows.Storage.Pickers;
|
||||||
|
using BindingAchievementGoal = Snap.Hutao.Model.Binding.Achievement.AchievementGoal;
|
||||||
|
using EntityAchievementArchive = Snap.Hutao.Model.Entity.AchievementArchive;
|
||||||
|
using MetadataAchievementGoal = Snap.Hutao.Model.Metadata.Achievement.AchievementGoal;
|
||||||
|
|
||||||
namespace Snap.Hutao.ViewModel;
|
namespace Snap.Hutao.ViewModel;
|
||||||
|
|
||||||
@@ -42,10 +45,10 @@ internal class AchievementViewModel : Abstraction.ViewModel, INavigationRecipien
|
|||||||
private readonly TaskCompletionSource<bool> openUICompletionSource = new();
|
private readonly TaskCompletionSource<bool> openUICompletionSource = new();
|
||||||
|
|
||||||
private AdvancedCollectionView? achievements;
|
private AdvancedCollectionView? achievements;
|
||||||
private List<Model.Binding.Achievement.AchievementGoal>? achievementGoals;
|
private List<BindingAchievementGoal>? achievementGoals;
|
||||||
private Model.Binding.Achievement.AchievementGoal? selectedAchievementGoal;
|
private BindingAchievementGoal? selectedAchievementGoal;
|
||||||
private ObservableCollection<Model.Entity.AchievementArchive>? archives;
|
private ObservableCollection<EntityAchievementArchive>? archives;
|
||||||
private Model.Entity.AchievementArchive? selectedArchive;
|
private EntityAchievementArchive? selectedArchive;
|
||||||
private bool isIncompletedItemsFirst = true;
|
private bool isIncompletedItemsFirst = true;
|
||||||
private string searchText = string.Empty;
|
private string searchText = string.Empty;
|
||||||
private string? finishDescription;
|
private string? finishDescription;
|
||||||
@@ -87,7 +90,7 @@ internal class AchievementViewModel : Abstraction.ViewModel, INavigationRecipien
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 成就存档集合
|
/// 成就存档集合
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ObservableCollection<Model.Entity.AchievementArchive>? Archives
|
public ObservableCollection<EntityAchievementArchive>? Archives
|
||||||
{
|
{
|
||||||
get => archives;
|
get => archives;
|
||||||
set => SetProperty(ref archives, value);
|
set => SetProperty(ref archives, value);
|
||||||
@@ -96,7 +99,7 @@ internal class AchievementViewModel : Abstraction.ViewModel, INavigationRecipien
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 选中的成就存档
|
/// 选中的成就存档
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Model.Entity.AchievementArchive? SelectedArchive
|
public EntityAchievementArchive? SelectedArchive
|
||||||
{
|
{
|
||||||
get => selectedArchive;
|
get => selectedArchive;
|
||||||
set
|
set
|
||||||
@@ -124,7 +127,7 @@ internal class AchievementViewModel : Abstraction.ViewModel, INavigationRecipien
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 成就分类
|
/// 成就分类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<Model.Binding.Achievement.AchievementGoal>? AchievementGoals
|
public List<BindingAchievementGoal>? AchievementGoals
|
||||||
{
|
{
|
||||||
get => achievementGoals;
|
get => achievementGoals;
|
||||||
set => SetProperty(ref achievementGoals, value);
|
set => SetProperty(ref achievementGoals, value);
|
||||||
@@ -133,7 +136,7 @@ internal class AchievementViewModel : Abstraction.ViewModel, INavigationRecipien
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 选中的成就分类
|
/// 选中的成就分类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Model.Binding.Achievement.AchievementGoal? SelectedAchievementGoal
|
public BindingAchievementGoal? SelectedAchievementGoal
|
||||||
{
|
{
|
||||||
get => selectedAchievementGoal;
|
get => selectedAchievementGoal;
|
||||||
set
|
set
|
||||||
@@ -165,7 +168,11 @@ internal class AchievementViewModel : Abstraction.ViewModel, INavigationRecipien
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 完成进度描述
|
/// 完成进度描述
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? FinishDescription { get => finishDescription; set => SetProperty(ref finishDescription, value); }
|
public string? FinishDescription
|
||||||
|
{
|
||||||
|
get => finishDescription;
|
||||||
|
set => SetProperty(ref finishDescription, value);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 打开页面命令
|
/// 打开页面命令
|
||||||
@@ -235,18 +242,18 @@ internal class AchievementViewModel : Abstraction.ViewModel, INavigationRecipien
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<Model.Binding.Achievement.AchievementGoal> sortedGoals;
|
List<BindingAchievementGoal> sortedGoals;
|
||||||
ObservableCollection<Model.Entity.AchievementArchive> archives;
|
ObservableCollection<EntityAchievementArchive> archives;
|
||||||
|
|
||||||
ThrowIfViewDisposed();
|
ThrowIfViewDisposed();
|
||||||
using (await DisposeLock.EnterAsync(CancellationToken).ConfigureAwait(false))
|
using (await DisposeLock.EnterAsync(CancellationToken).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
ThrowIfViewDisposed();
|
ThrowIfViewDisposed();
|
||||||
|
|
||||||
List<Model.Metadata.Achievement.AchievementGoal> goals = await metadataService.GetAchievementGoalsAsync(CancellationToken).ConfigureAwait(false);
|
List<MetadataAchievementGoal> goals = await metadataService.GetAchievementGoalsAsync(CancellationToken).ConfigureAwait(false);
|
||||||
sortedGoals = goals
|
sortedGoals = goals
|
||||||
.OrderBy(goal => goal.Order)
|
.OrderBy(goal => goal.Order)
|
||||||
.Select(goal => new Model.Binding.Achievement.AchievementGoal(goal))
|
.Select(goal => new BindingAchievementGoal(goal))
|
||||||
.ToList();
|
.ToList();
|
||||||
archives = await achievementService.GetArchiveCollectionAsync().ConfigureAwait(false);
|
archives = await achievementService.GetArchiveCollectionAsync().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
@@ -280,7 +287,7 @@ internal class AchievementViewModel : Abstraction.ViewModel, INavigationRecipien
|
|||||||
|
|
||||||
if (isOk)
|
if (isOk)
|
||||||
{
|
{
|
||||||
ArchiveAddResult result = await achievementService.TryAddArchiveAsync(Model.Entity.AchievementArchive.Create(name)).ConfigureAwait(false);
|
ArchiveAddResult result = await achievementService.TryAddArchiveAsync(EntityAchievementArchive.Create(name)).ConfigureAwait(false);
|
||||||
|
|
||||||
switch (result)
|
switch (result)
|
||||||
{
|
{
|
||||||
@@ -450,7 +457,7 @@ internal class AchievementViewModel : Abstraction.ViewModel, INavigationRecipien
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<bool> TryImportUIAFInternalAsync(Model.Entity.AchievementArchive archive, UIAF uiaf)
|
private async Task<bool> TryImportUIAFInternalAsync(EntityAchievementArchive archive, UIAF uiaf)
|
||||||
{
|
{
|
||||||
if (uiaf.IsCurrentVersionSupported())
|
if (uiaf.IsCurrentVersionSupported())
|
||||||
{
|
{
|
||||||
@@ -484,7 +491,7 @@ internal class AchievementViewModel : Abstraction.ViewModel, INavigationRecipien
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private async Task UpdateAchievementsAsync(Model.Entity.AchievementArchive archive)
|
private async Task UpdateAchievementsAsync(EntityAchievementArchive archive)
|
||||||
{
|
{
|
||||||
List<Model.Metadata.Achievement.Achievement> rawAchievements = await metadataService.GetAchievementsAsync(CancellationToken).ConfigureAwait(false);
|
List<Model.Metadata.Achievement.Achievement> rawAchievements = await metadataService.GetAchievementsAsync(CancellationToken).ConfigureAwait(false);
|
||||||
List<Model.Binding.Achievement.Achievement> combined;
|
List<Model.Binding.Achievement.Achievement> combined;
|
||||||
@@ -523,7 +530,7 @@ internal class AchievementViewModel : Abstraction.ViewModel, INavigationRecipien
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateAchievementsFilter(Model.Binding.Achievement.AchievementGoal? goal)
|
private void UpdateAchievementsFilter(BindingAchievementGoal? goal)
|
||||||
{
|
{
|
||||||
if (Achievements != null)
|
if (Achievements != null)
|
||||||
{
|
{
|
||||||
@@ -572,11 +579,11 @@ internal class AchievementViewModel : Abstraction.ViewModel, INavigationRecipien
|
|||||||
|
|
||||||
private struct GoalAggregation
|
private struct GoalAggregation
|
||||||
{
|
{
|
||||||
public readonly Model.Binding.Achievement.AchievementGoal AchievementGoal;
|
public readonly BindingAchievementGoal AchievementGoal;
|
||||||
public int Finished;
|
public int Finished;
|
||||||
public int Count;
|
public int Count;
|
||||||
|
|
||||||
public GoalAggregation(Model.Binding.Achievement.AchievementGoal goal)
|
public GoalAggregation(BindingAchievementGoal goal)
|
||||||
{
|
{
|
||||||
AchievementGoal = goal;
|
AchievementGoal = goal;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user