Compare commits

..

1 Commits

Author SHA1 Message Date
qhy040404
fe9078d486 prompt if hotkey not registered 2024-02-21 19:28:08 +08:00
52 changed files with 180 additions and 678 deletions

View File

@@ -18,7 +18,7 @@ body:
options: options:
- label: 我已阅读 Snap Hutao 文档中的[常见问题](https://hut.ao/advanced/FAQ.html)和[常见程序异常](https://hut.ao/advanced/exceptions.html),我的问题没有在文档中得到解答 - label: 我已阅读 Snap Hutao 文档中的[常见问题](https://hut.ao/advanced/FAQ.html)和[常见程序异常](https://hut.ao/advanced/exceptions.html),我的问题没有在文档中得到解答
required: true required: true
- label: 我知道文档站的导航栏中有**搜索功能**,且已经搜索过相关关键词 - label: 我知道文档站的导航栏中有**搜索功能**,且已经搜索过相关关键词
required: true required: true
@@ -29,12 +29,12 @@ body:
id: winver id: winver
attributes: attributes:
label: Windows 版本 label: Windows 版本
description: | description: |
`Win+R` 输入 `winver` 回车后在打开的窗口第二行可以找到 `Win+R` 输入 `winver` 回车后在打开的窗口第二行可以找到
placeholder: 22000.556 placeholder: 22000.556
validations: validations:
required: true required: true
- type: input - type: input
id: shver id: shver
attributes: attributes:
@@ -48,10 +48,10 @@ body:
id: deviceid id: deviceid
attributes: attributes:
label: 设备 ID label: 设备 ID
description: | description: |
在胡桃工具箱的反馈中心界面,你可以找到并复制你的设备 ID 在胡桃工具箱的反馈中心界面,你可以找到并复制你的设备 ID
如果你的问题涉及程序崩溃,请填写该项,这将有助于我们定位问题 如果你的问题涉及程序崩溃,请填写该项,这将有助于我们定位问题
如果你的程序已经无法启动,请下载并运行[诊断工具](https://github.com/DGP-Automation/ISSUE_TEMPLATES/releases/download/diagnosis_tools/Snap.Hutao.Diagnostic.Tooling.exe),它将显示你的设备 ID 如果你的程序已经无法启动,请下载并运行[诊断工具](https://github.com/DGP-Automation/ISSUE_TEMPLATES/releases/download/diagnosis_tools/Snap.Hutao.DiagTools.exe),它将显示你的设备 ID
validations: validations:
required: false required: false
@@ -79,7 +79,7 @@ body:
- 公告 - 公告
- 其它 - 其它
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: what-happened id: what-happened
@@ -107,3 +107,4 @@ body:
options: options:
- label: 我认为上述的描述已经足以详细,以允许开发人员能复现该问题 - label: 我认为上述的描述已经足以详细,以允许开发人员能复现该问题
required: true required: true

View File

@@ -18,7 +18,7 @@ body:
options: options:
- label: I have read [FAQ page](https://hut.ao/advanced/FAQ.html) and [Exception page](https://hut.ao/advanced/exceptions.html) in Snap Hutao document, and my issue is not answered - label: I have read [FAQ page](https://hut.ao/advanced/FAQ.html) and [Exception page](https://hut.ao/advanced/exceptions.html) in Snap Hutao document, and my issue is not answered
required: true required: true
- label: I and tried **search feature** in Snap Hutao document site, and no associated article - label: I and tried **search feature** in Snap Hutao document site, and no associated article
required: true required: true
@@ -29,12 +29,12 @@ body:
id: winver id: winver
attributes: attributes:
label: Windows Version label: Windows Version
description: | description: |
Use `Win+R` and input `winver`, Windows build version is usually at the second line Use `Win+R` and input `winver`, Windows build version is usually at the second line
placeholder: e.g. 22000.556 placeholder: e.g. 22000.556
validations: validations:
required: true required: true
- type: input - type: input
id: shver id: shver
attributes: attributes:
@@ -48,10 +48,10 @@ body:
id: deviceid id: deviceid
attributes: attributes:
label: Device ID label: Device ID
description: | description: |
In Snap Hutao's Feedback Center, you can find and copy your device ID In Snap Hutao's Feedback Center, you can find and copy your device ID
If your issue is about program crash, please fill this so we can dump the log and locate the source easier If your issue is about program crash, please fill this so we can dump the log and locate the source easier
If your program cannot startup, please download and run [Diagnostic Tooling](https://github.com/DGP-Automation/ISSUE_TEMPLATES/releases/download/diagnosis_tools/Snap.Hutao.Diagnostic.Tooling.exe), it will shows your device ID. If your program cannot startup, please download and run [Diagnosis Tool](https://github.com/DGP-Automation/ISSUE_TEMPLATES/releases/download/diagnosis_tools/Snap.Hutao.DiagTools.exe), it will shows your device ID.
validations: validations:
required: false required: false
@@ -74,12 +74,12 @@ body:
- User Interface - User Interface
- Snap Hutao Cloud - Snap Hutao Cloud
- Snap Hutao Account - Snap Hutao Account
- Checkin - Checkin
- Wiki - Wiki
- Announcement - Announcement
- Other - Other
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: what-happened id: what-happened
@@ -107,3 +107,4 @@ body:
options: options:
- label: I believe the description above is detail enough to allow developers to reproduce the issue - label: I believe the description above is detail enough to allow developers to reproduce the issue
required: true required: true

View File

@@ -13,8 +13,4 @@ updates:
groups: groups:
packages: packages:
patterns: patterns:
- "*" - "*"
- package-ecosystem: "github-actions"
directory: "/.github/workflows" # GitHub Workflows
schedule:
interval: "weekly"

View File

@@ -31,10 +31,10 @@ jobs:
runs-on: self-hosted runs-on: self-hosted
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4.1.1
- name: Setup .NET - name: Setup .NET
uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v4.0.0
with: with:
dotnet-version: 8.0 dotnet-version: 8.0

View File

@@ -74,4 +74,3 @@ Refresh:
script: script:
- apt-get install -y curl - apt-get install -y curl
- curl -X PATCH "$PURGE_URL" - curl -X PATCH "$PURGE_URL"
- curl -X POST -o /dev/null "$UPLOAD_OSS_URL"

View File

@@ -5,6 +5,7 @@ using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media; using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Shapes; using Microsoft.UI.Xaml.Shapes;
using System.Collections.Specialized;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Snap.Hutao.Control.Brush; namespace Snap.Hutao.Control.Brush;

View File

@@ -4,6 +4,7 @@
using CommunityToolkit.WinUI.Collections; using CommunityToolkit.WinUI.Collections;
using CommunityToolkit.WinUI.Helpers; using CommunityToolkit.WinUI.Helpers;
using Microsoft.UI.Xaml.Data; using Microsoft.UI.Xaml.Data;
using Snap.Hutao.Core.ExceptionService;
using System.Collections; using System.Collections;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Collections.Specialized; using System.Collections.Specialized;
@@ -207,11 +208,13 @@ internal sealed class AdvancedCollectionView<T> : IAdvancedCollectionView<T>, IN
public void Add(T item) public void Add(T item)
{ {
ThrowHelper.NotSupportedIf(IsReadOnly, "Collection is read-only.");
source.Add(item); source.Add(item);
} }
public void Clear() public void Clear()
{ {
ThrowHelper.NotSupportedIf(IsReadOnly, "Collection is read-only.");
source.Clear(); source.Clear();
} }
@@ -227,6 +230,7 @@ internal sealed class AdvancedCollectionView<T> : IAdvancedCollectionView<T>, IN
public bool Remove(T item) public bool Remove(T item)
{ {
ThrowHelper.NotSupportedIf(IsReadOnly, "Collection is read-only.");
source.Remove(item); source.Remove(item);
return true; return true;
} }
@@ -239,6 +243,7 @@ internal sealed class AdvancedCollectionView<T> : IAdvancedCollectionView<T>, IN
public void Insert(int index, T item) public void Insert(int index, T item)
{ {
ThrowHelper.NotSupportedIf(IsReadOnly, "Collection is read-only.");
source.Insert(index, item); source.Insert(index, item);
} }

View File

@@ -1,6 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
namespace Snap.Hutao.Control;
internal interface IXamlElementAccessor;

View File

@@ -41,14 +41,12 @@ internal class ScopedPage : Page
/// 应当在 InitializeComponent() 前调用 /// 应当在 InitializeComponent() 前调用
/// </summary> /// </summary>
/// <typeparam name="TViewModel">视图模型类型</typeparam> /// <typeparam name="TViewModel">视图模型类型</typeparam>
protected TViewModel InitializeWith<TViewModel>() protected void InitializeWith<TViewModel>()
where TViewModel : class, IViewModel where TViewModel : class, IViewModel
{ {
IViewModel viewModel = currentScope.ServiceProvider.GetRequiredService<TViewModel>(); IViewModel viewModel = currentScope.ServiceProvider.GetRequiredService<TViewModel>();
viewModel.CancellationToken = viewCancellationTokenSource.Token; viewModel.CancellationToken = viewCancellationTokenSource.Token;
DataContext = viewModel; DataContext = viewModel;
return (TViewModel)viewModel;
} }
/// <inheritdoc/> /// <inheritdoc/>

View File

@@ -1,6 +1,7 @@
// Copyright (c) DGP Studio. All rights reserved. // Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license. // Licensed under the MIT license.
using Snap.Hutao.Core.DependencyInjection.Abstraction;
using Snap.Hutao.Core.IO; using Snap.Hutao.Core.IO;
namespace Snap.Hutao.Core.Caching; namespace Snap.Hutao.Core.Caching;
@@ -9,7 +10,7 @@ namespace Snap.Hutao.Core.Caching;
/// 为图像缓存提供抽象 /// 为图像缓存提供抽象
/// </summary> /// </summary>
[HighQuality] [HighQuality]
internal interface IImageCache internal interface IImageCache : ICastService
{ {
/// <summary> /// <summary>
/// Gets the file path containing cached item for given Uri /// Gets the file path containing cached item for given Uri

View File

@@ -7,6 +7,4 @@ internal enum HutaoExceptionKind
{ {
None, None,
ServiceTypeCastFailed, ServiceTypeCastFailed,
FileSystemCreateFileInsufficientPermissions,
PrivateNamedPipeContentHashIncorrect,
} }

View File

@@ -29,7 +29,7 @@ internal readonly struct TempFile : IDisposable
} }
catch (UnauthorizedAccessException ex) catch (UnauthorizedAccessException ex)
{ {
HutaoException.Throw(HutaoExceptionKind.FileSystemCreateFileInsufficientPermissions, SH.CoreIOTempFileCreateFail, ex); ThrowHelper.RuntimeEnvironment(SH.CoreIOTempFileCreateFail, ex);
} }
if (delete) if (delete)

View File

@@ -148,15 +148,17 @@ internal sealed partial class Activation : IActivation
await taskContext.SwitchToBackgroundAsync(); await taskContext.SwitchToBackgroundAsync();
if (serviceProvider.GetRequiredService<IMetadataService>() is IMetadataServiceInitialization metadataServiceInitialization) serviceProvider
{ .GetRequiredService<IMetadataService>()
metadataServiceInitialization.InitializeInternalAsync().SafeForget(); .As<IMetadataServiceInitialization>()?
} .InitializeInternalAsync()
.SafeForget();
if (serviceProvider.GetRequiredService<IHutaoUserService>() is IHutaoUserServiceInitialization hutaoUserServiceInitialization) serviceProvider
{ .GetRequiredService<IHutaoUserService>()
hutaoUserServiceInitialization.InitializeInternalAsync().SafeForget(); .As<IHutaoUserServiceInitialization>()?
} .InitializeInternalAsync()
.SafeForget();
serviceProvider serviceProvider
.GetRequiredService<IDiscordService>() .GetRequiredService<IDiscordService>()

View File

@@ -49,7 +49,7 @@ internal sealed partial class PrivateNamedPipeServer : IDisposable
{ {
byte[] content = new byte[header->ContentLength]; byte[] content = new byte[header->ContentLength];
serverStream.ReadAtLeast(content, header->ContentLength, false); serverStream.ReadAtLeast(content, header->ContentLength, false);
HutaoException.ThrowIf(XxHash64.HashToUInt64(content) != header->Checksum, HutaoExceptionKind.PrivateNamedPipeContentHashIncorrect, "PipePacket Content Hash incorrect"); ThrowHelper.InvalidDataIf(XxHash64.HashToUInt64(content) != header->Checksum, "PipePacket Content Hash incorrect");
return content; return content;
} }

View File

@@ -18,11 +18,20 @@ internal static class DateTimeOffsetExtension
return defaultValue; return defaultValue;
} }
return value switch try
{ {
>= -62135596800 and <= 253402300799 => DateTimeOffset.FromUnixTimeSeconds(value), return DateTimeOffset.FromUnixTimeSeconds(value);
>= -62135596800000 and <= 253402300799999 => DateTimeOffset.FromUnixTimeMilliseconds(value), }
_ => defaultValue, catch (ArgumentOutOfRangeException)
}; {
try
{
return DateTimeOffset.FromUnixTimeMilliseconds(value);
}
catch (ArgumentOutOfRangeException)
{
return defaultValue;
}
}
} }
} }

