mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
Typo
This commit is contained in:
24
src/Snap.Hutao/Snap.Hutao/Control/Markup/TypeExtension.cs
Normal file
24
src/Snap.Hutao/Snap.Hutao/Control/Markup/TypeExtension.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.UI.Xaml.Markup;
|
||||
|
||||
namespace Snap.Hutao.Control.Markup;
|
||||
|
||||
/// <summary>
|
||||
/// 类型拓展
|
||||
/// </summary>
|
||||
[MarkupExtensionReturnType(ReturnType = typeof(Type))]
|
||||
internal sealed class TypeExtension : MarkupExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
public Type Type { get; set; } = default!;
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override object ProvideValue()
|
||||
{
|
||||
return Type;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Markup;
|
||||
|
||||
namespace Snap.Hutao.Control.Markup;
|
||||
|
||||
/// <summary>
|
||||
/// Xaml 服务提供器扩展
|
||||
/// </summary>
|
||||
internal static class XamlServiceProviderExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// Get IProvideValueTarget from serviceProvider
|
||||
/// </summary>
|
||||
/// <param name="provider">serviceProvider</param>
|
||||
/// <returns>IProvideValueTarget</returns>
|
||||
public static IProvideValueTarget GetProvideValueTarget(this IXamlServiceProvider provider)
|
||||
{
|
||||
return (IProvideValueTarget)provider.GetService(typeof(IProvideValueTarget));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get IRootObjectProvider from serviceProvider
|
||||
/// </summary>
|
||||
/// <param name="provider">serviceProvider</param>
|
||||
/// <returns>IRootObjectProvider</returns>
|
||||
public static IRootObjectProvider GetRootObjectProvider(this IXamlServiceProvider provider)
|
||||
{
|
||||
return (IRootObjectProvider)provider.GetService(typeof(IRootObjectProvider));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get IUriContext from serviceProvider
|
||||
/// </summary>
|
||||
/// <param name="provider">serviceProvider</param>
|
||||
/// <returns>IUriContext</returns>
|
||||
public static IUriContext GetUriContext(this IXamlServiceProvider provider)
|
||||
{
|
||||
return (IUriContext)provider.GetService(typeof(IUriContext));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get IXamlTypeResolver from serviceProvider
|
||||
/// </summary>
|
||||
/// <param name="provider">serviceProvider</param>
|
||||
/// <returns>IXamlTypeResolver</returns>
|
||||
public static IXamlTypeResolver GetXamlTypeResolver(this IXamlServiceProvider provider)
|
||||
{
|
||||
return (IXamlTypeResolver)provider.GetService(typeof(IXamlTypeResolver));
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,10 @@
|
||||
<!-- Copyright (c) Microsoft Corporation and Contributors. -->
|
||||
<!-- Licensed under the MIT License. -->
|
||||
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<FontFamily x:Key="MiSans">ms-appx:///Resource/Font/MiSans-Regular.ttf#MiSans</FontFamily>
|
||||
<FontFamily x:Key="CascadiaMonoAndMiSans">ms-appx:///Resource/Font/CascadiaMono.ttf#Cascadia Mono, ms-appx:///Resource/Font/MiSans-Regular.ttf#MiSans</FontFamily>
|
||||
|
||||
<StaticResource x:Key="PivotHeaderItemFontFamily" ResourceKey="MiSans"/>
|
||||
<StaticResource x:Key="ContentControlThemeFontFamily" ResourceKey="MiSans"/>
|
||||
|
||||
<Style BasedOn="{StaticResource BodyTextBlockStyle}" TargetType="TextBlock"/>
|
||||
<Style x:Key="BaseTextBlockStyle" TargetType="TextBlock">
|
||||
<Setter Property="FontFamily" Value="{StaticResource MiSans}"/>
|
||||
|
||||
@@ -12,7 +12,7 @@ internal interface IAppResourceProvider
|
||||
/// 获取资源
|
||||
/// </summary>
|
||||
/// <typeparam name="T">资源的类型</typeparam>
|
||||
/// <param name="name">资源的名称</param>
|
||||
/// <param name="key">资源的名称</param>
|
||||
/// <returns>资源</returns>
|
||||
T GetResource<T>(string name);
|
||||
T GetResource<T>(string key);
|
||||
}
|
||||
@@ -53,7 +53,7 @@ internal enum AssociationType
|
||||
/// <summary>
|
||||
/// 须弥
|
||||
/// </summary>
|
||||
[LocalizationKey("ModelIntrinsicAssociationTypeSemuru")]
|
||||
[LocalizationKey("ModelIntrinsicAssociationTypeSumeru")]
|
||||
ASSOC_TYPE_SUMERU,
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -492,15 +492,6 @@ namespace Snap.Hutao.Resource.Localization {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 须弥 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string ModelIntrinsicAssociationTypeSemuru {
|
||||
get {
|
||||
return ResourceManager.GetString("ModelIntrinsicAssociationTypeSemuru", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 至冬 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -510,6 +501,15 @@ namespace Snap.Hutao.Resource.Localization {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 须弥 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string ModelIntrinsicAssociationTypeSumeru {
|
||||
get {
|
||||
return ResourceManager.GetString("ModelIntrinsicAssociationTypeSumeru", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 少男 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -745,7 +745,7 @@ namespace Snap.Hutao.Resource.Localization {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 新增:{0} 个成就 | 更新:{1} 个成就 | 删除{2} 个成就 的本地化字符串。
|
||||
/// 查找类似 新增:{0} 个成就 | 更新:{1} 个成就 | 删除:{2} 个成就 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string ServiceAchievementImportResultFormat {
|
||||
get {
|
||||
|
||||
@@ -258,7 +258,7 @@
|
||||
<data name="ModelIntrinsicAssociationTypeRanger" xml:space="preserve">
|
||||
<value>游侠</value>
|
||||
</data>
|
||||
<data name="ModelIntrinsicAssociationTypeSemuru" xml:space="preserve">
|
||||
<data name="ModelIntrinsicAssociationTypeSumeru" xml:space="preserve">
|
||||
<value>须弥</value>
|
||||
</data>
|
||||
<data name="ModelIntrinsicAssociationTypeSnezhnaya" xml:space="preserve">
|
||||
@@ -343,7 +343,7 @@
|
||||
<value>必须先选择一个用户与角色</value>
|
||||
</data>
|
||||
<data name="ServiceAchievementImportResultFormat" xml:space="preserve">
|
||||
<value>新增:{0} 个成就 | 更新:{1} 个成就 | 删除{2} 个成就</value>
|
||||
<value>新增:{0} 个成就 | 更新:{1} 个成就 | 删除:{2} 个成就</value>
|
||||
</data>
|
||||
<data name="ServiceAchievementUserdataCorruptedInnerIdNotUnique" xml:space="preserve">
|
||||
<value>单个成就存档内发现多个相同的成就 Id</value>
|
||||
|
||||
@@ -5,6 +5,7 @@ using Microsoft.Extensions.Caching.Memory;
|
||||
using Snap.Hutao.Service.Abstraction;
|
||||
using Snap.Hutao.Web.Hoyolab.Hk4e.Common.Announcement;
|
||||
using Snap.Hutao.Web.Response;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Snap.Hutao.Service;
|
||||
@@ -66,9 +67,9 @@ internal sealed partial class AnnouncementService : IAnnouncementService
|
||||
{
|
||||
Regex timeTagRegrex = XmlTagRegex();
|
||||
|
||||
announcementListWrappers.ForEach(listWrapper =>
|
||||
foreach (ref AnnouncementListWrapper listWrapper in CollectionsMarshal.AsSpan(announcementListWrappers))
|
||||
{
|
||||
listWrapper.List.ForEach(item =>
|
||||
foreach (ref Announcement item in CollectionsMarshal.AsSpan(listWrapper.List))
|
||||
{
|
||||
if (contentMap.TryGetValue(item.AnnId, out string? rawContent))
|
||||
{
|
||||
@@ -77,8 +78,8 @@ internal sealed partial class AnnouncementService : IAnnouncementService
|
||||
}
|
||||
|
||||
item.Content = rawContent ?? string.Empty;
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -16,14 +16,14 @@ namespace Snap.Hutao.Service;
|
||||
[Injection(InjectAs.Singleton)]
|
||||
internal sealed class AppOptions : DbStoreOptions
|
||||
{
|
||||
private static readonly List<NameValue<BackdropType>> SupportedBackdropTypes = new()
|
||||
private readonly List<NameValue<BackdropType>> SupportedBackdropTypes = new()
|
||||
{
|
||||
new("Acrylic", BackdropType.Acrylic),
|
||||
new("Mica", BackdropType.Mica),
|
||||
new("MicaAlt", BackdropType.MicaAlt),
|
||||
};
|
||||
|
||||
private static readonly List<NameValue<string>> SupportedCultures = new()
|
||||
private readonly List<NameValue<string>> SupportedCultures = new()
|
||||
{
|
||||
ToNameValue(CultureInfo.GetCultureInfo("zh-Hans")),
|
||||
ToNameValue(CultureInfo.GetCultureInfo("zh-Hant")),
|
||||
|
||||
@@ -77,13 +77,6 @@ internal interface IInfoBarService
|
||||
/// <param name="delay">关闭延迟</param>
|
||||
void Success(string title, string message, int delay = 5000);
|
||||
|
||||
/// <summary>
|
||||
/// 异步等待加载完成
|
||||
/// </summary>
|
||||
/// <param name="token">取消令牌</param>
|
||||
/// <returns>任务</returns>
|
||||
Task WaitInitializationAsync(CancellationToken token = default);
|
||||
|
||||
/// <summary>
|
||||
/// 显示警告信息
|
||||
/// </summary>
|
||||
|
||||
@@ -13,8 +13,8 @@ namespace Snap.Hutao.Service.Notification;
|
||||
[Injection(InjectAs.Singleton, typeof(IInfoBarService))]
|
||||
internal sealed partial class InfoBarService : IInfoBarService
|
||||
{
|
||||
private readonly ILogger<InfoBarService> logger;
|
||||
private readonly ITaskContext taskContext;
|
||||
private readonly TaskCompletionSource initializaionCompletionSource;
|
||||
|
||||
private ObservableCollection<InfoBar>? collection;
|
||||
|
||||
@@ -24,16 +24,6 @@ internal sealed partial class InfoBarService : IInfoBarService
|
||||
get => collection ??= new();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 异步等待主窗体加载完成
|
||||
/// </summary>
|
||||
/// <param name="token">取消令牌</param>
|
||||
/// <returns>任务</returns>
|
||||
public Task WaitInitializationAsync(CancellationToken token = default)
|
||||
{
|
||||
return initializaionCompletionSource.Task;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Information(string message, int delay = 5000)
|
||||
{
|
||||
@@ -101,7 +91,7 @@ internal sealed partial class InfoBarService : IInfoBarService
|
||||
return;
|
||||
}
|
||||
|
||||
PrepareInfoBarAndShowInternalAsync(severity, title, message, delay).SafeForget();
|
||||
PrepareInfoBarAndShowInternalAsync(severity, title, message, delay).SafeForget(logger);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -135,12 +125,9 @@ internal sealed partial class InfoBarService : IInfoBarService
|
||||
}
|
||||
}
|
||||
|
||||
[SuppressMessage("", "VSTHRD100")]
|
||||
private async void OnInfoBarClosed(InfoBar sender, InfoBarClosedEventArgs args)
|
||||
private void OnInfoBarClosed(InfoBar sender, InfoBarClosedEventArgs args)
|
||||
{
|
||||
await taskContext.SwitchToMainThreadAsync();
|
||||
|
||||
collection!.Remove(sender);
|
||||
taskContext.InvokeOnMainThread(() => collection!.Remove(sender));
|
||||
sender.Closed -= OnInfoBarClosed;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -297,5 +297,4 @@
|
||||
</PivotItem>
|
||||
</Pivot>
|
||||
</Grid>
|
||||
|
||||
</shc:ScopedPage>
|
||||
@@ -8,6 +8,7 @@
|
||||
xmlns:shc="using:Snap.Hutao.Control"
|
||||
xmlns:shcm="using:Snap.Hutao.Control.Markup"
|
||||
xmlns:shv="using:Snap.Hutao.ViewModel"
|
||||
xmlns:shvc="using:Snap.Hutao.View.Control"
|
||||
d:DataContext="{d:DesignInstance shv:SettingViewModel}"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
mc:Ignorable="d">
|
||||
@@ -17,7 +18,7 @@
|
||||
<ColumnDefinition MaxWidth="1000"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Margin="16,16,24,16" Spacing="{StaticResource SettingsCardSpacing}">
|
||||
<StackPanel Margin="16,16,16,16" Spacing="{StaticResource SettingsCardSpacing}">
|
||||
<Border Height="280" Style="{StaticResource BorderCardStyle}">
|
||||
<Grid>
|
||||
<Image
|
||||
@@ -200,27 +201,30 @@
|
||||
Foreground="{ThemeResource SystemFillColorCriticalBrush}"
|
||||
Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
|
||||
Text="{shcm:ResourceString Name=ViewPageSettingDangerousHeader}"/>
|
||||
|
||||
<InfoBar
|
||||
IsClosable="False"
|
||||
IsOpen="{Binding Options.IsAdvancedLaunchOptionsEnabled}"
|
||||
Message="{shcm:ResourceString Name=ViewPageSettingFeaturesDangerousHint}"
|
||||
Severity="Error"/>
|
||||
|
||||
<clw:SettingsCard
|
||||
Background="{StaticResource SystemFillColorCriticalBackgroundBrush}"
|
||||
Description="{shcm:ResourceString Name=ViewPageSettingIsAdvancedLaunchOptionsEnabledDescription}"
|
||||
Header="{shcm:ResourceString Name=ViewPageSettingIsAdvancedLaunchOptionsEnabledHeader}"
|
||||
HeaderIcon="{shcm:FontIcon Glyph=}"
|
||||
IsEnabled="{Binding HutaoOptions.IsElevated}">
|
||||
<ToggleSwitch Width="120" IsOn="{Binding Options.IsAdvancedLaunchOptionsEnabled, Mode=TwoWay}"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<shvc:Elevation Visibility="{Binding HutaoOptions.IsElevated, Converter={StaticResource BoolToVisibilityRevertConverter}}"/>
|
||||
<ToggleSwitch Width="120" IsOn="{Binding Options.IsAdvancedLaunchOptionsEnabled, Mode=TwoWay}"/>
|
||||
</StackPanel>
|
||||
|
||||
</clw:SettingsCard>
|
||||
|
||||
<InfoBar
|
||||
Margin="0,4,0,0"
|
||||
IsClosable="False"
|
||||
IsOpen="True"
|
||||
Message="{shcm:ResourceString Name=ViewPageSettingDangerousHint}"
|
||||
Severity="Error"/>
|
||||
|
||||
<clw:SettingsCard
|
||||
ActionIconToolTip="{shcm:ResourceString Name=ViewPageSettingDangerousAction}"
|
||||
Command="{Binding Experimental.DeleteUsersCommand}"
|
||||
|
||||
@@ -72,17 +72,19 @@
|
||||
BorderThickness="0"
|
||||
DefaultLabelPosition="Right">
|
||||
<CommandBar.Content>
|
||||
<shcp:PanelSelector x:Name="ItemsPanelSelector" Margin="6,8,0,0"/>
|
||||
<shcp:PanelSelector x:Name="ItemsPanelSelector" Margin="8,8,0,0"/>
|
||||
</CommandBar.Content>
|
||||
<AppBarButton Icon="{shcm:FontIcon Glyph=}" Label="搜索提示"/>
|
||||
<AppBarElementContainer>
|
||||
<AutoSuggestBox
|
||||
Width="240"
|
||||
Height="36"
|
||||
Margin="16,6,6,0"
|
||||
Margin="6,6,6,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalContentAlignment="Center"
|
||||
PlaceholderText="{shcm:ResourceString Name=ViewPageWiKiAvatarAutoSuggestBoxPlaceHolder}"
|
||||
QueryIcon="{shcm:FontIcon Glyph=}"
|
||||
Style="{StaticResource DefaultAutoSuggestBoxStyle}"
|
||||
Text="{Binding FilterText, Mode=TwoWay}">
|
||||
<mxi:Interaction.Behaviors>
|
||||
<mxic:EventTriggerBehavior EventName="QuerySubmitted">
|
||||
@@ -97,15 +99,20 @@
|
||||
Icon="{shcm:FontIcon Glyph=}"
|
||||
Label="{shcm:ResourceString Name=ViewPageWiKiGeneralAddToDevPlanButtonLabel}"/>
|
||||
</CommandBar>
|
||||
<SplitView
|
||||
Grid.Row="1"
|
||||
DisplayMode="Inline"
|
||||
IsPaneOpen="True"
|
||||
OpenPaneLength="{StaticResource CompatSplitViewOpenPaneLength}"
|
||||
PaneBackground="{StaticResource CardBackgroundFillColorSecondaryBrush}">
|
||||
<SplitView.Pane>
|
||||
<cwuc:SwitchPresenter Grid.Row="1" Value="{Binding ElementName=ItemsPanelSelector, Path=Current}">
|
||||
<cwuc:Case Value="List">
|
||||
<cwuc:SwitchPresenter Grid.Row="1" Value="{Binding ElementName=ItemsPanelSelector, Path=Current}">
|
||||
<cwuc:SwitchPresenter.ContentTransitions>
|
||||
<TransitionCollection>
|
||||
<ContentThemeTransition/>
|
||||
</TransitionCollection>
|
||||
</cwuc:SwitchPresenter.ContentTransitions>
|
||||
<cwuc:Case Value="List">
|
||||
<SplitView
|
||||
Grid.Row="1"
|
||||
DisplayMode="Inline"
|
||||
IsPaneOpen="True"
|
||||
OpenPaneLength="{StaticResource CompatSplitViewOpenPaneLength}"
|
||||
PaneBackground="{StaticResource CardBackgroundFillColorSecondaryBrush}">
|
||||
<SplitView.Pane>
|
||||
<ListView
|
||||
Grid.Row="1"
|
||||
ItemsSource="{Binding Avatars}"
|
||||
@@ -133,469 +140,469 @@
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</cwuc:Case>
|
||||
<cwuc:Case Value="Grid">
|
||||
<GridView
|
||||
Margin="6,6,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Left"
|
||||
ItemsSource="{Binding Avatars}"
|
||||
SelectedItem="{Binding Selected, Mode=TwoWay}"
|
||||
SelectionMode="Single">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shvc:ItemIcon
|
||||
Width="44"
|
||||
Height="44"
|
||||
Icon="{Binding Icon, Converter={StaticResource AvatarIconConverter}, Mode=OneWay}"
|
||||
Quality="{Binding Quality}"/>
|
||||
</DataTemplate>
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
</cwuc:Case>
|
||||
</cwuc:SwitchPresenter>
|
||||
</SplitView.Pane>
|
||||
<SplitView.Content>
|
||||
<Grid>
|
||||
<!-- 渐变背景 -->
|
||||
<shci:Gradient
|
||||
VerticalAlignment="Top"
|
||||
BackgroundDirection="RightTopToLeftBottom"
|
||||
ForegroundDirection="TopToBottom"
|
||||
Source="{Binding Selected, Converter={StaticResource AvatarNameCardPicConverter}}"/>
|
||||
</SplitView.Pane>
|
||||
<SplitView.Content>
|
||||
<Grid>
|
||||
<!-- 渐变背景 -->
|
||||
<shci:Gradient
|
||||
VerticalAlignment="Top"
|
||||
BackgroundDirection="RightTopToLeftBottom"
|
||||
ForegroundDirection="TopToBottom"
|
||||
Source="{Binding Selected, Converter={StaticResource AvatarNameCardPicConverter}}"/>
|
||||
|
||||
<ScrollViewer>
|
||||
<StackPanel
|
||||
MaxWidth="800"
|
||||
Margin="0,0,20,16"
|
||||
HorizontalAlignment="Left">
|
||||
<!-- 简介 -->
|
||||
<Grid Margin="16,16,0,16" VerticalAlignment="Top">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0">
|
||||
<Grid Margin="0,0,0,16">
|
||||
<ScrollViewer>
|
||||
<StackPanel
|
||||
MaxWidth="800"
|
||||
Margin="0,0,20,16"
|
||||
HorizontalAlignment="Left">
|
||||
<!-- 简介 -->
|
||||
<Grid Margin="16,16,0,16" VerticalAlignment="Top">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<shci:MonoChrome
|
||||
Grid.Column="0"
|
||||
Width="32"
|
||||
Height="32"
|
||||
Source="{Binding Selected.FetterInfo.VisionBefore, Converter={StaticResource ElementNameIconConverter}}"/>
|
||||
<shci:MonoChrome
|
||||
Grid.Column="1"
|
||||
Width="32"
|
||||
Height="32"
|
||||
Source="{Binding Selected.Weapon, Converter={StaticResource WeaponTypeIconConverter}}"/>
|
||||
</Grid>
|
||||
<shvc:ItemIcon
|
||||
Width="100"
|
||||
Height="100"
|
||||
Icon="{Binding Selected.Icon, Converter={StaticResource AvatarIconConverter}, Mode=OneWay}"
|
||||
Quality="{Binding Selected.Quality, Mode=OneWay}"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="1" Margin="16,0,0,0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="0,0,0,2"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||
Text="{Binding Selected.Name}"/>
|
||||
<TextBlock
|
||||
Margin="24,0,0,2"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||
Text="{Binding Selected.FetterInfo.Title}"/>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock
|
||||
Margin="0,12,0,0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Selected.FetterInfo.Detail}"
|
||||
TextWrapping="NoWrap"/>
|
||||
|
||||
<cwuc:UniformGrid
|
||||
Margin="0,12,0,0"
|
||||
ColumnSpacing="12"
|
||||
Columns="4">
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource BaseTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageWiKiAvatarOccupationNameTitle}"/>
|
||||
<TextBlock
|
||||
Margin="0,6,0,0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Selected.FetterInfo.Native}"
|
||||
TextWrapping="NoWrap"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource BaseTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageWiKiAvatarConstellationNameTitle}"/>
|
||||
<TextBlock
|
||||
Margin="0,6,0,0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Selected.FetterInfo.ConstellationBefore}"
|
||||
TextWrapping="NoWrap"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource BaseTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageWiKiAvatarDateofBirthTitle}"/>
|
||||
<TextBlock
|
||||
Margin="0,6,0,0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Selected.FetterInfo.BirthFormatted}"
|
||||
TextWrapping="NoWrap"/>
|
||||
</StackPanel>
|
||||
</cwuc:UniformGrid>
|
||||
|
||||
<cwuc:UniformGrid
|
||||
Margin="0,12,0,0"
|
||||
ColumnSpacing="12"
|
||||
Columns="4">
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource BaseTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageWiKiAvatarChineseCVNameTitle}"/>
|
||||
<TextBlock
|
||||
Margin="0,6,0,0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Selected.FetterInfo.CvChinese}"
|
||||
TextWrapping="NoWrap"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource BaseTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageWiKiAvatarJapaneseCVNameTitle}"/>
|
||||
<TextBlock
|
||||
Margin="0,6,0,0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Selected.FetterInfo.CvJapanese}"
|
||||
TextWrapping="NoWrap"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource BaseTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageWiKiAvatarEnglishCVNameTitle}"/>
|
||||
<TextBlock
|
||||
Margin="0,6,0,0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Selected.FetterInfo.CvEnglish}"
|
||||
TextWrapping="NoWrap"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource BaseTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageWiKiAvatarKoreanCVNameTitle}"/>
|
||||
<TextBlock
|
||||
Margin="0,6,0,0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Selected.FetterInfo.CvKorean}"
|
||||
TextWrapping="NoWrap"/>
|
||||
</StackPanel>
|
||||
</cwuc:UniformGrid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<!-- 属性 -->
|
||||
<shvc:BaseValueSlider
|
||||
Margin="16,16,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
BaseValueInfo="{Binding BaseValueInfo, Mode=OneWay}"/>
|
||||
<TextBlock
|
||||
Margin="16,32,0,0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarAscensionMaterialsHeader}"/>
|
||||
<GridView
|
||||
Margin="16,16,0,0"
|
||||
ItemsSource="{Binding Selected.CultivationItemsView}"
|
||||
SelectionMode="None">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shvc:BottomTextControl Text="{Binding Name}">
|
||||
<shvc:ItemIcon Icon="{Binding Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding RankLevel}"/>
|
||||
</shvc:BottomTextControl>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</GridView>
|
||||
|
||||
<TextBlock
|
||||
Margin="16,32,0,0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarAscensionMaterialsHeader}"/>
|
||||
<shvc:SkillPivot
|
||||
Margin="16,16,0,0"
|
||||
ItemTemplate="{StaticResource SkillDataTemplate}"
|
||||
Skills="{Binding Selected.SkillDepot.CompositeSkills}"/>
|
||||
|
||||
<TextBlock
|
||||
Margin="16,32,0,0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarConstellationNameTitle}"/>
|
||||
<shvc:SkillPivot
|
||||
Grid.Column="1"
|
||||
Margin="16,16,0,0"
|
||||
ItemTemplate="{StaticResource TalentDataTemplate}"
|
||||
Skills="{Binding Selected.SkillDepot.Talents}"/>
|
||||
|
||||
<TextBlock
|
||||
Margin="16,32,0,0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarTeamCombinationHeader}"/>
|
||||
<GridView
|
||||
Margin="16,16,0,0"
|
||||
ItemsSource="{Binding Selected.Collocation.Avatars}"
|
||||
SelectionMode="None">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shvc:BottomTextControl Text="{Binding Rate}" ToolTipService.ToolTip="{Binding Name}">
|
||||
<shvc:ItemIcon Icon="{Binding Icon}" Quality="{Binding Quality}"/>
|
||||
</shvc:BottomTextControl>
|
||||
</DataTemplate>
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
<TextBlock
|
||||
Margin="16,0,0,0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarWeaponCombinationHeader}"/>
|
||||
<GridView
|
||||
Margin="16,16,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
ItemsSource="{Binding Selected.Collocation.Weapons}"
|
||||
SelectionMode="None">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shvc:BottomTextControl Text="{Binding Rate}" ToolTipService.ToolTip="{Binding Name}">
|
||||
<shvc:ItemIcon Icon="{Binding Icon}" Quality="{Binding Quality}"/>
|
||||
</shvc:BottomTextControl>
|
||||
</DataTemplate>
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
<TextBlock
|
||||
Margin="16,0,0,0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarArtifactSetCombinationHeader}"/>
|
||||
<GridView
|
||||
Margin="16,16,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
ItemsSource="{Binding Selected.Collocation.ReliquarySets}"
|
||||
SelectionMode="None">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shvc:BottomTextControl Text="{Binding Rate}" ToolTipService.ToolTip="{Binding Name}">
|
||||
<cwuc:SwitchPresenter Value="{Binding Icons.Count, Mode=OneWay}">
|
||||
<cwuc:Case IsDefault="True">
|
||||
<cwuc:Case.Value>
|
||||
<x:Int32>0</x:Int32>
|
||||
</cwuc:Case.Value>
|
||||
<Grid>
|
||||
<shvc:ItemIcon
|
||||
Width="80"
|
||||
Height="80"
|
||||
Icon="{StaticResource UI_ItemIcon_None}"
|
||||
Quality="QUALITY_ORANGE"/>
|
||||
</Grid>
|
||||
</cwuc:Case>
|
||||
<cwuc:Case>
|
||||
<cwuc:Case.Value>
|
||||
<x:Int32>1</x:Int32>
|
||||
</cwuc:Case.Value>
|
||||
<Grid>
|
||||
<shvc:ItemIcon
|
||||
Width="80"
|
||||
Height="80"
|
||||
Icon="{Binding Icons[0]}"
|
||||
Quality="QUALITY_ORANGE"/>
|
||||
</Grid>
|
||||
</cwuc:Case>
|
||||
<cwuc:Case>
|
||||
<cwuc:Case.Value>
|
||||
<x:Int32>2</x:Int32>
|
||||
</cwuc:Case.Value>
|
||||
<Grid>
|
||||
<shvc:ItemIcon Quality="QUALITY_ORANGE"/>
|
||||
<shci:CachedImage
|
||||
Width="54"
|
||||
Margin="0,4,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Source="{Binding Icons[0]}"/>
|
||||
<shci:CachedImage
|
||||
Width="54"
|
||||
Margin="0,0,0,4"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Bottom"
|
||||
Source="{Binding Icons[1]}"/>
|
||||
</Grid>
|
||||
</cwuc:Case>
|
||||
</cwuc:SwitchPresenter>
|
||||
</shvc:BottomTextControl>
|
||||
</DataTemplate>
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
|
||||
<TextBlock
|
||||
Margin="16,32,0,0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarMiscHeader}"/>
|
||||
<Border Margin="16,16,0,0" Style="{StaticResource BorderCardStyle}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<mxi:Interaction.Behaviors>
|
||||
<shcb:AutoHeightBehavior TargetHeight="1024" TargetWidth="2048"/>
|
||||
</mxi:Interaction.Behaviors>
|
||||
<Border Margin="16" Style="{StaticResource BorderCardStyle}">
|
||||
<shci:CachedImage HorizontalAlignment="Stretch" Source="{Binding Selected.Icon, Converter={StaticResource GachaAvatarIconConverter}}"/>
|
||||
</Border>
|
||||
|
||||
<shci:CachedImage
|
||||
Grid.ColumnSpan="2"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Stretch"
|
||||
Source="{Binding Selected.Icon, Converter={StaticResource GachaAvatarImgConverter}}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!-- 料理 -->
|
||||
<Expander
|
||||
Margin="16,16,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Header="{shcm:ResourceString Name=ViewPageWiKiAvatarFoodHeader}">
|
||||
<Grid DataContext="{Binding Selected.CookBonusView}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarSpecialFoodTitle}"/>
|
||||
<shvc:BottomTextControl
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="0,16,0,0"
|
||||
Text="{Binding Item.Name}">
|
||||
<shvc:ItemIcon Icon="{Binding Item.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding Item.RankLevel}"/>
|
||||
</shvc:BottomTextControl>
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
Margin="16,0,0,0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarOriginalFoodTitle}"/>
|
||||
<shvc:BottomTextControl
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Margin="16,16,0,0"
|
||||
Text="{Binding OriginItem.Name}">
|
||||
<shvc:ItemIcon Icon="{Binding OriginItem.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding OriginItem.RankLevel}"/>
|
||||
</shvc:BottomTextControl>
|
||||
<StackPanel
|
||||
Grid.RowSpan="4"
|
||||
Grid.Column="2"
|
||||
Margin="16,0,0,0">
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
Grid.ColumnSpan="4"
|
||||
Text="{Binding Item.Description}"
|
||||
TextWrapping="Wrap"/>
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
Grid.ColumnSpan="4"
|
||||
Margin="0,16,0,0"
|
||||
Text="{Binding Item.EffectDescription}"
|
||||
TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Expander>
|
||||
<!-- 衣装 -->
|
||||
<Expander
|
||||
Margin="16,16,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Header="{shcm:ResourceString Name=ViewPageWiKiAvatarCostumeHeader}">
|
||||
<ItemsControl Margin="0,0,0,-16" ItemsSource="{Binding Selected.Costumes}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Grid.Column="0">
|
||||
<Grid Margin="0,0,0,16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<shci:CachedImage
|
||||
Width="80"
|
||||
Height="80"
|
||||
Margin="0,0,16,0"
|
||||
Source="{StaticResource UI_AvatarIcon_Costume_Card}"/>
|
||||
<shci:CachedImage
|
||||
Width="80"
|
||||
Height="80"
|
||||
Margin="0,0,16,0"
|
||||
Source="{Binding Icon, Converter={StaticResource AvatarCardConverter}}"/>
|
||||
<StackPanel Grid.Column="1" Margin="0,0,16,-4">
|
||||
<TextBlock Text="{Binding Name}"/>
|
||||
<TextBlock
|
||||
Margin="0,8,0,16"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Description}"/>
|
||||
</StackPanel>
|
||||
<shci:MonoChrome
|
||||
Grid.Column="0"
|
||||
Width="32"
|
||||
Height="32"
|
||||
Source="{Binding Selected.FetterInfo.VisionBefore, Converter={StaticResource ElementNameIconConverter}}"/>
|
||||
<shci:MonoChrome
|
||||
Grid.Column="1"
|
||||
Width="32"
|
||||
Height="32"
|
||||
Source="{Binding Selected.Weapon, Converter={StaticResource WeaponTypeIconConverter}}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Expander>
|
||||
<!-- 资料 -->
|
||||
<Expander
|
||||
Margin="16,16,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Header="{shcm:ResourceString Name=ViewPageWiKiAvatarQuotesHeader}">
|
||||
<ItemsControl ItemsSource="{Binding Selected.FetterInfo.Fetters}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Margin="0,0,0,0">
|
||||
<TextBlock Text="{Binding Title}"/>
|
||||
<shct:DescriptionTextBlock Margin="0,8,0,0" Description="{Binding Context}">
|
||||
<shct:DescriptionTextBlock.Resources>
|
||||
<Style BasedOn="{StaticResource CaptionTextBlockStyle}" TargetType="TextBlock"/>
|
||||
</shct:DescriptionTextBlock.Resources>
|
||||
</shct:DescriptionTextBlock>
|
||||
<MenuFlyoutSeparator Margin="0,8"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Expander>
|
||||
<!-- 故事 -->
|
||||
<Expander
|
||||
Margin="16,16,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Header="{shcm:ResourceString Name=ViewPageWiKiAvatarStoriesHeader}">
|
||||
<ItemsControl ItemsSource="{Binding Selected.FetterInfo.FetterStories}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Margin="0,0,0,0">
|
||||
<TextBlock Text="{Binding Title}"/>
|
||||
<shvc:ItemIcon
|
||||
Width="100"
|
||||
Height="100"
|
||||
Icon="{Binding Selected.Icon, Converter={StaticResource AvatarIconConverter}, Mode=OneWay}"
|
||||
Quality="{Binding Selected.Quality, Mode=OneWay}"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="1" Margin="16,0,0,0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="0,8,0,0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Context}"/>
|
||||
<MenuFlyoutSeparator Margin="0,8"/>
|
||||
Margin="0,0,0,2"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||
Text="{Binding Selected.Name}"/>
|
||||
<TextBlock
|
||||
Margin="24,0,0,2"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||
Text="{Binding Selected.FetterInfo.Title}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Expander>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</SplitView.Content>
|
||||
</SplitView>
|
||||
|
||||
<TextBlock
|
||||
Margin="0,12,0,0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Selected.FetterInfo.Detail}"
|
||||
TextWrapping="NoWrap"/>
|
||||
|
||||
<cwuc:UniformGrid
|
||||
Margin="0,12,0,0"
|
||||
ColumnSpacing="12"
|
||||
Columns="4">
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource BaseTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageWiKiAvatarOccupationNameTitle}"/>
|
||||
<TextBlock
|
||||
Margin="0,6,0,0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Selected.FetterInfo.Native}"
|
||||
TextWrapping="NoWrap"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource BaseTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageWiKiAvatarConstellationNameTitle}"/>
|
||||
<TextBlock
|
||||
Margin="0,6,0,0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Selected.FetterInfo.ConstellationBefore}"
|
||||
TextWrapping="NoWrap"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource BaseTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageWiKiAvatarDateofBirthTitle}"/>
|
||||
<TextBlock
|
||||
Margin="0,6,0,0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Selected.FetterInfo.BirthFormatted}"
|
||||
TextWrapping="NoWrap"/>
|
||||
</StackPanel>
|
||||
</cwuc:UniformGrid>
|
||||
|
||||
<cwuc:UniformGrid
|
||||
Margin="0,12,0,0"
|
||||
ColumnSpacing="12"
|
||||
Columns="4">
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource BaseTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageWiKiAvatarChineseCVNameTitle}"/>
|
||||
<TextBlock
|
||||
Margin="0,6,0,0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Selected.FetterInfo.CvChinese}"
|
||||
TextWrapping="NoWrap"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource BaseTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageWiKiAvatarJapaneseCVNameTitle}"/>
|
||||
<TextBlock
|
||||
Margin="0,6,0,0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Selected.FetterInfo.CvJapanese}"
|
||||
TextWrapping="NoWrap"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource BaseTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageWiKiAvatarEnglishCVNameTitle}"/>
|
||||
<TextBlock
|
||||
Margin="0,6,0,0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Selected.FetterInfo.CvEnglish}"
|
||||
TextWrapping="NoWrap"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource BaseTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageWiKiAvatarKoreanCVNameTitle}"/>
|
||||
<TextBlock
|
||||
Margin="0,6,0,0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Selected.FetterInfo.CvKorean}"
|
||||
TextWrapping="NoWrap"/>
|
||||
</StackPanel>
|
||||
</cwuc:UniformGrid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<!-- 属性 -->
|
||||
<shvc:BaseValueSlider
|
||||
Margin="16,16,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
BaseValueInfo="{Binding BaseValueInfo, Mode=OneWay}"/>
|
||||
<TextBlock
|
||||
Margin="16,32,0,0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarAscensionMaterialsHeader}"/>
|
||||
<GridView
|
||||
Margin="16,16,0,0"
|
||||
ItemsSource="{Binding Selected.CultivationItemsView}"
|
||||
SelectionMode="None">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shvc:BottomTextControl Text="{Binding Name}">
|
||||
<shvc:ItemIcon Icon="{Binding Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding RankLevel}"/>
|
||||
</shvc:BottomTextControl>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</GridView>
|
||||
|
||||
<TextBlock
|
||||
Margin="16,32,0,0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarAscensionMaterialsHeader}"/>
|
||||
<shvc:SkillPivot
|
||||
Margin="16,16,0,0"
|
||||
ItemTemplate="{StaticResource SkillDataTemplate}"
|
||||
Skills="{Binding Selected.SkillDepot.CompositeSkills}"/>
|
||||
|
||||
<TextBlock
|
||||
Margin="16,32,0,0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarConstellationNameTitle}"/>
|
||||
<shvc:SkillPivot
|
||||
Grid.Column="1"
|
||||
Margin="16,16,0,0"
|
||||
ItemTemplate="{StaticResource TalentDataTemplate}"
|
||||
Skills="{Binding Selected.SkillDepot.Talents}"/>
|
||||
|
||||
<TextBlock
|
||||
Margin="16,32,0,0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarTeamCombinationHeader}"/>
|
||||
<GridView
|
||||
Margin="16,16,0,0"
|
||||
ItemsSource="{Binding Selected.Collocation.Avatars}"
|
||||
SelectionMode="None">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shvc:BottomTextControl Text="{Binding Rate}" ToolTipService.ToolTip="{Binding Name}">
|
||||
<shvc:ItemIcon Icon="{Binding Icon}" Quality="{Binding Quality}"/>
|
||||
</shvc:BottomTextControl>
|
||||
</DataTemplate>
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
<TextBlock
|
||||
Margin="16,0,0,0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarWeaponCombinationHeader}"/>
|
||||
<GridView
|
||||
Margin="16,16,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
ItemsSource="{Binding Selected.Collocation.Weapons}"
|
||||
SelectionMode="None">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shvc:BottomTextControl Text="{Binding Rate}" ToolTipService.ToolTip="{Binding Name}">
|
||||
<shvc:ItemIcon Icon="{Binding Icon}" Quality="{Binding Quality}"/>
|
||||
</shvc:BottomTextControl>
|
||||
</DataTemplate>
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
<TextBlock
|
||||
Margin="16,0,0,0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarArtifactSetCombinationHeader}"/>
|
||||
<GridView
|
||||
Margin="16,16,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
ItemsSource="{Binding Selected.Collocation.ReliquarySets}"
|
||||
SelectionMode="None">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shvc:BottomTextControl Text="{Binding Rate}" ToolTipService.ToolTip="{Binding Name}">
|
||||
<cwuc:SwitchPresenter Value="{Binding Icons.Count, Mode=OneWay}">
|
||||
<cwuc:Case IsDefault="True">
|
||||
<cwuc:Case.Value>
|
||||
<x:Int32>0</x:Int32>
|
||||
</cwuc:Case.Value>
|
||||
<Grid>
|
||||
<shvc:ItemIcon
|
||||
Width="80"
|
||||
Height="80"
|
||||
Icon="{StaticResource UI_ItemIcon_None}"
|
||||
Quality="QUALITY_ORANGE"/>
|
||||
</Grid>
|
||||
</cwuc:Case>
|
||||
<cwuc:Case>
|
||||
<cwuc:Case.Value>
|
||||
<x:Int32>1</x:Int32>
|
||||
</cwuc:Case.Value>
|
||||
<Grid>
|
||||
<shvc:ItemIcon
|
||||
Width="80"
|
||||
Height="80"
|
||||
Icon="{Binding Icons[0]}"
|
||||
Quality="QUALITY_ORANGE"/>
|
||||
</Grid>
|
||||
</cwuc:Case>
|
||||
<cwuc:Case>
|
||||
<cwuc:Case.Value>
|
||||
<x:Int32>2</x:Int32>
|
||||
</cwuc:Case.Value>
|
||||
<Grid>
|
||||
<shvc:ItemIcon Quality="QUALITY_ORANGE"/>
|
||||
<shci:CachedImage
|
||||
Width="54"
|
||||
Margin="0,4,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Source="{Binding Icons[0]}"/>
|
||||
<shci:CachedImage
|
||||
Width="54"
|
||||
Margin="0,0,0,4"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Bottom"
|
||||
Source="{Binding Icons[1]}"/>
|
||||
</Grid>
|
||||
</cwuc:Case>
|
||||
</cwuc:SwitchPresenter>
|
||||
</shvc:BottomTextControl>
|
||||
</DataTemplate>
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
|
||||
<TextBlock
|
||||
Margin="16,32,0,0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarMiscHeader}"/>
|
||||
<Border Margin="16,16,0,0" Style="{StaticResource BorderCardStyle}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<mxi:Interaction.Behaviors>
|
||||
<shcb:AutoHeightBehavior TargetHeight="1024" TargetWidth="2048"/>
|
||||
</mxi:Interaction.Behaviors>
|
||||
<Border Margin="16" Style="{StaticResource BorderCardStyle}">
|
||||
<shci:CachedImage HorizontalAlignment="Stretch" Source="{Binding Selected.Icon, Converter={StaticResource GachaAvatarIconConverter}}"/>
|
||||
</Border>
|
||||
|
||||
<shci:CachedImage
|
||||
Grid.ColumnSpan="2"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Stretch"
|
||||
Source="{Binding Selected.Icon, Converter={StaticResource GachaAvatarImgConverter}}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!-- 料理 -->
|
||||
<Expander
|
||||
Margin="16,16,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Header="{shcm:ResourceString Name=ViewPageWiKiAvatarFoodHeader}">
|
||||
<Grid DataContext="{Binding Selected.CookBonusView}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarSpecialFoodTitle}"/>
|
||||
<shvc:BottomTextControl
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="0,16,0,0"
|
||||
Text="{Binding Item.Name}">
|
||||
<shvc:ItemIcon Icon="{Binding Item.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding Item.RankLevel}"/>
|
||||
</shvc:BottomTextControl>
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
Margin="16,0,0,0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarOriginalFoodTitle}"/>
|
||||
<shvc:BottomTextControl
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Margin="16,16,0,0"
|
||||
Text="{Binding OriginItem.Name}">
|
||||
<shvc:ItemIcon Icon="{Binding OriginItem.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding OriginItem.RankLevel}"/>
|
||||
</shvc:BottomTextControl>
|
||||
<StackPanel
|
||||
Grid.RowSpan="4"
|
||||
Grid.Column="2"
|
||||
Margin="16,0,0,0">
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
Grid.ColumnSpan="4"
|
||||
Text="{Binding Item.Description}"
|
||||
TextWrapping="Wrap"/>
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
Grid.ColumnSpan="4"
|
||||
Margin="0,16,0,0"
|
||||
Text="{Binding Item.EffectDescription}"
|
||||
TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Expander>
|
||||
<!-- 衣装 -->
|
||||
<Expander
|
||||
Margin="16,16,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Header="{shcm:ResourceString Name=ViewPageWiKiAvatarCostumeHeader}">
|
||||
<ItemsControl Margin="0,0,0,-16" ItemsSource="{Binding Selected.Costumes}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="0,0,0,16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<shci:CachedImage
|
||||
Width="80"
|
||||
Height="80"
|
||||
Margin="0,0,16,0"
|
||||
Source="{StaticResource UI_AvatarIcon_Costume_Card}"/>
|
||||
<shci:CachedImage
|
||||
Width="80"
|
||||
Height="80"
|
||||
Margin="0,0,16,0"
|
||||
Source="{Binding Icon, Converter={StaticResource AvatarCardConverter}}"/>
|
||||
<StackPanel Grid.Column="1" Margin="0,0,16,-4">
|
||||
<TextBlock Text="{Binding Name}"/>
|
||||
<TextBlock
|
||||
Margin="0,8,0,16"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Description}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Expander>
|
||||
<!-- 资料 -->
|
||||
<Expander
|
||||
Margin="16,16,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Header="{shcm:ResourceString Name=ViewPageWiKiAvatarQuotesHeader}">
|
||||
<ItemsControl ItemsSource="{Binding Selected.FetterInfo.Fetters}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Margin="0,0,0,0">
|
||||
<TextBlock Text="{Binding Title}"/>
|
||||
<shct:DescriptionTextBlock Margin="0,8,0,0" Description="{Binding Context}">
|
||||
<shct:DescriptionTextBlock.Resources>
|
||||
<Style BasedOn="{StaticResource CaptionTextBlockStyle}" TargetType="TextBlock"/>
|
||||
</shct:DescriptionTextBlock.Resources>
|
||||
</shct:DescriptionTextBlock>
|
||||
<MenuFlyoutSeparator Margin="0,8"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Expander>
|
||||
<!-- 故事 -->
|
||||
<Expander
|
||||
Margin="16,16,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Header="{shcm:ResourceString Name=ViewPageWiKiAvatarStoriesHeader}">
|
||||
<ItemsControl ItemsSource="{Binding Selected.FetterInfo.FetterStories}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Margin="0,0,0,0">
|
||||
<TextBlock Text="{Binding Title}"/>
|
||||
<TextBlock
|
||||
Margin="0,8,0,0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Context}"/>
|
||||
<MenuFlyoutSeparator Margin="0,8"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Expander>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</SplitView.Content>
|
||||
</SplitView>
|
||||
</cwuc:Case>
|
||||
<cwuc:Case Value="Grid">
|
||||
<GridView
|
||||
Padding="12,12,6,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Left"
|
||||
ItemContainerStyle="{StaticResource LargeGridViewItemStyle}"
|
||||
ItemsSource="{Binding Avatars}"
|
||||
SelectedItem="{Binding Selected, Mode=TwoWay}"
|
||||
SelectionMode="Single">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shvc:BottomTextControl Text="{Binding Name}">
|
||||
<shvc:ItemIcon Icon="{Binding Icon, Converter={StaticResource AvatarIconConverter}, Mode=OneWay}" Quality="{Binding Quality}"/>
|
||||
</shvc:BottomTextControl>
|
||||
</DataTemplate>
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
</cwuc:Case>
|
||||
</cwuc:SwitchPresenter>
|
||||
|
||||
</Grid>
|
||||
<shvc:LoadingView IsLoading="{Binding Avatars, Converter={StaticResource EmptyObjectToBoolRevertConverter}}"/>
|
||||
</Grid>
|
||||
|
||||
74
src/Snap.Hutao/Snap.Hutao/ViewModel/Wiki/AvatarFilter.cs
Normal file
74
src/Snap.Hutao/Snap.Hutao/ViewModel/Wiki/AvatarFilter.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.Extensions.Primitives;
|
||||
using Snap.Hutao.Model.Intrinsic.Immutable;
|
||||
using Snap.Hutao.Model.Metadata.Avatar;
|
||||
|
||||
namespace Snap.Hutao.ViewModel.Wiki;
|
||||
|
||||
/// <summary>
|
||||
/// 角色筛选器
|
||||
/// </summary>
|
||||
internal static class AvatarFilter
|
||||
{
|
||||
/// <summary>
|
||||
/// 构建筛选操作
|
||||
/// </summary>
|
||||
/// <param name="input">输入</param>
|
||||
/// <returns>筛选操作</returns>
|
||||
public static Predicate<object> Compile(string input)
|
||||
{
|
||||
return (object o) => o is Avatar avatar && DoFilter(input, avatar);
|
||||
}
|
||||
|
||||
private static bool DoFilter(string input, Avatar avatar)
|
||||
{
|
||||
List<bool> matches = new();
|
||||
|
||||
foreach (StringSegment segment in new StringTokenizer(input, new char[] { ' ' }))
|
||||
{
|
||||
string value = segment.ToString();
|
||||
|
||||
if (avatar.Name == value)
|
||||
{
|
||||
matches.Add(true);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IntrinsicImmutables.ElementNames.Contains(value))
|
||||
{
|
||||
matches.Add(avatar.FetterInfo.VisionBefore == value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IntrinsicImmutables.AssociationTypes.Contains(value))
|
||||
{
|
||||
matches.Add(avatar.FetterInfo.Association.GetLocalizedDescriptionOrDefault() == value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IntrinsicImmutables.WeaponTypes.Contains(value))
|
||||
{
|
||||
matches.Add(avatar.Weapon.GetLocalizedDescriptionOrDefault() == value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IntrinsicImmutables.ItemQualities.Contains(value))
|
||||
{
|
||||
matches.Add(avatar.Quality.GetLocalizedDescriptionOrDefault() == value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IntrinsicImmutables.BodyTypes.Contains(value))
|
||||
{
|
||||
matches.Add(avatar.Body.GetLocalizedDescriptionOrDefault() == value);
|
||||
continue;
|
||||
}
|
||||
|
||||
matches.Add(false);
|
||||
}
|
||||
|
||||
return matches.Count > 0 && matches.Aggregate((a, b) => a && b);
|
||||
}
|
||||
}
|
||||
60
src/Snap.Hutao/Snap.Hutao/ViewModel/Wiki/WeaponFilter.cs
Normal file
60
src/Snap.Hutao/Snap.Hutao/ViewModel/Wiki/WeaponFilter.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.Extensions.Primitives;
|
||||
using Snap.Hutao.Model.Intrinsic.Immutable;
|
||||
using Snap.Hutao.Model.Metadata.Weapon;
|
||||
|
||||
namespace Snap.Hutao.ViewModel.Wiki;
|
||||
|
||||
/// <summary>
|
||||
/// 武器筛选器
|
||||
/// </summary>
|
||||
internal static class WeaponFilter
|
||||
{
|
||||
/// <summary>
|
||||
/// 构建筛选操作
|
||||
/// </summary>
|
||||
/// <param name="input">输入</param>
|
||||
/// <returns>筛选操作</returns>
|
||||
public static Predicate<object> Compile(string input)
|
||||
{
|
||||
return (object o) => o is Weapon weapon && DoFilter(input, weapon);
|
||||
}
|
||||
|
||||
private static bool DoFilter(string input, Weapon weapon)
|
||||
{
|
||||
List<bool> matches = new();
|
||||
|
||||
foreach (StringSegment segment in new StringTokenizer(input, ' '.Enumerate().ToArray()))
|
||||
{
|
||||
string value = segment.ToString();
|
||||
|
||||
if (weapon.Name == value)
|
||||
{
|
||||
matches.Add(true);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IntrinsicImmutables.WeaponTypes.Contains(value))
|
||||
{
|
||||
matches.Add(weapon.WeaponType.GetLocalizedDescriptionOrDefault() == value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IntrinsicImmutables.ItemQualities.Contains(value))
|
||||
{
|
||||
matches.Add(weapon.Quality.GetLocalizedDescriptionOrDefault() == value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IntrinsicImmutables.FightProperties.Contains(value))
|
||||
{
|
||||
matches.Add(weapon.GrowCurves.ElementAtOrDefault(1).Key.GetLocalizedDescriptionOrDefault() == value);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return matches.Count > 0 && matches.Aggregate((a, b) => a && b);
|
||||
}
|
||||
}
|
||||
@@ -224,62 +224,4 @@ internal sealed partial class WikiAvatarViewModel : Abstraction.ViewModel
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class AvatarFilter
|
||||
{
|
||||
public static Predicate<object> Compile(string input)
|
||||
{
|
||||
return (object o) => o is Avatar avatar && DoFilter(input, avatar);
|
||||
}
|
||||
|
||||
private static bool DoFilter(string input, Avatar avatar)
|
||||
{
|
||||
List<bool> matches = new();
|
||||
|
||||
foreach (StringSegment segment in new StringTokenizer(input, ' '.Enumerate().ToArray()))
|
||||
{
|
||||
string value = segment.ToString();
|
||||
|
||||
if (avatar.Name == value)
|
||||
{
|
||||
matches.Add(true);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IntrinsicImmutables.ElementNames.Contains(value))
|
||||
{
|
||||
matches.Add(avatar.FetterInfo.VisionBefore == value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IntrinsicImmutables.AssociationTypes.Contains(value))
|
||||
{
|
||||
matches.Add(avatar.FetterInfo.Association.GetLocalizedDescriptionOrDefault() == value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IntrinsicImmutables.WeaponTypes.Contains(value))
|
||||
{
|
||||
matches.Add(avatar.Weapon.GetLocalizedDescriptionOrDefault() == value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IntrinsicImmutables.ItemQualities.Contains(value))
|
||||
{
|
||||
matches.Add(avatar.Quality.GetLocalizedDescriptionOrDefault() == value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IntrinsicImmutables.BodyTypes.Contains(value))
|
||||
{
|
||||
matches.Add(avatar.Body.GetLocalizedDescriptionOrDefault() == value);
|
||||
continue;
|
||||
}
|
||||
|
||||
matches.Add(false);
|
||||
}
|
||||
|
||||
return matches.Count > 0 && matches.Aggregate((a, b) => a && b);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,9 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using CommunityToolkit.WinUI.UI;
|
||||
using Microsoft.Extensions.Primitives;
|
||||
using Snap.Hutao.Model.Calculable;
|
||||
using Snap.Hutao.Model.Entity.Primitive;
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Model.Intrinsic.Immutable;
|
||||
using Snap.Hutao.Model.Metadata;
|
||||
using Snap.Hutao.Model.Metadata.Weapon;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
@@ -215,48 +213,4 @@ internal sealed partial class WikiWeaponViewModel : Abstraction.ViewModel
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class WeaponFilter
|
||||
{
|
||||
public static Predicate<object> Compile(string input)
|
||||
{
|
||||
return (object o) => o is Weapon weapon && DoFilter(input, weapon);
|
||||
}
|
||||
|
||||
private static bool DoFilter(string input, Weapon weapon)
|
||||
{
|
||||
List<bool> matches = new();
|
||||
|
||||
foreach (StringSegment segment in new StringTokenizer(input, ' '.Enumerate().ToArray()))
|
||||
{
|
||||
string value = segment.ToString();
|
||||
|
||||
if (weapon.Name == value)
|
||||
{
|
||||
matches.Add(true);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IntrinsicImmutables.WeaponTypes.Contains(value))
|
||||
{
|
||||
matches.Add(weapon.WeaponType.GetLocalizedDescriptionOrDefault() == value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IntrinsicImmutables.ItemQualities.Contains(value))
|
||||
{
|
||||
matches.Add(weapon.Quality.GetLocalizedDescriptionOrDefault() == value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IntrinsicImmutables.FightProperties.Contains(value))
|
||||
{
|
||||
matches.Add(weapon.GrowCurves.ElementAtOrDefault(1).Key.GetLocalizedDescriptionOrDefault() == value);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return matches.Count > 0 && matches.Aggregate((a, b) => a && b);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,9 +20,9 @@ namespace Snap.Hutao.Web.Hoyolab.App.Account;
|
||||
[HttpClient(HttpClientConfiguration.XRpc)]
|
||||
internal sealed partial class AccountClient
|
||||
{
|
||||
private readonly HttpClient httpClient;
|
||||
private readonly JsonSerializerOptions options;
|
||||
private readonly ILogger<AccountClient> logger;
|
||||
private readonly HttpClient httpClient;
|
||||
|
||||
/// <summary>
|
||||
/// 异步生成米游社操作验证密钥
|
||||
|
||||
Reference in New Issue
Block a user