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N*=SZt4M7QP;HL^p8&!Thz|I&B+#@Cx7KN^1bpmR
zZV8IufMG>zf$xOtZx;Vi1*{rtYSRK9g`+wv9Iez9`l(`0^o;YKv?HyzO{2
zj+GWuqXBoX8~fXoz(2?VF!`LH5!c@q`~MA&DvK!x?!FEDw!`6QbNlVQa{NEm;E-F}
S(Gx2G0000
internal partial class MetadataService
{
-#pragma warning disable CA1823
private const string FileNameAchievement = "Achievement";
private const string FileNameAchievementGoal = "AchievementGoal";
private const string FileNameAvatar = "Avatar";
@@ -31,5 +30,4 @@ internal partial class MetadataService
private const string FileNameWeapon = "Weapon";
private const string FileNameWeaponCurve = "WeaponCurve";
private const string FileNameWeaponPromote = "WeaponPromote";
-#pragma warning restore
}
diff --git a/src/Snap.Hutao/Snap.Hutao/Service/Navigation/DocumentationProvider.cs b/src/Snap.Hutao/Snap.Hutao/Service/Navigation/DocumentationProvider.cs
new file mode 100644
index 00000000..4d029580
--- /dev/null
+++ b/src/Snap.Hutao/Snap.Hutao/Service/Navigation/DocumentationProvider.cs
@@ -0,0 +1,46 @@
+// Copyright (c) DGP Studio. All rights reserved.
+// Licensed under the MIT license.
+
+using Snap.Hutao.View.Page;
+
+namespace Snap.Hutao.Service.Navigation;
+
+[Injection(InjectAs.Singleton, typeof(IDocumentationProvider))]
+[ConstructorGenerated]
+internal sealed partial class DocumentationProvider : IDocumentationProvider
+{
+ private const string Home = "https://hut.ao";
+
+ private static readonly Dictionary TypeDocumentations = new()
+ {
+ [typeof(AchievementPage)] = "https://hut.ao/features/achievements.html",
+ [typeof(AnnouncementPage)] = "https://hut.ao/features/dashboard.html",
+ [typeof(AvatarPropertyPage)] = "https://hut.ao/features/character-data.html",
+ [typeof(CultivationPage)] = "https://hut.ao/features/develop-plan.html",
+ [typeof(DailyNotePage)] = "https://hut.ao/features/real-time-notes.html",
+ [typeof(GachaLogPage)] = "https://hut.ao/features/wish-export.html",
+ [typeof(HutaoDatabasePage)] = "https://hut.ao/features/hutao-API.html",
+ [typeof(HutaoPassportPage)] = "https://hut.ao/zh/features/hutao-settings.html#%E8%83%A1%E6%A1%83%E5%B8%90%E5%8F%B7",
+ [typeof(LaunchGamePage)] = "https://hut.ao/features/game-launcher.html",
+ [typeof(LoginHoyoverseUserPage)] = "https://hut.ao/features/mhy-account-switch.html",
+ [typeof(LoginMihoyoUserPage)] = "https://hut.ao/features/mhy-account-switch.html",
+ [typeof(SettingPage)] = "https://hut.ao/features/hutao-settings.html",
+ [typeof(SpiralAbyssRecordPage)] = "https://hut.ao/features/dashboard.html",
+ [typeof(TestPage)] = Home,
+ [typeof(WikiAvatarPage)] = "https://hut.ao/features/character-wiki.html",
+ [typeof(WikiMonsterPage)] = "https://hut.ao/features/monster-wiki.html",
+ [typeof(WikiWeaponPage)] = "https://hut.ao/features/weapon-wiki.html",
+ };
+
+ private readonly INavigationService navigationService;
+
+ public string GetDocumentation()
+ {
+ if (navigationService.Current is { } type)
+ {
+ return TypeDocumentations[type];
+ }
+
+ return Home;
+ }
+}
\ No newline at end of file
diff --git a/src/Snap.Hutao/Snap.Hutao/Service/Navigation/IDocumentationProvider.cs b/src/Snap.Hutao/Snap.Hutao/Service/Navigation/IDocumentationProvider.cs
new file mode 100644
index 00000000..b5f2962f
--- /dev/null
+++ b/src/Snap.Hutao/Snap.Hutao/Service/Navigation/IDocumentationProvider.cs
@@ -0,0 +1,9 @@
+// Copyright (c) DGP Studio. All rights reserved.
+// Licensed under the MIT license.
+
+namespace Snap.Hutao.Service.Navigation;
+
+internal interface IDocumentationProvider
+{
+ string GetDocumentation();
+}
\ No newline at end of file
diff --git a/src/Snap.Hutao/Snap.Hutao/Service/Navigation/INavigationService.cs b/src/Snap.Hutao/Snap.Hutao/Service/Navigation/INavigationService.cs
index a098a5f3..b8e328e6 100644
--- a/src/Snap.Hutao/Snap.Hutao/Service/Navigation/INavigationService.cs
+++ b/src/Snap.Hutao/Snap.Hutao/Service/Navigation/INavigationService.cs
@@ -10,7 +10,7 @@ namespace Snap.Hutao.Service.Navigation;
/// 导航服务
///
[HighQuality]
-internal interface INavigationService : ICastService
+internal interface INavigationService : ICastService, INavigationCurrent
{
///
/// 导航到指定类型的页面
@@ -48,3 +48,8 @@ internal interface INavigationService : ICastService
///
void GoBack();
}
+
+internal interface INavigationCurrent
+{
+ Type? Current { get; }
+}
\ No newline at end of file
diff --git a/src/Snap.Hutao/Snap.Hutao/Service/Navigation/NavigationService.cs b/src/Snap.Hutao/Snap.Hutao/Service/Navigation/NavigationService.cs
index b2218f00..0d8f10dc 100644
--- a/src/Snap.Hutao/Snap.Hutao/Service/Navigation/NavigationService.cs
+++ b/src/Snap.Hutao/Snap.Hutao/Service/Navigation/NavigationService.cs
@@ -43,6 +43,8 @@ internal sealed class NavigationService : INavigationService, INavigationInitial
paneClosedEventHandler = OnPaneStateChanged;
}
+ public Type? Current { get => frame?.Content.GetType(); }
+
private NavigationView? NavigationView
{
get => navigationView;
diff --git a/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj b/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj
index adef38fd..03b93d4b 100644
--- a/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj
+++ b/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj
@@ -96,6 +96,7 @@
+
@@ -224,6 +225,7 @@
+
diff --git a/src/Snap.Hutao/Snap.Hutao/View/Control/WebViewer.xaml.cs b/src/Snap.Hutao/Snap.Hutao/View/Control/WebViewer.xaml.cs
index bdf8dcb7..6120b457 100644
--- a/src/Snap.Hutao/Snap.Hutao/View/Control/WebViewer.xaml.cs
+++ b/src/Snap.Hutao/Snap.Hutao/View/Control/WebViewer.xaml.cs
@@ -20,6 +20,7 @@ internal partial class WebViewer : UserControl, IRecipient
private readonly RoutedEventHandler loadEventHandler;
private readonly RoutedEventHandler unloadEventHandler;
+ [SuppressMessage("", "IDE0052")]
private MiHoYoJSInterface? jsInterface;
private bool isFirstNavigate = true;
diff --git a/src/Snap.Hutao/Snap.Hutao/View/UserView.xaml b/src/Snap.Hutao/Snap.Hutao/View/UserView.xaml
index bc7fdbf7..e867c237 100644
--- a/src/Snap.Hutao/Snap.Hutao/View/UserView.xaml
+++ b/src/Snap.Hutao/Snap.Hutao/View/UserView.xaml
@@ -16,31 +16,52 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
\ 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 b49ab13e..a937c793 100644
--- a/src/Snap.Hutao/Snap.Hutao/ViewModel/SettingViewModel.cs
+++ b/src/Snap.Hutao/Snap.Hutao/ViewModel/SettingViewModel.cs
@@ -111,6 +111,12 @@ internal sealed partial class SettingViewModel : Abstraction.ViewModel
AppInstance.Restart(string.Empty);
}
+ [Command("StoreReviewCommand")]
+ private static async Task StoreReviewAsync()
+ {
+ await Launcher.LaunchUriAsync(new("ms-windows-store://review/?ProductId=9PH4NXJ2JN52"));
+ }
+
[Command("SetGamePathCommand")]
private async Task SetGamePathAsync()
{
@@ -183,12 +189,6 @@ internal sealed partial class SettingViewModel : Abstraction.ViewModel
}
}
- [Command("StoreReviewCommand")]
- private async Task StoreReviewAsync()
- {
- await Launcher.LaunchUriAsync(new("ms-windows-store://review/?ProductId=9PH4NXJ2JN52"));
- }
-
[Command("SetDataFolderCommand")]
private async Task SetDataFolderAsync()
{
diff --git a/src/Snap.Hutao/Snap.Hutao/ViewModel/User/UserViewModel.cs b/src/Snap.Hutao/Snap.Hutao/ViewModel/User/UserViewModel.cs
index 25c508b9..f38f4a7c 100644
--- a/src/Snap.Hutao/Snap.Hutao/ViewModel/User/UserViewModel.cs
+++ b/src/Snap.Hutao/Snap.Hutao/ViewModel/User/UserViewModel.cs
@@ -14,6 +14,7 @@ using Snap.Hutao.View.Page;
using Snap.Hutao.Web.Hoyolab;
using System.Collections.ObjectModel;
using System.Text;
+using Windows.System;
namespace Snap.Hutao.ViewModel.User;
@@ -25,6 +26,7 @@ namespace Snap.Hutao.ViewModel.User;
[Injection(InjectAs.Singleton)]
internal sealed partial class UserViewModel : ObservableObject
{
+ private readonly IDocumentationProvider documentationProvider;
private readonly INavigationService navigationService;
private readonly IServiceProvider serviceProvider;
private readonly IInfoBarService infoBarService;
@@ -248,4 +250,10 @@ internal sealed partial class UserViewModel : ObservableObject
}
}
}
+
+ [Command("OpenDocumentationCommand")]
+ private async Task OpenDocumentationAsync()
+ {
+ await Launcher.LaunchUriAsync(new(documentationProvider.GetDocumentation()));
+ }
}
\ No newline at end of file