View File

@@ -46,6 +46,34 @@ internal static partial class EnumerableExtension
return first; return first;
} }
public static string JoinToString<T>(this IEnumerable<T> source, char separator, Action<StringBuilder, T> selector)
{
StringBuilder resultBuilder = new();
IEnumerator<T> enumerator = source.GetEnumerator();
if (!enumerator.MoveNext())
{
return string.Empty;
}
T first = enumerator.Current;
selector(resultBuilder, first);
if (!enumerator.MoveNext())
{
return resultBuilder.ToString();
}
do
{
resultBuilder.Append(separator);
selector(resultBuilder, enumerator.Current);
}
while (enumerator.MoveNext());
return resultBuilder.ToString();
}
public static string JoinToString<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source, char separator, Action<StringBuilder, TKey, TValue> selector) public static string JoinToString<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source, char separator, Action<StringBuilder, TKey, TValue> selector)
{ {
StringBuilder resultBuilder = new(); StringBuilder resultBuilder = new();

View File

@@ -27,7 +27,7 @@ internal sealed partial class MainWindow : Window, IWindowOptionsSource, IMinMax
public MainWindow(IServiceProvider serviceProvider) public MainWindow(IServiceProvider serviceProvider)
{ {
InitializeComponent(); InitializeComponent();
windowOptions = new(this, TitleBarView.DragArea, new(1200, 741), true); windowOptions = new(this, TitleBarView.DragArea, new(1200, 741), true, false);
this.InitializeController(serviceProvider); this.InitializeController(serviceProvider);
} }

View File

@@ -1,6 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
namespace Snap.Hutao.Message;
internal sealed class BackgroundImageTypeChangedMessage;

View File

@@ -13,7 +13,7 @@
<Identity <Identity
Name="60568DGPStudio.SnapHutao" Name="60568DGPStudio.SnapHutao"
Publisher="CN=35C8E923-85DF-49A7-9172-B39DC6312C52" Publisher="CN=35C8E923-85DF-49A7-9172-B39DC6312C52"
Version="1.9.7.0" /> Version="1.9.6.0" />
<Properties> <Properties>
<DisplayName>Snap Hutao</DisplayName> <DisplayName>Snap Hutao</DisplayName>

View File

@@ -13,7 +13,7 @@
<Identity <Identity
Name="60568DGPStudio.SnapHutaoDev" Name="60568DGPStudio.SnapHutaoDev"
Publisher="CN=35C8E923-85DF-49A7-9172-B39DC6312C52" Publisher="CN=35C8E923-85DF-49A7-9172-B39DC6312C52"
Version="1.9.7.0" /> Version="1.9.6.0" />
<Properties> <Properties>
<DisplayName>Snap Hutao Dev</DisplayName> <DisplayName>Snap Hutao Dev</DisplayName>

View File

@@ -145,7 +145,7 @@
<value>Save</value> <value>Save</value>
</data> </data>
<data name="ControlImageCachedImageInvalidResourceUri" xml:space="preserve"> <data name="ControlImageCachedImageInvalidResourceUri" xml:space="preserve">
<value>Invalid Uri</value> <value>Invalid URL</value>
</data> </data>
<data name="ControlImageCompositionImageHttpRequest" xml:space="preserve"> <data name="ControlImageCompositionImageHttpRequest" xml:space="preserve">
<value>HTTP GET {0}</value> <value>HTTP GET {0}</value>
@@ -285,7 +285,7 @@
<comment>Need EXACT same string in game</comment> <comment>Need EXACT same string in game</comment>
</data> </data>
<data name="ModelIntrinsicAssociationTypeInazuma" xml:space="preserve"> <data name="ModelIntrinsicAssociationTypeInazuma" xml:space="preserve">
<value>Inazuma</value> <value>Inadzuma</value>
<comment>Need EXACT same string in game</comment> <comment>Need EXACT same string in game</comment>
</data> </data>
<data name="ModelIntrinsicAssociationTypeLiyue" xml:space="preserve"> <data name="ModelIntrinsicAssociationTypeLiyue" xml:space="preserve">
@@ -546,7 +546,7 @@
<value>Uploaded {1} wish records of UID: {0}, stored {2}</value> <value>Uploaded {1} wish records of UID: {0}, stored {2}</value>
</data> </data>
<data name="ServerPassportLoginRequired" xml:space="preserve"> <data name="ServerPassportLoginRequired" xml:space="preserve">
<value>Please login or register Snap Hutao account first</value> <value>Please login or register Hutao account first</value>
</data> </data>
<data name="ServerPassportLoginSucceed" xml:space="preserve"> <data name="ServerPassportLoginSucceed" xml:space="preserve">
<value>Login successfully</value> <value>Login successfully</value>
@@ -558,7 +558,7 @@
<value>Password has been set successfully</value> <value>Password has been set successfully</value>
</data> </data>
<data name="ServerPassportServiceEmailHasNotRegistered" xml:space="preserve"> <data name="ServerPassportServiceEmailHasNotRegistered" xml:space="preserve">
<value>Current email address is not registered</value> <value>Current email adress is not registered</value>
</data> </data>
<data name="ServerPassportServiceEmailHasRegistered" xml:space="preserve"> <data name="ServerPassportServiceEmailHasRegistered" xml:space="preserve">
<value>Current emaill address is registered</value> <value>Current emaill address is registered</value>
@@ -767,21 +767,6 @@
<data name="ServiceAvatarInfoSummaryShowcaseRefreshTimeFormat" xml:space="preserve"> <data name="ServiceAvatarInfoSummaryShowcaseRefreshTimeFormat" xml:space="preserve">
<value>Character Showcase: {0:MM-dd HH:mm}</value> <value>Character Showcase: {0:MM-dd HH:mm}</value>
</data> </data>
<data name="ServiceBackgroundImageTypeBing" xml:space="preserve">
<value>Bing Daily Wallpaper</value>
</data>
<data name="ServiceBackgroundImageTypeDaily" xml:space="preserve">
<value>Hutao Daily Wallpaper</value>
</data>
<data name="ServiceBackgroundImageTypeLauncher" xml:space="preserve">
<value>Genshin Official Launcher Wallpaper</value>
</data>
<data name="ServiceBackgroundImageTypeLocalFolder" xml:space="preserve">
<value>Local Random Image</value>
</data>
<data name="ServiceBackgroundImageTypeNone" xml:space="preserve">
<value>No Wallpaper</value>
</data>
<data name="ServiceCultivationProjectCurrentUserdataCourrpted" xml:space="preserve"> <data name="ServiceCultivationProjectCurrentUserdataCourrpted" xml:space="preserve">
<value>Failed to save development plan status</value> <value>Failed to save development plan status</value>
</data> </data>
@@ -839,9 +824,6 @@
<data name="ServiceDailyNoteNotifierTransformerHint" xml:space="preserve"> <data name="ServiceDailyNoteNotifierTransformerHint" xml:space="preserve">
<value>Parametric Transformer is ready</value> <value>Parametric Transformer is ready</value>
</data> </data>
<data name="ServiceDiscordActivityElevationRequiredHint" xml:space="preserve">
<value>Missing permission, unable to set your Discord Activity.</value>
</data>
<data name="ServiceDiscordGameActivityDetails" xml:space="preserve"> <data name="ServiceDiscordGameActivityDetails" xml:space="preserve">
<value>Exploring in Teyvat</value> <value>Exploring in Teyvat</value>
</data> </data>
@@ -1409,9 +1391,6 @@
<data name="ViewLaunchGameHeader" xml:space="preserve"> <data name="ViewLaunchGameHeader" xml:space="preserve">
<value>Game Launcher</value> <value>Game Launcher</value>
</data> </data>
<data name="ViewListViewDragElevatedHint" xml:space="preserve">
<value>Cannot reorder in Admin Mode</value>
</data>
<data name="ViewModelAchievementArchiveAdded" xml:space="preserve"> <data name="ViewModelAchievementArchiveAdded" xml:space="preserve">
<value>Archive [{0}] added successfully</value> <value>Archive [{0}] added successfully</value>
</data> </data>
@@ -1691,9 +1670,6 @@
<data name="ViewModelWelcomeDownloadSummaryComplete" xml:space="preserve"> <data name="ViewModelWelcomeDownloadSummaryComplete" xml:space="preserve">
<value>Completed</value> <value>Completed</value>
</data> </data>
<data name="ViewModelWelcomeDownloadSummaryContentTypeNotMatch" xml:space="preserve">
<value>Response stream does not contain valid content type</value>
</data>
<data name="ViewModelWelcomeDownloadSummaryDefault" xml:space="preserve"> <data name="ViewModelWelcomeDownloadSummaryDefault" xml:space="preserve">
<value>Queued</value> <value>Queued</value>
</data> </data>
@@ -2210,12 +2186,6 @@
<data name="ViewPageLaunchGameArgumentsHeader" xml:space="preserve"> <data name="ViewPageLaunchGameArgumentsHeader" xml:space="preserve">
<value>Launch Parameters</value> <value>Launch Parameters</value>
</data> </data>
<data name="ViewPageLaunchGameBetterGIDescription" xml:space="preserve">
<value>Auto start Better GUI for automation tasks after game launched</value>
</data>
<data name="ViewPageLaunchGameBetterGIHeader" xml:space="preserve">
<value>Better GI</value>
</data>
<data name="ViewPageLaunchGameCommonHeader" xml:space="preserve"> <data name="ViewPageLaunchGameCommonHeader" xml:space="preserve">
<value>General</value> <value>General</value>
</data> </data>
@@ -2357,15 +2327,6 @@
<data name="ViewPageSettingBackdropMaterialHeader" xml:space="preserve"> <data name="ViewPageSettingBackdropMaterialHeader" xml:space="preserve">
<value>Backdrop Material</value> <value>Backdrop Material</value>
</data> </data>
<data name="ViewPageSettingBackgroundImageCopyrightHeader" xml:space="preserve">
<value>Image Copyright Information</value>
</data>
<data name="ViewPageSettingBackgroundImageDescription" xml:space="preserve">
<value>Change the source of wallpaper, restart Snap Hutao to apply the change</value>
</data>
<data name="ViewPageSettingBackgroundImageHeader" xml:space="preserve">
<value>Wallpaper Image</value>
</data>
<data name="ViewPageSettingCacheFolderDescription" xml:space="preserve"> <data name="ViewPageSettingCacheFolderDescription" xml:space="preserve">
<value>Images cache are saved here</value> <value>Images cache are saved here</value>
</data> </data>
@@ -2583,10 +2544,10 @@
<value>Reset Image Resource</value> <value>Reset Image Resource</value>
</data> </data>
<data name="ViewPageSettingsAdvancedOptionsLaunchUnlockFpsDescription" xml:space="preserve"> <data name="ViewPageSettingsAdvancedOptionsLaunchUnlockFpsDescription" xml:space="preserve">
<value>Add Unlock Frame Rate Limit Option in Game Launcher Process Section</value> <value>在启动游戏页面的进程部分加入解锁帧率限制选项</value>
</data> </data>
<data name="ViewPageSettingsAdvancedOptionsLaunchUnlockFpsHeader" xml:space="preserve"> <data name="ViewPageSettingsAdvancedOptionsLaunchUnlockFpsHeader" xml:space="preserve">
<value>Game Launcher - Unlock Frame Rate Limit</value> <value>启动游戏-解锁帧率限制</value>
</data> </data>
<data name="ViewPageSettingSetDataFolderDescription" xml:space="preserve"> <data name="ViewPageSettingSetDataFolderDescription" xml:space="preserve">
<value>You need to move data in the directory manually, otherwise new user data will be created.</value> <value>You need to move data in the directory manually, otherwise new user data will be created.</value>

View File

@@ -767,21 +767,6 @@
<data name="ServiceAvatarInfoSummaryShowcaseRefreshTimeFormat" xml:space="preserve"> <data name="ServiceAvatarInfoSummaryShowcaseRefreshTimeFormat" xml:space="preserve">
<value>Pameran Karakter: {0:MM-dd HH:mm}</value> <value>Pameran Karakter: {0:MM-dd HH:mm}</value>
</data> </data>
<data name="ServiceBackgroundImageTypeBing" xml:space="preserve">
<value>必应每日一图</value>
</data>
<data name="ServiceBackgroundImageTypeDaily" xml:space="preserve">
<value>胡桃每日一图</value>
</data>
<data name="ServiceBackgroundImageTypeLauncher" xml:space="preserve">
<value>官方启动器壁纸</value>
</data>
<data name="ServiceBackgroundImageTypeLocalFolder" xml:space="preserve">
<value>本地随机图片</value>
</data>
<data name="ServiceBackgroundImageTypeNone" xml:space="preserve">
<value>无背景图片</value>
</data>
<data name="ServiceCultivationProjectCurrentUserdataCourrpted" xml:space="preserve"> <data name="ServiceCultivationProjectCurrentUserdataCourrpted" xml:space="preserve">
<value>Gagal menyimpan status rencana pengembangan</value> <value>Gagal menyimpan status rencana pengembangan</value>
</data> </data>
@@ -839,9 +824,6 @@
<data name="ServiceDailyNoteNotifierTransformerHint" xml:space="preserve"> <data name="ServiceDailyNoteNotifierTransformerHint" xml:space="preserve">
<value>Parametric Transformer telah siap</value> <value>Parametric Transformer telah siap</value>
</data> </data>
<data name="ServiceDiscordActivityElevationRequiredHint" xml:space="preserve">
<value>权限不足,将无法为您设置 Discord Activity 状态</value>
</data>
<data name="ServiceDiscordGameActivityDetails" xml:space="preserve"> <data name="ServiceDiscordGameActivityDetails" xml:space="preserve">
<value>Menjelajahi di Teyvat</value> <value>Menjelajahi di Teyvat</value>
</data> </data>
@@ -1409,9 +1391,6 @@
<data name="ViewLaunchGameHeader" xml:space="preserve"> <data name="ViewLaunchGameHeader" xml:space="preserve">
<value>Game Launcher</value> <value>Game Launcher</value>
</data> </data>
<data name="ViewListViewDragElevatedHint" xml:space="preserve">
<value>管理员模式下无法拖动排序</value>
</data>
<data name="ViewModelAchievementArchiveAdded" xml:space="preserve"> <data name="ViewModelAchievementArchiveAdded" xml:space="preserve">
<value>Arsip [{0}] berhasil ditambahkan</value> <value>Arsip [{0}] berhasil ditambahkan</value>
</data> </data>
@@ -1691,9 +1670,6 @@
<data name="ViewModelWelcomeDownloadSummaryComplete" xml:space="preserve"> <data name="ViewModelWelcomeDownloadSummaryComplete" xml:space="preserve">
<value>Selesai</value> <value>Selesai</value>
</data> </data>
<data name="ViewModelWelcomeDownloadSummaryContentTypeNotMatch" xml:space="preserve">
<value>响应内容不是有效的文件字节流</value>
</data>
<data name="ViewModelWelcomeDownloadSummaryDefault" xml:space="preserve"> <data name="ViewModelWelcomeDownloadSummaryDefault" xml:space="preserve">
<value>Mengantre</value> <value>Mengantre</value>
</data> </data>
@@ -2034,7 +2010,7 @@
<value>Pratinjau</value> <value>Pratinjau</value>
</data> </data>
<data name="ViewPageGahcaLogPivotStatistics" xml:space="preserve"> <data name="ViewPageGahcaLogPivotStatistics" xml:space="preserve">
<value>Statistik</value> <value>全球祈愿统计</value>
</data> </data>
<data name="ViewPageGahcaLogPivotWeapon" xml:space="preserve"> <data name="ViewPageGahcaLogPivotWeapon" xml:space="preserve">
<value>Senjata</value> <value>Senjata</value>
@@ -2210,12 +2186,6 @@
<data name="ViewPageLaunchGameArgumentsHeader" xml:space="preserve"> <data name="ViewPageLaunchGameArgumentsHeader" xml:space="preserve">
<value>Argumen Awalan</value> <value>Argumen Awalan</value>
</data> </data>
<data name="ViewPageLaunchGameBetterGIDescription" xml:space="preserve">
<value>在游戏启动后尝试启动并使用 Better GI 进行自动化任务</value>
</data>
<data name="ViewPageLaunchGameBetterGIHeader" xml:space="preserve">
<value>Better GI</value>
</data>
<data name="ViewPageLaunchGameCommonHeader" xml:space="preserve"> <data name="ViewPageLaunchGameCommonHeader" xml:space="preserve">
<value>Umum</value> <value>Umum</value>
</data> </data>
@@ -2357,15 +2327,6 @@
<data name="ViewPageSettingBackdropMaterialHeader" xml:space="preserve"> <data name="ViewPageSettingBackdropMaterialHeader" xml:space="preserve">
<value>Backdrop Material</value> <value>Backdrop Material</value>
</data> </data>
<data name="ViewPageSettingBackgroundImageCopyrightHeader" xml:space="preserve">
<value>图片版权信息</value>
</data>
<data name="ViewPageSettingBackgroundImageDescription" xml:space="preserve">
<value>更改窗体的背景图片来源,重启胡桃以尽快生效</value>
</data>
<data name="ViewPageSettingBackgroundImageHeader" xml:space="preserve">
<value>背景图片</value>
</data>
<data name="ViewPageSettingCacheFolderDescription" xml:space="preserve"> <data name="ViewPageSettingCacheFolderDescription" xml:space="preserve">
<value>Cache gambar disimpan di sini</value> <value>Cache gambar disimpan di sini</value>
</data> </data>

View File

@@ -767,21 +767,6 @@
<data name="ServiceAvatarInfoSummaryShowcaseRefreshTimeFormat" xml:space="preserve"> <data name="ServiceAvatarInfoSummaryShowcaseRefreshTimeFormat" xml:space="preserve">
<value>キャラクターラインナップ:{0:MM-dd HH:mm}</value> <value>キャラクターラインナップ:{0:MM-dd HH:mm}</value>
</data> </data>
<data name="ServiceBackgroundImageTypeBing" xml:space="preserve">
<value>必应每日一图</value>
</data>
<data name="ServiceBackgroundImageTypeDaily" xml:space="preserve">
<value>胡桃每日一图</value>
</data>
<data name="ServiceBackgroundImageTypeLauncher" xml:space="preserve">
<value>官方启动器壁纸</value>
</data>
<data name="ServiceBackgroundImageTypeLocalFolder" xml:space="preserve">
<value>本地随机图片</value>
</data>
<data name="ServiceBackgroundImageTypeNone" xml:space="preserve">
<value>无背景图片</value>
</data>
<data name="ServiceCultivationProjectCurrentUserdataCourrpted" xml:space="preserve"> <data name="ServiceCultivationProjectCurrentUserdataCourrpted" xml:space="preserve">
<value>育成計画のステータスを保存できません</value> <value>育成計画のステータスを保存できません</value>
</data> </data>
@@ -839,9 +824,6 @@
<data name="ServiceDailyNoteNotifierTransformerHint" xml:space="preserve"> <data name="ServiceDailyNoteNotifierTransformerHint" xml:space="preserve">
<value>参量物質変化器は使用可能</value> <value>参量物質変化器は使用可能</value>
</data> </data>
<data name="ServiceDiscordActivityElevationRequiredHint" xml:space="preserve">
<value>权限不足,将无法为您设置 Discord Activity 状态</value>
</data>
<data name="ServiceDiscordGameActivityDetails" xml:space="preserve"> <data name="ServiceDiscordGameActivityDetails" xml:space="preserve">
<value>テイワット大陸を探索中</value> <value>テイワット大陸を探索中</value>
</data> </data>
@@ -1409,9 +1391,6 @@
<data name="ViewLaunchGameHeader" xml:space="preserve"> <data name="ViewLaunchGameHeader" xml:space="preserve">
<value>ゲームランチャー</value> <value>ゲームランチャー</value>
</data> </data>
<data name="ViewListViewDragElevatedHint" xml:space="preserve">
<value>管理员模式下无法拖动排序</value>
</data>
<data name="ViewModelAchievementArchiveAdded" xml:space="preserve"> <data name="ViewModelAchievementArchiveAdded" xml:space="preserve">
<value>アーカイブ [{0}] を作成しました</value> <value>アーカイブ [{0}] を作成しました</value>
</data> </data>
@@ -1691,9 +1670,6 @@
<data name="ViewModelWelcomeDownloadSummaryComplete" xml:space="preserve"> <data name="ViewModelWelcomeDownloadSummaryComplete" xml:space="preserve">
<value>完了</value> <value>完了</value>
</data> </data>
<data name="ViewModelWelcomeDownloadSummaryContentTypeNotMatch" xml:space="preserve">
<value>响应内容不是有效的文件字节流</value>
</data>
<data name="ViewModelWelcomeDownloadSummaryDefault" xml:space="preserve"> <data name="ViewModelWelcomeDownloadSummaryDefault" xml:space="preserve">
<value>待機中</value> <value>待機中</value>
</data> </data>
@@ -2034,7 +2010,7 @@
<value>一覧</value> <value>一覧</value>
</data> </data>
<data name="ViewPageGahcaLogPivotStatistics" xml:space="preserve"> <data name="ViewPageGahcaLogPivotStatistics" xml:space="preserve">
<value>統計</value> <value>全球祈愿统计</value>
</data> </data>
<data name="ViewPageGahcaLogPivotWeapon" xml:space="preserve"> <data name="ViewPageGahcaLogPivotWeapon" xml:space="preserve">
<value>武器</value> <value>武器</value>
@@ -2210,12 +2186,6 @@
<data name="ViewPageLaunchGameArgumentsHeader" xml:space="preserve"> <data name="ViewPageLaunchGameArgumentsHeader" xml:space="preserve">
<value>コマンドラインパラメーター</value> <value>コマンドラインパラメーター</value>
</data> </data>
<data name="ViewPageLaunchGameBetterGIDescription" xml:space="preserve">
<value>在游戏启动后尝试启动并使用 Better GI 进行自动化任务</value>
</data>
<data name="ViewPageLaunchGameBetterGIHeader" xml:space="preserve">
<value>Better GI</value>
</data>
<data name="ViewPageLaunchGameCommonHeader" xml:space="preserve"> <data name="ViewPageLaunchGameCommonHeader" xml:space="preserve">
<value>一般</value> <value>一般</value>
</data> </data>
@@ -2357,15 +2327,6 @@
<data name="ViewPageSettingBackdropMaterialHeader" xml:space="preserve"> <data name="ViewPageSettingBackdropMaterialHeader" xml:space="preserve">
<value>テーマ</value> <value>テーマ</value>
</data> </data>
<data name="ViewPageSettingBackgroundImageCopyrightHeader" xml:space="preserve">
<value>图片版权信息</value>
</data>
<data name="ViewPageSettingBackgroundImageDescription" xml:space="preserve">
<value>更改窗体的背景图片来源,重启胡桃以尽快生效</value>
</data>
<data name="ViewPageSettingBackgroundImageHeader" xml:space="preserve">
<value>背景图片</value>
</data>
<data name="ViewPageSettingCacheFolderDescription" xml:space="preserve"> <data name="ViewPageSettingCacheFolderDescription" xml:space="preserve">
<value>イメージキャッシュはここに格納されます</value> <value>イメージキャッシュはここに格納されます</value>
</data> </data>

View File

@@ -767,21 +767,6 @@
<data name="ServiceAvatarInfoSummaryShowcaseRefreshTimeFormat" xml:space="preserve"> <data name="ServiceAvatarInfoSummaryShowcaseRefreshTimeFormat" xml:space="preserve">
<value>角色橱窗:{0:MM-dd HH:mm}</value> <value>角色橱窗:{0:MM-dd HH:mm}</value>
</data> </data>
<data name="ServiceBackgroundImageTypeBing" xml:space="preserve">
<value>必应每日一图</value>
</data>
<data name="ServiceBackgroundImageTypeDaily" xml:space="preserve">
<value>胡桃每日一图</value>
</data>
<data name="ServiceBackgroundImageTypeLauncher" xml:space="preserve">
<value>官方启动器壁纸</value>
</data>
<data name="ServiceBackgroundImageTypeLocalFolder" xml:space="preserve">
<value>本地随机图片</value>
</data>
<data name="ServiceBackgroundImageTypeNone" xml:space="preserve">
<value>无背景图片</value>
</data>
<data name="ServiceCultivationProjectCurrentUserdataCourrpted" xml:space="preserve"> <data name="ServiceCultivationProjectCurrentUserdataCourrpted" xml:space="preserve">
<value>육성 계획 상태를 저장하지 못했습니다</value> <value>육성 계획 상태를 저장하지 못했습니다</value>
</data> </data>
@@ -839,9 +824,6 @@
<data name="ServiceDailyNoteNotifierTransformerHint" xml:space="preserve"> <data name="ServiceDailyNoteNotifierTransformerHint" xml:space="preserve">
<value>매개 변수 변환기가 준비되었습니다</value> <value>매개 변수 변환기가 준비되었습니다</value>
</data> </data>
<data name="ServiceDiscordActivityElevationRequiredHint" xml:space="preserve">
<value>权限不足,将无法为您设置 Discord Activity 状态</value>
</data>
<data name="ServiceDiscordGameActivityDetails" xml:space="preserve"> <data name="ServiceDiscordGameActivityDetails" xml:space="preserve">
<value>正在提瓦特大陆中探索</value> <value>正在提瓦特大陆中探索</value>
</data> </data>
@@ -1409,9 +1391,6 @@
<data name="ViewLaunchGameHeader" xml:space="preserve"> <data name="ViewLaunchGameHeader" xml:space="preserve">
<value>게임 시작</value> <value>게임 시작</value>
</data> </data>
<data name="ViewListViewDragElevatedHint" xml:space="preserve">
<value>管理员模式下无法拖动排序</value>
</data>
<data name="ViewModelAchievementArchiveAdded" xml:space="preserve"> <data name="ViewModelAchievementArchiveAdded" xml:space="preserve">
<value>아카이브 [{0}]가 추가되었습니다</value> <value>아카이브 [{0}]가 추가되었습니다</value>
</data> </data>
@@ -1691,9 +1670,6 @@
<data name="ViewModelWelcomeDownloadSummaryComplete" xml:space="preserve"> <data name="ViewModelWelcomeDownloadSummaryComplete" xml:space="preserve">
<value>완료</value> <value>완료</value>
</data> </data>
<data name="ViewModelWelcomeDownloadSummaryContentTypeNotMatch" xml:space="preserve">
<value>响应内容不是有效的文件字节流</value>
</data>
<data name="ViewModelWelcomeDownloadSummaryDefault" xml:space="preserve"> <data name="ViewModelWelcomeDownloadSummaryDefault" xml:space="preserve">
<value>대기 중</value> <value>대기 중</value>
</data> </data>
@@ -2034,7 +2010,7 @@
<value>개요</value> <value>개요</value>
</data> </data>
<data name="ViewPageGahcaLogPivotStatistics" xml:space="preserve"> <data name="ViewPageGahcaLogPivotStatistics" xml:space="preserve">
<value>统计</value> <value>全球祈愿统计</value>
</data> </data>
<data name="ViewPageGahcaLogPivotWeapon" xml:space="preserve"> <data name="ViewPageGahcaLogPivotWeapon" xml:space="preserve">
<value>무기</value> <value>무기</value>
@@ -2210,12 +2186,6 @@
<data name="ViewPageLaunchGameArgumentsHeader" xml:space="preserve"> <data name="ViewPageLaunchGameArgumentsHeader" xml:space="preserve">
<value>启动参数</value> <value>启动参数</value>
</data> </data>
<data name="ViewPageLaunchGameBetterGIDescription" xml:space="preserve">
<value>在游戏启动后尝试启动并使用 Better GI 进行自动化任务</value>
</data>
<data name="ViewPageLaunchGameBetterGIHeader" xml:space="preserve">
<value>Better GI</value>
</data>
<data name="ViewPageLaunchGameCommonHeader" xml:space="preserve"> <data name="ViewPageLaunchGameCommonHeader" xml:space="preserve">
<value>보통</value> <value>보통</value>
</data> </data>
@@ -2357,15 +2327,6 @@
<data name="ViewPageSettingBackdropMaterialHeader" xml:space="preserve"> <data name="ViewPageSettingBackdropMaterialHeader" xml:space="preserve">
<value>배경 테마</value> <value>배경 테마</value>
</data> </data>
<data name="ViewPageSettingBackgroundImageCopyrightHeader" xml:space="preserve">
<value>图片版权信息</value>
</data>
<data name="ViewPageSettingBackgroundImageDescription" xml:space="preserve">
<value>更改窗体的背景图片来源,重启胡桃以尽快生效</value>
</data>
<data name="ViewPageSettingBackgroundImageHeader" xml:space="preserve">
<value>背景图片</value>
</data>
<data name="ViewPageSettingCacheFolderDescription" xml:space="preserve"> <data name="ViewPageSettingCacheFolderDescription" xml:space="preserve">
<value>여기에 저장된 이미지 캐시</value> <value>여기에 저장된 이미지 캐시</value>
</data> </data>

View File

@@ -767,21 +767,6 @@
<data name="ServiceAvatarInfoSummaryShowcaseRefreshTimeFormat" xml:space="preserve"> <data name="ServiceAvatarInfoSummaryShowcaseRefreshTimeFormat" xml:space="preserve">
<value>Exibição de personagens: {0:MM-dd HH:mm}</value> <value>Exibição de personagens: {0:MM-dd HH:mm}</value>
</data> </data>
<data name="ServiceBackgroundImageTypeBing" xml:space="preserve">
<value>必应每日一图</value>
</data>
<data name="ServiceBackgroundImageTypeDaily" xml:space="preserve">
<value>胡桃每日一图</value>
</data>
<data name="ServiceBackgroundImageTypeLauncher" xml:space="preserve">
<value>官方启动器壁纸</value>
</data>
<data name="ServiceBackgroundImageTypeLocalFolder" xml:space="preserve">
<value>本地随机图片</value>
</data>
<data name="ServiceBackgroundImageTypeNone" xml:space="preserve">
<value>无背景图片</value>
</data>
<data name="ServiceCultivationProjectCurrentUserdataCourrpted" xml:space="preserve"> <data name="ServiceCultivationProjectCurrentUserdataCourrpted" xml:space="preserve">
<value>Falha ao salvar o status do planejamento</value> <value>Falha ao salvar o status do planejamento</value>
</data> </data>
@@ -839,9 +824,6 @@
<data name="ServiceDailyNoteNotifierTransformerHint" xml:space="preserve"> <data name="ServiceDailyNoteNotifierTransformerHint" xml:space="preserve">
<value>O Transformador Paramétrico está pronto</value> <value>O Transformador Paramétrico está pronto</value>
</data> </data>
<data name="ServiceDiscordActivityElevationRequiredHint" xml:space="preserve">
<value>权限不足,将无法为您设置 Discord Activity 状态</value>
</data>
<data name="ServiceDiscordGameActivityDetails" xml:space="preserve"> <data name="ServiceDiscordGameActivityDetails" xml:space="preserve">
<value>Explorando em Teyvat</value> <value>Explorando em Teyvat</value>
</data> </data>
@@ -1409,9 +1391,6 @@
<data name="ViewLaunchGameHeader" xml:space="preserve"> <data name="ViewLaunchGameHeader" xml:space="preserve">
<value>Inicializador</value> <value>Inicializador</value>
</data> </data>
<data name="ViewListViewDragElevatedHint" xml:space="preserve">
<value>管理员模式下无法拖动排序</value>
</data>
<data name="ViewModelAchievementArchiveAdded" xml:space="preserve"> <data name="ViewModelAchievementArchiveAdded" xml:space="preserve">
<value>Arquivo [{0}] adicionado com sucesso</value> <value>Arquivo [{0}] adicionado com sucesso</value>
</data> </data>
@@ -1691,9 +1670,6 @@
<data name="ViewModelWelcomeDownloadSummaryComplete" xml:space="preserve"> <data name="ViewModelWelcomeDownloadSummaryComplete" xml:space="preserve">
<value>Concluído</value> <value>Concluído</value>
</data> </data>
<data name="ViewModelWelcomeDownloadSummaryContentTypeNotMatch" xml:space="preserve">
<value>响应内容不是有效的文件字节流</value>
</data>
<data name="ViewModelWelcomeDownloadSummaryDefault" xml:space="preserve"> <data name="ViewModelWelcomeDownloadSummaryDefault" xml:space="preserve">
<value>Em fila</value> <value>Em fila</value>
</data> </data>
@@ -2210,12 +2186,6 @@
<data name="ViewPageLaunchGameArgumentsHeader" xml:space="preserve"> <data name="ViewPageLaunchGameArgumentsHeader" xml:space="preserve">
<value>Argumentos de inicialização</value> <value>Argumentos de inicialização</value>
</data> </data>
<data name="ViewPageLaunchGameBetterGIDescription" xml:space="preserve">
<value>在游戏启动后尝试启动并使用 Better GI 进行自动化任务</value>
</data>
<data name="ViewPageLaunchGameBetterGIHeader" xml:space="preserve">
<value>Better GI</value>
</data>
<data name="ViewPageLaunchGameCommonHeader" xml:space="preserve"> <data name="ViewPageLaunchGameCommonHeader" xml:space="preserve">
<value>Geral</value> <value>Geral</value>
</data> </data>
@@ -2357,15 +2327,6 @@
<data name="ViewPageSettingBackdropMaterialHeader" xml:space="preserve"> <data name="ViewPageSettingBackdropMaterialHeader" xml:space="preserve">
<value>Material de pano de fundo</value> <value>Material de pano de fundo</value>
</data> </data>
<data name="ViewPageSettingBackgroundImageCopyrightHeader" xml:space="preserve">
<value>图片版权信息</value>
</data>
<data name="ViewPageSettingBackgroundImageDescription" xml:space="preserve">
<value>更改窗体的背景图片来源,重启胡桃以尽快生效</value>
</data>
<data name="ViewPageSettingBackgroundImageHeader" xml:space="preserve">
<value>背景图片</value>
</data>
<data name="ViewPageSettingCacheFolderDescription" xml:space="preserve"> <data name="ViewPageSettingCacheFolderDescription" xml:space="preserve">
<value>O cache de imagens é salvo aqui</value> <value>O cache de imagens é salvo aqui</value>
</data> </data>
@@ -2571,7 +2532,7 @@
<value>自定义背景图片,支持 bmp / gif / ico / jpg / jpeg / png / tiff / webp 格式</value> <value>自定义背景图片,支持 bmp / gif / ico / jpg / jpeg / png / tiff / webp 格式</value>
</data> </data>
<data name="ViewPageSettingOpenBackgroundImageFolderHeader" xml:space="preserve"> <data name="ViewPageSettingOpenBackgroundImageFolderHeader" xml:space="preserve">
<value>Abrir pasta do fundo</value> <value>打开背景图片文件夹</value>
</data> </data>
<data name="ViewPageSettingResetAction" xml:space="preserve"> <data name="ViewPageSettingResetAction" xml:space="preserve">
<value>Resetar</value> <value>Resetar</value>

View File

@@ -767,21 +767,6 @@
<data name="ServiceAvatarInfoSummaryShowcaseRefreshTimeFormat" xml:space="preserve"> <data name="ServiceAvatarInfoSummaryShowcaseRefreshTimeFormat" xml:space="preserve">
<value>Демонстрация персонажей: {0:MM-dd HH:mm}</value> <value>Демонстрация персонажей: {0:MM-dd HH:mm}</value>
</data> </data>
<data name="ServiceBackgroundImageTypeBing" xml:space="preserve">
<value>必应每日一图</value>
</data>
<data name="ServiceBackgroundImageTypeDaily" xml:space="preserve">
<value>胡桃每日一图</value>
</data>
<data name="ServiceBackgroundImageTypeLauncher" xml:space="preserve">
<value>官方启动器壁纸</value>
</data>
<data name="ServiceBackgroundImageTypeLocalFolder" xml:space="preserve">
<value>本地随机图片</value>
</data>
<data name="ServiceBackgroundImageTypeNone" xml:space="preserve">
<value>无背景图片</value>
</data>
<data name="ServiceCultivationProjectCurrentUserdataCourrpted" xml:space="preserve"> <data name="ServiceCultivationProjectCurrentUserdataCourrpted" xml:space="preserve">
<value>Не удалось сохранить статус плана разработки.</value> <value>Не удалось сохранить статус плана разработки.</value>
</data> </data>
@@ -839,9 +824,6 @@
<data name="ServiceDailyNoteNotifierTransformerHint" xml:space="preserve"> <data name="ServiceDailyNoteNotifierTransformerHint" xml:space="preserve">
<value>Преобразователь готов</value> <value>Преобразователь готов</value>
</data> </data>
<data name="ServiceDiscordActivityElevationRequiredHint" xml:space="preserve">
<value>权限不足,将无法为您设置 Discord Activity 状态</value>
</data>
<data name="ServiceDiscordGameActivityDetails" xml:space="preserve"> <data name="ServiceDiscordGameActivityDetails" xml:space="preserve">
<value>Исследование Тейвата</value> <value>Исследование Тейвата</value>
</data> </data>
@@ -1409,9 +1391,6 @@
<data name="ViewLaunchGameHeader" xml:space="preserve"> <data name="ViewLaunchGameHeader" xml:space="preserve">
<value>Game Launcher</value> <value>Game Launcher</value>
</data> </data>
<data name="ViewListViewDragElevatedHint" xml:space="preserve">
<value>管理员模式下无法拖动排序</value>
</data>
<data name="ViewModelAchievementArchiveAdded" xml:space="preserve"> <data name="ViewModelAchievementArchiveAdded" xml:space="preserve">
<value>存档 [{0}] 添加成功</value> <value>存档 [{0}] 添加成功</value>
</data> </data>
@@ -1691,9 +1670,6 @@
<data name="ViewModelWelcomeDownloadSummaryComplete" xml:space="preserve"> <data name="ViewModelWelcomeDownloadSummaryComplete" xml:space="preserve">
<value>Завершено</value> <value>Завершено</value>
</data> </data>
<data name="ViewModelWelcomeDownloadSummaryContentTypeNotMatch" xml:space="preserve">
<value>响应内容不是有效的文件字节流</value>
</data>
<data name="ViewModelWelcomeDownloadSummaryDefault" xml:space="preserve"> <data name="ViewModelWelcomeDownloadSummaryDefault" xml:space="preserve">
<value>В процессе</value> <value>В процессе</value>
</data> </data>
@@ -2034,7 +2010,7 @@
<value>总览</value> <value>总览</value>
</data> </data>
<data name="ViewPageGahcaLogPivotStatistics" xml:space="preserve"> <data name="ViewPageGahcaLogPivotStatistics" xml:space="preserve">
<value>统计</value> <value>全球祈愿统计</value>
</data> </data>
<data name="ViewPageGahcaLogPivotWeapon" xml:space="preserve"> <data name="ViewPageGahcaLogPivotWeapon" xml:space="preserve">
<value>Оружие</value> <value>Оружие</value>
@@ -2210,12 +2186,6 @@
<data name="ViewPageLaunchGameArgumentsHeader" xml:space="preserve"> <data name="ViewPageLaunchGameArgumentsHeader" xml:space="preserve">
<value>启动参数</value> <value>启动参数</value>
</data> </data>
<data name="ViewPageLaunchGameBetterGIDescription" xml:space="preserve">
<value>在游戏启动后尝试启动并使用 Better GI 进行自动化任务</value>
</data>
<data name="ViewPageLaunchGameBetterGIHeader" xml:space="preserve">
<value>Better GI</value>
</data>
<data name="ViewPageLaunchGameCommonHeader" xml:space="preserve"> <data name="ViewPageLaunchGameCommonHeader" xml:space="preserve">
<value>常规</value> <value>常规</value>
</data> </data>
@@ -2357,15 +2327,6 @@
<data name="ViewPageSettingBackdropMaterialHeader" xml:space="preserve"> <data name="ViewPageSettingBackdropMaterialHeader" xml:space="preserve">
<value>背景材质</value> <value>背景材质</value>
</data> </data>
<data name="ViewPageSettingBackgroundImageCopyrightHeader" xml:space="preserve">
<value>图片版权信息</value>
</data>
<data name="ViewPageSettingBackgroundImageDescription" xml:space="preserve">
<value>更改窗体的背景图片来源,重启胡桃以尽快生效</value>
</data>
<data name="ViewPageSettingBackgroundImageHeader" xml:space="preserve">
<value>背景图片</value>
</data>
<data name="ViewPageSettingCacheFolderDescription" xml:space="preserve"> <data name="ViewPageSettingCacheFolderDescription" xml:space="preserve">
<value>图片缓存 在此处存放</value> <value>图片缓存 在此处存放</value>
</data> </data>

View File

@@ -767,21 +767,6 @@
<data name="ServiceAvatarInfoSummaryShowcaseRefreshTimeFormat" xml:space="preserve"> <data name="ServiceAvatarInfoSummaryShowcaseRefreshTimeFormat" xml:space="preserve">
<value>角色櫥窗:{0:MM-dd HH:mm}</value> <value>角色櫥窗:{0:MM-dd HH:mm}</value>
</data> </data>
<data name="ServiceBackgroundImageTypeBing" xml:space="preserve">
<value>必应每日一图</value>
</data>
<data name="ServiceBackgroundImageTypeDaily" xml:space="preserve">
<value>胡桃每日一图</value>
</data>
<data name="ServiceBackgroundImageTypeLauncher" xml:space="preserve">
<value>官方启动器壁纸</value>
</data>
<data name="ServiceBackgroundImageTypeLocalFolder" xml:space="preserve">
<value>本地随机图片</value>
</data>
<data name="ServiceBackgroundImageTypeNone" xml:space="preserve">
<value>无背景图片</value>
</data>
<data name="ServiceCultivationProjectCurrentUserdataCourrpted" xml:space="preserve"> <data name="ServiceCultivationProjectCurrentUserdataCourrpted" xml:space="preserve">
<value>保存養成計劃狀態失敗</value> <value>保存養成計劃狀態失敗</value>
</data> </data>
@@ -839,9 +824,6 @@
<data name="ServiceDailyNoteNotifierTransformerHint" xml:space="preserve"> <data name="ServiceDailyNoteNotifierTransformerHint" xml:space="preserve">
<value>參量質變儀已準備完成</value> <value>參量質變儀已準備完成</value>
</data> </data>
<data name="ServiceDiscordActivityElevationRequiredHint" xml:space="preserve">
<value>权限不足,将无法为您设置 Discord Activity 状态</value>
</data>
<data name="ServiceDiscordGameActivityDetails" xml:space="preserve"> <data name="ServiceDiscordGameActivityDetails" xml:space="preserve">
<value>正在提瓦特大陸中探索</value> <value>正在提瓦特大陸中探索</value>
</data> </data>
@@ -1409,9 +1391,6 @@
<data name="ViewLaunchGameHeader" xml:space="preserve"> <data name="ViewLaunchGameHeader" xml:space="preserve">
<value>啟動遊戲</value> <value>啟動遊戲</value>
</data> </data>
<data name="ViewListViewDragElevatedHint" xml:space="preserve">
<value>管理员模式下无法拖动排序</value>
</data>
<data name="ViewModelAchievementArchiveAdded" xml:space="preserve"> <data name="ViewModelAchievementArchiveAdded" xml:space="preserve">
<value>存檔 [{0}] 添加成功</value> <value>存檔 [{0}] 添加成功</value>
</data> </data>
@@ -1691,9 +1670,6 @@
<data name="ViewModelWelcomeDownloadSummaryComplete" xml:space="preserve"> <data name="ViewModelWelcomeDownloadSummaryComplete" xml:space="preserve">
<value>完成</value> <value>完成</value>
</data> </data>
<data name="ViewModelWelcomeDownloadSummaryContentTypeNotMatch" xml:space="preserve">
<value>响应内容不是有效的文件字节流</value>
</data>
<data name="ViewModelWelcomeDownloadSummaryDefault" xml:space="preserve"> <data name="ViewModelWelcomeDownloadSummaryDefault" xml:space="preserve">
<value>待處理</value> <value>待處理</value>
</data> </data>
@@ -2034,7 +2010,7 @@
<value>總覽</value> <value>總覽</value>
</data> </data>
<data name="ViewPageGahcaLogPivotStatistics" xml:space="preserve"> <data name="ViewPageGahcaLogPivotStatistics" xml:space="preserve">
<value>統計</value> <value>全球祈愿统计</value>
</data> </data>
<data name="ViewPageGahcaLogPivotWeapon" xml:space="preserve"> <data name="ViewPageGahcaLogPivotWeapon" xml:space="preserve">
<value>武器</value> <value>武器</value>
@@ -2210,12 +2186,6 @@
<data name="ViewPageLaunchGameArgumentsHeader" xml:space="preserve"> <data name="ViewPageLaunchGameArgumentsHeader" xml:space="preserve">
<value>啟動參數</value> <value>啟動參數</value>
</data> </data>
<data name="ViewPageLaunchGameBetterGIDescription" xml:space="preserve">
<value>在游戏启动后尝试启动并使用 Better GI 进行自动化任务</value>
</data>
<data name="ViewPageLaunchGameBetterGIHeader" xml:space="preserve">
<value>Better GI</value>
</data>
<data name="ViewPageLaunchGameCommonHeader" xml:space="preserve"> <data name="ViewPageLaunchGameCommonHeader" xml:space="preserve">
<value>一般</value> <value>一般</value>
</data> </data>
@@ -2357,15 +2327,6 @@
<data name="ViewPageSettingBackdropMaterialHeader" xml:space="preserve"> <data name="ViewPageSettingBackdropMaterialHeader" xml:space="preserve">
<value>背景材質</value> <value>背景材質</value>
</data> </data>
<data name="ViewPageSettingBackgroundImageCopyrightHeader" xml:space="preserve">
<value>图片版权信息</value>
</data>
<data name="ViewPageSettingBackgroundImageDescription" xml:space="preserve">
<value>更改窗体的背景图片来源,重启胡桃以尽快生效</value>
</data>
<data name="ViewPageSettingBackgroundImageHeader" xml:space="preserve">
<value>背景图片</value>
</data>
<data name="ViewPageSettingCacheFolderDescription" xml:space="preserve"> <data name="ViewPageSettingCacheFolderDescription" xml:space="preserve">
<value>圖片暫存存放在此</value> <value>圖片暫存存放在此</value>
</data> </data>

View File

@@ -86,7 +86,7 @@ internal sealed partial class AnnouncementService : IAnnouncementService
foreach (ref readonly Announcement item in CollectionsMarshal.AsSpan(listWrapper.List)) foreach (ref readonly Announcement item in CollectionsMarshal.AsSpan(listWrapper.List))
{ {
item.Subtitle = new StringBuilder(item.Subtitle).Replace("\r<br>", string.Empty).ToString(); item.Subtitle = new StringBuilder(item.Subtitle).Replace("\r<br>", string.Empty).ToString();
item.Content = AnnouncementRegex.XmlTimeTagRegex().Replace(item.Content, x => x.Groups[1].Value); item.Content = AnnouncementRegex.XmlTimeTagRegex.Replace(item.Content, x => x.Groups[1].Value);
} }
} }
} }
@@ -133,7 +133,7 @@ internal sealed partial class AnnouncementService : IAnnouncementService
continue; continue;
} }
MatchCollection matches = AnnouncementRegex.XmlTimeTagRegex().Matches(announcement.Content); MatchCollection matches = AnnouncementRegex.XmlTimeTagRegex.Matches(announcement.Content);
if (matches.Count < 2) if (matches.Count < 2)
{ {
continue; continue;

View File

@@ -1,12 +1,14 @@
// Copyright (c) DGP Studio. All rights reserved. // Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license. // Licensed under the MIT license.
using Snap.Hutao.Core.DependencyInjection.Abstraction;
namespace Snap.Hutao.Service.Hutao; namespace Snap.Hutao.Service.Hutao;
/// <summary> /// <summary>
/// 胡桃用户服务 /// 胡桃用户服务
/// </summary> /// </summary>
internal interface IHutaoUserService internal interface IHutaoUserService : ICastService
{ {
/// <summary> /// <summary>
/// 异步初始化 /// 异步初始化

View File

@@ -10,7 +10,7 @@ namespace Snap.Hutao.Service.Metadata;
/// 元数据服务 /// 元数据服务
/// </summary> /// </summary>
[HighQuality] [HighQuality]
internal interface IMetadataService internal interface IMetadataService : ICastService
{ {
IMemoryCache MemoryCache { get; } IMemoryCache MemoryCache { get; }

View File

@@ -1,9 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
namespace Snap.Hutao.Service.Navigation;
internal interface INavigationCurrent
{
Type? Current { get; }
}

View File

@@ -1,6 +1,8 @@
// Copyright (c) DGP Studio. All rights reserved. // Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license. // Licensed under the MIT license.
using Microsoft.UI.Xaml.Controls;
namespace Snap.Hutao.Service.Navigation; namespace Snap.Hutao.Service.Navigation;
/// <summary> /// <summary>
@@ -8,5 +10,10 @@ namespace Snap.Hutao.Service.Navigation;
/// </summary> /// </summary>
internal interface INavigationInitialization internal interface INavigationInitialization
{ {
void Initialize(INavigationViewAccessor accessor); /// <summary>
/// 使用指定的对象进行初始化
/// </summary>
/// <param name="navigationView">管理的 <see cref="NavigationView"/></param>
/// <param name="frame">管理的 <see cref="Frame"/></param>
void Initialize(NavigationView navigationView, Frame frame);
} }

View File

@@ -10,7 +10,7 @@ namespace Snap.Hutao.Service.Navigation;
/// 导航服务 /// 导航服务
/// </summary> /// </summary>
[HighQuality] [HighQuality]
internal interface INavigationService : INavigationCurrent internal interface INavigationService : ICastService, INavigationCurrent
{ {
/// <summary> /// <summary>
/// 导航到指定类型的页面 /// 导航到指定类型的页面
@@ -47,4 +47,9 @@ internal interface INavigationService : INavigationCurrent
/// 尽可能尝试返回 /// 尽可能尝试返回
/// </summary> /// </summary>
void GoBack(); void GoBack();
}
internal interface INavigationCurrent
{
Type? Current { get; }
} }

View File

@@ -1,14 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.Control;
namespace Snap.Hutao.Service.Navigation;
internal interface INavigationViewAccessor : IXamlElementAccessor
{
NavigationView NavigationView { get; }
Frame Frame { get; }
}

View File

@@ -147,10 +147,10 @@ internal sealed class NavigationService : INavigationService, INavigationInitial
} }
/// <inheritdoc/> /// <inheritdoc/>
public void Initialize(INavigationViewAccessor accessor) public void Initialize(NavigationView navigationView, Frame frame)
{ {
NavigationView = accessor.NavigationView; NavigationView = navigationView;
frame = accessor.Frame; this.frame = frame;
NavigationView.IsPaneOpen = LocalSetting.Get(SettingKeys.IsNavPaneOpen, true); NavigationView.IsPaneOpen = LocalSetting.Get(SettingKeys.IsNavPaneOpen, true);
} }

View File

@@ -298,7 +298,6 @@
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.0.240109" /> <PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.0.240109" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.Segmented" Version="8.0.240109" /> <PackageReference Include="CommunityToolkit.WinUI.Controls.Segmented" Version="8.0.240109" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.0.240109" /> <PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.0.240109" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.TokenizingTextBox" Version="8.0.240109" />
<PackageReference Include="CommunityToolkit.WinUI.Media" Version="8.0.240109" /> <PackageReference Include="CommunityToolkit.WinUI.Media" Version="8.0.240109" />
<PackageReference Include="CommunityToolkit.WinUI.Notifications" Version="7.1.2" /> <PackageReference Include="CommunityToolkit.WinUI.Notifications" Version="7.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.2" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.2" />

View File

@@ -113,7 +113,7 @@
<Expander <Expander
x:Name="DetailExpander" x:Name="DetailExpander"
Padding="12,0,12,0" Padding="16,0,16,0"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"
Background="Transparent" Background="Transparent"

View File

@@ -18,7 +18,7 @@
<mxi:Interaction.Behaviors> <mxi:Interaction.Behaviors>
<shcb:PeriodicInvokeCommandOrOnActualThemeChangedBehavior <shcb:PeriodicInvokeCommandOrOnActualThemeChangedBehavior
Command="{Binding UpdateBackgroundCommand}" Command="{Binding UpdateBackgroundCommand}"
CommandParameter="{x:Bind BackgroundImagePresenter}" CommandParameter="{x:Bind BackdroundImagePresenter}"
Period="0:5:0"/> Period="0:5:0"/>
</mxi:Interaction.Behaviors> </mxi:Interaction.Behaviors>
@@ -28,10 +28,9 @@
<x:Double x:Key="NavigationViewItemOnLeftIconBoxHeight">24</x:Double> <x:Double x:Key="NavigationViewItemOnLeftIconBoxHeight">24</x:Double>
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="Transparent"/> <SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="Transparent"/>
</UserControl.Resources> </UserControl.Resources>
<!-- Background="{ThemeResource SolidBackgroundFillColorBaseBrush}" --> <Grid Background="{ThemeResource SolidBackgroundFillColorBaseBrush}" Transitions="{ThemeResource EntranceThemeTransitions}">
<Grid Transitions="{ThemeResource EntranceThemeTransitions}">
<Image <Image
x:Name="BackgroundImagePresenter" x:Name="BackdroundImagePresenter"
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"
Opacity="0" Opacity="0"

View File

@@ -27,44 +27,17 @@ internal sealed partial class MainView : UserControl
/// </summary> /// </summary>
public MainView() public MainView()
{ {
IServiceProvider serviceProvider = Ioc.Default; DataContext = Ioc.Default.GetRequiredService<MainViewModel>();
MainViewModel mainViewModel = serviceProvider.GetRequiredService<MainViewModel>();
DataContext = mainViewModel;
InitializeComponent(); InitializeComponent();
mainViewModel.Initialize(new BackgroundImagePresenterAccessor(BackgroundImagePresenter)); IServiceProvider serviceProvider = Ioc.Default;
navigationService = serviceProvider.GetRequiredService<INavigationService>(); navigationService = serviceProvider.GetRequiredService<INavigationService>();
if (navigationService is INavigationInitialization navigationInitialization) if (navigationService is INavigationInitialization navigationInitialization)
{ {
navigationInitialization.Initialize(new NavigationViewAccessor(NavView, ContentFrame)); navigationInitialization.Initialize(NavView, ContentFrame);
} }
navigationService.Navigate<AnnouncementPage>(INavigationAwaiter.Default, true); navigationService.Navigate<AnnouncementPage>(INavigationAwaiter.Default, true);
} }
private class NavigationViewAccessor : INavigationViewAccessor
{
public NavigationViewAccessor(NavigationView navigationView, Frame frame)
{
NavigationView = navigationView;
Frame = frame;
}
public NavigationView NavigationView { get; private set; }
public Frame Frame { get; private set; }
}
private class BackgroundImagePresenterAccessor : IBackgroundImagePresenterAccessor
{
public BackgroundImagePresenterAccessor(Image backgroundImagePresenter)
{
BackgroundImagePresenter = backgroundImagePresenter;
}
public Image BackgroundImagePresenter { get; private set; }
}
} }

View File

@@ -7,6 +7,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mxi="using:Microsoft.Xaml.Interactivity" xmlns:mxi="using:Microsoft.Xaml.Interactivity"
xmlns:mxic="using:Microsoft.Xaml.Interactions.Core"
xmlns:shc="using:Snap.Hutao.Control" xmlns:shc="using:Snap.Hutao.Control"
xmlns:shcb="using:Snap.Hutao.Control.Behavior" xmlns:shcb="using:Snap.Hutao.Control.Behavior"
xmlns:shci="using:Snap.Hutao.Control.Image" xmlns:shci="using:Snap.Hutao.Control.Image"
@@ -72,10 +73,6 @@
</shct:DescriptionTextBlock> </shct:DescriptionTextBlock>
</DataTemplate> </DataTemplate>
<DataTemplate x:Key="SuggestionTemplate">
<TextBlock VerticalAlignment="Center" Text="{Binding}"/>
</DataTemplate>
<DataTemplate x:Key="AvatarListTemplate"> <DataTemplate x:Key="AvatarListTemplate">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@@ -268,20 +265,22 @@
</CommandBar.Content> </CommandBar.Content>
<!--<AppBarButton Icon="{shcm:FontIcon Glyph=&#xE946;}" Label="搜索提示"/>--> <!--<AppBarButton Icon="{shcm:FontIcon Glyph=&#xE946;}" Label="搜索提示"/>-->
<AppBarElementContainer> <AppBarElementContainer>
<cwc:TokenizingTextBox <AutoSuggestBox
x:Name="AvatarSuggestBox" Width="240"
Width="520" Height="36"
Margin="6,0,6,0" Margin="6,6,6,0"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
ItemsSource="{Binding FilterTokens, Mode=TwoWay}"
MaximumTokens="5"
PlaceholderText="{shcm:ResourceString Name=ViewPageWiKiAvatarAutoSuggestBoxPlaceHolder}" PlaceholderText="{shcm:ResourceString Name=ViewPageWiKiAvatarAutoSuggestBoxPlaceHolder}"
QueryIcon="{cw:FontIconSource Glyph=&#xE721;}" QueryIcon="{shcm:FontIcon Glyph=&#xE721;}"
SuggestedItemTemplate="{StaticResource SuggestionTemplate}" Style="{StaticResource DefaultAutoSuggestBoxStyle}"
SuggestedItemsSource="{Binding AvailableQueries}" Text="{Binding FilterText, Mode=TwoWay}">
Text="{Binding FilterToken, Mode=TwoWay}" <mxi:Interaction.Behaviors>
TokenItemTemplate="{StaticResource SuggestionTemplate}"/> <mxic:EventTriggerBehavior EventName="QuerySubmitted">
<mxic:InvokeCommandAction Command="{Binding FilterCommand}" CommandParameter="{Binding FilterText}"/>
</mxic:EventTriggerBehavior>
</mxi:Interaction.Behaviors>
</AutoSuggestBox>
</AppBarElementContainer> </AppBarElementContainer>
<AppBarButton <AppBarButton
Command="{Binding CultivateCommand}" Command="{Binding CultivateCommand}"

View File

@@ -1,8 +1,6 @@
// Copyright (c) DGP Studio. All rights reserved. // Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license. // Licensed under the MIT license.
using CommunityToolkit.WinUI.Controls;
using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.Control; using Snap.Hutao.Control;
using Snap.Hutao.ViewModel.Wiki; using Snap.Hutao.ViewModel.Wiki;
@@ -19,19 +17,7 @@ internal sealed partial class WikiAvatarPage : ScopedPage
/// </summary> /// </summary>
public WikiAvatarPage() public WikiAvatarPage()
{ {
WikiAvatarViewModel viewModel = InitializeWith<WikiAvatarViewModel>(); InitializeWith<WikiAvatarViewModel>();
InitializeComponent(); InitializeComponent();
viewModel.Initialize(new TokenizingTextBoxAccessor(AvatarSuggestBox));
}
private class TokenizingTextBoxAccessor : ITokenizingTextBoxAccessor
{
public TokenizingTextBoxAccessor(TokenizingTextBox tokenizingTextBox)
{
TokenizingTextBox = tokenizingTextBox;
}
public TokenizingTextBox TokenizingTextBox { get; private set; }
} }
} }

