diff --git a/src/Snap.Hutao/Snap.Hutao/Core/LifeCycle/Activation.cs b/src/Snap.Hutao/Snap.Hutao/Core/LifeCycle/Activation.cs
index e2f91506..6dcd3e29 100644
--- a/src/Snap.Hutao/Snap.Hutao/Core/LifeCycle/Activation.cs
+++ b/src/Snap.Hutao/Snap.Hutao/Core/LifeCycle/Activation.cs
@@ -10,6 +10,7 @@ using Snap.Hutao.Service.Abstraction;
using Snap.Hutao.Service.DailyNote;
using Snap.Hutao.Service.Metadata;
using Snap.Hutao.Service.Navigation;
+using System.Diagnostics;
using System.Security.Principal;
namespace Snap.Hutao.Core.LifeCycle;
@@ -220,7 +221,7 @@ internal static class Activation
if (!isRedirected)
{
// It's a direct open process, should exit immediately.
- Environment.Exit(0);
+ Process.GetCurrentProcess().Kill();
}
break;
diff --git a/src/Snap.Hutao/Snap.Hutao/Core/Setting/StaticResource.cs b/src/Snap.Hutao/Snap.Hutao/Core/Setting/StaticResource.cs
index 4791a3e9..3e0dd7ad 100644
--- a/src/Snap.Hutao/Snap.Hutao/Core/Setting/StaticResource.cs
+++ b/src/Snap.Hutao/Snap.Hutao/Core/Setting/StaticResource.cs
@@ -13,10 +13,15 @@ internal static class StaticResource
///
public static void FulfillAllContracts()
{
- LocalSetting.Set(SettingKeys.StaticResourceV1Contract, true);
- LocalSetting.Set(SettingKeys.StaticResourceV2Contract, true);
- LocalSetting.Set(SettingKeys.StaticResourceV3Contract, true);
- LocalSetting.Set(SettingKeys.StaticResourceV4Contract, true);
+ SetContractsState(true);
+ }
+
+ ///
+ /// 完成所有合约
+ ///
+ public static void UnfulfillAllContracts()
+ {
+ SetContractsState(false);
}
///
@@ -40,4 +45,12 @@ internal static class StaticResource
|| (!LocalSetting.Get(SettingKeys.StaticResourceV3Contract, false))
|| (!LocalSetting.Get(SettingKeys.StaticResourceV4Contract, false));
}
+
+ private static void SetContractsState(bool state)
+ {
+ LocalSetting.Set(SettingKeys.StaticResourceV1Contract, state);
+ LocalSetting.Set(SettingKeys.StaticResourceV2Contract, state);
+ LocalSetting.Set(SettingKeys.StaticResourceV3Contract, state);
+ LocalSetting.Set(SettingKeys.StaticResourceV4Contract, state);
+ }
}
\ No newline at end of file
diff --git a/src/Snap.Hutao/Snap.Hutao/Model/Binding/AvatarProperty/Avatar.cs b/src/Snap.Hutao/Snap.Hutao/Model/Binding/AvatarProperty/Avatar.cs
index 5d325886..1b016d9d 100644
--- a/src/Snap.Hutao/Snap.Hutao/Model/Binding/AvatarProperty/Avatar.cs
+++ b/src/Snap.Hutao/Snap.Hutao/Model/Binding/AvatarProperty/Avatar.cs
@@ -46,7 +46,7 @@ public class Avatar : ICalculableSource
///
/// 等级
///
- public string Level { get; set; } = default!;
+ public string Level { get => $"Lv.{LevelNumber}"; }
///
/// 武器
@@ -63,6 +63,11 @@ public class Avatar : ICalculableSource
///
public List Constellations { get; set; } = default!;
+ ///
+ /// 激活的命之座个数
+ ///
+ public int ActivatedConstellationCount { get => Constellations.Where(c => c.IsActivated).Count(); }
+
///
/// 技能列表
///
diff --git a/src/Snap.Hutao/Snap.Hutao/Model/Binding/AvatarProperty/Skill.cs b/src/Snap.Hutao/Snap.Hutao/Model/Binding/AvatarProperty/Skill.cs
index 8bf76de3..9003de77 100644
--- a/src/Snap.Hutao/Snap.Hutao/Model/Binding/AvatarProperty/Skill.cs
+++ b/src/Snap.Hutao/Snap.Hutao/Model/Binding/AvatarProperty/Skill.cs
@@ -17,16 +17,21 @@ public class Skill : NameIconDescription, ICalculableSource
///
public LevelParam Info { get; set; } = default!;
+ ///
+ /// 不计算命座的技能等级
+ ///
+ public int LevelNumber { get; set; }
+
+ ///
+ /// 不计算命座的技能等级字符串
+ ///
+ public string Level { get => $"Lv.{LevelNumber}"; }
+
///
/// 技能组Id
///
internal int GroupId { get; set; }
- ///
- /// 技能等级,仅用于养成计算
- ///
- internal int LevelNumber { get; set; }
-
///
public ICalculableSkill ToCalculable()
{
diff --git a/src/Snap.Hutao/Snap.Hutao/Model/Binding/AvatarProperty/Weapon.cs b/src/Snap.Hutao/Snap.Hutao/Model/Binding/AvatarProperty/Weapon.cs
index b20d8758..f4db3d6b 100644
--- a/src/Snap.Hutao/Snap.Hutao/Model/Binding/AvatarProperty/Weapon.cs
+++ b/src/Snap.Hutao/Snap.Hutao/Model/Binding/AvatarProperty/Weapon.cs
@@ -17,10 +17,15 @@ public class Weapon : EquipBase, ICalculableSource
///
public Pair SubProperty { get; set; } = default!;
+ ///
+ /// 精炼等级
+ ///
+ public int AffixLevelNumber { get; set; }
+
///
/// 精炼属性
///
- public string AffixLevel { get; set; } = default!;
+ public string AffixLevel { get => string.Format(SH.ModelBindingAvatarPropertyWeaponAffixFormat, AffixLevelNumber); }
///
/// 精炼名称
diff --git a/src/Snap.Hutao/Snap.Hutao/Program.cs b/src/Snap.Hutao/Snap.Hutao/Program.cs
index dcbb1de3..324b75d9 100644
--- a/src/Snap.Hutao/Snap.Hutao/Program.cs
+++ b/src/Snap.Hutao/Snap.Hutao/Program.cs
@@ -34,8 +34,6 @@ public static partial class Program
Application.Start(InitializeApp);
Control.ScopedPage.DisposePreviousScope();
}
-
- AppInstance.GetCurrent().UnregisterKey();
}
private static void InitializeApp(ApplicationInitializationCallbackParams param)
diff --git a/src/Snap.Hutao/Snap.Hutao/Resource/Localization/SH.Designer.cs b/src/Snap.Hutao/Snap.Hutao/Resource/Localization/SH.Designer.cs
index 8b71a4e4..c61f7c3a 100644
--- a/src/Snap.Hutao/Snap.Hutao/Resource/Localization/SH.Designer.cs
+++ b/src/Snap.Hutao/Snap.Hutao/Resource/Localization/SH.Designer.cs
@@ -276,6 +276,15 @@ namespace Snap.Hutao.Resource.Localization {
}
}
+ ///
+ /// 查找类似 精炼 {0} 的本地化字符串。
+ ///
+ internal static string ModelBindingAvatarPropertyWeaponAffixFormat {
+ get {
+ return ResourceManager.GetString("ModelBindingAvatarPropertyWeaponAffixFormat", resourceCulture);
+ }
+ }
+
///
/// 查找类似 周一/周四/周日 的本地化字符串。
///
@@ -2130,6 +2139,24 @@ namespace Snap.Hutao.Resource.Localization {
}
}
+ ///
+ /// 查找类似 详细数据 的本地化字符串。
+ ///
+ internal static string ViewPageAvatarPropertyPivotDetailHeader {
+ get {
+ return ResourceManager.GetString("ViewPageAvatarPropertyPivotDetailHeader", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 总览数据 的本地化字符串。
+ ///
+ internal static string ViewPageAvatarPropertyPivotOverviewHeader {
+ get {
+ return ResourceManager.GetString("ViewPageAvatarPropertyPivotOverviewHeader", resourceCulture);
+ }
+ }
+
///
/// 查找类似 初始词条 的本地化字符串。
///
@@ -3444,6 +3471,42 @@ namespace Snap.Hutao.Resource.Localization {
}
}
+ ///
+ /// 查找类似 重置 的本地化字符串。
+ ///
+ internal static string ViewPageSettingResetAction {
+ get {
+ return ResourceManager.GetString("ViewPageSettingResetAction", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 下次启动时会重新下载所有图像资源 的本地化字符串。
+ ///
+ internal static string ViewPageSettingResetStaticResourceDescription {
+ get {
+ return ResourceManager.GetString("ViewPageSettingResetStaticResourceDescription", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 重置图片资源 的本地化字符串。
+ ///
+ internal static string ViewPageSettingResetStaticResourceHeader {
+ get {
+ return ResourceManager.GetString("ViewPageSettingResetStaticResourceHeader", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 重置成功 的本地化字符串。
+ ///
+ internal static string ViewPageSettingResetSuccessMessage {
+ get {
+ return ResourceManager.GetString("ViewPageSettingResetSuccessMessage", resourceCulture);
+ }
+ }
+
///
/// 查找类似 更改目录后需要手动移动目录内的数据,否则会重新创建用户数据 的本地化字符串。
///
diff --git a/src/Snap.Hutao/Snap.Hutao/Resource/Localization/SH.resx b/src/Snap.Hutao/Snap.Hutao/Resource/Localization/SH.resx
index 5e5b8880..f8985fa1 100644
--- a/src/Snap.Hutao/Snap.Hutao/Resource/Localization/SH.resx
+++ b/src/Snap.Hutao/Snap.Hutao/Resource/Localization/SH.resx
@@ -189,6 +189,9 @@
选择账号并启动
+
+ 精炼 {0}
+
周一/周四/周日
@@ -807,6 +810,12 @@
角色属性
+
+ 详细数据
+
+
+ 总览数据
+
初始词条
@@ -1245,6 +1254,18 @@
游戏
+
+ 重置
+
+
+ 下次启动时会重新下载所有图像资源
+
+
+ 重置图片资源
+
+
+ 重置成功
+
更改目录后需要手动移动目录内的数据,否则会重新创建用户数据
diff --git a/src/Snap.Hutao/Snap.Hutao/Service/AvatarInfo/Factory/SummaryAvatarFactory.cs b/src/Snap.Hutao/Snap.Hutao/Service/AvatarInfo/Factory/SummaryAvatarFactory.cs
index b6296ff0..41e7df80 100644
--- a/src/Snap.Hutao/Snap.Hutao/Service/AvatarInfo/Factory/SummaryAvatarFactory.cs
+++ b/src/Snap.Hutao/Snap.Hutao/Service/AvatarInfo/Factory/SummaryAvatarFactory.cs
@@ -69,8 +69,6 @@ internal class SummaryAvatarFactory
};
TryApplyCostumeIconToAvatar(ref propertyAvatar, avatar);
-
- propertyAvatar.Level = $"Lv.{propertyAvatar.LevelNumber}";
return propertyAvatar;
}
@@ -153,7 +151,7 @@ internal class SummaryAvatarFactory
Id = weapon.Id,
LevelNumber = equip.Weapon!.Level,
SubProperty = subProperty,
- AffixLevel = $"精炼{affixLevel + 1}",
+ AffixLevelNumber = affixLevel + 1,
AffixName = weapon.Affix?.Name ?? string.Empty,
AffixDescription = weapon.Affix?.Descriptions.Single(a => a.Level == affixLevel).Description ?? string.Empty,
};
diff --git a/src/Snap.Hutao/Snap.Hutao/Service/AvatarInfo/Factory/SummaryFactoryImplementation.cs b/src/Snap.Hutao/Snap.Hutao/Service/AvatarInfo/Factory/SummaryFactoryImplementation.cs
index b137d83a..9a554694 100644
--- a/src/Snap.Hutao/Snap.Hutao/Service/AvatarInfo/Factory/SummaryFactoryImplementation.cs
+++ b/src/Snap.Hutao/Snap.Hutao/Service/AvatarInfo/Factory/SummaryFactoryImplementation.cs
@@ -38,6 +38,8 @@ internal class SummaryFactoryImplementation
Avatars = avatarInfos
.Where(a => !AvatarIds.IsPlayer(a.AvatarId))
.Select(a => new SummaryAvatarFactory(metadataContext, a).CreateAvatar())
+ .OrderByDescending(a => (int)a.Quality)
+ .ThenByDescending(a => a.ActivatedConstellationCount)
.ToList(),
};
}
diff --git a/src/Snap.Hutao/Snap.Hutao/Service/Game/GameConstants.cs b/src/Snap.Hutao/Snap.Hutao/Service/Game/GameConstants.cs
index 606ecb13..ab9adfb7 100644
--- a/src/Snap.Hutao/Snap.Hutao/Service/Game/GameConstants.cs
+++ b/src/Snap.Hutao/Snap.Hutao/Service/Game/GameConstants.cs
@@ -32,4 +32,14 @@ internal static class GameConstants
/// 国际服数据文件夹
///
public const string GenshinImpactData = "GenshinImpact_Data";
+
+ ///
+ /// 国服进程名
+ ///
+ public const string YuanShenProcessName = "YuanShen";
+
+ ///
+ /// 外服进程名
+ ///
+ public const string GenshinImpactProcessName = "GenshinImpact";
}
\ No newline at end of file
diff --git a/src/Snap.Hutao/Snap.Hutao/Service/Game/GameService.cs b/src/Snap.Hutao/Snap.Hutao/Service/Game/GameService.cs
index 41d9b1c4..2fd35521 100644
--- a/src/Snap.Hutao/Snap.Hutao/Service/Game/GameService.cs
+++ b/src/Snap.Hutao/Snap.Hutao/Service/Game/GameService.cs
@@ -285,8 +285,8 @@ internal class GameService : IGameService
return true;
}
- return Process.GetProcessesByName(YuanShenFileName).Any()
- || Process.GetProcessesByName(GenshinImpactFileName).Any();
+ return Process.GetProcessesByName(YuanShenProcessName).Any()
+ || Process.GetProcessesByName(GenshinImpactProcessName).Any();
}
///
diff --git a/src/Snap.Hutao/Snap.Hutao/View/Page/AvatarPropertyPage.xaml b/src/Snap.Hutao/Snap.Hutao/View/Page/AvatarPropertyPage.xaml
index c26204c4..44021af7 100644
--- a/src/Snap.Hutao/Snap.Hutao/View/Page/AvatarPropertyPage.xaml
+++ b/src/Snap.Hutao/Snap.Hutao/View/Page/AvatarPropertyPage.xaml
@@ -3,6 +3,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cwu="using:CommunityToolkit.WinUI.UI"
+ xmlns:cwua="using:CommunityToolkit.WinUI.UI.Animations"
xmlns:cwucont="using:CommunityToolkit.WinUI.UI.Controls"
xmlns:cwuconv="using:CommunityToolkit.WinUI.UI.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@@ -38,194 +39,245 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+ Text="{Binding ActivatedConstellationCount}"/>
+
+ Grid.Row="0"
+ Grid.Column="1"
+ Margin="0,6,6,6">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ HorizontalTextAlignment="Center"
+ Style="{StaticResource CaptionTextBlockStyle}"
+ Text="{Binding SelectedAvatar.FetterLevel}"
+ TextAlignment="Center"
+ TextTrimming="None"
+ TextWrapping="NoWrap"/>
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -530,6 +596,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -538,69 +669,43 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Snap.Hutao/Snap.Hutao/View/Page/SettingPage.xaml b/src/Snap.Hutao/Snap.Hutao/View/Page/SettingPage.xaml
index 541a625e..d1c3fc5b 100644
--- a/src/Snap.Hutao/Snap.Hutao/View/Page/SettingPage.xaml
+++ b/src/Snap.Hutao/Snap.Hutao/View/Page/SettingPage.xaml
@@ -156,6 +156,14 @@
+
+
+
+
+
@@ -181,16 +189,6 @@
Message="{shcm:ResourceString Name=ViewPageSettingDangerousHint}"
Severity="Error"/>
-
-
-
-
-
-
@@ -49,11 +48,6 @@ internal class ExperimentalFeaturesViewModel : ObservableObject
///
public ICommand DeleteUsersCommand { get; }
- ///
- /// 删除所有计划任务命令
- ///
- public ICommand DeleteAllScheduleTasksCommand { get; }
-
private Task OpenCacheFolderAsync()
{
return Launcher.LaunchFolderAsync(ApplicationData.Current.LocalCacheFolder).AsTask();
@@ -75,17 +69,4 @@ internal class ExperimentalFeaturesViewModel : ObservableObject
infoBarService.Success(SH.ViewModelExperimentalDeleteUserSuccess);
}
}
-
- private void DangerousDeleteAllScheduleTasks()
- {
- IInfoBarService infoBarService = serviceProvider.GetRequiredService();
- if (Core.ScheduleTaskHelper.UnregisterAllTasks())
- {
- infoBarService.Success(SH.ViewModelExperimentalDeleteTaskSuccess);
- }
- else
- {
- infoBarService.Warning(SH.ViewModelExperimentalDeleteTaskWarning);
- }
- }
}
\ No newline at end of file
diff --git a/src/Snap.Hutao/Snap.Hutao/ViewModel/SettingViewModel.cs b/src/Snap.Hutao/Snap.Hutao/ViewModel/SettingViewModel.cs
index 64ba4295..b211a6db 100644
--- a/src/Snap.Hutao/Snap.Hutao/ViewModel/SettingViewModel.cs
+++ b/src/Snap.Hutao/Snap.Hutao/ViewModel/SettingViewModel.cs
@@ -74,6 +74,7 @@ internal class SettingViewModel : Abstraction.ViewModel
DeleteGameWebCacheCommand = new RelayCommand(DeleteGameWebCache);
ShowSignInWebViewDialogCommand = new AsyncRelayCommand(ShowSignInWebViewDialogAsync);
SetDataFolderCommand = new AsyncRelayCommand(SetDataFolderAsync);
+ ResetStaticResourceCommand = new RelayCommand(ResetStaticResource);
}
///
@@ -182,6 +183,11 @@ internal class SettingViewModel : Abstraction.ViewModel
///
public ICommand SetDataFolderCommand { get; }
+ ///
+ /// 重置静态资源
+ ///
+ public ICommand ResetStaticResourceCommand { get; }
+
private async Task SetGamePathAsync()
{
IGameLocator locator = serviceProvider.GetRequiredService>()
@@ -260,4 +266,10 @@ internal class SettingViewModel : Abstraction.ViewModel
infoBarService.Success(SH.ViewModelSettingSetDataFolderSuccess);
}
}
+
+ private void ResetStaticResource()
+ {
+ StaticResource.UnfulfillAllContracts();
+ serviceProvider.GetRequiredService().Success(SH.ViewPageSettingResetSuccessMessage);
+ }
}
\ No newline at end of file