View File

@@ -32,10 +32,6 @@
Source="{Binding Converter={StaticResource PropertyDescriptor}}"/> Source="{Binding Converter={StaticResource PropertyDescriptor}}"/>
</DataTemplate> </DataTemplate>
<DataTemplate x:Key="SuggestionTemplate">
<TextBlock VerticalAlignment="Center" Text="{Binding}"/>
</DataTemplate>
<DataTemplate x:Key="WeaponListTemplate"> <DataTemplate x:Key="WeaponListTemplate">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@@ -135,21 +131,21 @@
LocalSettingKeySuffixForCurrent="WikiWeaponPage.Weapons"/> LocalSettingKeySuffixForCurrent="WikiWeaponPage.Weapons"/>
</CommandBar.Content> </CommandBar.Content>
<AppBarElementContainer> <AppBarElementContainer>
<cwc:TokenizingTextBox <AutoSuggestBox
x:Name="WeaponSuggestBox" Width="240"
Width="520" Height="36"
Margin="16,0,6,0" Margin="16,6,6,0"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
ItemTemplate="{StaticResource SuggestionTemplate}"
ItemsSource="{Binding FilterTokens, Mode=TwoWay}"
MaximumTokens="5"
PlaceholderText="{shcm:ResourceString Name=ViewPageWiKiWeaponAutoSuggestBoxPlaceHolder}" PlaceholderText="{shcm:ResourceString Name=ViewPageWiKiWeaponAutoSuggestBoxPlaceHolder}"
QueryIcon="{cw:FontIconSource Glyph=&#xE721;}" QueryIcon="{shcm:FontIcon Glyph=&#xE721;}"
SuggestedItemTemplate="{StaticResource SuggestionTemplate}" Text="{Binding FilterText, Mode=TwoWay}">
SuggestedItemsSource="{Binding AvailableQueries}" <mxi:Interaction.Behaviors>
Text="{Binding FilterToken, Mode=TwoWay}" <mxic:EventTriggerBehavior EventName="QuerySubmitted">
TokenItemTemplate="{StaticResource SuggestionTemplate}"/> <mxic:InvokeCommandAction Command="{Binding FilterCommand}" CommandParameter="{Binding FilterText}"/>
</mxic:EventTriggerBehavior>
</mxi:Interaction.Behaviors>
</AutoSuggestBox>
</AppBarElementContainer> </AppBarElementContainer>
<AppBarButton <AppBarButton
Command="{Binding CultivateCommand}" Command="{Binding CultivateCommand}"

View File

@@ -1,7 +1,6 @@
// Copyright (c) DGP Studio. All rights reserved. // Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license. // Licensed under the MIT license.
using CommunityToolkit.WinUI.Controls;
using Snap.Hutao.Control; using Snap.Hutao.Control;
using Snap.Hutao.ViewModel.Wiki; using Snap.Hutao.ViewModel.Wiki;
@@ -18,19 +17,7 @@ internal sealed partial class WikiWeaponPage : ScopedPage
/// </summary> /// </summary>
public WikiWeaponPage() public WikiWeaponPage()
{ {
WikiWeaponViewModel viewModel = InitializeWith<WikiWeaponViewModel>(); InitializeWith<WikiWeaponViewModel>();
InitializeComponent(); InitializeComponent();
viewModel.Initialize(new TokenizingTextBoxAccessor(WeaponSuggestBox));
}
private class TokenizingTextBoxAccessor : ITokenizingTextBoxAccessor
{
public TokenizingTextBoxAccessor(TokenizingTextBox tokenizingTextBox)
{
TokenizingTextBox = tokenizingTextBox;
}
public TokenizingTextBox TokenizingTextBox { get; private set; }
} }
} }

View File

@@ -1,12 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.Control;
namespace Snap.Hutao.ViewModel;
internal interface IBackgroundImagePresenterAccessor : IXamlElementAccessor
{
Image BackgroundImagePresenter { get; }
}

View File

@@ -1,9 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
namespace Snap.Hutao.ViewModel;
internal interface IMainViewModelInitialization
{
void Initialize(IBackgroundImagePresenterAccessor accessor);
}

View File

@@ -1,45 +1,27 @@
// Copyright (c) DGP Studio. All rights reserved. // Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license. // Licensed under the MIT license.
using CommunityToolkit.Mvvm.Messaging;
using CommunityToolkit.WinUI.Animations; using CommunityToolkit.WinUI.Animations;
using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media.Animation; using Microsoft.UI.Xaml.Media.Animation;
using Snap.Hutao.Control.Animation; using Snap.Hutao.Control.Animation;
using Snap.Hutao.Control.Theme; using Snap.Hutao.Control.Theme;
using Snap.Hutao.Message;
using Snap.Hutao.Service.BackgroundImage; using Snap.Hutao.Service.BackgroundImage;
namespace Snap.Hutao.ViewModel; namespace Snap.Hutao.ViewModel;
[ConstructorGenerated] [ConstructorGenerated]
[Injection(InjectAs.Singleton)] [Injection(InjectAs.Singleton)]
internal sealed partial class MainViewModel : Abstraction.ViewModel, IMainViewModelInitialization, IRecipient<BackgroundImageTypeChangedMessage> internal sealed partial class MainViewModel : Abstraction.ViewModel
{ {
private readonly IBackgroundImageService backgroundImageService; private readonly IBackgroundImageService backgroundImageService;
private readonly ITaskContext taskContext; private readonly ITaskContext taskContext;
private BackgroundImage? previousBackgroundImage; private BackgroundImage? previousBackgroundImage;
private Image? backgroundImagePresenter;
public void Initialize(IBackgroundImagePresenterAccessor accessor)
{
backgroundImagePresenter = accessor.BackgroundImagePresenter;
}
public void Receive(BackgroundImageTypeChangedMessage message)
{
UpdateBackgroundAsync().SafeForget();
}
[Command("UpdateBackgroundCommand")] [Command("UpdateBackgroundCommand")]
private async Task UpdateBackgroundAsync() private async Task UpdateBackgroundAsync(Image presenter)
{ {
if (backgroundImagePresenter is null)
{
return;
}
(bool isOk, BackgroundImage backgroundImage) = await backgroundImageService.GetNextBackgroundImageAsync(previousBackgroundImage).ConfigureAwait(false); (bool isOk, BackgroundImage backgroundImage) = await backgroundImageService.GetNextBackgroundImageAsync(previousBackgroundImage).ConfigureAwait(false);
if (isOk) if (isOk)
@@ -54,11 +36,11 @@ internal sealed partial class MainViewModel : Abstraction.ViewModel, IMainViewMo
duration: ControlAnimationConstants.ImageOpacityFadeInOut, duration: ControlAnimationConstants.ImageOpacityFadeInOut,
easingType: EasingType.Quartic, easingType: EasingType.Quartic,
easingMode: EasingMode.EaseInOut) easingMode: EasingMode.EaseInOut)
.StartAsync(backgroundImagePresenter) .StartAsync(presenter)
.ConfigureAwait(true); .ConfigureAwait(true);
backgroundImagePresenter.Source = backgroundImage.ImageSource; presenter.Source = backgroundImage.ImageSource;
double targetOpacity = ThemeHelper.IsDarkMode(backgroundImagePresenter.ActualTheme) ? 1 - backgroundImage.Luminance : backgroundImage.Luminance; double targetOpacity = ThemeHelper.IsDarkMode(presenter.ActualTheme) ? 1 - backgroundImage.Luminance : backgroundImage.Luminance;
await AnimationBuilder await AnimationBuilder
.Create() .Create()
@@ -67,7 +49,7 @@ internal sealed partial class MainViewModel : Abstraction.ViewModel, IMainViewMo
duration: ControlAnimationConstants.ImageOpacityFadeInOut, duration: ControlAnimationConstants.ImageOpacityFadeInOut,
easingType: EasingType.Quartic, easingType: EasingType.Quartic,
easingMode: EasingMode.EaseInOut) easingMode: EasingMode.EaseInOut)
.StartAsync(backgroundImagePresenter) .StartAsync(presenter)
.ConfigureAwait(true); .ConfigureAwait(true);
} }
} }

View File

@@ -1,7 +1,6 @@
// Copyright (c) DGP Studio. All rights reserved. // Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license. // Licensed under the MIT license.
using CommunityToolkit.Mvvm.Messaging;
using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Controls;
using Microsoft.Windows.AppLifecycle; using Microsoft.Windows.AppLifecycle;
using Snap.Hutao.Core; using Snap.Hutao.Core;
@@ -55,7 +54,6 @@ internal sealed partial class SettingViewModel : Abstraction.ViewModel
private readonly IUserService userService; private readonly IUserService userService;
private readonly ITaskContext taskContext; private readonly ITaskContext taskContext;
private readonly AppOptions appOptions; private readonly AppOptions appOptions;
private readonly IMessenger messenger;
private NameValue<BackdropType>? selectedBackdropType; private NameValue<BackdropType>? selectedBackdropType;
private NameValue<BackgroundImageType>? selectedBackgroundImageType; private NameValue<BackgroundImageType>? selectedBackgroundImageType;
@@ -102,7 +100,6 @@ internal sealed partial class SettingViewModel : Abstraction.ViewModel
if (SetProperty(ref selectedBackgroundImageType, value) && value is not null) if (SetProperty(ref selectedBackgroundImageType, value) && value is not null)
{ {
AppOptions.BackgroundImageType = value.Value; AppOptions.BackgroundImageType = value.Value;
messenger.Send(new Message.BackgroundImageTypeChangedMessage());
} }
} }
} }

View File

@@ -1,12 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using CommunityToolkit.WinUI.Controls;
using Snap.Hutao.Control;
namespace Snap.Hutao.ViewModel.Wiki;
internal interface ITokenizingTextBoxAccessor : IXamlElementAccessor
{
TokenizingTextBox TokenizingTextBox { get; }
}

View File

@@ -1,9 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
namespace Snap.Hutao.ViewModel.Wiki;
internal interface IWikiViewModelInitialization
{
void Initialize(ITokenizingTextBoxAccessor accessor);
}

View File

@@ -1,14 +1,11 @@
// Copyright (c) DGP Studio. All rights reserved. // Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license. // Licensed under the MIT license.
using CommunityToolkit.WinUI.Controls;
using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.Control.Collection.AdvancedCollectionView; using Snap.Hutao.Control.Collection.AdvancedCollectionView;
using Snap.Hutao.Factory.ContentDialog; using Snap.Hutao.Factory.ContentDialog;
using Snap.Hutao.Model.Calculable; using Snap.Hutao.Model.Calculable;
using Snap.Hutao.Model.Entity.Primitive; using Snap.Hutao.Model.Entity.Primitive;
using Snap.Hutao.Model.Intrinsic; using Snap.Hutao.Model.Intrinsic;
using Snap.Hutao.Model.Intrinsic.Frozen;
using Snap.Hutao.Model.Metadata; using Snap.Hutao.Model.Metadata;
using Snap.Hutao.Model.Metadata.Avatar; using Snap.Hutao.Model.Metadata.Avatar;
using Snap.Hutao.Model.Metadata.Item; using Snap.Hutao.Model.Metadata.Item;
@@ -20,8 +17,6 @@ using Snap.Hutao.Service.Notification;
using Snap.Hutao.Service.User; using Snap.Hutao.Service.User;
using Snap.Hutao.View.Dialog; using Snap.Hutao.View.Dialog;
using Snap.Hutao.Web.Response; using Snap.Hutao.Web.Response;
using System.Collections.Frozen;
using System.Collections.ObjectModel;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using CalculateAvatarPromotionDelta = Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate.AvatarPromotionDelta; using CalculateAvatarPromotionDelta = Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate.AvatarPromotionDelta;
using CalculateClient = Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate.CalculateClient; using CalculateClient = Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate.CalculateClient;
@@ -37,7 +32,7 @@ namespace Snap.Hutao.ViewModel.Wiki;
[HighQuality] [HighQuality]
[ConstructorGenerated] [ConstructorGenerated]
[Injection(InjectAs.Scoped)] [Injection(InjectAs.Scoped)]
internal sealed partial class WikiAvatarViewModel : Abstraction.ViewModel, IWikiViewModelInitialization internal sealed partial class WikiAvatarViewModel : Abstraction.ViewModel
{ {
private readonly IContentDialogFactory contentDialogFactory; private readonly IContentDialogFactory contentDialogFactory;
private readonly ICultivationService cultivationService; private readonly ICultivationService cultivationService;
@@ -50,12 +45,10 @@ internal sealed partial class WikiAvatarViewModel : Abstraction.ViewModel, IWiki
private AdvancedCollectionView<Avatar>? avatars; private AdvancedCollectionView<Avatar>? avatars;
private Avatar? selected; private Avatar? selected;
private ObservableCollection<string>? filterTokens; private string? filterText;
private string? filterToken;
private BaseValueInfo? baseValueInfo; private BaseValueInfo? baseValueInfo;
private Dictionary<Level, Dictionary<GrowCurveType, float>>? levelAvatarCurveMap; private Dictionary<Level, Dictionary<GrowCurveType, float>>? levelAvatarCurveMap;
private List<Promote>? promotes; private List<Promote>? promotes;
private FrozenSet<string> availableQueries;
/// <summary> /// <summary>
/// 角色列表 /// 角色列表
@@ -82,21 +75,9 @@ internal sealed partial class WikiAvatarViewModel : Abstraction.ViewModel, IWiki
public BaseValueInfo? BaseValueInfo { get => baseValueInfo; set => SetProperty(ref baseValueInfo, value); } public BaseValueInfo? BaseValueInfo { get => baseValueInfo; set => SetProperty(ref baseValueInfo, value); }
/// <summary> /// <summary>
/// 保存的筛选标志 /// 筛选文本
/// </summary> /// </summary>
public ObservableCollection<string>? FilterTokens { get => filterTokens; set => SetProperty(ref filterTokens, value); } public string? FilterText { get => filterText; set => SetProperty(ref filterText, value); }
public string? FilterToken { get => filterToken; set => SetProperty(ref filterToken, value); }
public FrozenSet<string>? AvailableQueries { get => availableQueries; }
public void Initialize(ITokenizingTextBoxAccessor accessor)
{
accessor.TokenizingTextBox.TextChanged += OnFilterSuggestionRequested;
accessor.TokenizingTextBox.QuerySubmitted += OnQuerySubmitted;
accessor.TokenizingTextBox.TokenItemAdded += OnTokenItemModified;
accessor.TokenizingTextBox.TokenItemRemoved += OnTokenItemModified;
}
protected override async ValueTask<bool> InitializeUIAsync() protected override async ValueTask<bool> InitializeUIAsync()
{ {
@@ -120,18 +101,6 @@ internal sealed partial class WikiAvatarViewModel : Abstraction.ViewModel, IWiki
await taskContext.SwitchToMainThreadAsync(); await taskContext.SwitchToMainThreadAsync();
Avatars = new(list, true); Avatars = new(list, true);
Selected = Avatars.View.ElementAtOrDefault(0); Selected = Avatars.View.ElementAtOrDefault(0);
FilterTokens = [];
availableQueries = FrozenSet.ToFrozenSet<string>(
[
.. avatars.Select(a => a.Name),
.. IntrinsicFrozen.AssociationTypes,
.. IntrinsicFrozen.BodyTypes,
.. IntrinsicFrozen.ElementNames,
.. IntrinsicFrozen.ItemQualities,
.. IntrinsicFrozen.WeaponTypes,
]);
return true; return true;
} }
@@ -233,53 +202,21 @@ internal sealed partial class WikiAvatarViewModel : Abstraction.ViewModel, IWiki
BaseValueInfo = new(avatar.MaxLevel, propertyCurveValues, levelAvatarCurveMap, avatarPromoteMap); BaseValueInfo = new(avatar.MaxLevel, propertyCurveValues, levelAvatarCurveMap, avatarPromoteMap);
} }
private void OnFilterSuggestionRequested(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) [Command("FilterCommand")]
private void ApplyFilter(string? input)
{ {
if (Avatars is null) if (Avatars is null)
{ {
return; return;
} }
if (string.IsNullOrWhiteSpace(FilterToken)) if (string.IsNullOrWhiteSpace(input))
{
return;
}
if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
{
sender.ItemsSource = availableQueries.Where(q => q.Contains(FilterToken, StringComparison.OrdinalIgnoreCase));
}
}
private void OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
{
if (args.ChosenSuggestion is not null)
{
return;
}
ApplyFilter();
}
private void OnTokenItemModified(TokenizingTextBox sender, object args)
{
ApplyFilter();
}
private void ApplyFilter()
{
if (Avatars is null)
{
return;
}
if (FilterTokens.IsNullOrEmpty())
{ {
Avatars.Filter = default!; Avatars.Filter = default!;
return; return;
} }
Avatars.Filter = AvatarFilter.Compile(string.Join(' ', FilterTokens)); Avatars.Filter = AvatarFilter.Compile(input);
if (Selected is not null && Avatars.Contains(Selected)) if (Selected is not null && Avatars.Contains(Selected))
{ {

View File

@@ -1,14 +1,11 @@
// Copyright (c) DGP Studio. All rights reserved. // Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license. // Licensed under the MIT license.
using CommunityToolkit.WinUI.Controls;
using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.Control.Collection.AdvancedCollectionView; using Snap.Hutao.Control.Collection.AdvancedCollectionView;
using Snap.Hutao.Factory.ContentDialog; using Snap.Hutao.Factory.ContentDialog;
using Snap.Hutao.Model.Calculable; using Snap.Hutao.Model.Calculable;
using Snap.Hutao.Model.Entity.Primitive; using Snap.Hutao.Model.Entity.Primitive;
using Snap.Hutao.Model.Intrinsic; using Snap.Hutao.Model.Intrinsic;
using Snap.Hutao.Model.Intrinsic.Frozen;
using Snap.Hutao.Model.Metadata; using Snap.Hutao.Model.Metadata;
using Snap.Hutao.Model.Metadata.Item; using Snap.Hutao.Model.Metadata.Item;
using Snap.Hutao.Model.Metadata.Weapon; using Snap.Hutao.Model.Metadata.Weapon;
@@ -20,7 +17,6 @@ using Snap.Hutao.Service.Notification;
using Snap.Hutao.Service.User; using Snap.Hutao.Service.User;
using Snap.Hutao.View.Dialog; using Snap.Hutao.View.Dialog;
using Snap.Hutao.Web.Response; using Snap.Hutao.Web.Response;
using System.Collections.Frozen;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using CalculateAvatarPromotionDelta = Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate.AvatarPromotionDelta; using CalculateAvatarPromotionDelta = Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate.AvatarPromotionDelta;
using CalculateClient = Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate.CalculateClient; using CalculateClient = Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate.CalculateClient;
@@ -33,7 +29,7 @@ namespace Snap.Hutao.ViewModel.Wiki;
/// </summary> /// </summary>
[ConstructorGenerated] [ConstructorGenerated]
[Injection(InjectAs.Scoped)] [Injection(InjectAs.Scoped)]
internal sealed partial class WikiWeaponViewModel : Abstraction.ViewModel, IWikiViewModelInitialization internal sealed partial class WikiWeaponViewModel : Abstraction.ViewModel
{ {
private readonly IContentDialogFactory contentDialogFactory; private readonly IContentDialogFactory contentDialogFactory;
private readonly CalculateClient calculateClient; private readonly CalculateClient calculateClient;
@@ -46,12 +42,10 @@ internal sealed partial class WikiWeaponViewModel : Abstraction.ViewModel, IWiki
private AdvancedCollectionView<Weapon>? weapons; private AdvancedCollectionView<Weapon>? weapons;
private Weapon? selected; private Weapon? selected;
private List<string>? filterTokens; private string? filterText;
private string? filterToken;
private BaseValueInfo? baseValueInfo; private BaseValueInfo? baseValueInfo;
private Dictionary<Level, Dictionary<GrowCurveType, float>>? levelWeaponCurveMap; private Dictionary<Level, Dictionary<GrowCurveType, float>>? levelWeaponCurveMap;
private List<Promote>? promotes; private List<Promote>? promotes;
private FrozenSet<string> availableQueries;
/// <summary> /// <summary>
/// 角色列表 /// 角色列表
@@ -78,21 +72,9 @@ internal sealed partial class WikiWeaponViewModel : Abstraction.ViewModel, IWiki
public BaseValueInfo? BaseValueInfo { get => baseValueInfo; set => SetProperty(ref baseValueInfo, value); } public BaseValueInfo? BaseValueInfo { get => baseValueInfo; set => SetProperty(ref baseValueInfo, value); }
/// <summary> /// <summary>
/// 保存的筛选标志 /// 筛选文本
/// </summary> /// </summary>
public List<string>? FilterTokens { get => filterTokens; set => SetProperty(ref filterTokens, value); } public string? FilterText { get => filterText; set => SetProperty(ref filterText, value); }
public string? FilterToken { get => filterToken; set => SetProperty(ref filterToken, value); }
public FrozenSet<string> AvailableQueries { get => availableQueries; }
public void Initialize(ITokenizingTextBoxAccessor accessor)
{
accessor.TokenizingTextBox.TextChanged += OnFilterSuggestionRequested;
accessor.TokenizingTextBox.QuerySubmitted += OnQuerySubmitted;
accessor.TokenizingTextBox.TokenItemAdded += OnTokenItemModified;
accessor.TokenizingTextBox.TokenItemRemoved += OnTokenItemModified;
}
/// <inheritdoc/> /// <inheritdoc/>
protected override async Task OpenUIAsync() protected override async Task OpenUIAsync()
@@ -116,15 +98,6 @@ internal sealed partial class WikiWeaponViewModel : Abstraction.ViewModel, IWiki
Weapons = new(list, true); Weapons = new(list, true);
Selected = Weapons.View.ElementAtOrDefault(0); Selected = Weapons.View.ElementAtOrDefault(0);
FilterTokens = [];
availableQueries = FrozenSet.ToFrozenSet(
[
.. weapons.Select(w => w.Name),
.. IntrinsicFrozen.ItemQualities,
.. IntrinsicFrozen.FightProperties,
.. IntrinsicFrozen.WeaponTypes,
]);
} }
} }
@@ -214,53 +187,21 @@ internal sealed partial class WikiWeaponViewModel : Abstraction.ViewModel, IWiki
BaseValueInfo = new(weapon.MaxLevel, propertyCurveValues, levelWeaponCurveMap, weaponPromoteMap); BaseValueInfo = new(weapon.MaxLevel, propertyCurveValues, levelWeaponCurveMap, weaponPromoteMap);
} }
private void OnFilterSuggestionRequested(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) [Command("FilterCommand")]
private void ApplyFilter(string? input)
{ {
if (Weapons is null) if (Weapons is null)
{ {
return; return;
} }
if (string.IsNullOrWhiteSpace(FilterToken)) if (string.IsNullOrWhiteSpace(input))
{
return;
}
if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
{
sender.ItemsSource = availableQueries.Where(q => q.Contains(FilterToken, StringComparison.OrdinalIgnoreCase));
}
}
private void OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
{
if (args.ChosenSuggestion is not null)
{
return;
}
ApplyFilter();
}
private void OnTokenItemModified(TokenizingTextBox sender, object args)
{
ApplyFilter();
}
private void ApplyFilter()
{
if (Weapons is null)
{
return;
}
if (FilterTokens.IsNullOrEmpty())
{ {
Weapons.Filter = default!; Weapons.Filter = default!;
return; return;
} }
Weapons.Filter = WeaponFilter.Compile(string.Join(' ', FilterTokens)); Weapons.Filter = WeaponFilter.Compile(input);
if (Selected is not null && Weapons.Contains(Selected)) if (Selected is not null && Weapons.Contains(Selected))
{ {

View File

@@ -22,6 +22,9 @@ internal static partial class AnnouncementRegex
/// <inheritdoc cref="SH.WebAnnouncementMatchPermanentActivityTime"/> /// <inheritdoc cref="SH.WebAnnouncementMatchPermanentActivityTime"/>
public static readonly Regex PermanentActivityAfterUpdateTimeRegex = new(SH.WebAnnouncementMatchPermanentActivityTime, RegexOptions.Compiled); public static readonly Regex PermanentActivityAfterUpdateTimeRegex = new(SH.WebAnnouncementMatchPermanentActivityTime, RegexOptions.Compiled);
/// <inheritdoc cref="XmlTagRegex"/>
public static readonly Regex XmlTimeTagRegex = XmlTagRegex();
[GeneratedRegex("&lt;t class=\"t_(?:gl|lc)\".*?&gt;(.*?)&lt;/t&gt;", RegexOptions.Multiline)] [GeneratedRegex("&lt;t class=\"t_(?:gl|lc)\".*?&gt;(.*?)&lt;/t&gt;", RegexOptions.Multiline)]
public static partial Regex XmlTimeTagRegex(); private static partial Regex XmlTagRegex();
} }