Compare commits

..

1 Commits

Author SHA1 Message Date
qhy040404
5182fd8577 trigger gc after viewmodel dispose 2024-04-28 14:19:24 +08:00
383 changed files with 2076 additions and 11027 deletions

View File

@@ -40,7 +40,7 @@ body:
attributes:
label: Snap Hutao 版本
description: 在应用标题,应用程序的反馈中心界面中可以找到
placeholder: 1.9.9.0
placeholder: 1.4.15.0
validations:
required: true
@@ -62,19 +62,20 @@ body:
description: 请设置一个你认为合适的分类,这将帮助我们快速定位问题
options:
- 安装和环境
- 游戏启动器
- 祈愿记录
- 成就管理
- 我的角色
- 角色信息面板
- 游戏启动器
- 实时便笺
- 养成计算
- 深境螺旋/胡桃数据库
- Wiki
- 米游社账号面板
- 每日签到奖励
- 胡桃通行证/胡桃云
- 用户界面
- 文件缓存
- 祈愿记录
- 玩家查询
- 胡桃数据库
- 用户界面
- 胡桃云
- 胡桃帐号
- 签到
- Wiki
- 公告
- 其它
validations:

View File

@@ -40,7 +40,7 @@ body:
attributes:
label: Snap Hutao Version
description: You can find the version in application's title bar
placeholder: e.g. 1.9.9.0
placeholder: e.g. 1.4.15.0
validations:
required: true
@@ -62,19 +62,20 @@ body:
description: Please select the most associated category of your issue
options:
- Installation and Environment
- Game Launcher
- Wish Export
- Achievement
- My Character
- Game Launcher
- Realtime Note
- Develop Plan
- Spiral Abyss
- Wiki
- MiHoYo Account Panel
- Daily Checkin Reward
- Hutao Passport/Hutao Cloud
- User Interface
- File Cache
- Wish Export
- Game Record
- Hutao Database
- User Interface
- Snap Hutao Cloud
- Snap Hutao Account
- Checkin
- Wiki
- Announcement
- Other
validations:

View File

@@ -1,15 +0,0 @@
<!--- Hi, thanks for considering make a PR contribution to Snap Hutao, we appreciate your work. -->
<!--- Before you create this PR, please fill the following form and checklist -->
## Description
<!--- Describe your changes -->
## Related Issue
<!--- If there's an associated issue, please use [GitHub Keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) to link it -->
<!-- e.g. fix #999, resolve #999, close #999 -->
## Checklist
- [ ] The target PR branch is `develop` branch

View File

@@ -17,7 +17,7 @@ You can follow the instructions in the [Quick Start](https://hut.ao/en/quick-sta
## 本地化翻译 / Localization
[![zh-TW translation](https://img.shields.io/badge/dynamic/json?color=blue&label=zh-TW&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27zh-TW%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15670597-565845.json)](https://crowdin.com/project/snap-hutao) [![en translation](https://img.shields.io/badge/dynamic/json?color=blue&label=en&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27en%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15670597-565845.json)](https://crowdin.com/project/snap-hutao) [![id translation](https://img.shields.io/badge/dynamic/json?color=blue&label=id&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27id%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15670597-565845.json)](https://crowdin.com/project/snap-hutao) [![ja translation](https://img.shields.io/badge/dynamic/json?color=blue&label=ja&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27ja%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15670597-565845.json)](https://crowdin.com/project/snap-hutao) [![ko translation](https://img.shields.io/badge/dynamic/json?color=blue&label=ko&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27ko%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15670597-565845.json)](https://crowdin.com/project/snap-hutao) [![pt-PT translation](https://img.shields.io/badge/dynamic/json?color=blue&label=pt-PT&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27pt-PT%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15670597-565845.json)](https://crowdin.com/project/snap-hutao) [![ru translation](https://img.shields.io/badge/dynamic/json?color=blue&label=ru&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27ru%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15670597-565845.json)](https://crowdin.com/project/snap-hutao)
![zh-TW translation](https://img.shields.io/badge/dynamic/json?color=blue&label=zh-TW&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27zh-TW%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15670597-565845.json) ![en translation](https://img.shields.io/badge/dynamic/json?color=blue&label=en&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27en%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15670597-565845.json) ![id translation](https://img.shields.io/badge/dynamic/json?color=blue&label=id&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27id%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15670597-565845.json) ![ja translation](https://img.shields.io/badge/dynamic/json?color=blue&label=ja&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27ja%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15670597-565845.json) ![ko translation](https://img.shields.io/badge/dynamic/json?color=blue&label=ko&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27ko%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15670597-565845.json)![pt-PT translation](https://img.shields.io/badge/dynamic/json?color=blue&label=pt-PT&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27pt-PT%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15670597-565845.json) ![ru translation](https://img.shields.io/badge/dynamic/json?color=blue&label=ru&style=flat&logo=crowdin&query=%24.progress[?(@.data.languageId==%27ru%27)].data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15670597-565845.json)
Snap Hutao 使用 [Crowdin](https://translate.hut.ao/) 作为客户端文本翻译平台,在该平台上你可以为你熟悉的语言提交翻译文本。我们感谢每一个为 Snap Hutao 做出贡献的社区成员,并且欢迎更多的朋友能参与到这个项目中。

View File

@@ -6,7 +6,6 @@
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources/>
<ResourceDictionary Source="ms-appx:///CommunityToolkit.WinUI.Controls.SettingsControls/SettingsCard/SettingsCard.xaml"/>
<ResourceDictionary Source="ms-appx:///CommunityToolkit.WinUI.Controls.TokenizingTextBox/TokenizingTextBox.xaml"/>
<ResourceDictionary Source="ms-appx:///Control/Loading.xaml"/>
<ResourceDictionary Source="ms-appx:///Control/Image/CachedImage.xaml"/>

View File

@@ -8,9 +8,7 @@ using Snap.Hutao.Core.ExceptionService;
using Snap.Hutao.Core.LifeCycle;
using Snap.Hutao.Core.LifeCycle.InterProcess;
using Snap.Hutao.Core.Logging;
using Snap.Hutao.Core.Setting;
using Snap.Hutao.Core.Windowing.HotKey;
using Snap.Hutao.Core.Windowing.NotifyIcon;
using Snap.Hutao.Core.Shell;
using System.Diagnostics;
namespace Snap.Hutao;
@@ -41,7 +39,7 @@ public sealed partial class App : Application
""";
private readonly IServiceProvider serviceProvider;
private readonly IAppActivation activation;
private readonly IActivation activation;
private readonly ILogger<App> logger;
/// <summary>
@@ -52,21 +50,13 @@ public sealed partial class App : Application
{
// Load app resource
InitializeComponent();
activation = serviceProvider.GetRequiredService<IAppActivation>();
activation = serviceProvider.GetRequiredService<IActivation>();
logger = serviceProvider.GetRequiredService<ILogger<App>>();
serviceProvider.GetRequiredService<ExceptionRecorder>().Record(this);
this.serviceProvider = serviceProvider;
}
public bool IsExiting { get; private set; }
public new void Exit()
{
IsExiting = true;
base.Exit();
}
/// <inheritdoc/>
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
@@ -83,9 +73,11 @@ public sealed partial class App : Application
logger.LogColorizedInformation((ConsoleBanner, ConsoleColor.DarkYellow));
LogDiagnosticInformation();
// Manually invoke
// manually invoke
activation.Activate(HutaoActivationArguments.FromAppActivationArguments(activatedEventArgs));
activation.PostInitialization();
activation.Initialize();
serviceProvider.GetRequiredService<IJumpListInterop>().ConfigureAsync().SafeForget();
}
catch
{

View File

@@ -22,6 +22,7 @@ internal sealed partial class ScopedPageScopeReferenceTracker : IScopedPageScope
public IServiceScope CreateScope()
{
GC.Collect(GC.MaxGeneration, GCCollectionMode.Aggressive, true);
IServiceScope currentScope = serviceProvider.CreateScope();
// In case previous one is not disposed.

View File

@@ -17,13 +17,8 @@
<x:String x:Key="UI_Icon_Intee_Explore_1">https://api.snapgenshin.com/static/raw/Bg/UI_Icon_Intee_Explore_1.png</x:String>
<x:String x:Key="UI_ImgSign_ItemIcon">https://api.snapgenshin.com/static/raw/Bg/UI_ImgSign_ItemIcon.png</x:String>
<x:String x:Key="UI_ItemIcon_None">https://api.snapgenshin.com/static/raw/Bg/UI_ItemIcon_None.png</x:String>
<!-- Mark -->
<x:String x:Key="UI_MarkQuest_Events_Proce">https://api.snapgenshin.com/static/raw/Mark/UI_MarkQuest_Events_Proce.png</x:String>
<x:String x:Key="UI_MarkQuest_Events_Start">https://api.snapgenshin.com/static/raw/Mark/UI_MarkQuest_Events_Start.png</x:String>
<x:String x:Key="UI_MarkQuest_Main_Proce">https://api.snapgenshin.com/static/raw/Mark/UI_MarkQuest_Main_Proce.png</x:String>
<x:String x:Key="UI_MarkQuest_Main_Start">https://api.snapgenshin.com/static/raw/Mark/UI_MarkQuest_Main_Start.png</x:String>
<x:String x:Key="UI_MarkTower">https://api.snapgenshin.com/static/raw/Mark/UI_MarkTower.png</x:String>
<x:String x:Key="UI_MarkQuest_Events_Proce">https://api.snapgenshin.com/static/raw/Bg/UI_MarkQuest_Events_Proce.png</x:String>
<x:String x:Key="UI_MarkTower">https://api.snapgenshin.com/static/raw/Bg/UI_MarkTower.png</x:String>
<!-- ItemIcon -->
<x:String x:Key="UI_ItemIcon_201">https://api.snapgenshin.com/static/raw/ItemIcon/UI_ItemIcon_201.png</x:String>

View File

@@ -1,7 +1,6 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.Extensions.Caching.Memory;
using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient;
using Snap.Hutao.Core.IO;
using Snap.Hutao.Core.IO.Hashing;
@@ -29,7 +28,6 @@ namespace Snap.Hutao.Core.Caching;
internal sealed partial class ImageCache : IImageCache, IImageCacheFilePathOperation
{
private const string CacheFolderName = nameof(ImageCache);
private const string CacheFailedDownloadTasksName = $"{nameof(ImageCache)}.FailedDownloadTasks";
private readonly FrozenDictionary<int, TimeSpan> retryCountToDelay = FrozenDictionary.ToFrozenDictionary(
[
@@ -40,11 +38,10 @@ internal sealed partial class ImageCache : IImageCache, IImageCacheFilePathOpera
private readonly ConcurrentDictionary<string, Task> concurrentTasks = new();
private readonly IHttpRequestMessageBuilderFactory httpRequestMessageBuilderFactory;
private readonly IHttpClientFactory httpClientFactory;
private readonly IHttpRequestMessageBuilderFactory httpRequestMessageBuilderFactory;
private readonly IServiceProvider serviceProvider;
private readonly ILogger<ImageCache> logger;
private readonly IMemoryCache memoryCache;
private string? baseFolder;
private string? cacheFolder;
@@ -195,16 +192,6 @@ internal sealed partial class ImageCache : IImageCache, IImageCacheFilePathOpera
if (responseMessage.IsSuccessStatusCode)
{
if (responseMessage.Content.Headers.ContentType?.MediaType is "application/json")
{
#if DEBUG
DebugTrack(uri);
#endif
string raw = await responseMessage.Content.ReadAsStringAsync().ConfigureAwait(false);
logger.LogColorizedCritical("Failed to download '{Uri}' with unexpected body '{Raw}'", (uri, ConsoleColor.Red), (raw, ConsoleColor.DarkYellow));
return;
}
using (Stream httpStream = await responseMessage.Content.ReadAsStreamAsync().ConfigureAwait(false))
{
using (FileStream fileStream = File.Create(baseFile))
@@ -227,25 +214,10 @@ internal sealed partial class ImageCache : IImageCache, IImageCacheFilePathOpera
}
default:
#if DEBUG
DebugTrack(uri);
#endif
logger.LogColorizedCritical("Failed to download '{Uri}' with status code '{StatusCode}'", (uri, ConsoleColor.Red), (responseMessage.StatusCode, ConsoleColor.DarkYellow));
return;
}
}
}
}
}
}
#if DEBUG
internal partial class ImageCache
{
private void DebugTrack(Uri uri)
{
HashSet<string>? set = memoryCache.GetOrCreate(CacheFailedDownloadTasksName, entry => entry.Value ??= new HashSet<string>()) as HashSet<string>;
set?.Add(uri.ToString());
}
}
#endif
}

View File

@@ -0,0 +1,25 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using System.Security.Cryptography;
using System.Text;
namespace Snap.Hutao.Core;
/// <summary>
/// 支持Md5转换
/// </summary>
[HighQuality]
internal static class Convert
{
/// <summary>
/// 获取字符串的MD5计算结果
/// </summary>
/// <param name="source">源字符串</param>
/// <returns>计算的结果</returns>
public static string ToMd5HexString(string source)
{
byte[] hash = MD5.HashData(Encoding.UTF8.GetBytes(source));
return System.Convert.ToHexString(hash);
}
}

View File

@@ -0,0 +1,26 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.Core.DependencyInjection.Abstraction;
namespace Snap.Hutao.Core.DependencyInjection;
/// <summary>
/// 对象扩展
/// </summary>
[HighQuality]
internal static class CastServiceExtension
{
/// <summary>
/// <see langword="as"/> 的链式调用扩展
/// </summary>
/// <typeparam name="T">目标转换类型</typeparam>
/// <param name="service">对象</param>
/// <returns>转换类型后的对象</returns>
[Obsolete("Not useful anymore")]
public static T? As<T>(this ICastService service)
where T : class
{
return service as T;
}
}

View File

@@ -16,7 +16,7 @@ internal sealed class HutaoException : Exception
throw new HutaoException(message, innerException);
}
public static void ThrowIf([DoesNotReturnIf(true)] bool condition, string message, Exception? innerException = default)
public static void ThrowIf(bool condition, string message, Exception? innerException = default)
{
if (condition)
{
@@ -24,7 +24,7 @@ internal sealed class HutaoException : Exception
}
}
public static void ThrowIfNot([DoesNotReturnIf(false)] bool condition, string message, Exception? innerException = default)
public static void ThrowIfNot(bool condition, string message, Exception? innerException = default)
{
if (!condition)
{
@@ -51,12 +51,6 @@ internal sealed class HutaoException : Exception
throw new InvalidCastException(message, innerException);
}
[DoesNotReturn]
public static InvalidOperationException InvalidOperation(string message, Exception? innerException = default)
{
throw new InvalidOperationException(message, innerException);
}
[DoesNotReturn]
public static NotSupportedException NotSupported(string? message = default, Exception? innerException = default)
{
@@ -66,6 +60,6 @@ internal sealed class HutaoException : Exception
[DoesNotReturn]
public static OperationCanceledException OperationCanceled(string message, Exception? innerException = default)
{
throw new OperationCanceledException(message, innerException);
return new OperationCanceledException(message, innerException);
}
}

View File

@@ -0,0 +1,23 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
namespace Snap.Hutao.Core.ExceptionService;
internal enum HutaoExceptionKind
{
None,
// Foundation
ImageCacheInvalidUri,
DatabaseCorrupted,
UserdataCorrupted,
// IO
FileSystemCreateFileInsufficientPermissions,
PrivateNamedPipeContentHashIncorrect,
// Service
GachaStatisticsInvalidItemId,
GameFpsUnlockingFailed,
GameConfigInvalidChannelOptions,
}

View File

@@ -1,6 +1,7 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.Win32.Foundation;
using Snap.Hutao.Win32.System.Com;
using Snap.Hutao.Win32.UI.Shell;
using System.IO;
@@ -62,13 +63,13 @@ internal static class FileOperation
result = true;
}
IUnknownMarshal.Release(pDestShellItem);
pDestShellItem->Release();
}
IUnknownMarshal.Release(pSourceShellItem);
pSourceShellItem->Release();
}
IUnknownMarshal.Release(pFileOperation);
pFileOperation->Release();
}
return result;
@@ -89,10 +90,10 @@ internal static class FileOperation
result = true;
}
IUnknownMarshal.Release(pShellItem);
pShellItem->Release();
}
IUnknownMarshal.Release(pFileOperation);
pFileOperation->Release();
}
return result;

View File

@@ -8,17 +8,12 @@ namespace Snap.Hutao.Core.IO.Hashing;
internal static class Hash
{
public static unsafe string SHA1HexString(string input)
public static string SHA1HexString(string input)
{
return HashCore(Convert.ToHexString, SHA1.HashData, Encoding.UTF8.GetBytes, input);
return HashCore(System.Convert.ToHexString, SHA1.HashData, Encoding.UTF8.GetBytes, input);
}
public static unsafe string MD5HexString(string input)
{
return HashCore(Convert.ToHexString, System.Security.Cryptography.MD5.HashData, Encoding.UTF8.GetBytes, input);
}
private static unsafe TResult HashCore<TInput, TResult>(Func<byte[], TResult> resultConverter, Func<byte[], byte[]> hashMethod, Func<TInput, byte[]> bytesConverter, TInput input)
private static TResult HashCore<TInput, TResult>(Func<byte[], TResult> resultConverter, Func<byte[], byte[]> hashMethod, Func<TInput, byte[]> bytesConverter, TInput input)
{
return resultConverter(hashMethod(bytesConverter(input)));
}

View File

@@ -34,6 +34,6 @@ internal static class MD5
public static async ValueTask<string> HashAsync(Stream stream, CancellationToken token = default)
{
byte[] bytes = await System.Security.Cryptography.MD5.HashDataAsync(stream, token).ConfigureAwait(false);
return Convert.ToHexString(bytes);
return System.Convert.ToHexString(bytes);
}
}

View File

@@ -18,6 +18,6 @@ internal static class SHA256
public static async ValueTask<string> HashAsync(Stream stream, CancellationToken token = default)
{
byte[] bytes = await System.Security.Cryptography.SHA256.HashDataAsync(stream, token).ConfigureAwait(false);
return Convert.ToHexString(bytes);
return System.Convert.ToHexString(bytes);
}
}

View File

@@ -1,21 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
namespace Snap.Hutao.Core;
internal sealed class LazySlim<T>
{
private readonly Func<T> valueFactory;
[MaybeNull]
private T value;
private bool initialized;
private object? syncRoot;
public LazySlim(Func<T> valueFactory)
{
this.valueFactory = valueFactory;
}
public T Value { get => LazyInitializer.EnsureInitialized(ref value, ref initialized, ref syncRoot, valueFactory); }
}

View File

@@ -3,11 +3,8 @@
using CommunityToolkit.WinUI.Notifications;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.UI.Xaml;
using Snap.Hutao.Core.LifeCycle.InterProcess;
using Snap.Hutao.Core.Setting;
using Snap.Hutao.Core.Windowing.HotKey;
using Snap.Hutao.Core.Windowing.NotifyIcon;
using Snap.Hutao.Service.DailyNote;
using Snap.Hutao.Service.Discord;
using Snap.Hutao.Service.Hutao;
@@ -23,9 +20,9 @@ namespace Snap.Hutao.Core.LifeCycle;
/// </summary>
[HighQuality]
[ConstructorGenerated]
[Injection(InjectAs.Singleton, typeof(IAppActivation))]
[Injection(InjectAs.Singleton, typeof(IActivation))]
[SuppressMessage("", "CA1001")]
internal sealed partial class AppActivation : IAppActivation, IAppActivationActionHandlersAccess, IDisposable
internal sealed partial class Activation : IActivation
{
public const string Action = nameof(Action);
public const string Uid = nameof(Uid);
@@ -38,15 +35,13 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi
private const string UrlActionRefresh = "/REFRESH";
private readonly IServiceProvider serviceProvider;
private readonly ICurrentXamlWindowReference currentWindowReference;
private readonly ICurrentWindowReference currentWindowReference;
private readonly ITaskContext taskContext;
private readonly SemaphoreSlim activateSemaphore = new(1);
/// <inheritdoc/>
public void Activate(HutaoActivationArguments args)
{
// Before activate, we try to redirect to the opened process in App,
// And we check if it's a toast activation.
if (ToastNotificationManagerCompat.WasCurrentProcessToastActivated())
{
return;
@@ -56,52 +51,10 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi
}
/// <inheritdoc/>
public void PostInitialization()
public void Initialize()
{
serviceProvider.GetRequiredService<PrivateNamedPipeServer>().RunAsync().SafeForget();
ToastNotificationManagerCompat.OnActivated += NotificationActivate;
serviceProvider.GetRequiredService<HotKeyOptions>().RegisterAll();
if (LocalSetting.Get(SettingKeys.IsNotifyIconEnabled, true))
{
serviceProvider.GetRequiredService<App>().DispatcherShutdownMode = DispatcherShutdownMode.OnExplicitShutdown;
_ = serviceProvider.GetRequiredService<NotifyIconController>();
}
}
public void Dispose()
{
activateSemaphore.Dispose();
}
public async ValueTask HandleLaunchGameActionAsync(string? uid = null)
{
serviceProvider
.GetRequiredService<IMemoryCache>()
.Set(ViewModel.Game.LaunchGameViewModel.DesiredUid, uid);
await taskContext.SwitchToMainThreadAsync();
if (currentWindowReference.Window is null)
{
currentWindowReference.Window = serviceProvider.GetRequiredService<LaunchGameWindow>();
return;
}
if (currentWindowReference.Window is MainWindow)
{
await serviceProvider
.GetRequiredService<INavigationService>()
.NavigateAsync<View.Page.LaunchGamePage>(INavigationAwaiter.Default, true)
.ConfigureAwait(false);
return;
}
else
{
// We have a non-Main Window, just exit current process anyway
Process.GetCurrentProcess().Kill();
}
}
private void NotificationActivate(ToastNotificationActivatedEventArgsCompat args)
@@ -141,6 +94,12 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi
ArgumentNullException.ThrowIfNull(args.LaunchActivatedArguments);
switch (args.LaunchActivatedArguments)
{
case LaunchGame:
{
await HandleLaunchGameActionAsync().ConfigureAwait(false);
break;
}
default:
{
await HandleNormalLaunchActionAsync().ConfigureAwait(false);
@@ -153,9 +112,10 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi
private async ValueTask HandleNormalLaunchActionAsync()
{
// Increase launch times
LocalSetting.Update(SettingKeys.LaunchTimes, 0, x => unchecked(x + 1));
LocalSetting.Update(SettingKeys.LaunchTimes, 0, x => x + 1);
// If the guide is completed, we check if there's any unfulfilled resource category present.
// If it's the first time launch, we show the guide window anyway.
// Otherwise, we check if there's any unfulfilled resource category present.
if (UnsafeLocalSetting.Get(SettingKeys.Major1Minor10Revision0GuideState, GuideState.Language) >= GuideState.StaticResourceBegin)
{
if (StaticResource.IsAnyUnfulfilledCategoryPresent())
@@ -164,11 +124,10 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi
}
}
// If it's the first time launch, show the guide window anyway.
if (UnsafeLocalSetting.Get(SettingKeys.Major1Minor10Revision0GuideState, GuideState.Language) < GuideState.Completed)
{
await taskContext.SwitchToMainThreadAsync();
currentWindowReference.Window = serviceProvider.GetRequiredService<GuideWindow>();
serviceProvider.GetRequiredService<GuideWindow>();
}
else
{
@@ -185,7 +144,7 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi
await taskContext.SwitchToMainThreadAsync();
currentWindowReference.Window = serviceProvider.GetRequiredService<MainWindow>();
serviceProvider.GetRequiredService<MainWindow>();
await taskContext.SwitchToBackgroundAsync();
@@ -199,7 +158,10 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi
hutaoUserServiceInitialization.InitializeInternalAsync().SafeForget();
}
serviceProvider.GetRequiredService<IDiscordService>().SetNormalActivityAsync().SafeForget();
serviceProvider
.GetRequiredService<IDiscordService>()
.SetNormalActivityAsync()
.SafeForget();
}
private async ValueTask HandleUrlActivationAsync(Uri uri, bool isRedirectTo)
@@ -282,4 +244,34 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi
}
}
}
private async ValueTask HandleLaunchGameActionAsync(string? uid = null)
{
serviceProvider
.GetRequiredService<IMemoryCache>()
.Set(ViewModel.Game.LaunchGameViewModel.DesiredUid, uid);
await taskContext.SwitchToMainThreadAsync();
if (currentWindowReference.Window is null)
{
serviceProvider.GetRequiredService<LaunchGameWindow>();
return;
}
if (currentWindowReference.Window is MainWindow)
{
await serviceProvider
.GetRequiredService<INavigationService>()
.NavigateAsync<View.Page.LaunchGamePage>(INavigationAwaiter.Default, true)
.ConfigureAwait(false);
return;
}
else
{
// We have a non-Main Window, just exit current process anyway
Process.GetCurrentProcess().Kill();
}
}
}

View File

@@ -5,19 +5,19 @@ using Microsoft.UI.Xaml;
namespace Snap.Hutao.Core.LifeCycle;
[Injection(InjectAs.Singleton, typeof(ICurrentXamlWindowReference))]
internal sealed class CurrentXamlWindowReference : ICurrentXamlWindowReference
[Injection(InjectAs.Singleton, typeof(ICurrentWindowReference))]
internal sealed class CurrentWindowReference : ICurrentWindowReference
{
private readonly WeakReference<Window> reference = new(default!);
[SuppressMessage("", "SH007")]
public Window? Window
public Window Window
{
get
{
reference.TryGetTarget(out Window? window);
return window!;
}
set => reference.SetTarget(value!);
set => reference.SetTarget(value);
}
}

View File

@@ -0,0 +1,24 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.UI.Xaml;
using Snap.Hutao.Core.Windowing;
using Snap.Hutao.Win32.Foundation;
using WinRT.Interop;
namespace Snap.Hutao.Core.LifeCycle;
internal static class CurrentWindowReferenceExtension
{
public static XamlRoot GetXamlRoot(this ICurrentWindowReference reference)
{
return reference.Window.Content.XamlRoot;
}
public static HWND GetWindowHandle(this ICurrentWindowReference reference)
{
return reference.Window is IWindowOptionsSource optionsSource
? optionsSource.WindowOptions.Hwnd
: WindowNative.GetWindowHandle(reference.Window);
}
}

View File

@@ -1,23 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.UI.Xaml;
using Snap.Hutao.Core.Windowing;
using Snap.Hutao.Win32.Foundation;
using WinRT.Interop;
namespace Snap.Hutao.Core.LifeCycle;
internal static class CurrentXamlWindowReferenceExtension
{
public static XamlRoot GetXamlRoot(this ICurrentXamlWindowReference reference)
{
ArgumentNullException.ThrowIfNull(reference.Window);
return reference.Window.Content.XamlRoot;
}
public static HWND GetWindowHandle(this ICurrentXamlWindowReference reference)
{
return WindowExtension.GetWindowHandle(reference.Window);
}
}

View File

@@ -0,0 +1,14 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
namespace Snap.Hutao.Core.LifeCycle;
/// <summary>
/// 激活
/// </summary>
internal interface IActivation
{
void Activate(HutaoActivationArguments args);
void Initialize();
}

View File

@@ -1,16 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
namespace Snap.Hutao.Core.LifeCycle;
internal interface IAppActivation
{
void Activate(HutaoActivationArguments args);
void PostInitialization();
}
internal interface IAppActivationActionHandlersAccess
{
ValueTask HandleLaunchGameActionAsync(string? uid = null);
}

View File

@@ -5,10 +5,10 @@ using Microsoft.UI.Xaml;
namespace Snap.Hutao.Core.LifeCycle;
internal interface ICurrentXamlWindowReference
internal interface ICurrentWindowReference
{
/// <summary>
/// Only set in WindowController
/// </summary>
public Window? Window { get; set; }
public Window Window { get; set; }
}

View File

@@ -16,6 +16,6 @@ internal sealed partial class PrivateNamedPipeMessageDispatcher
return;
}
serviceProvider.GetRequiredService<IAppActivation>().Activate(args);
serviceProvider.GetRequiredService<IActivation>().Activate(args);
}
}

View File

@@ -10,18 +10,11 @@ namespace Snap.Hutao.Core.Logging;
internal sealed class ConsoleWindowLifeTime : IDisposable
{
public const bool DebugModeEnabled =
#if IS_ALPHA_BUILD
true;
#else
false;
#endif
private readonly bool consoleWindowAllocated;
public ConsoleWindowLifeTime()
{
if (LocalSetting.Get(SettingKeys.IsAllocConsoleDebugModeEnabled, DebugModeEnabled))
if (LocalSetting.Get(SettingKeys.IsAllocConsoleDebugModeEnabled, false))
{
consoleWindowAllocated = AllocConsole();
if (consoleWindowAllocated)

View File

@@ -151,7 +151,7 @@ internal static class LoggerExtension
}
else
{
resultMessageBuilder.Append(ConsoleVirtualTerminalSequences.ForegroundWhite);
resultMessageBuilder.Append(ConsoleVirtualTerminalSequences.Default);
}
}
}
@@ -164,7 +164,7 @@ internal static class LoggerExtension
// Restore default colors
if (message.ForegroundColor.HasValue || message.BackgroundColor.HasValue)
{
resultMessageBuilder.Append(ConsoleVirtualTerminalSequences.ForegroundWhite);
resultMessageBuilder.Append(ConsoleVirtualTerminalSequences.Default);
}
return resultMessageBuilder.ToString();

View File

@@ -1,27 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace Snap.Hutao.Core;
internal readonly ref struct ReadOnlySpan2D<T>
where T : unmanaged
{
private readonly ref T reference;
private readonly int length;
private readonly int columns;
public unsafe ReadOnlySpan2D(void* pointer, int length, int columns)
{
reference = ref *(T*)pointer;
this.length = length;
this.columns = columns;
}
public ReadOnlySpan<T> this[int row]
{
get => MemoryMarshal.CreateReadOnlySpan(ref Unsafe.Add(ref reference, row * columns), columns);
}
}

View File

@@ -3,7 +3,6 @@
using Microsoft.Web.WebView2.Core;
using Microsoft.Win32;
using Snap.Hutao.Core.IO.Hashing;
using Snap.Hutao.Core.Setting;
using System.IO;
using System.Security.Principal;
@@ -16,13 +15,15 @@ namespace Snap.Hutao.Core;
[Injection(InjectAs.Singleton)]
internal sealed class RuntimeOptions
{
private readonly LazySlim<(Version Version, string UserAgent)> lazyVersionAndUserAgent = new(() =>
private readonly IServiceProvider serviceProvider;
private readonly Lazy<(Version Version, string UserAgent)> lazyVersionAndUserAgent = new(() =>
{
Version version = Package.Current.Id.Version.ToVersion();
return (version, $"Snap Hutao/{version}");
});
private readonly LazySlim<string> lazyDataFolder = new(() =>
private readonly Lazy<string> lazyDataFolder = new(() =>
{
string preferredPath = LocalSetting.Get(SettingKeys.DataFolderPath, string.Empty);
@@ -47,14 +48,14 @@ internal sealed class RuntimeOptions
return path;
});
private readonly LazySlim<string> lazyDeviceId = new(() =>
private readonly Lazy<string> lazyDeviceId = new(() =>
{
string userName = Environment.UserName;
object? machineGuid = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\", "MachineGuid", userName);
return Hash.MD5HexString($"{userName}{machineGuid}");
return Convert.ToMd5HexString($"{userName}{machineGuid}");
});
private readonly LazySlim<(string Version, bool Supported)> lazyWebViewEnvironment = new(() =>
private readonly Lazy<(string Version, bool Supported)> lazyWebViewEnvironment = new(() =>
{
try
{
@@ -67,7 +68,7 @@ internal sealed class RuntimeOptions
}
});
private readonly LazySlim<bool> lazyElevated = new(() =>
private readonly Lazy<bool> lazyElevated = new(() =>
{
if (LocalSetting.Get(SettingKeys.OverrideElevationRequirement, false))
{
@@ -81,18 +82,18 @@ internal sealed class RuntimeOptions
}
});
private readonly LazySlim<string> lazyLocalCache = new(() => ApplicationData.Current.LocalCacheFolder.Path);
private readonly LazySlim<string> lazyInstalledLocation = new(() => Package.Current.InstalledLocation.Path);
private readonly LazySlim<string> lazyFamilyName = new(() => Package.Current.Id.FamilyName);
private readonly Lazy<string> lazyLocalCache = new(() => ApplicationData.Current.LocalCacheFolder.Path);
private readonly Lazy<string> lazyInstalledLocation = new(() => Package.Current.InstalledLocation.Path);
private readonly Lazy<string> lazyFamilyName = new(() => Package.Current.Id.FamilyName);
private readonly LazySlim<bool> lazyToastAvailable = new(() =>
{
ITaskContext taskContext = Ioc.Default.GetRequiredService<ITaskContext>();
return taskContext.InvokeOnMainThread(() => ToastNotificationManager.CreateToastNotifier().Setting is NotificationSetting.Enabled);
});
private bool isToastAvailable;
private bool isToastAvailableInitialized;
private object isToastAvailableLock = new();
public RuntimeOptions()
public RuntimeOptions(IServiceProvider serviceProvider, ILogger<RuntimeOptions> logger)
{
this.serviceProvider = serviceProvider;
AppLaunchTime = DateTimeOffset.UtcNow;
}
@@ -116,7 +117,19 @@ internal sealed class RuntimeOptions
public bool IsElevated { get => lazyElevated.Value; }
public bool IsToastAvailable { get => lazyToastAvailable.Value; }
public bool IsToastAvailable
{
get
{
return LazyInitializer.EnsureInitialized(ref isToastAvailable, ref isToastAvailableInitialized, ref isToastAvailableLock, GetIsToastAvailable);
bool GetIsToastAvailable()
{
ITaskContext taskContext = serviceProvider.GetRequiredService<ITaskContext>();
return taskContext.InvokeOnMainThread(() => ToastNotificationManager.CreateToastNotifier().Setting is NotificationSetting.Enabled);
}
}
}
public DateTimeOffset AppLaunchTime { get; }
}

View File

@@ -12,13 +12,8 @@ internal static class SettingKeys
{
#region MainWindow
public const string WindowRect = "WindowRect";
public const string GuideWindowRect = "GuideWindowRect";
public const string IsNavPaneOpen = "IsNavPaneOpen";
public const string IsInfoBarToggleChecked = "IsInfoBarToggleChecked";
#endregion
#region Infrastructure
public const string ExcludedAnnouncementIds = "ExcludedAnnouncementIds";
#endregion
@@ -30,7 +25,6 @@ internal static class SettingKeys
public const string StaticResourceImageArchive = "StaticResourceImageArchive";
public const string HotKeyMouseClickRepeatForever = "HotKeyMouseClickRepeatForever";
public const string IsAllocConsoleDebugModeEnabled = "IsAllocConsoleDebugModeEnabled2";
public const string IsNotifyIconEnabled = "IsNotifyIconEnabled";
#endregion
#region Passport

View File

@@ -0,0 +1,16 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
namespace Snap.Hutao.Core.Shell;
/// <summary>
/// 跳转列表交互
/// </summary>
internal interface IJumpListInterop
{
/// <summary>
/// 异步配置跳转列表
/// </summary>
/// <returns>任务</returns>
ValueTask ConfigureAsync();
}

View File

@@ -0,0 +1,36 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.Core.LifeCycle;
using Windows.UI.StartScreen;
namespace Snap.Hutao.Core.Shell;
/// <summary>
/// 跳转列表交互
/// </summary>
[HighQuality]
[Injection(InjectAs.Transient, typeof(IJumpListInterop))]
internal sealed class JumpListInterop : IJumpListInterop
{
/// <summary>
/// 异步配置跳转列表
/// </summary>
/// <returns>任务</returns>
public async ValueTask ConfigureAsync()
{
if (JumpList.IsSupported())
{
JumpList list = await JumpList.LoadCurrentAsync();
list.Items.Clear();
JumpListItem launchGameItem = JumpListItem.CreateWithArguments(Activation.LaunchGame, SH.CoreJumpListHelperLaunchGameItemDisplayName);
launchGameItem.Logo = "ms-appx:///Resource/Navigation/LaunchGame.png".ToUri();
list.Items.Add(launchGameItem);
await list.SaveAsync();
}
}
}

View File

@@ -54,7 +54,7 @@ internal sealed partial class ShellLinkInterop : IShellLinkInterop
pShellLink->SetShowCmd(SHOW_WINDOW_CMD.SW_NORMAL);
pShellLink->SetIconLocation(targetLogoPath, 0);
if (SUCCEEDED(IUnknownMarshal.QueryInterface(pShellLink, in IPersistFile.IID, out IPersistFile* pPersistFile)))
if (SUCCEEDED(pShellLink->QueryInterface(in IPersistFile.IID, out IPersistFile* pPersistFile)))
{
string desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
string target = Path.Combine(desktop, $"{SH.FormatAppNameAndVersion(runtimeOptions.Version)}.lnk");
@@ -64,10 +64,10 @@ internal sealed partial class ShellLinkInterop : IShellLinkInterop
result = true;
}
IUnknownMarshal.Release(pPersistFile);
pPersistFile->Release();
}
uint value = IUnknownMarshal.Release(pShellLink);
pShellLink->Release();
}
return result;

View File

@@ -1,8 +1,6 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using System.Diagnostics;
namespace Snap.Hutao.Core.Threading;
internal delegate bool SpinWaitPredicate<T>(ref readonly T state);
@@ -17,23 +15,4 @@ internal static class SpinWaitPolyfill
spinner.SpinOnce();
}
}
[SuppressMessage("", "SH002")]
public static unsafe bool SpinUntil<T>(ref T state, delegate*<ref readonly T, bool> condition, TimeSpan timeout)
{
long startTime = Stopwatch.GetTimestamp();
SpinWait spinner = default;
while (!condition(ref state))
{
spinner.SpinOnce();
if (timeout < Stopwatch.GetElapsedTime(startTime))
{
return false;
}
}
return true;
}
}

View File

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

View File

@@ -1,41 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.UI.Composition;
using Microsoft.UI.Composition.SystemBackdrops;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using System.Collections.Concurrent;
namespace Snap.Hutao.Core.Windowing.Backdrop;
// https://github.com/microsoft/microsoft-ui-xaml/blob/winui3/release/1.5-stable/controls/dev/Materials/DesktopAcrylicBackdrop/DesktopAcrylicBackdrop.cpp
internal sealed class InputActiveDesktopAcrylicBackdrop : SystemBackdrop
{
private readonly ConcurrentDictionary<ICompositionSupportsSystemBackdrop, DesktopAcrylicController> controllers = [];
protected override void OnTargetConnected(ICompositionSupportsSystemBackdrop target, XamlRoot xamlRoot)
{
base.OnTargetConnected(target, xamlRoot);
DesktopAcrylicController newController = new();
SystemBackdropConfiguration configuration = GetDefaultSystemBackdropConfiguration(target, xamlRoot);
configuration.IsInputActive = true;
newController.AddSystemBackdropTarget(target);
newController.SetSystemBackdropConfiguration(configuration);
controllers.TryAdd(target, newController);
}
protected override void OnTargetDisconnected(ICompositionSupportsSystemBackdrop target)
{
base.OnTargetDisconnected(target);
if (controllers.TryRemove(target, out DesktopAcrylicController? controller))
{
controller.RemoveSystemBackdropTarget(target);
controller.Dispose();
}
}
}

View File

@@ -1,50 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.UI.Composition;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Hosting;
using Microsoft.UI.Xaml.Media;
using System.Runtime.CompilerServices;
using WinRT;
namespace Snap.Hutao.Core.Windowing.Backdrop;
internal sealed class SystemBackdropDesktopWindowXamlSourceAccess : SystemBackdrop
{
private readonly SystemBackdrop? innerBackdrop;
public SystemBackdropDesktopWindowXamlSourceAccess(SystemBackdrop? systemBackdrop)
{
innerBackdrop = systemBackdrop;
}
public DesktopWindowXamlSource? DesktopWindowXamlSource
{
get; private set;
}
protected override void OnTargetConnected(ICompositionSupportsSystemBackdrop target, XamlRoot xamlRoot)
{
DesktopWindowXamlSource = DesktopWindowXamlSource.FromAbi(target.As<IInspectable>().ThisPtr);
if (innerBackdrop is not null)
{
ProtectedOnTargetConnected(innerBackdrop, target, xamlRoot);
}
}
protected override void OnTargetDisconnected(ICompositionSupportsSystemBackdrop target)
{
DesktopWindowXamlSource = null;
if (innerBackdrop is not null)
{
ProtectedOnTargetDisconnected(innerBackdrop, target);
}
}
[UnsafeAccessor(UnsafeAccessorKind.Method, Name = nameof(OnTargetConnected))]
private static extern void ProtectedOnTargetConnected(SystemBackdrop systemBackdrop, ICompositionSupportsSystemBackdrop target, XamlRoot xamlRoot);
[UnsafeAccessor(UnsafeAccessorKind.Method, Name = nameof(OnTargetDisconnected))]
private static extern void ProtectedOnTargetDisconnected(SystemBackdrop systemBackdrop, ICompositionSupportsSystemBackdrop target);
}

View File

@@ -9,9 +9,9 @@ using Windows.UI;
namespace Snap.Hutao.Core.Windowing.Backdrop;
internal sealed class TransparentBackdrop : SystemBackdrop, IBackdropNeedEraseBackground
internal sealed class TransparentBackdrop : SystemBackdrop, IDisposable, IBackdropNeedEraseBackground
{
private object? compositorLock;
private readonly object compositorLock = new();
private Color tintColor;
private Windows.UI.Composition.CompositionColorBrush? brush;
@@ -31,14 +31,27 @@ internal sealed class TransparentBackdrop : SystemBackdrop, IBackdropNeedEraseBa
{
get
{
return LazyInitializer.EnsureInitialized(ref compositor, ref compositorLock, () =>
if (compositor is null)
{
DispatcherQueue.EnsureSystemDispatcherQueue();
return new Windows.UI.Composition.Compositor();
});
lock (compositorLock)
{
if (compositor is null)
{
DispatcherQueue.EnsureSystemDispatcherQueue();
compositor = new Windows.UI.Composition.Compositor();
}
}
}
return compositor;
}
}
public void Dispose()
{
compositor?.Dispose();
}
protected override void OnTargetConnected(ICompositionSupportsSystemBackdrop connectedTarget, XamlRoot xamlRoot)
{
brush ??= Compositor.CreateColorBrush(tintColor);
@@ -48,13 +61,5 @@ internal sealed class TransparentBackdrop : SystemBackdrop, IBackdropNeedEraseBa
protected override void OnTargetDisconnected(ICompositionSupportsSystemBackdrop disconnectedTarget)
{
disconnectedTarget.SystemBackdrop = null;
if (compositorLock is not null)
{
lock (compositorLock)
{
compositor?.Dispose();
}
}
}
}

View File

@@ -17,10 +17,10 @@ namespace Snap.Hutao.Core.Windowing.HotKey;
[SuppressMessage("", "SA1124")]
internal sealed class HotKeyCombination : ObservableObject
{
private readonly ICurrentWindowReference currentWindowReference;
private readonly IInfoBarService infoBarService;
private readonly RuntimeOptions runtimeOptions;
private readonly HWND hwnd;
private readonly string settingKey;
private readonly int hotKeyId;
private readonly HotKeyParameter defaultHotKeyParameter;
@@ -36,12 +36,12 @@ internal sealed class HotKeyCombination : ObservableObject
private VirtualKey key;
private bool isEnabled;
public HotKeyCombination(IServiceProvider serviceProvider, HWND hwnd, string settingKey, int hotKeyId, HOT_KEY_MODIFIERS defaultModifiers, VirtualKey defaultKey)
public HotKeyCombination(IServiceProvider serviceProvider, string settingKey, int hotKeyId, HOT_KEY_MODIFIERS defaultModifiers, VirtualKey defaultKey)
{
currentWindowReference = serviceProvider.GetRequiredService<ICurrentWindowReference>();
infoBarService = serviceProvider.GetRequiredService<IInfoBarService>();
runtimeOptions = serviceProvider.GetRequiredService<RuntimeOptions>();
this.hwnd = hwnd;
this.settingKey = settingKey;
this.hotKeyId = hotKeyId;
defaultHotKeyParameter = new(defaultModifiers, defaultKey);
@@ -53,7 +53,7 @@ internal sealed class HotKeyCombination : ObservableObject
HotKeyParameter actual = LocalSettingGetHotKeyParameter();
modifiers = actual.Modifiers;
InitializeModifiersCompositionFields();
InitializeModifiersComposeFields();
key = actual.Key;
keyNameValue = VirtualKeys.GetList().Single(v => v.Value == key);
@@ -164,8 +164,8 @@ internal sealed class HotKeyCombination : ObservableObject
_ = (value, registered) switch
{
(true, false) => Register(),
(false, true) => Unregister(),
(true, false) => RegisterForCurrentWindow(),
(false, true) => UnregisterForCurrentWindow(),
_ => false,
};
}
@@ -174,7 +174,7 @@ internal sealed class HotKeyCombination : ObservableObject
public string DisplayName { get => ToString(); }
public bool Register()
public bool RegisterForCurrentWindow()
{
if (!runtimeOptions.IsElevated || !IsEnabled)
{
@@ -186,6 +186,7 @@ internal sealed class HotKeyCombination : ObservableObject
return true;
}
HWND hwnd = currentWindowReference.GetWindowHandle();
BOOL result = RegisterHotKey(hwnd, hotKeyId, Modifiers, (uint)Key);
registered = result;
@@ -197,7 +198,7 @@ internal sealed class HotKeyCombination : ObservableObject
return result;
}
public bool Unregister()
public bool UnregisterForCurrentWindow()
{
if (!runtimeOptions.IsElevated)
{
@@ -209,6 +210,7 @@ internal sealed class HotKeyCombination : ObservableObject
return true;
}
HWND hwnd = currentWindowReference.GetWindowHandle();
BOOL result = UnregisterHotKey(hwnd, hotKeyId);
registered = !result;
return result;
@@ -270,7 +272,7 @@ internal sealed class HotKeyCombination : ObservableObject
Modifiers = modifiers;
}
private void InitializeModifiersCompositionFields()
private void InitializeModifiersComposeFields()
{
if (Modifiers.HasFlag(HOT_KEY_MODIFIERS.MOD_WIN))
{
@@ -307,7 +309,7 @@ internal sealed class HotKeyCombination : ObservableObject
HotKeyParameter current = new(Modifiers, Key);
LocalSetting.Set(settingKey, *(int*)&current);
Unregister();
Register();
UnregisterForCurrentWindow();
RegisterForCurrentWindow();
}
}

View File

@@ -0,0 +1,97 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.Win32.UI.Input.KeyboardAndMouse;
using System.Runtime.InteropServices;
using static Snap.Hutao.Win32.User32;
namespace Snap.Hutao.Core.Windowing.HotKey;
[SuppressMessage("", "CA1001")]
[Injection(InjectAs.Singleton, typeof(IHotKeyController))]
[ConstructorGenerated]
internal sealed partial class HotKeyController : IHotKeyController
{
private static readonly WaitCallback RunMouseClickRepeatForever = MouseClickRepeatForever;
private readonly object syncRoot = new();
private readonly HotKeyOptions hotKeyOptions;
private volatile CancellationTokenSource? cancellationTokenSource;
public void RegisterAll()
{
hotKeyOptions.MouseClickRepeatForeverKeyCombination.RegisterForCurrentWindow();
}
public void UnregisterAll()
{
hotKeyOptions.MouseClickRepeatForeverKeyCombination.UnregisterForCurrentWindow();
}
public void OnHotKeyPressed(in HotKeyParameter parameter)
{
if (parameter.Equals(hotKeyOptions.MouseClickRepeatForeverKeyCombination))
{
ToggleMouseClickRepeatForever();
}
}
private static unsafe INPUT CreateInputForMouseEvent(MOUSE_EVENT_FLAGS flags)
{
INPUT input = default;
input.type = INPUT_TYPE.INPUT_MOUSE;
input.Anonymous.mi.dwFlags = flags;
return input;
}
[SuppressMessage("", "SH007")]
private static unsafe void MouseClickRepeatForever(object? state)
{
CancellationToken token = (CancellationToken)state!;
// We want to use this thread for a long time
while (!token.IsCancellationRequested)
{
INPUT[] inputs =
[
CreateInputForMouseEvent(MOUSE_EVENT_FLAGS.MOUSEEVENTF_LEFTDOWN),
CreateInputForMouseEvent(MOUSE_EVENT_FLAGS.MOUSEEVENTF_LEFTUP),
];
if (SendInput(inputs.AsSpan(), sizeof(INPUT)) is 0)
{
Marshal.ThrowExceptionForHR(Marshal.GetLastPInvokeError());
}
if (token.IsCancellationRequested)
{
return;
}
Thread.Sleep(System.Random.Shared.Next(100, 150));
}
}
private void ToggleMouseClickRepeatForever()
{
lock (syncRoot)
{
if (hotKeyOptions.IsMouseClickRepeatForeverOn)
{
// Turn off
cancellationTokenSource?.Cancel();
cancellationTokenSource = default;
hotKeyOptions.IsMouseClickRepeatForeverOn = false;
}
else
{
// Turn on
cancellationTokenSource = new();
ThreadPool.QueueUserWorkItem(RunMouseClickRepeatForever, cancellationTokenSource.Token);
hotKeyOptions.IsMouseClickRepeatForeverOn = true;
}
}
}
}

View File

@@ -1,92 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.Win32.Foundation;
using Snap.Hutao.Win32.UI.WindowsAndMessaging;
using System.Collections.Concurrent;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using static Snap.Hutao.Win32.ConstValues;
using static Snap.Hutao.Win32.User32;
namespace Snap.Hutao.Core.Windowing.HotKey;
internal sealed class HotKeyMessageWindow : IDisposable
{
private const string WindowClassName = "SnapHutaoHotKeyMessageWindowClass";
private static readonly ConcurrentDictionary<HWND, HotKeyMessageWindow> WindowTable = [];
private bool isDisposed;
public unsafe HotKeyMessageWindow()
{
ushort atom;
fixed (char* className = WindowClassName)
{
WNDCLASSW wc = new()
{
lpfnWndProc = WNDPROC.Create(&OnWindowProcedure),
lpszClassName = className,
};
atom = RegisterClassW(&wc);
}
ArgumentOutOfRangeException.ThrowIfEqual<ushort>(atom, 0);
HWND = CreateWindowExW(0, WindowClassName, WindowClassName, 0, 0, 0, 0, 0, default, default, default, default);
if (HWND == default)
{
Marshal.ThrowExceptionForHR(Marshal.GetLastPInvokeError());
}
WindowTable.TryAdd(HWND, this);
}
~HotKeyMessageWindow()
{
Dispose();
}
public Action<HotKeyParameter>? HotKeyPressed { get; set; }
public HWND HWND { get; }
public void Dispose()
{
if (isDisposed)
{
return;
}
isDisposed = true;
DestroyWindow(HWND);
WindowTable.TryRemove(HWND, out _);
GC.SuppressFinalize(this);
}
[SuppressMessage("", "SH002")]
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvStdcall)])]
private static unsafe LRESULT OnWindowProcedure(HWND hwnd, uint uMsg, WPARAM wParam, LPARAM lParam)
{
if (!WindowTable.TryGetValue(hwnd, out HotKeyMessageWindow? window))
{
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
}
switch (uMsg)
{
case WM_HOTKEY:
window.HotKeyPressed?.Invoke(*(HotKeyParameter*)&lParam);
break;
default:
break;
}
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
}
}

View File

@@ -4,35 +4,19 @@
using CommunityToolkit.Mvvm.ComponentModel;
using Snap.Hutao.Core.Setting;
using Snap.Hutao.Model;
using Snap.Hutao.Win32.UI.Input.KeyboardAndMouse;
using System.Runtime.InteropServices;
using Windows.System;
using static Snap.Hutao.Win32.User32;
namespace Snap.Hutao.Core.Windowing.HotKey;
[Injection(InjectAs.Singleton)]
internal sealed partial class HotKeyOptions : ObservableObject, IDisposable
internal sealed partial class HotKeyOptions : ObservableObject
{
private static readonly WaitCallback RunMouseClickRepeatForever = MouseClickRepeatForever;
private readonly object syncRoot = new();
private readonly HotKeyMessageWindow hotKeyMessageWindow;
private volatile CancellationTokenSource? cancellationTokenSource;
private bool isDisposed;
private bool isMouseClickRepeatForeverOn;
private HotKeyCombination mouseClickRepeatForeverKeyCombination;
public HotKeyOptions(IServiceProvider serviceProvider)
{
hotKeyMessageWindow = new()
{
HotKeyPressed = OnHotKeyPressed,
};
mouseClickRepeatForeverKeyCombination = new(serviceProvider, hotKeyMessageWindow.HWND, SettingKeys.HotKeyMouseClickRepeatForever, 100000, default, VirtualKey.F8);
mouseClickRepeatForeverKeyCombination = new(serviceProvider, SettingKeys.HotKeyMouseClickRepeatForever, 100000, default, VirtualKey.F8);
}
public List<NameValue<VirtualKey>> VirtualKeys { get; } = HotKey.VirtualKeys.GetList();
@@ -48,96 +32,4 @@ internal sealed partial class HotKeyOptions : ObservableObject, IDisposable
get => mouseClickRepeatForeverKeyCombination;
set => SetProperty(ref mouseClickRepeatForeverKeyCombination, value);
}
public void Dispose()
{
if (isDisposed)
{
return;
}
isDisposed = true;
UnregisterAll();
hotKeyMessageWindow.Dispose();
cancellationTokenSource?.Dispose();
GC.SuppressFinalize(this);
}
public void RegisterAll()
{
MouseClickRepeatForeverKeyCombination.Register();
}
private static unsafe INPUT CreateInputForMouseEvent(MOUSE_EVENT_FLAGS flags)
{
INPUT input = default;
input.type = INPUT_TYPE.INPUT_MOUSE;
input.Anonymous.mi.dwFlags = flags;
return input;
}
[SuppressMessage("", "SH007")]
private static unsafe void MouseClickRepeatForever(object? state)
{
CancellationToken token = (CancellationToken)state!;
// We want to use this thread for a long time
while (!token.IsCancellationRequested)
{
INPUT[] inputs =
[
CreateInputForMouseEvent(MOUSE_EVENT_FLAGS.MOUSEEVENTF_LEFTDOWN),
CreateInputForMouseEvent(MOUSE_EVENT_FLAGS.MOUSEEVENTF_LEFTUP),
];
if (SendInput(inputs.AsSpan(), sizeof(INPUT)) is 0)
{
Marshal.ThrowExceptionForHR(Marshal.GetLastPInvokeError());
}
if (token.IsCancellationRequested)
{
return;
}
Thread.Sleep(System.Random.Shared.Next(100, 150));
}
}
private void UnregisterAll()
{
MouseClickRepeatForeverKeyCombination.Unregister();
}
[SuppressMessage("", "SH002")]
private void OnHotKeyPressed(HotKeyParameter parameter)
{
if (parameter.Equals(MouseClickRepeatForeverKeyCombination))
{
ToggleMouseClickRepeatForever();
}
}
private void ToggleMouseClickRepeatForever()
{
lock (syncRoot)
{
if (IsMouseClickRepeatForeverOn)
{
// Turn off
cancellationTokenSource?.Cancel();
cancellationTokenSource = default;
IsMouseClickRepeatForeverOn = false;
}
else
{
// Turn on
cancellationTokenSource = new();
ThreadPool.QueueUserWorkItem(RunMouseClickRepeatForever, cancellationTokenSource.Token);
IsMouseClickRepeatForeverOn = true;
}
}
}
}

View File

@@ -0,0 +1,13 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
namespace Snap.Hutao.Core.Windowing.HotKey;
internal interface IHotKeyController
{
void OnHotKeyPressed(in HotKeyParameter parameter);
void RegisterAll();
void UnregisterAll();
}

View File

@@ -6,10 +6,10 @@ namespace Snap.Hutao.Core.Windowing;
/// <summary>
/// 为扩展窗体提供必要的选项
/// </summary>
internal interface IXamlWindowOptionsSource
internal interface IWindowOptionsSource
{
/// <summary>
/// 窗体选项
/// </summary>
XamlWindowOptions WindowOptions { get; }
WindowOptions WindowOptions { get; }
}

View File

@@ -1,67 +0,0 @@
<Flyout
x:Class="Snap.Hutao.Core.Windowing.NotifyIcon.NotifyIconContextMenu"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:shcm="using:Snap.Hutao.Control.Markup"
xmlns:shcwb="using:Snap.Hutao.Core.Windowing.Backdrop"
xmlns:shv="using:Snap.Hutao.ViewModel"
ShouldConstrainToRootBounds="False"
mc:Ignorable="d">
<Flyout.SystemBackdrop>
<shcwb:InputActiveDesktopAcrylicBackdrop/>
</Flyout.SystemBackdrop>
<Flyout.FlyoutPresenterStyle>
<Style BasedOn="{StaticResource DefaultFlyoutPresenterStyle}" TargetType="FlyoutPresenter">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Margin" Value="0"/>
</Style>
</Flyout.FlyoutPresenterStyle>
<Grid
x:Name="Root"
d:DataContext="{d:DesignInstance shv:NotifyIconViewModel}"
Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Margin="8" Text="{Binding Title}"/>
<Grid Grid.Row="1" Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}">
<StackPanel
Margin="4,0"
HorizontalAlignment="Right"
Orientation="Horizontal"
Spacing="2">
<AppBarButton Command="{Binding ShowWindowCommand}" Label="{shcm:ResourceString Name=CoreWindowingNotifyIconViewLabel}">
<AppBarButton.Icon>
<FontIcon
Width="20"
Height="20"
Glyph="&#xE80F;"/>
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton Command="{Binding LaunchGameCommand}" Label="{shcm:ResourceString Name=CoreWindowingNotifyIconLaunchGameLabel}">
<AppBarButton.Icon>
<FontIcon
Width="20"
Height="20"
Glyph="&#xE7FC;"/>
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton Command="{Binding ExitCommand}" Label="{shcm:ResourceString Name=CoreWindowingNotifyIconExitLabel}">
<AppBarButton.Icon>
<FontIcon
Width="20"
Height="20"
Glyph="&#xE7E8;"/>
</AppBarButton.Icon>
</AppBarButton>
</StackPanel>
</Grid>
</Grid>
</Flyout>

View File

@@ -1,17 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.ViewModel;
namespace Snap.Hutao.Core.Windowing.NotifyIcon;
internal sealed partial class NotifyIconContextMenu : Flyout
{
public NotifyIconContextMenu(IServiceProvider serviceProvider)
{
AllowFocusOnInteraction = false;
InitializeComponent();
Root.DataContext = serviceProvider.GetRequiredService<NotifyIconViewModel>();
}
}

View File

@@ -1,92 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.Core.ExceptionService;
using Snap.Hutao.Win32.Foundation;
using Snap.Hutao.Win32.UI.WindowsAndMessaging;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Windows.Storage;
using static Snap.Hutao.Win32.ConstValues;
namespace Snap.Hutao.Core.Windowing.NotifyIcon;
[Injection(InjectAs.Singleton)]
internal sealed class NotifyIconController : IDisposable
{
private readonly LazySlim<NotifyIconContextMenu> lazyMenu;
private readonly NotifyIconXamlHostWindow xamlHostWindow;
private readonly NotifyIconMessageWindow messageWindow;
private readonly System.Drawing.Icon icon;
public NotifyIconController(IServiceProvider serviceProvider)
{
lazyMenu = new(() => new(serviceProvider));
StorageFile iconFile = StorageFile.GetFileFromApplicationUriAsync("ms-appx:///Assets/Logo.ico".ToUri()).AsTask().GetAwaiter().GetResult();
icon = new(iconFile.Path);
xamlHostWindow = new();
messageWindow = new()
{
TaskbarCreated = OnRecreateNotifyIconRequested,
ContextMenuRequested = OnContextMenuRequested,
};
CreateNotifyIcon();
}
private static ref readonly Guid Id
{
get
{
// MD5 for "Snap.Hutao"
ReadOnlySpan<byte> data = [0xEE, 0x01, 0x5C, 0xCB, 0xF3, 0x97, 0xC6, 0x93, 0xE8, 0x77, 0xCE, 0x09, 0x54, 0x90, 0xEE, 0xAC];
return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
}
}
public void Dispose()
{
messageWindow.Dispose();
NotifyIconMethods.Delete(Id);
icon.Dispose();
xamlHostWindow.Dispose();
}
private void OnRecreateNotifyIconRequested(NotifyIconMessageWindow window)
{
NotifyIconMethods.Delete(Id);
if (!NotifyIconMethods.Add(Id, window.HWND, "Snap Hutao", NotifyIconMessageWindow.WM_NOTIFYICON_CALLBACK, (HICON)icon.Handle))
{
HutaoException.InvalidOperation("Failed to recreate NotifyIcon");
}
if (!NotifyIconMethods.SetVersion(Id, NOTIFYICON_VERSION_4))
{
HutaoException.InvalidOperation("Failed to set NotifyIcon version");
}
}
private void CreateNotifyIcon()
{
NotifyIconMethods.Delete(Id);
if (!NotifyIconMethods.Add(Id, messageWindow.HWND, "Snap Hutao", NotifyIconMessageWindow.WM_NOTIFYICON_CALLBACK, (HICON)icon.Handle))
{
HutaoException.InvalidOperation("Failed to create NotifyIcon");
}
if (!NotifyIconMethods.SetVersion(Id, NOTIFYICON_VERSION_4))
{
HutaoException.InvalidOperation("Failed to set NotifyIcon version");
}
}
private void OnContextMenuRequested(NotifyIconMessageWindow window, PointUInt16 point)
{
RECT iconRect = NotifyIconMethods.GetRect(Id, window.HWND);
xamlHostWindow.ShowFlyoutAt(lazyMenu.Value, new Windows.Foundation.Point(point.X, point.Y), iconRect);
}
}

View File

@@ -1,151 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.Win32.Foundation;
using Snap.Hutao.Win32.UI.WindowsAndMessaging;
using System.Collections.Concurrent;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using static Snap.Hutao.Win32.ConstValues;
using static Snap.Hutao.Win32.User32;
namespace Snap.Hutao.Core.Windowing.NotifyIcon;
[SuppressMessage("", "SA1310")]
internal sealed class NotifyIconMessageWindow : IDisposable
{
public const uint WM_NOTIFYICON_CALLBACK = 0x444U;
private const string WindowClassName = "SnapHutaoNotifyIconMessageWindowClass";
private static readonly ConcurrentDictionary<HWND, NotifyIconMessageWindow> WindowTable = [];
[SuppressMessage("", "SA1306")]
private readonly uint WM_TASKBARCREATED;
private bool isDisposed;
public unsafe NotifyIconMessageWindow()
{
ushort atom;
fixed (char* className = WindowClassName)
{
WNDCLASSW wc = new()
{
lpfnWndProc = WNDPROC.Create(&OnWindowProcedure),
lpszClassName = className,
};
atom = RegisterClassW(&wc);
}
ArgumentOutOfRangeException.ThrowIfEqual<ushort>(atom, 0);
// https://learn.microsoft.com/zh,cn/windows/win32/shell/taskbar#taskbar,creation,notification
WM_TASKBARCREATED = RegisterWindowMessageW("TaskbarCreated");
HWND = CreateWindowExW(0, WindowClassName, WindowClassName, 0, 0, 0, 0, 0, default, default, default, default);
if (HWND == default)
{
Marshal.ThrowExceptionForHR(Marshal.GetLastPInvokeError());
}
WindowTable.TryAdd(HWND, this);
}
~NotifyIconMessageWindow()
{
Dispose();
}
public Action<NotifyIconMessageWindow>? TaskbarCreated { get; set; }
public Action<NotifyIconMessageWindow, PointUInt16>? ContextMenuRequested { get; set; }
public HWND HWND { get; }
public void Dispose()
{
if (isDisposed)
{
return;
}
isDisposed = true;
DestroyWindow(HWND);
WindowTable.TryRemove(HWND, out _);
GC.SuppressFinalize(this);
}
[SuppressMessage("", "SH002")]
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvStdcall)])]
private static unsafe LRESULT OnWindowProcedure(HWND hwnd, uint uMsg, WPARAM wParam, LPARAM lParam)
{
if (!WindowTable.TryGetValue(hwnd, out NotifyIconMessageWindow? window))
{
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
}
if (uMsg == window.WM_TASKBARCREATED)
{
// TODO: Re-add the notify icon.
window.TaskbarCreated?.Invoke(window);
}
// https://learn.microsoft.com/zh-cn/windows/win32/api/shellapi/ns-shellapi-notifyicondataw
if (uMsg is WM_NOTIFYICON_CALLBACK)
{
LPARAM2 lParam2 = *(LPARAM2*)&lParam;
PointUInt16 wParam2 = *(PointUInt16*)&wParam;
switch (lParam2.Low)
{
case WM_CONTEXTMENU:
window.ContextMenuRequested?.Invoke(window, wParam2);
break;
case WM_MOUSEMOVE:
// X: wParam2.X Y: wParam2.Y Low: WM_MOUSEMOVE
break;
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
break;
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
break;
case NIN_SELECT:
// X: wParam2.X Y: wParam2.Y Low: NIN_SELECT
break;
case NIN_POPUPOPEN:
// X: wParam2.X Y: 0? Low: NIN_POPUPOPEN
break;
case NIN_POPUPCLOSE:
// X: wParam2.X Y: 0? Low: NIN_POPUPCLOSE
break;
default:
break;
}
}
else
{
switch (uMsg)
{
case WM_ACTIVATEAPP:
break;
case WM_DWMNCRENDERINGCHANGED:
break;
default:
break;
}
}
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
}
private readonly struct LPARAM2
{
public readonly uint Low;
public readonly uint High;
}
}

View File

@@ -1,90 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.Win32.Foundation;
using Snap.Hutao.Win32.UI.Shell;
using Snap.Hutao.Win32.UI.WindowsAndMessaging;
using System.Runtime.InteropServices;
using static Snap.Hutao.Win32.Shell32;
namespace Snap.Hutao.Core.Windowing.NotifyIcon;
internal sealed class NotifyIconMethods
{
public static BOOL Add(ref readonly NOTIFYICONDATAW data)
{
return Shell_NotifyIconW(NOTIFY_ICON_MESSAGE.NIM_ADD, in data);
}
[SuppressMessage("", "SH002")]
public static unsafe BOOL Add(Guid id, HWND hWnd, string tip, uint uCallbackMessage, HICON hIcon)
{
NOTIFYICONDATAW data = default;
data.cbSize = (uint)sizeof(NOTIFYICONDATAW);
data.uFlags = NOTIFY_ICON_DATA_FLAGS.NIF_MESSAGE | NOTIFY_ICON_DATA_FLAGS.NIF_ICON | NOTIFY_ICON_DATA_FLAGS.NIF_TIP | NOTIFY_ICON_DATA_FLAGS.NIF_GUID;
data.guidItem = id;
data.hWnd = hWnd;
tip.AsSpan().CopyTo(new(data.szTip, 128));
data.uCallbackMessage = uCallbackMessage;
data.hIcon = hIcon;
data.dwState = NOTIFY_ICON_STATE.NIS_HIDDEN;
data.dwStateMask = NOTIFY_ICON_STATE.NIS_HIDDEN;
return Add(in data);
}
public static BOOL Modify(ref readonly NOTIFYICONDATAW data)
{
return Shell_NotifyIconW(NOTIFY_ICON_MESSAGE.NIM_MODIFY, in data);
}
public static BOOL Delete(ref readonly NOTIFYICONDATAW data)
{
return Shell_NotifyIconW(NOTIFY_ICON_MESSAGE.NIM_DELETE, in data);
}
public static unsafe BOOL Delete(Guid id)
{
NOTIFYICONDATAW data = default;
data.cbSize = (uint)sizeof(NOTIFYICONDATAW);
data.uFlags = NOTIFY_ICON_DATA_FLAGS.NIF_GUID;
data.guidItem = id;
return Delete(in data);
}
[SuppressMessage("", "SH002")]
public static unsafe RECT GetRect(Guid id, HWND hWND)
{
NOTIFYICONIDENTIFIER identifier = new()
{
cbSize = (uint)sizeof(NOTIFYICONIDENTIFIER),
hWnd = hWND,
guidItem = id,
};
Marshal.ThrowExceptionForHR(Shell_NotifyIconGetRect(ref identifier, out RECT rect));
return rect;
}
public static BOOL SetFocus(ref readonly NOTIFYICONDATAW data)
{
return Shell_NotifyIconW(NOTIFY_ICON_MESSAGE.NIM_SETFOCUS, in data);
}
public static BOOL SetVersion(ref readonly NOTIFYICONDATAW data)
{
return Shell_NotifyIconW(NOTIFY_ICON_MESSAGE.NIM_SETVERSION, in data);
}
public static unsafe BOOL SetVersion(Guid id, uint version)
{
NOTIFYICONDATAW data = default;
data.cbSize = (uint)sizeof(NOTIFYICONDATAW);
data.uFlags = NOTIFY_ICON_DATA_FLAGS.NIF_GUID;
data.guidItem = id;
data.Anonymous.uVersion = version;
return SetVersion(in data);
}
}

View File

@@ -1,69 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.UI.Windowing;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Snap.Hutao.Core.Windowing.Backdrop;
using Snap.Hutao.Win32;
using Snap.Hutao.Win32.Foundation;
using Snap.Hutao.Win32.UI.WindowsAndMessaging;
using Windows.Foundation;
using WinRT.Interop;
using static Snap.Hutao.Win32.User32;
namespace Snap.Hutao.Core.Windowing.NotifyIcon;
internal sealed class NotifyIconXamlHostWindow : Window, IDisposable, IWindowNeedEraseBackground
{
private readonly XamlWindowSubclass subclass;
public NotifyIconXamlHostWindow()
{
Content = new Border();
this.SetLayeredWindow();
AppWindow.Title = "SnapHutaoNotifyIconXamlHost";
AppWindow.IsShownInSwitchers = false;
if (AppWindow.Presenter is OverlappedPresenter presenter)
{
presenter.IsMaximizable = false;
presenter.IsMinimizable = false;
presenter.IsResizable = false;
presenter.IsAlwaysOnTop = true;
presenter.SetBorderAndTitleBar(false, false);
}
XamlWindowOptions options = new(this, default!, default);
subclass = new(this, options);
subclass.Initialize();
Activate();
}
public void ShowFlyoutAt(FlyoutBase flyout, Point point, RECT icon)
{
icon.left -= 8;
icon.top -= 8;
icon.right += 8;
icon.bottom += 8;
HWND hwnd = WindowNative.GetWindowHandle(this);
ShowWindow(hwnd, SHOW_WINDOW_CMD.SW_NORMAL);
SetForegroundWindow(hwnd);
AppWindow.MoveAndResize(StructMarshal.RectInt32(icon));
flyout.ShowAt(Content, new()
{
Placement = FlyoutPlacementMode.Auto,
ShowMode = FlyoutShowMode.Transient,
});
}
public void Dispose()
{
subclass.Dispose();
}
}

View File

@@ -1,10 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
namespace Snap.Hutao.Core.Windowing.NotifyIcon;
internal readonly struct PointUInt16
{
public readonly ushort X;
public readonly ushort Y;
}

View File

@@ -13,6 +13,7 @@ using Snap.Hutao.Win32;
using Snap.Hutao.Win32.Foundation;
using Snap.Hutao.Win32.Graphics.Dwm;
using Snap.Hutao.Win32.UI.WindowsAndMessaging;
using System.Collections.Frozen;
using System.IO;
using Windows.Graphics;
using Windows.UI;
@@ -22,23 +23,22 @@ using static Snap.Hutao.Win32.User32;
namespace Snap.Hutao.Core.Windowing;
[SuppressMessage("", "CA1001")]
internal sealed class XamlWindowController
internal sealed class WindowController
{
private readonly Window window;
private readonly XamlWindowOptions options;
private readonly WindowOptions options;
private readonly IServiceProvider serviceProvider;
private readonly XamlWindowSubclass subclass;
private readonly XamlWindowNonRudeHWND windowNonRudeHWND;
private readonly WindowSubclass subclass;
public XamlWindowController(Window window, in XamlWindowOptions options, IServiceProvider serviceProvider)
public WindowController(Window window, in WindowOptions options, IServiceProvider serviceProvider)
{
this.window = window;
this.options = options;
this.serviceProvider = serviceProvider;
subclass = new(window, options);
windowNonRudeHWND = new(options.Hwnd);
// Window reference must be set before Window Subclass created
serviceProvider.GetRequiredService<ICurrentWindowReference>().Window = window;
subclass = new(window, options, serviceProvider);
InitializeCore();
}
@@ -87,9 +87,9 @@ internal sealed class XamlWindowController
SizeInt32 scaledSize = options.InitSize.Scale(scale);
RectInt32 rect = StructMarshal.RectInt32(scaledSize);
if (!string.IsNullOrEmpty(options.PersistRectKey))
if (options.PersistSize)
{
RectInt32 persistedRect = (CompactRect)LocalSetting.Get(options.PersistRectKey, (CompactRect)rect);
RectInt32 persistedRect = (CompactRect)LocalSetting.Get(SettingKeys.WindowRect, (CompactRect)rect);
if (persistedRect.Size() >= options.InitSize.Size())
{
rect = persistedRect.Scale(scale);
@@ -102,7 +102,7 @@ internal sealed class XamlWindowController
private void SaveOrSkipWindowSize()
{
if (string.IsNullOrEmpty(options.PersistRectKey))
if (!options.PersistSize)
{
return;
}
@@ -114,7 +114,7 @@ internal sealed class XamlWindowController
if (!windowPlacement.ShowCmd.HasFlag(SHOW_WINDOW_CMD.SW_SHOWMAXIMIZED))
{
double scale = 1.0 / options.GetRasterizationScale();
LocalSetting.Set(options.PersistRectKey, (CompactRect)window.AppWindow.GetRect().Scale(scale));
LocalSetting.Set(SettingKeys.WindowRect, (CompactRect)window.AppWindow.GetRect().Scale(scale));
}
}
@@ -135,42 +135,34 @@ internal sealed class XamlWindowController
private void OnWindowClosed(object sender, WindowEventArgs args)
{
if (LocalSetting.Get(SettingKeys.IsNotifyIconEnabled, true) && !serviceProvider.GetRequiredService<App>().IsExiting)
{
args.Handled = true;
window.Hide();
ICurrentXamlWindowReference currentXamlWindowReference = serviceProvider.GetRequiredService<ICurrentXamlWindowReference>();
if (currentXamlWindowReference.Window == window)
{
currentXamlWindowReference.Window = default!;
}
GC.Collect(GC.MaxGeneration);
}
else
{
SaveOrSkipWindowSize();
subclass?.Dispose();
windowNonRudeHWND?.Dispose();
}
SaveOrSkipWindowSize();
subclass?.Dispose();
}
private void ExtendsContentIntoTitleBar()
{
AppWindowTitleBar appTitleBar = window.AppWindow.TitleBar;
appTitleBar.IconShowOptions = IconShowOptions.HideIconAndSystemMenu;
appTitleBar.ExtendsContentIntoTitleBar = true;
if (options.UseLegacyDragBarImplementation)
{
// use normal Window method to extend.
window.ExtendsContentIntoTitleBar = true;
window.SetTitleBar(options.TitleBar);
}
else
{
AppWindowTitleBar appTitleBar = window.AppWindow.TitleBar;
appTitleBar.IconShowOptions = IconShowOptions.HideIconAndSystemMenu;
appTitleBar.ExtendsContentIntoTitleBar = true;
UpdateTitleButtonColor();
UpdateDragRectangles();
options.TitleBar.ActualThemeChanged += (_, _) => UpdateTitleButtonColor();
options.TitleBar.SizeChanged += (_, _) => UpdateDragRectangles();
UpdateTitleButtonColor();
UpdateDragRectangles();
options.TitleBar.ActualThemeChanged += (_, _) => UpdateTitleButtonColor();
options.TitleBar.SizeChanged += (_, _) => UpdateDragRectangles();
}
}
private bool UpdateSystemBackdrop(BackdropType backdropType)
{
SystemBackdrop? actualBackdop = backdropType switch
window.SystemBackdrop = backdropType switch
{
BackdropType.Transparent => new Backdrop.TransparentBackdrop(),
BackdropType.MicaAlt => new MicaBackdrop() { Kind = MicaKind.BaseAlt },
@@ -179,8 +171,6 @@ internal sealed class XamlWindowController
_ => null,
};
window.SystemBackdrop = new Backdrop.SystemBackdropDesktopWindowXamlSourceAccess(actualBackdop);
return true;
}

View File

@@ -2,67 +2,30 @@
// Licensed under the MIT license.
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Hosting;
using Snap.Hutao.Core.Windowing.Backdrop;
using Snap.Hutao.Win32.Foundation;
using Snap.Hutao.Win32.UI.WindowsAndMessaging;
using System.Runtime.CompilerServices;
using WinRT.Interop;
using static Snap.Hutao.Win32.Macros;
using static Snap.Hutao.Win32.User32;
namespace Snap.Hutao.Core.Windowing;
internal static class WindowExtension
{
private static readonly ConditionalWeakTable<Window, XamlWindowController> WindowControllers = [];
private static readonly ConditionalWeakTable<Window, WindowController> WindowControllers = [];
public static void InitializeController<TWindow>(this TWindow window, IServiceProvider serviceProvider)
where TWindow : Window, IXamlWindowOptionsSource
where TWindow : Window, IWindowOptionsSource
{
XamlWindowController windowController = new(window, window.WindowOptions, serviceProvider);
WindowController windowController = new(window, window.WindowOptions, serviceProvider);
WindowControllers.Add(window, windowController);
}
public static bool IsControllerInitialized<TWindow>(this TWindow window)
where TWindow : Window
{
return WindowControllers.TryGetValue(window, out _);
}
public static void SetLayeredWindow(this Window window)
{
HWND hwnd = (HWND)WindowNative.GetWindowHandle(window);
nint style = GetWindowLongPtrW(hwnd, WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE);
style |= (nint)WINDOW_EX_STYLE.WS_EX_LAYERED;
SetWindowLongPtrW(hwnd, WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE, style);
SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), 0, LAYERED_WINDOW_ATTRIBUTES_FLAGS.LWA_COLORKEY | LAYERED_WINDOW_ATTRIBUTES_FLAGS.LWA_ALPHA);
}
public static void Show(this Window window)
{
ShowWindow(GetWindowHandle(window), SHOW_WINDOW_CMD.SW_NORMAL);
}
public static void Hide(this Window window)
{
ShowWindow(GetWindowHandle(window), SHOW_WINDOW_CMD.SW_HIDE);
}
public static DesktopWindowXamlSource? GetDesktopWindowXamlSource(this Window window)
{
if (window.SystemBackdrop is SystemBackdropDesktopWindowXamlSourceAccess access)
{
return access.DesktopWindowXamlSource;
}
return default;
}
public static HWND GetWindowHandle(this Window? window)
{
return window is IXamlWindowOptionsSource optionsSource
? optionsSource.WindowOptions.Hwnd
: WindowNative.GetWindowHandle(window);
}
}

View File

@@ -2,6 +2,7 @@
// Licensed under the MIT license.
using Microsoft.UI.Input;
using Microsoft.UI.Windowing;
using Microsoft.UI.Xaml;
using Snap.Hutao.Win32.Foundation;
using Windows.Graphics;
@@ -13,7 +14,7 @@ namespace Snap.Hutao.Core.Windowing;
/// <summary>
/// Window 选项
/// </summary>
internal readonly struct XamlWindowOptions
internal readonly struct WindowOptions
{
/// <summary>
/// 窗体句柄
@@ -38,18 +39,20 @@ internal readonly struct XamlWindowOptions
/// <summary>
/// 是否持久化尺寸
/// </summary>
[Obsolete]
public readonly bool PersistSize;
public readonly string? PersistRectKey;
/// <summary>
/// 是否使用 Win UI 3 自带的拓展标题栏实现
/// </summary>
public readonly bool UseLegacyDragBarImplementation = !AppWindowTitleBar.IsCustomizationSupported();
public XamlWindowOptions(Window window, FrameworkElement titleBar, SizeInt32 initSize, string? persistSize = default)
public WindowOptions(Window window, FrameworkElement titleBar, SizeInt32 initSize, bool persistSize = false)
{
Hwnd = WindowNative.GetWindowHandle(window);
InputNonClientPointerSource = InputNonClientPointerSource.GetForWindowId(window.AppWindow.Id);
TitleBar = titleBar;
InitSize = initSize;
PersistRectKey = persistSize;
PersistSize = persistSize;
}
/// <summary>

View File

@@ -0,0 +1,145 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.UI.Xaml;
using Snap.Hutao.Core.Windowing.Backdrop;
using Snap.Hutao.Core.Windowing.HotKey;
using Snap.Hutao.Win32.Foundation;
using Snap.Hutao.Win32.UI.Shell;
using Snap.Hutao.Win32.UI.WindowsAndMessaging;
using static Snap.Hutao.Win32.ComCtl32;
using static Snap.Hutao.Win32.ConstValues;
using static Snap.Hutao.Win32.User32;
namespace Snap.Hutao.Core.Windowing;
/// <summary>
/// 窗体子类管理器
/// </summary>
[HighQuality]
internal sealed class WindowSubclass : IDisposable
{
private const int WindowSubclassId = 101;
private const int DragBarSubclassId = 102;
private readonly Window window;
private readonly WindowOptions options;
private readonly IServiceProvider serviceProvider;
private readonly IHotKeyController hotKeyController;
// We have to explicitly hold a reference to SUBCLASSPROC
private SUBCLASSPROC windowProc = default!;
private SUBCLASSPROC legacyDragBarProc = default!;
public WindowSubclass(Window window, in WindowOptions options, IServiceProvider serviceProvider)
{
this.window = window;
this.options = options;
this.serviceProvider = serviceProvider;
hotKeyController = serviceProvider.GetRequiredService<IHotKeyController>();
}
/// <summary>
/// 尝试设置窗体子类
/// </summary>
/// <returns>是否设置成功</returns>
public bool Initialize()
{
windowProc = OnSubclassProcedure;
bool windowHooked = SetWindowSubclass(options.Hwnd, windowProc, WindowSubclassId, 0);
hotKeyController.RegisterAll();
bool titleBarHooked = true;
// only hook up drag bar proc when use legacy Window.ExtendsContentIntoTitleBar
if (!options.UseLegacyDragBarImplementation)
{
return windowHooked && titleBarHooked;
}
titleBarHooked = false;
HWND hwndDragBar = FindWindowExW(options.Hwnd, default, "DRAG_BAR_WINDOW_CLASS", default);
if (hwndDragBar.IsNull)
{
return windowHooked && titleBarHooked;
}
legacyDragBarProc = OnLegacyDragBarProcedure;
titleBarHooked = SetWindowSubclass(hwndDragBar, legacyDragBarProc, DragBarSubclassId, 0);
return windowHooked && titleBarHooked;
}
/// <inheritdoc/>
public void Dispose()
{
hotKeyController.UnregisterAll();
RemoveWindowSubclass(options.Hwnd, windowProc, WindowSubclassId);
windowProc = default!;
if (options.UseLegacyDragBarImplementation)
{
RemoveWindowSubclass(options.Hwnd, legacyDragBarProc, DragBarSubclassId);
legacyDragBarProc = default!;
}
}
[SuppressMessage("", "SH002")]
private unsafe LRESULT OnSubclassProcedure(HWND hwnd, uint uMsg, WPARAM wParam, LPARAM lParam, nuint uIdSubclass, nuint dwRefData)
{
switch (uMsg)
{
case WM_GETMINMAXINFO:
{
if (window is IMinMaxInfoHandler handler)
{
handler.HandleMinMaxInfo(ref *(MINMAXINFO*)lParam, options.GetRasterizationScale());
}
break;
}
case WM_NCRBUTTONDOWN:
case WM_NCRBUTTONUP:
{
return default;
}
case WM_HOTKEY:
{
hotKeyController.OnHotKeyPressed(*(HotKeyParameter*)&lParam);
break;
}
case WM_ERASEBKGND:
{
if (window.SystemBackdrop is IBackdropNeedEraseBackground)
{
return (LRESULT)(int)BOOL.TRUE;
}
break;
}
}
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
}
[SuppressMessage("", "SH002")]
private LRESULT OnLegacyDragBarProcedure(HWND hwnd, uint uMsg, WPARAM wParam, LPARAM lParam, nuint uIdSubclass, nuint dwRefData)
{
switch (uMsg)
{
case WM_NCRBUTTONDOWN:
case WM_NCRBUTTONUP:
{
return (LRESULT)(nint)WM_NULL;
}
}
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
}
}

View File

@@ -1,25 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.Win32.Foundation;
using static Snap.Hutao.Win32.User32;
namespace Snap.Hutao.Core.Windowing;
internal sealed class XamlWindowNonRudeHWND : IDisposable
{
// https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-itaskbarlist2-markfullscreenwindow#remarks
private const string NonRudeHWND = "NonRudeHWND";
private readonly HWND hwnd;
public XamlWindowNonRudeHWND(HWND hwnd)
{
this.hwnd = hwnd;
SetPropW(hwnd, NonRudeHWND, BOOL.TRUE);
}
public void Dispose()
{
RemovePropW(hwnd, NonRudeHWND);
}
}

View File

@@ -1,89 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.UI.Xaml;
using Snap.Hutao.Core.Windowing.Backdrop;
using Snap.Hutao.Core.Windowing.NotifyIcon;
using Snap.Hutao.Win32;
using Snap.Hutao.Win32.Foundation;
using Snap.Hutao.Win32.UI.Shell;
using Snap.Hutao.Win32.UI.WindowsAndMessaging;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using static Snap.Hutao.Win32.ComCtl32;
using static Snap.Hutao.Win32.ConstValues;
namespace Snap.Hutao.Core.Windowing;
[HighQuality]
internal sealed class XamlWindowSubclass : IDisposable
{
private const int WindowSubclassId = 101;
private readonly Window window;
private readonly XamlWindowOptions options;
// We have to explicitly hold a reference to SUBCLASSPROC
private SUBCLASSPROC windowProc = default!;
private UnmanagedAccess<XamlWindowSubclass> unmanagedAccess = default!;
public XamlWindowSubclass(Window window, in XamlWindowOptions options)
{
this.window = window;
this.options = options;
}
public unsafe bool Initialize()
{
windowProc = SUBCLASSPROC.Create(&OnSubclassProcedure);
unmanagedAccess = UnmanagedAccess.Create(this);
return SetWindowSubclass(options.Hwnd, windowProc, WindowSubclassId, unmanagedAccess);
}
public void Dispose()
{
RemoveWindowSubclass(options.Hwnd, windowProc, WindowSubclassId);
windowProc = default!;
unmanagedAccess.Dispose();
}
[SuppressMessage("", "SH002")]
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvStdcall)])]
private static unsafe LRESULT OnSubclassProcedure(HWND hwnd, uint uMsg, WPARAM wParam, LPARAM lParam, nuint uIdSubclass, nuint dwRefData)
{
XamlWindowSubclass? state = UnmanagedAccess.Get<XamlWindowSubclass>(dwRefData);
ArgumentNullException.ThrowIfNull(state);
switch (uMsg)
{
case WM_GETMINMAXINFO:
{
if (state.window is IMinMaxInfoHandler handler)
{
handler.HandleMinMaxInfo(ref *(MINMAXINFO*)lParam, state.options.GetRasterizationScale());
}
break;
}
case WM_NCRBUTTONDOWN:
case WM_NCRBUTTONUP:
{
return default;
}
case WM_ERASEBKGND:
{
if (state.window is IWindowNeedEraseBackground || state.window.SystemBackdrop is IBackdropNeedEraseBackground)
{
return (LRESULT)(int)BOOL.TRUE;
}
break;
}
}
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
}
}

View File

@@ -13,7 +13,7 @@ namespace Snap.Hutao.Factory.ContentDialog;
[Injection(InjectAs.Singleton, typeof(IContentDialogFactory))]
internal sealed partial class ContentDialogFactory : IContentDialogFactory
{
private readonly ICurrentXamlWindowReference currentWindowReference;
private readonly ICurrentWindowReference currentWindowReference;
private readonly IServiceProvider serviceProvider;
private readonly ITaskContext taskContext;
private readonly AppOptions appOptions;

View File

@@ -18,7 +18,7 @@ namespace Snap.Hutao.Factory.Picker;
[Injection(InjectAs.Transient, typeof(IFileSystemPickerInteraction))]
internal sealed partial class FileSystemPickerInteraction : IFileSystemPickerInteraction
{
private readonly ICurrentXamlWindowReference currentWindowReference;
private readonly ICurrentWindowReference currentWindowReference;
public unsafe ValueResult<bool, ValueFile> PickFile(string? title, string? defaultFileName, (string Name, string Type)[]? filters)
{

View File

@@ -2,7 +2,6 @@
// Licensed under the MIT license.
using Microsoft.UI.Xaml;
using Snap.Hutao.Core.Setting;
using Snap.Hutao.Core.Windowing;
using Snap.Hutao.Win32.UI.WindowsAndMessaging;
@@ -12,7 +11,7 @@ namespace Snap.Hutao;
/// 指引窗口
/// </summary>
[Injection(InjectAs.Singleton)]
internal sealed partial class GuideWindow : Window, IXamlWindowOptionsSource, IMinMaxInfoHandler
internal sealed partial class GuideWindow : Window, IWindowOptionsSource, IMinMaxInfoHandler
{
private const int MinWidth = 1000;
private const int MinHeight = 650;
@@ -20,16 +19,16 @@ internal sealed partial class GuideWindow : Window, IXamlWindowOptionsSource, IM
private const int MaxWidth = 1200;
private const int MaxHeight = 800;
private readonly XamlWindowOptions windowOptions;
private readonly WindowOptions windowOptions;
public GuideWindow(IServiceProvider serviceProvider)
{
InitializeComponent();
windowOptions = new(this, DragableGrid, new(MinWidth, MinHeight), SettingKeys.GuideWindowRect);
windowOptions = new(this, DragableGrid, new(MinWidth, MinHeight));
this.InitializeController(serviceProvider);
}
XamlWindowOptions IXamlWindowOptionsSource.WindowOptions { get => windowOptions; }
WindowOptions IWindowOptionsSource.WindowOptions { get => windowOptions; }
public unsafe void HandleMinMaxInfo(ref MINMAXINFO info, double scalingFactor)
{

View File

@@ -32,7 +32,6 @@ internal sealed partial class IdentifyMonitorWindow : Window
{
List<IdentifyMonitorWindow> windows = [];
// TODO: the order here is not sync with unity.
IReadOnlyList<DisplayArea> displayAreas = DisplayArea.FindAll();
for (int i = 0; i < displayAreas.Count; i++)
{

View File

@@ -23,18 +23,6 @@
"Equatable": true,
"EqualityOperators": true
},
{
"Name": "ChapterId",
"Documentation": "章节 Id",
"Equatable": true,
"EqualityOperators": true
},
{
"Name": "ChapterGroupId",
"Documentation": "章节分组 Id",
"Equatable": true,
"EqualityOperators": true
},
{
"Name": "EquipAffixId",
"Documentation": "装备属性 Id",
@@ -125,12 +113,6 @@
"Equatable": true,
"EqualityOperators": true
},
{
"Name": "QuestId",
"Documentation": "任务 Id",
"Equatable": true,
"EqualityOperators": true
},
{
"Name": "ReliquaryLevel",
"Documentation": "圣遗物等级 1 - 21",

View File

@@ -3,7 +3,6 @@
using Microsoft.UI.Xaml;
using Snap.Hutao.Control.Extension;
using Snap.Hutao.Core.Setting;
using Snap.Hutao.Core.Windowing;
using Snap.Hutao.ViewModel.Game;
using Snap.Hutao.Win32.UI.WindowsAndMessaging;
@@ -15,7 +14,7 @@ namespace Snap.Hutao;
/// </summary>
[HighQuality]
[Injection(InjectAs.Singleton)]
internal sealed partial class LaunchGameWindow : Window, IDisposable, IXamlWindowOptionsSource, IMinMaxInfoHandler
internal sealed partial class LaunchGameWindow : Window, IDisposable, IWindowOptionsSource, IMinMaxInfoHandler
{
private const int MinWidth = 240;
private const int MinHeight = 240;
@@ -23,7 +22,7 @@ internal sealed partial class LaunchGameWindow : Window, IDisposable, IXamlWindo
private const int MaxWidth = 320;
private const int MaxHeight = 320;
private readonly XamlWindowOptions windowOptions;
private readonly WindowOptions windowOptions;
private readonly IServiceScope scope;
/// <summary>
@@ -41,7 +40,7 @@ internal sealed partial class LaunchGameWindow : Window, IDisposable, IXamlWindo
}
/// <inheritdoc/>
public XamlWindowOptions WindowOptions { get => windowOptions; }
public WindowOptions WindowOptions { get => windowOptions; }
/// <inheritdoc/>
public void Dispose()

View File

@@ -1,9 +1,7 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.UI.Content;
using Microsoft.UI.Xaml;
using Snap.Hutao.Core.Setting;
using Snap.Hutao.Core.Windowing;
using Snap.Hutao.Win32.UI.WindowsAndMessaging;
@@ -14,12 +12,13 @@ namespace Snap.Hutao;
/// </summary>
[HighQuality]
[Injection(InjectAs.Singleton)]
internal sealed partial class MainWindow : Window, IXamlWindowOptionsSource, IMinMaxInfoHandler
[SuppressMessage("", "CA1001")]
internal sealed partial class MainWindow : Window, IWindowOptionsSource, IMinMaxInfoHandler
{
private const int MinWidth = 1000;
private const int MinHeight = 600;
private readonly XamlWindowOptions windowOptions;
private readonly WindowOptions windowOptions;
/// <summary>
/// 构造一个新的主窗体
@@ -28,18 +27,12 @@ internal sealed partial class MainWindow : Window, IXamlWindowOptionsSource, IMi
public MainWindow(IServiceProvider serviceProvider)
{
InitializeComponent();
windowOptions = new(this, TitleBarView.DragArea, new(1200, 741), SettingKeys.WindowRect);
windowOptions = new(this, TitleBarView.DragArea, new(1200, 741), true);
this.InitializeController(serviceProvider);
if (this.GetDesktopWindowXamlSource() is { } desktopWindowXamlSource)
{
DesktopChildSiteBridge desktopChildSiteBridge = desktopWindowXamlSource.SiteBridge;
desktopChildSiteBridge.ResizePolicy = ContentSizePolicy.ResizeContentToParentWindow;
}
}
/// <inheritdoc/>
public XamlWindowOptions WindowOptions { get => windowOptions; }
public WindowOptions WindowOptions { get => windowOptions; }
/// <inheritdoc/>
public unsafe void HandleMinMaxInfo(ref MINMAXINFO pInfo, double scalingFactor)

View File

@@ -3,9 +3,6 @@
using CommunityToolkit.Mvvm.ComponentModel;
using Snap.Hutao.Core.Abstraction;
using Snap.Hutao.Model.Entity.Abstraction;
using Snap.Hutao.Model.Primitive;
using Snap.Hutao.ViewModel.DailyNote;
using Snap.Hutao.ViewModel.User;
using Snap.Hutao.Web.Hoyolab.Takumi.Binding;
using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.DailyNote;
@@ -19,7 +16,7 @@ namespace Snap.Hutao.Model.Entity;
/// </summary>
[HighQuality]
[Table("daily_notes")]
internal sealed class DailyNoteEntry : ObservableObject, IMappingFrom<DailyNoteEntry, UserAndUid>, IAppDbEntity
internal sealed class DailyNoteEntry : ObservableObject, IMappingFrom<DailyNoteEntry, UserAndUid>
{
/// <summary>
/// 内部Id
@@ -55,9 +52,6 @@ internal sealed class DailyNoteEntry : ObservableObject, IMappingFrom<DailyNoteE
/// </summary>
public DailyNote? DailyNote { get; set; }
[NotMapped]
public DailyNoteArchonQuestView ArchonQuestView { get; set; } = default!;
/// <summary>
/// 刷新时间
/// </summary>
@@ -74,26 +68,61 @@ internal sealed class DailyNoteEntry : ObservableObject, IMappingFrom<DailyNoteE
}
}
/// <summary>
/// 树脂提醒阈值
/// </summary>
public int ResinNotifyThreshold { get; set; }
/// <summary>
/// 用于判断树脂是否继续提醒
/// </summary>
public bool ResinNotifySuppressed { get; set; }
/// <summary>
/// 洞天宝钱提醒阈值
/// </summary>
public int HomeCoinNotifyThreshold { get; set; }
/// <summary>
/// 用于判断洞天宝钱是否继续提醒
/// </summary>
public bool HomeCoinNotifySuppressed { get; set; }
/// <summary>
/// 参量质变仪提醒
/// </summary>
public bool TransformerNotify { get; set; }
/// <summary>
/// 用于判断参量质变仪是否继续提醒
/// </summary>
public bool TransformerNotifySuppressed { get; set; }
/// <summary>
/// 每日委托提醒
/// </summary>
public bool DailyTaskNotify { get; set; }
/// <summary>
/// 用于判断每日委托是否继续提醒
/// </summary>
public bool DailyTaskNotifySuppressed { get; set; }
/// <summary>
/// 探索派遣提醒
/// </summary>
public bool ExpeditionNotify { get; set; }
/// <summary>
/// 用于判断探索派遣是否继续提醒
/// </summary>
public bool ExpeditionNotifySuppressed { get; set; }
/// <summary>
/// 构造一个新的实时便笺
/// </summary>
/// <param name="userAndUid">用户与角色</param>
/// <returns>新的实时便笺</returns>
public static DailyNoteEntry From(UserAndUid userAndUid)
{
return new()
@@ -105,6 +134,10 @@ internal sealed class DailyNoteEntry : ObservableObject, IMappingFrom<DailyNoteE
};
}
/// <summary>
/// 更新实时便笺
/// </summary>
/// <param name="dailyNote">新的值</param>
public void UpdateDailyNote(DailyNote? dailyNote)
{
DailyNote = dailyNote;
@@ -113,24 +146,4 @@ internal sealed class DailyNoteEntry : ObservableObject, IMappingFrom<DailyNoteE
RefreshTime = DateTimeOffset.UtcNow;
OnPropertyChanged(nameof(RefreshTimeFormatted));
}
public void CopyTo(DailyNoteEntry other)
{
other.UpdateDailyNote(DailyNote);
other.ResinNotifySuppressed = ResinNotifySuppressed;
other.OnPropertyChanged(nameof(ResinNotifySuppressed));
other.HomeCoinNotifySuppressed = HomeCoinNotifySuppressed;
other.OnPropertyChanged(nameof(HomeCoinNotifySuppressed));
other.TransformerNotifySuppressed = TransformerNotifySuppressed;
other.OnPropertyChanged(nameof(TransformerNotifySuppressed));
other.DailyTaskNotifySuppressed = DailyTaskNotifySuppressed;
other.OnPropertyChanged(nameof(DailyTaskNotifySuppressed));
other.ExpeditionNotifySuppressed = ExpeditionNotifySuppressed;
other.OnPropertyChanged(nameof(ExpeditionNotifySuppressed));
}
}
}

View File

@@ -3,42 +3,14 @@
namespace Snap.Hutao.Model.Intrinsic;
internal enum QuestType : uint
internal enum QuestType
{
/// <summary>
/// Archon Quest 魔神任务
/// </summary>
AQ,
/// <summary>
/// Fractions Quest 帮派任务
/// </summary>
FQ,
/// <summary>
/// Legend Quest 传说任务
/// </summary>
LQ,
/// <summary>
/// Event Quest 活动任务
/// </summary>
EQ,
/// <summary>
/// Daily Quest 日常任务
/// </summary>
DQ,
/// <summary>
/// Indescribable Quest 不可描述的任务?
/// </summary>
IQ,
VQ,
/// <summary>
/// World Quest 世界任务
/// </summary>
WQ,
}

View File

@@ -1,34 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.Model.Intrinsic;
using Snap.Hutao.Model.Primitive;
namespace Snap.Hutao.Model.Metadata;
internal sealed class Chapter
{
public ChapterId Id { get; set; }
public ChapterGroupId GroupId { get; set; }
public QuestId BeginQuestId { get; set; }
public QuestId EndQuestId { get; set; }
public uint NeedPlayerLevel { get; set; }
public string Number { get; set; } = default!;
public string Title { get; set; } = default!;
public string Icon { get; set; } = default!;
public string ImageTitle { get; set; } = default!;
public string SerialNumberIcon { get; set; } = default!;
public City CityId { get; set; }
public QuestType QuestType { get; set; }
}

View File

@@ -6,7 +6,6 @@ namespace Snap.Hutao.Model.Metadata;
// CityTaskOpenExcelConfig
internal enum City : uint
{
None = 0,
Mondstadt = 1,
Liyue = 2,
Inazuma = 3,

View File

@@ -3,6 +3,7 @@
using Snap.Hutao.Control;
using Snap.Hutao.Model.Intrinsic;
using System.Collections.Frozen;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -34,6 +34,8 @@ internal sealed class Material : DisplayItem
/// <returns>是否为物品栏物品</returns>
public bool IsInventoryItem()
{
// TODO: Add a pre-filtered metadata set to check if it's an inventory item
// 原质
if (Id == 112001U)
{

View File

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

View File

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

View File

@@ -2,7 +2,7 @@
// Licensed under the MIT license.
using Microsoft.UI.Xaml;
using Snap.Hutao.Core.Windowing.NotifyIcon;
using Snap.Hutao.Core;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using WinRT;

View File

@@ -60,45 +60,45 @@
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
@@ -1334,12 +1334,6 @@
<data name="ViewDialogLaunchGameAccountTitle" xml:space="preserve">
<value>Name the account</value>
</data>
<data name="ViewDialogLaunchGameConfigurationFixDialogHint" xml:space="preserve">
<value>Select game server of the current gane client path</value>
</data>
<data name="ViewDialogLaunchGameConfigurationFixDialogTitle" xml:space="preserve">
<value>Fixing configuration file</value>
</data>
<data name="ViewDialogLaunchGamePackageConvertHint" xml:space="preserve">
<value>Conversion may take some time. Please don't close HuTao.</value>
</data>
@@ -1361,21 +1355,6 @@
<data name="ViewDialogSettingDeleteUserDataTitle" xml:space="preserve">
<value>Delete user data permanently?</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginCloseButtonText" xml:space="preserve">
<value>Log in Now</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginHint" xml:space="preserve">
<value>No Hutao Passport logged in currently, uploading Abyss Records will not grant you Hutao Cloud privilege extension.</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginPrimaryButtonText" xml:space="preserve">
<value>Continue to Upload</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginTitle" xml:space="preserve">
<value>Upload Abyss Records</value>
</data>
<data name="ViewDialogUpdatePackageDownloadUpdatelogLinkContent" xml:space="preserve">
<value>Check Update Logs</value>
</data>
<data name="ViewDialogUserDocumentAction" xml:space="preserve">
<value>Take me there</value>
</data>
@@ -1397,9 +1376,6 @@
<data name="ViewGachaLogHeader" xml:space="preserve">
<value>Wish History</value>
</data>
<data name="ViewGuideStaticResourceDownloadSize" xml:space="preserve">
<value>Expected asset size: {0}</value>
</data>
<data name="ViewGuideStepAgreementIHaveReadText" xml:space="preserve">
<value>I've read and agreed to</value>
</data>
@@ -1415,12 +1391,6 @@
<data name="ViewGuideStepAgreementTermOfService" xml:space="preserve">
<value>User Agreement and Legal Notices</value>
</data>
<data name="ViewGuideStepCommonSetting" xml:space="preserve">
<value>Basic Settings</value>
</data>
<data name="ViewGuideStepCommonSettingHint" xml:space="preserve">
<value>You may make changes in Settings</value>
</data>
<data name="ViewGuideStepDocument" xml:space="preserve">
<value>Document</value>
</data>
@@ -1448,24 +1418,6 @@
<data name="ViewGuideStepStaticResource" xml:space="preserve">
<value>Assets</value>
</data>
<data name="ViewGuideStepStaticResourceSetting" xml:space="preserve">
<value>Image Assets Settings</value>
</data>
<data name="ViewGuideStepStaticResourceSettingHint" xml:space="preserve">
<value>* Unless uninstall and reinstall Snap Hutao, you cannot change this setting</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumHeader" xml:space="preserve">
<value>Image Assets Archive</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumOff" xml:space="preserve">
<value>Full Archive</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumOn" xml:space="preserve">
<value>Minimum Archive</value>
</data>
<data name="ViewGuideStepStaticResourceSettingQualityHeader" xml:space="preserve">
<value>Image Assets Quality</value>
</data>
<data name="ViewHutaoDatabaseHeader" xml:space="preserve">
<value>Abyss Stats</value>
</data>
@@ -1655,12 +1607,6 @@
<data name="ViewModelGuideActionStaticResourceBegin" xml:space="preserve">
<value>Dowloading Assets</value>
</data>
<data name="ViewModelGuideStaticResourceQualityHigh" xml:space="preserve">
<value>Raw</value>
</data>
<data name="ViewModelGuideStaticResourceQualityRaw" xml:space="preserve">
<value>High Quality</value>
</data>
<data name="ViewModelHutaoPassportEmailNotValidHint" xml:space="preserve">
<value>Please enter correct email address</value>
</data>
@@ -1679,12 +1625,6 @@
<data name="ViewModelLaunchGameEnsureGameResourceFail" xml:space="preserve">
<value>Convert server failed</value>
</data>
<data name="ViewModelLaunchGameFixConfigurationFileButtonText" xml:space="preserve">
<value>Fix Configuration File</value>
</data>
<data name="ViewModelLaunchGameFixConfigurationFileSuccess" xml:space="preserve">
<value>Fix Complete</value>
</data>
<data name="ViewModelLaunchGameIdentifyMonitorsAction" xml:space="preserve">
<value>Identify Monitors</value>
</data>
@@ -1697,9 +1637,6 @@
<data name="ViewModelLaunchGameSchemeNotSelected" xml:space="preserve">
<value>No server selected</value>
</data>
<data name="ViewModelLaunchGameSetGamePathButtonText" xml:space="preserve">
<value>Set Game Path</value>
</data>
<data name="ViewModelLaunchGameSwitchGameAccountFail" xml:space="preserve">
<value>Switch game account failed</value>
</data>
@@ -1736,9 +1673,6 @@
<data name="ViewModelSettingGeetestCustomUrlSucceed" xml:space="preserve">
<value>CAPTCHA Verification composite URL successfully configured</value>
</data>
<data name="ViewModelSettingResetStaticResourceProgress" xml:space="preserve">
<value>Resetting Static Resource</value>
</data>
<data name="ViewModelSettingSetDataFolderSuccess" xml:space="preserve">
<value>Set data directory successfully. Restart to apply changes.</value>
</data>
@@ -2720,12 +2654,6 @@
<data name="ViewPageSettingTranslateNavigate" xml:space="preserve">
<value>Contribute Translations</value>
</data>
<data name="ViewPageSettingUnobtainedWishItemVisibleDescription" xml:space="preserve">
<value>Display undrawn wish items in Character and Weapon tabs in Wish Export</value>
</data>
<data name="ViewPageSettingUnobtainedWishItemVisibleHeader" xml:space="preserve">
<value>Undrawn Wish Items</value>
</data>
<data name="ViewPageSettingUpdateCheckAction" xml:space="preserve">
<value>Store Page</value>
</data>
@@ -2906,15 +2834,6 @@
<data name="ViewSpiralAbyssUploadRecord" xml:space="preserve">
<value>Upload Data</value>
</data>
<data name="ViewTitileUpdatePackageDownloadContent" xml:space="preserve">
<value>Download Now?</value>
</data>
<data name="ViewTitileUpdatePackageDownloadFailedMessage" xml:space="preserve">
<value>Failed to Download Update Patch</value>
</data>
<data name="ViewTitileUpdatePackageDownloadTitle" xml:space="preserve">
<value>Snap Hutao {0} is Released</value>
</data>
<data name="ViewTitileUpdatePackageReadyContent" xml:space="preserve">
<value>Install now?</value>
</data>
@@ -2924,9 +2843,6 @@
<data name="ViewTitleAutoClicking" xml:space="preserve">
<value>Auto Click</value>
</data>
<data name="ViewTitleUpdatePackageInstallingContent" xml:space="preserve">
<value>Installing New Version Patch</value>
</data>
<data name="ViewToolHeader" xml:space="preserve">
<value>Tools</value>
</data>
@@ -3006,19 +2922,19 @@
<value>Weapon WIKI</value>
</data>
<data name="WebAnnouncementMatchPermanentActivityTime" xml:space="preserve">
<value>(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)后永久开放</value>
<value>(?:〓Event Duration〓|〓Quest Start Time〓).*?Permanently.*?Version.*?(\d\.\d).*?update</value>
</data>
<data name="WebAnnouncementMatchPersistentActivityTime" xml:space="preserve">
<value>〓活动时间〓.*?(\d\.\d)版本期间持续开放</value>
<value>〓Event Duration〓.*?Available throughout the entirety of Version (\d\.\d)</value>
</data>
<data name="WebAnnouncementMatchTransientActivityTime" xml:space="preserve">
<value>(?:〓活动时间〓|祈愿时间|【上架时间】|〓折扣时间〓).*?(\d\.\d)版本更新后.*?~.*?&amp;lt;t class="t_(?:gl|lc)".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;</value>
<value>(?:〓Event Duration〓|Event Wish Duration|【Availability Duration】|〓Discount Period〓).*?After.*?(\d\.\d).*?&amp;lt;t class="t_(?:gl|lc)".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;</value>
</data>
<data name="WebAnnouncementMatchVersionUpdatePreviewTime" xml:space="preserve">
<value>将于&amp;lt;t class=\"t_(?:gl|lc)\".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;进行版本更新维护</value>
<value>Dear.*?&amp;lt;t class=\"t_(?:gl|lc)\".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;</value>
</data>
<data name="WebAnnouncementMatchVersionUpdatePreviewTitle" xml:space="preserve">
<value>\d\.\d版本更新维护预告</value>
<value>Version \d\.\d Update Maintenance Preview</value>
</data>
<data name="WebAnnouncementMatchVersionUpdateTime" xml:space="preserve">
<value>〓Update Maintenance Duration〓.+?&amp;lt;t class=\"t_(?:gl|lc)\".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;</value>
@@ -3078,7 +2994,7 @@
<value>{0} mins</value>
</data>
<data name="WebDailyNoteExtraTaskRewardNotAllowed" xml:space="preserve">
<value>Daily Commissions are not Completed</value>
<value>Incomplete Daily Commissions</value>
</data>
<data name="WebDailyNoteExtraTaskRewardNotTaken" xml:space="preserve">
<value>Daily Commission Reward not claimed</value>

File diff suppressed because it is too large Load Diff

View File

@@ -60,45 +60,45 @@
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
@@ -1334,12 +1334,6 @@
<data name="ViewDialogLaunchGameAccountTitle" xml:space="preserve">
<value>Beri nama pada akun</value>
</data>
<data name="ViewDialogLaunchGameConfigurationFixDialogHint" xml:space="preserve">
<value>请选择当前游戏路径对应的游戏服务器</value>
</data>
<data name="ViewDialogLaunchGameConfigurationFixDialogTitle" xml:space="preserve">
<value>正在修复配置文件</value>
</data>
<data name="ViewDialogLaunchGamePackageConvertHint" xml:space="preserve">
<value>Konversi bisa memakan waktu. Jangan matikan perangkat lunak.</value>
</data>
@@ -1361,21 +1355,6 @@
<data name="ViewDialogSettingDeleteUserDataTitle" xml:space="preserve">
<value>Hapus data pengguna secara permanen?</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginCloseButtonText" xml:space="preserve">
<value>前往登录</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginHint" xml:space="preserve">
<value>当前未登录胡桃账号,上传深渊数据无法获赠胡桃云时长</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginPrimaryButtonText" xml:space="preserve">
<value>继续上传</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginTitle" xml:space="preserve">
<value>上传深渊数据</value>
</data>
<data name="ViewDialogUpdatePackageDownloadUpdatelogLinkContent" xml:space="preserve">
<value>查看更新日志</value>
</data>
<data name="ViewDialogUserDocumentAction" xml:space="preserve">
<value>Tuju saya kesana</value>
</data>
@@ -1397,9 +1376,6 @@
<data name="ViewGachaLogHeader" xml:space="preserve">
<value>Riwayat Wish</value>
</data>
<data name="ViewGuideStaticResourceDownloadSize" xml:space="preserve">
<value>预计下载大小:{0}</value>
</data>
<data name="ViewGuideStepAgreementIHaveReadText" xml:space="preserve">
<value>Saya telah membaca dan menyetujuinya</value>
</data>
@@ -1415,12 +1391,6 @@
<data name="ViewGuideStepAgreementTermOfService" xml:space="preserve">
<value>Perjanjian Pengguna dan Pemberitahuan Hukum</value>
</data>
<data name="ViewGuideStepCommonSetting" xml:space="preserve">
<value>基础设置</value>
</data>
<data name="ViewGuideStepCommonSettingHint" xml:space="preserve">
<value>稍后可以在设置中修改</value>
</data>
<data name="ViewGuideStepDocument" xml:space="preserve">
<value>Dokumentasi</value>
</data>
@@ -1431,7 +1401,7 @@
<value>Mulai ulang Snap Hutao setelah instalasi untuk memeriksa apakah perubahannya berlaku.</value>
</data>
<data name="ViewGuideStepEnvironmentFontDescription1" xml:space="preserve">
<value>如果上方的图标中存在乱码或方块字,请前往</value>
<value>Jika ikon di atas bermasalah atau tidak dapat dimuat, silakan kunjungi</value>
</data>
<data name="ViewGuideStepEnvironmentFontDescription2" xml:space="preserve">
<value>untuk mengunduh dan menginstal font</value>
@@ -1448,24 +1418,6 @@
<data name="ViewGuideStepStaticResource" xml:space="preserve">
<value>Aset</value>
</data>
<data name="ViewGuideStepStaticResourceSetting" xml:space="preserve">
<value>图像资源设置</value>
</data>
<data name="ViewGuideStepStaticResourceSettingHint" xml:space="preserve">
<value>* 除非你卸载并重新安装胡桃,否则你将无法更改这些设置</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumHeader" xml:space="preserve">
<value>图片资源包体</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumOff" xml:space="preserve">
<value>完整包体</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumOn" xml:space="preserve">
<value>精简包体</value>
</data>
<data name="ViewGuideStepStaticResourceSettingQualityHeader" xml:space="preserve">
<value>图片资源质量</value>
</data>
<data name="ViewHutaoDatabaseHeader" xml:space="preserve">
<value>Abyss Stats</value>
</data>
@@ -1655,12 +1607,6 @@
<data name="ViewModelGuideActionStaticResourceBegin" xml:space="preserve">
<value>Mengunduh aset</value>
</data>
<data name="ViewModelGuideStaticResourceQualityHigh" xml:space="preserve">
<value>高质量</value>
</data>
<data name="ViewModelGuideStaticResourceQualityRaw" xml:space="preserve">
<value>原图</value>
</data>
<data name="ViewModelHutaoPassportEmailNotValidHint" xml:space="preserve">
<value>Silakan masukkan alamat email yang benar.</value>
</data>
@@ -1679,12 +1625,6 @@
<data name="ViewModelLaunchGameEnsureGameResourceFail" xml:space="preserve">
<value>Konversi server gagal</value>
</data>
<data name="ViewModelLaunchGameFixConfigurationFileButtonText" xml:space="preserve">
<value>修复配置文件</value>
</data>
<data name="ViewModelLaunchGameFixConfigurationFileSuccess" xml:space="preserve">
<value>修复完成</value>
</data>
<data name="ViewModelLaunchGameIdentifyMonitorsAction" xml:space="preserve">
<value>Identifikasi Monitor</value>
</data>
@@ -1697,9 +1637,6 @@
<data name="ViewModelLaunchGameSchemeNotSelected" xml:space="preserve">
<value>Tidak ada server yang terpilih</value>
</data>
<data name="ViewModelLaunchGameSetGamePathButtonText" xml:space="preserve">
<value>设置游戏目录</value>
</data>
<data name="ViewModelLaunchGameSwitchGameAccountFail" xml:space="preserve">
<value>Gagal ganti akun game</value>
</data>
@@ -1736,9 +1673,6 @@
<data name="ViewModelSettingGeetestCustomUrlSucceed" xml:space="preserve">
<value>URL Composite Verifikasi CAPTCHA berhasil dikonfigurasi</value>
</data>
<data name="ViewModelSettingResetStaticResourceProgress" xml:space="preserve">
<value>正在重置图片资源</value>
</data>
<data name="ViewModelSettingSetDataFolderSuccess" xml:space="preserve">
<value>Direktori data berhasil diatur. Restart untuk menerapkan perubahan.</value>
</data>
@@ -2720,12 +2654,6 @@
<data name="ViewPageSettingTranslateNavigate" xml:space="preserve">
<value>Kontribusi penerjemahan</value>
</data>
<data name="ViewPageSettingUnobtainedWishItemVisibleDescription" xml:space="preserve">
<value>在祈愿记录页面角色与武器页签显示未抽取到的祈愿物品</value>
</data>
<data name="ViewPageSettingUnobtainedWishItemVisibleHeader" xml:space="preserve">
<value>未抽取到的祈愿物品</value>
</data>
<data name="ViewPageSettingUpdateCheckAction" xml:space="preserve">
<value>Buka toko</value>
</data>
@@ -2906,15 +2834,6 @@
<data name="ViewSpiralAbyssUploadRecord" xml:space="preserve">
<value>Mengunggah Data</value>
</data>
<data name="ViewTitileUpdatePackageDownloadContent" xml:space="preserve">
<value>是否立即下载?</value>
</data>
<data name="ViewTitileUpdatePackageDownloadFailedMessage" xml:space="preserve">
<value>下载更新失败</value>
</data>
<data name="ViewTitileUpdatePackageDownloadTitle" xml:space="preserve">
<value>胡桃 {0} 版本已发布</value>
</data>
<data name="ViewTitileUpdatePackageReadyContent" xml:space="preserve">
<value>Pasang sekarang?</value>
</data>
@@ -2924,9 +2843,6 @@
<data name="ViewTitleAutoClicking" xml:space="preserve">
<value>Auto Click</value>
</data>
<data name="ViewTitleUpdatePackageInstallingContent" xml:space="preserve">
<value>正在安装更新</value>
</data>
<data name="ViewToolHeader" xml:space="preserve">
<value>Alat</value>
</data>
@@ -3006,13 +2922,13 @@
<value>Senjata WIKI</value>
</data>
<data name="WebAnnouncementMatchPermanentActivityTime" xml:space="preserve">
<value>(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)后永久开放</value>
<value>(?:〓Durasi Event〓|〓Waktu Mulai Misi〓).*?(\d\.\d)the Version update(?:after|)Selamanya Tersedia</value>
</data>
<data name="WebAnnouncementMatchPersistentActivityTime" xml:space="preserve">
<value>〓活动时间〓.*?(\d\.\d)版本期间持续开放</value>
<value>〓Durasi Event〓.*?(\d\.\d) Tersedia selama versi ini</value>
</data>
<data name="WebAnnouncementMatchTransientActivityTime" xml:space="preserve">
<value>(?:〓活动时间〓|祈愿时间|【上架时间】|〓折扣时间〓).*?(\d\.\d)版本更新后.*?~.*?&amp;lt;t class="t_(?:gl|lc)".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;</value>
<value>(?:〓Waktu Acara〓|Waktu Menginginkan|【Waktu Peluncuran】|〓Waktu Diskon〓).*?(\d\.\d) Setelah Pembaruan Versi.*?~.*?&amp;lt;t class="t_(?:gl|lc)".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;</value>
</data>
<data name="WebAnnouncementMatchVersionUpdatePreviewTime" xml:space="preserve">
<value>将于&amp;lt;t class=\"t_(?:gl|lc)\".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;进行版本更新维护</value>

View File

@@ -60,45 +60,45 @@
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
@@ -1334,12 +1334,6 @@
<data name="ViewDialogLaunchGameAccountTitle" xml:space="preserve">
<value>名前を変更</value>
</data>
<data name="ViewDialogLaunchGameConfigurationFixDialogHint" xml:space="preserve">
<value>请选择当前游戏路径对应的游戏服务器</value>
</data>
<data name="ViewDialogLaunchGameConfigurationFixDialogTitle" xml:space="preserve">
<value>正在修复配置文件</value>
</data>
<data name="ViewDialogLaunchGamePackageConvertHint" xml:space="preserve">
<value>変換に時間がかかる場合があります、アプリを閉じないでください</value>
</data>
@@ -1361,21 +1355,6 @@
<data name="ViewDialogSettingDeleteUserDataTitle" xml:space="preserve">
<value>ユーザーデータを完全に削除しますか</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginCloseButtonText" xml:space="preserve">
<value>前往登录</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginHint" xml:space="preserve">
<value>当前未登录胡桃账号,上传深渊数据无法获赠胡桃云时长</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginPrimaryButtonText" xml:space="preserve">
<value>继续上传</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginTitle" xml:space="preserve">
<value>上传深渊数据</value>
</data>
<data name="ViewDialogUpdatePackageDownloadUpdatelogLinkContent" xml:space="preserve">
<value>查看更新日志</value>
</data>
<data name="ViewDialogUserDocumentAction" xml:space="preserve">
<value>すぐに移動</value>
</data>
@@ -1397,9 +1376,6 @@
<data name="ViewGachaLogHeader" xml:space="preserve">
<value>祈願履歴</value>
</data>
<data name="ViewGuideStaticResourceDownloadSize" xml:space="preserve">
<value>预计下载大小:{0}</value>
</data>
<data name="ViewGuideStepAgreementIHaveReadText" xml:space="preserve">
<value>規約を熟読し、それに同意します</value>
</data>
@@ -1415,12 +1391,6 @@
<data name="ViewGuideStepAgreementTermOfService" xml:space="preserve">
<value>利用規約</value>
</data>
<data name="ViewGuideStepCommonSetting" xml:space="preserve">
<value>基础设置</value>
</data>
<data name="ViewGuideStepCommonSettingHint" xml:space="preserve">
<value>稍后可以在设置中修改</value>
</data>
<data name="ViewGuideStepDocument" xml:space="preserve">
<value>ドキュメント</value>
</data>
@@ -1431,7 +1401,7 @@
<value>インストール完了後に胡桃を再起動し、動作を確認してください</value>
</data>
<data name="ViewGuideStepEnvironmentFontDescription1" xml:space="preserve">
<value>如果上方的图标中存在乱码或方块字,请前往</value>
<value>上のアイコンが読み込めなかったり文字化けしている場合はこちら</value>
</data>
<data name="ViewGuideStepEnvironmentFontDescription2" xml:space="preserve">
<value>フォントを自動的にダウンロード、インストールします</value>
@@ -1448,24 +1418,6 @@
<data name="ViewGuideStepStaticResource" xml:space="preserve">
<value>リソース</value>
</data>
<data name="ViewGuideStepStaticResourceSetting" xml:space="preserve">
<value>图像资源设置</value>
</data>
<data name="ViewGuideStepStaticResourceSettingHint" xml:space="preserve">
<value>* 除非你卸载并重新安装胡桃,否则你将无法更改这些设置</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumHeader" xml:space="preserve">
<value>图片资源包体</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumOff" xml:space="preserve">
<value>完整包体</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumOn" xml:space="preserve">
<value>精简包体</value>
</data>
<data name="ViewGuideStepStaticResourceSettingQualityHeader" xml:space="preserve">
<value>图片资源质量</value>
</data>
<data name="ViewHutaoDatabaseHeader" xml:space="preserve">
<value>深境螺旋集計</value>
</data>
@@ -1655,12 +1607,6 @@
<data name="ViewModelGuideActionStaticResourceBegin" xml:space="preserve">
<value>アセットをダウンロード中、しばらくお待ちください</value>
</data>
<data name="ViewModelGuideStaticResourceQualityHigh" xml:space="preserve">
<value>高质量</value>
</data>
<data name="ViewModelGuideStaticResourceQualityRaw" xml:space="preserve">
<value>原图</value>
</data>
<data name="ViewModelHutaoPassportEmailNotValidHint" xml:space="preserve">
<value>メールアドレスが正しい形式ではありません</value>
</data>
@@ -1679,12 +1625,6 @@
<data name="ViewModelLaunchGameEnsureGameResourceFail" xml:space="preserve">
<value>サーバーの切り替えができませんでした</value>
</data>
<data name="ViewModelLaunchGameFixConfigurationFileButtonText" xml:space="preserve">
<value>修复配置文件</value>
</data>
<data name="ViewModelLaunchGameFixConfigurationFileSuccess" xml:space="preserve">
<value>修复完成</value>
</data>
<data name="ViewModelLaunchGameIdentifyMonitorsAction" xml:space="preserve">
<value>モニターの識別</value>
</data>
@@ -1697,9 +1637,6 @@
<data name="ViewModelLaunchGameSchemeNotSelected" xml:space="preserve">
<value>サーバーが選択されていません</value>
</data>
<data name="ViewModelLaunchGameSetGamePathButtonText" xml:space="preserve">
<value>设置游戏目录</value>
</data>
<data name="ViewModelLaunchGameSwitchGameAccountFail" xml:space="preserve">
<value>アカウントの切り替えができませんでした</value>
</data>
@@ -1736,9 +1673,6 @@
<data name="ViewModelSettingGeetestCustomUrlSucceed" xml:space="preserve">
<value>非探知認証複合URLの構成に成功しました</value>
</data>
<data name="ViewModelSettingResetStaticResourceProgress" xml:space="preserve">
<value>正在重置图片资源</value>
</data>
<data name="ViewModelSettingSetDataFolderSuccess" xml:space="preserve">
<value>データディレクトリのリセットが完了しました、再起動して変更を適用します</value>
</data>
@@ -2720,12 +2654,6 @@
<data name="ViewPageSettingTranslateNavigate" xml:space="preserve">
<value>和訳を提供</value>
</data>
<data name="ViewPageSettingUnobtainedWishItemVisibleDescription" xml:space="preserve">
<value>在祈愿记录页面角色与武器页签显示未抽取到的祈愿物品</value>
</data>
<data name="ViewPageSettingUnobtainedWishItemVisibleHeader" xml:space="preserve">
<value>未抽取到的祈愿物品</value>
</data>
<data name="ViewPageSettingUpdateCheckAction" xml:space="preserve">
<value>ストアで表示</value>
</data>
@@ -2906,15 +2834,6 @@
<data name="ViewSpiralAbyssUploadRecord" xml:space="preserve">
<value>データをアップロード</value>
</data>
<data name="ViewTitileUpdatePackageDownloadContent" xml:space="preserve">
<value>是否立即下载?</value>
</data>
<data name="ViewTitileUpdatePackageDownloadFailedMessage" xml:space="preserve">
<value>下载更新失败</value>
</data>
<data name="ViewTitileUpdatePackageDownloadTitle" xml:space="preserve">
<value>胡桃 {0} 版本已发布</value>
</data>
<data name="ViewTitileUpdatePackageReadyContent" xml:space="preserve">
<value>今すぐインストールしますか?</value>
</data>
@@ -2924,9 +2843,6 @@
<data name="ViewTitleAutoClicking" xml:space="preserve">
<value>オートクリック</value>
</data>
<data name="ViewTitleUpdatePackageInstallingContent" xml:space="preserve">
<value>正在安装更新</value>
</data>
<data name="ViewToolHeader" xml:space="preserve">
<value>ツールボックス</value>
</data>
@@ -3006,25 +2922,25 @@
<value>武器一覧</value>
</data>
<data name="WebAnnouncementMatchPermanentActivityTime" xml:space="preserve">
<value>(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)后永久开放</value>
<value>(?:〓イベント期間〓|〓任務開(?:始|放)時間〓).*?(\d\.\d).*?開放</value>
</data>
<data name="WebAnnouncementMatchPersistentActivityTime" xml:space="preserve">
<value>〓活动时间〓.*?(\d\.\d)版本期间持续开放</value>
<value>〓イベント期間〓.*?(\d\.\d)バージョン</value>
</data>
<data name="WebAnnouncementMatchTransientActivityTime" xml:space="preserve">
<value>(?:〓活动时间〓|祈愿时间|【上架时间】|〓折扣时间〓).*?(\d\.\d)版本更新后.*?~.*?&amp;lt;t class="t_(?:gl|lc)".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;</value>
<value>(?:〓イベント期間〓|祈願期間|【開始日時】).*?(\d\.\d)バージョンアップ.*?~.*?&amp;lt;t class="t_(?:gl|lc)".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;</value>
</data>
<data name="WebAnnouncementMatchVersionUpdatePreviewTime" xml:space="preserve">
<value>将于&amp;lt;t class=\"t_(?:gl|lc)\".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;进行版本更新维护</value>
<value>親愛.*?&amp;lt;t class=\"t_(?:gl|lc)\".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;</value>
</data>
<data name="WebAnnouncementMatchVersionUpdatePreviewTitle" xml:space="preserve">
<value>\d\.\d版本更新维护预告</value>
<value>Ver\.\d\.\dバージョンアップのお知らせ</value>
</data>
<data name="WebAnnouncementMatchVersionUpdateTime" xml:space="preserve">
<value>〓メンテナンス時間〓.+?&amp;lt;t class=\"t_(?:gl|lc)\".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;</value>
</data>
<data name="WebAnnouncementMatchVersionUpdateTitle" xml:space="preserve">
<value>Ver.\d\.\d.+正式リリース</value>
<value>Ver\.\d\.\d.*?正式リリース</value>
</data>
<data name="WebAnnouncementTimeDaysBeginFormat" xml:space="preserve">
<value>{0} 日後に開始</value>

View File

@@ -60,45 +60,45 @@
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
@@ -1334,12 +1334,6 @@
<data name="ViewDialogLaunchGameAccountTitle" xml:space="preserve">
<value>계정 이름 설정</value>
</data>
<data name="ViewDialogLaunchGameConfigurationFixDialogHint" xml:space="preserve">
<value>请选择当前游戏路径对应的游戏服务器</value>
</data>
<data name="ViewDialogLaunchGameConfigurationFixDialogTitle" xml:space="preserve">
<value>正在修复配置文件</value>
</data>
<data name="ViewDialogLaunchGamePackageConvertHint" xml:space="preserve">
<value>변환에 시간이 걸릴 수 있습니다. 호두를 끄지 마세요</value>
</data>
@@ -1361,21 +1355,6 @@
<data name="ViewDialogSettingDeleteUserDataTitle" xml:space="preserve">
<value>사용자 데이터 영구 삭제</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginCloseButtonText" xml:space="preserve">
<value>前往登录</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginHint" xml:space="preserve">
<value>当前未登录胡桃账号,上传深渊数据无法获赠胡桃云时长</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginPrimaryButtonText" xml:space="preserve">
<value>继续上传</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginTitle" xml:space="preserve">
<value>上传深渊数据</value>
</data>
<data name="ViewDialogUpdatePackageDownloadUpdatelogLinkContent" xml:space="preserve">
<value>查看更新日志</value>
</data>
<data name="ViewDialogUserDocumentAction" xml:space="preserve">
<value>지금 이동</value>
</data>
@@ -1397,9 +1376,6 @@
<data name="ViewGachaLogHeader" xml:space="preserve">
<value>기원 기록</value>
</data>
<data name="ViewGuideStaticResourceDownloadSize" xml:space="preserve">
<value>预计下载大小:{0}</value>
</data>
<data name="ViewGuideStepAgreementIHaveReadText" xml:space="preserve">
<value>我已阅读并同意</value>
</data>
@@ -1415,12 +1391,6 @@
<data name="ViewGuideStepAgreementTermOfService" xml:space="preserve">
<value>用户使用协议与法律声明</value>
</data>
<data name="ViewGuideStepCommonSetting" xml:space="preserve">
<value>基础设置</value>
</data>
<data name="ViewGuideStepCommonSettingHint" xml:space="preserve">
<value>稍后可以在设置中修改</value>
</data>
<data name="ViewGuideStepDocument" xml:space="preserve">
<value>문서</value>
</data>
@@ -1431,7 +1401,7 @@
<value>安装完成后重启胡桃以查看是否正常生效</value>
</data>
<data name="ViewGuideStepEnvironmentFontDescription1" xml:space="preserve">
<value>如果上方的图标中存在乱码或方块字,请前往</value>
<value>如果上方的图标中存在乱码,请前往</value>
</data>
<data name="ViewGuideStepEnvironmentFontDescription2" xml:space="preserve">
<value>下载并自行安装图标字体</value>
@@ -1448,24 +1418,6 @@
<data name="ViewGuideStepStaticResource" xml:space="preserve">
<value>资源</value>
</data>
<data name="ViewGuideStepStaticResourceSetting" xml:space="preserve">
<value>图像资源设置</value>
</data>
<data name="ViewGuideStepStaticResourceSettingHint" xml:space="preserve">
<value>* 除非你卸载并重新安装胡桃,否则你将无法更改这些设置</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumHeader" xml:space="preserve">
<value>图片资源包体</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumOff" xml:space="preserve">
<value>完整包体</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumOn" xml:space="preserve">
<value>精简包体</value>
</data>
<data name="ViewGuideStepStaticResourceSettingQualityHeader" xml:space="preserve">
<value>图片资源质量</value>
</data>
<data name="ViewHutaoDatabaseHeader" xml:space="preserve">
<value>나선 비경 통계</value>
</data>
@@ -1655,12 +1607,6 @@
<data name="ViewModelGuideActionStaticResourceBegin" xml:space="preserve">
<value>下载资源文件中,请稍候</value>
</data>
<data name="ViewModelGuideStaticResourceQualityHigh" xml:space="preserve">
<value>高质量</value>
</data>
<data name="ViewModelGuideStaticResourceQualityRaw" xml:space="preserve">
<value>原图</value>
</data>
<data name="ViewModelHutaoPassportEmailNotValidHint" xml:space="preserve">
<value>请输入正确的邮箱</value>
</data>
@@ -1679,12 +1625,6 @@
<data name="ViewModelLaunchGameEnsureGameResourceFail" xml:space="preserve">
<value>서버 변경 실패</value>
</data>
<data name="ViewModelLaunchGameFixConfigurationFileButtonText" xml:space="preserve">
<value>修复配置文件</value>
</data>
<data name="ViewModelLaunchGameFixConfigurationFileSuccess" xml:space="preserve">
<value>修复完成</value>
</data>
<data name="ViewModelLaunchGameIdentifyMonitorsAction" xml:space="preserve">
<value>识别显示器</value>
</data>
@@ -1697,9 +1637,6 @@
<data name="ViewModelLaunchGameSchemeNotSelected" xml:space="preserve">
<value>아직 서버를 선택하지 않았습니다</value>
</data>
<data name="ViewModelLaunchGameSetGamePathButtonText" xml:space="preserve">
<value>设置游戏目录</value>
</data>
<data name="ViewModelLaunchGameSwitchGameAccountFail" xml:space="preserve">
<value>계정 전환 살패</value>
</data>
@@ -1736,9 +1673,6 @@
<data name="ViewModelSettingGeetestCustomUrlSucceed" xml:space="preserve">
<value>无感验证复合 Url 配置成功</value>
</data>
<data name="ViewModelSettingResetStaticResourceProgress" xml:space="preserve">
<value>正在重置图片资源</value>
</data>
<data name="ViewModelSettingSetDataFolderSuccess" xml:space="preserve">
<value>데이터 경로를 설정했습니다. 변경 사항을 적용하기 위해 재시작합니다</value>
</data>
@@ -2720,12 +2654,6 @@
<data name="ViewPageSettingTranslateNavigate" xml:space="preserve">
<value>번역에 기여하기</value>
</data>
<data name="ViewPageSettingUnobtainedWishItemVisibleDescription" xml:space="preserve">
<value>在祈愿记录页面角色与武器页签显示未抽取到的祈愿物品</value>
</data>
<data name="ViewPageSettingUnobtainedWishItemVisibleHeader" xml:space="preserve">
<value>未抽取到的祈愿物品</value>
</data>
<data name="ViewPageSettingUpdateCheckAction" xml:space="preserve">
<value>스토어로 이동</value>
</data>
@@ -2906,15 +2834,6 @@
<data name="ViewSpiralAbyssUploadRecord" xml:space="preserve">
<value>데이터 업로드</value>
</data>
<data name="ViewTitileUpdatePackageDownloadContent" xml:space="preserve">
<value>是否立即下载?</value>
</data>
<data name="ViewTitileUpdatePackageDownloadFailedMessage" xml:space="preserve">
<value>下载更新失败</value>
</data>
<data name="ViewTitileUpdatePackageDownloadTitle" xml:space="preserve">
<value>胡桃 {0} 版本已发布</value>
</data>
<data name="ViewTitileUpdatePackageReadyContent" xml:space="preserve">
<value>是否立即安装?</value>
</data>
@@ -2924,9 +2843,6 @@
<data name="ViewTitleAutoClicking" xml:space="preserve">
<value>自动连点</value>
</data>
<data name="ViewTitleUpdatePackageInstallingContent" xml:space="preserve">
<value>正在安装更新</value>
</data>
<data name="ViewToolHeader" xml:space="preserve">
<value>도구</value>
</data>

View File

@@ -60,45 +60,45 @@
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
@@ -145,7 +145,7 @@
<value>Salvar</value>
</data>
<data name="ControlAutoSuggestBoxNotFoundValue" xml:space="preserve">
<value>Nenhum resultado.</value>
<value>未找到结果</value>
</data>
<data name="ControlImageCachedImageInvalidResourceUri" xml:space="preserve">
<value>Uri inválido</value>
@@ -190,16 +190,16 @@
<value>O WebView2 Runtime não foi detectado</value>
</data>
<data name="CoreWindowHotkeyCombinationRegisterFailed" xml:space="preserve">
<value>Falha ao definir atalho [{0}] para [{1}].</value>
<value>[{0}] 热键 [{1}] 注册失败</value>
</data>
<data name="CoreWindowThemeDark" xml:space="preserve">
<value>Tema Escuro</value>
<value>深色</value>
</data>
<data name="CoreWindowThemeLight" xml:space="preserve">
<value>Tema Claro</value>
<value>浅色</value>
</data>
<data name="CoreWindowThemeSystem" xml:space="preserve">
<value>Padrão do sistema</value>
<value>跟随系统</value>
</data>
<data name="FilePickerExportCommit" xml:space="preserve">
<value>Exportar</value>
@@ -226,7 +226,7 @@
<value>&lt;color=#1E90FF&gt;他&lt;/color&gt;/&lt;color=#FFB6C1&gt;她&lt;/color&gt;</value>
</data>
<data name="MetadataSpecialNameRealNameId1" xml:space="preserve">
<value>Viajante</value>
<value>流浪者</value>
</data>
<data name="ModelBindingAvatarPropertyWeaponAffixFormat" xml:space="preserve">
<value>Refinar {0}</value>
@@ -528,7 +528,7 @@
<value>Onda 4: Uma onda surgirá somente depois de matar todos os inimigos da onda anterior</value>
</data>
<data name="ModelMetadataTowerWaveTypeWave99999" xml:space="preserve">
<value>Mantenha 4 monstros do grupo de ladrões de tesouro no campo, substituindo-os imediatamente após serem derrotados, totalizando 12 monstros.</value>
<value>维持场上 4 个盗宝团怪物,击杀后立即替换,总数 12 个</value>
</data>
<data name="ModelNameValueDefaultDescription" xml:space="preserve">
<value>Atualize os dados de exibição</value>
@@ -783,7 +783,7 @@
<value>Exibição de personagens: {0:MM-dd HH:mm}</value>
</data>
<data name="ServiceBackgroundImageTypeBing" xml:space="preserve">
<value>Imagem do Dia do Bing</value>
<value>必应每日一图</value>
</data>
<data name="ServiceBackgroundImageTypeDaily" xml:space="preserve">
<value>胡桃每日一图</value>
@@ -873,7 +873,7 @@
<value>Evento de oração de personagem</value>
</data>
<data name="ServiceGachaLogFactoryChronicledWishName" xml:space="preserve">
<value>Orações coletadas</value>
<value>集录祈愿</value>
</data>
<data name="ServiceGachaLogFactoryPermanentWishName" xml:space="preserve">
<value>Invocação do Mochileiro</value>
@@ -1334,12 +1334,6 @@
<data name="ViewDialogLaunchGameAccountTitle" xml:space="preserve">
<value>Nomeie a conta</value>
</data>
<data name="ViewDialogLaunchGameConfigurationFixDialogHint" xml:space="preserve">
<value>请选择当前游戏路径对应的游戏服务器</value>
</data>
<data name="ViewDialogLaunchGameConfigurationFixDialogTitle" xml:space="preserve">
<value>正在修复配置文件</value>
</data>
<data name="ViewDialogLaunchGamePackageConvertHint" xml:space="preserve">
<value>A conversão pode levar algum tempo. Não feche o software.</value>
</data>
@@ -1361,21 +1355,6 @@
<data name="ViewDialogSettingDeleteUserDataTitle" xml:space="preserve">
<value>Excluir permanentemente os dados do usuário?</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginCloseButtonText" xml:space="preserve">
<value>前往登录</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginHint" xml:space="preserve">
<value>当前未登录胡桃账号,上传深渊数据无法获赠胡桃云时长</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginPrimaryButtonText" xml:space="preserve">
<value>继续上传</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginTitle" xml:space="preserve">
<value>上传深渊数据</value>
</data>
<data name="ViewDialogUpdatePackageDownloadUpdatelogLinkContent" xml:space="preserve">
<value>查看更新日志</value>
</data>
<data name="ViewDialogUserDocumentAction" xml:space="preserve">
<value>Leve-me até lá</value>
</data>
@@ -1397,9 +1376,6 @@
<data name="ViewGachaLogHeader" xml:space="preserve">
<value>Histórico de orações</value>
</data>
<data name="ViewGuideStaticResourceDownloadSize" xml:space="preserve">
<value>预计下载大小:{0}</value>
</data>
<data name="ViewGuideStepAgreementIHaveReadText" xml:space="preserve">
<value>Eu li e concordei com</value>
</data>
@@ -1415,12 +1391,6 @@
<data name="ViewGuideStepAgreementTermOfService" xml:space="preserve">
<value>Contrato do usuário e avisos legais</value>
</data>
<data name="ViewGuideStepCommonSetting" xml:space="preserve">
<value>基础设置</value>
</data>
<data name="ViewGuideStepCommonSettingHint" xml:space="preserve">
<value>稍后可以在设置中修改</value>
</data>
<data name="ViewGuideStepDocument" xml:space="preserve">
<value>Documentação</value>
</data>
@@ -1431,7 +1401,7 @@
<value>Reinicie o Snap Hutao após a instalação para verificar se ela foi efetivada</value>
</data>
<data name="ViewGuideStepEnvironmentFontDescription1" xml:space="preserve">
<value>如果上方的图标中存在乱码或方块字,请前往</value>
<value>Se os ícones acima estiverem com mojibake ou não puderem ser carregados, visite</value>
</data>
<data name="ViewGuideStepEnvironmentFontDescription2" xml:space="preserve">
<value>para baixar e instalar a fonte</value>
@@ -1448,24 +1418,6 @@
<data name="ViewGuideStepStaticResource" xml:space="preserve">
<value>Recursos</value>
</data>
<data name="ViewGuideStepStaticResourceSetting" xml:space="preserve">
<value>图像资源设置</value>
</data>
<data name="ViewGuideStepStaticResourceSettingHint" xml:space="preserve">
<value>* 除非你卸载并重新安装胡桃,否则你将无法更改这些设置</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumHeader" xml:space="preserve">
<value>图片资源包体</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumOff" xml:space="preserve">
<value>完整包体</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumOn" xml:space="preserve">
<value>精简包体</value>
</data>
<data name="ViewGuideStepStaticResourceSettingQualityHeader" xml:space="preserve">
<value>图片资源质量</value>
</data>
<data name="ViewHutaoDatabaseHeader" xml:space="preserve">
<value>Status do abismo</value>
</data>
@@ -1655,12 +1607,6 @@
<data name="ViewModelGuideActionStaticResourceBegin" xml:space="preserve">
<value>Baixando recursos</value>
</data>
<data name="ViewModelGuideStaticResourceQualityHigh" xml:space="preserve">
<value>高质量</value>
</data>
<data name="ViewModelGuideStaticResourceQualityRaw" xml:space="preserve">
<value>原图</value>
</data>
<data name="ViewModelHutaoPassportEmailNotValidHint" xml:space="preserve">
<value>Digite o endereço de e-mail correto</value>
</data>
@@ -1679,12 +1625,6 @@
<data name="ViewModelLaunchGameEnsureGameResourceFail" xml:space="preserve">
<value>Falha ao converter o servidor</value>
</data>
<data name="ViewModelLaunchGameFixConfigurationFileButtonText" xml:space="preserve">
<value>修复配置文件</value>
</data>
<data name="ViewModelLaunchGameFixConfigurationFileSuccess" xml:space="preserve">
<value>修复完成</value>
</data>
<data name="ViewModelLaunchGameIdentifyMonitorsAction" xml:space="preserve">
<value>Identificar monitores</value>
</data>
@@ -1697,9 +1637,6 @@
<data name="ViewModelLaunchGameSchemeNotSelected" xml:space="preserve">
<value>Nenhum servidor selecionado</value>
</data>
<data name="ViewModelLaunchGameSetGamePathButtonText" xml:space="preserve">
<value>设置游戏目录</value>
</data>
<data name="ViewModelLaunchGameSwitchGameAccountFail" xml:space="preserve">
<value>Falha ao trocar a conta do jogo</value>
</data>
@@ -1736,9 +1673,6 @@
<data name="ViewModelSettingGeetestCustomUrlSucceed" xml:space="preserve">
<value>URL composto de verificação de CAPTCHA configurado com sucesso</value>
</data>
<data name="ViewModelSettingResetStaticResourceProgress" xml:space="preserve">
<value>正在重置图片资源</value>
</data>
<data name="ViewModelSettingSetDataFolderSuccess" xml:space="preserve">
<value>Definir o diretório de dados com êxito. Reinicie para aplicar as alterações.</value>
</data>
@@ -2454,7 +2388,7 @@
<value>背景图片</value>
</data>
<data name="ViewPageSettingBackgroundImageLocalFolderCopyrightHeader" xml:space="preserve">
<value>A imagem de fundo utilizada é armazenada localmente no dispositivo do usuário. Em caso de violação de direitos autorais, o usuário será o único responsável.</value>
<value>当前背景为本地图片,如遇版权问题由用户个人负责</value>
</data>
<data name="ViewPageSettingCacheFolderDescription" xml:space="preserve">
<value>O cache de imagens é salvo aqui</value>
@@ -2463,7 +2397,7 @@
<value>Pasta de cache</value>
</data>
<data name="ViewPageSettingCardHutaoPassportHeader" xml:space="preserve">
<value>Passe de Batalha da Hutao</value>
<value>胡桃通行证</value>
</data>
<data name="ViewPageSettingCopyDeviceIdAction" xml:space="preserve">
<value>Copiar</value>
@@ -2658,7 +2592,7 @@
<value>Site oficial</value>
</data>
<data name="ViewPageSettingOpenBackgroundImageFolderDescription" xml:space="preserve">
<value>Personalize o plano de fundo com imagens nos formatos bmp, gif, ico, jpg, jpeg, png, tiff e webp.</value>
<value>自定义背景图片,支持 bmp / gif / ico / jpg / jpeg / png / tiff / webp 格式</value>
</data>
<data name="ViewPageSettingOpenBackgroundImageFolderHeader" xml:space="preserve">
<value>Abrir pasta do fundo</value>
@@ -2673,10 +2607,10 @@
<value>Redefinir recurso de imagem</value>
</data>
<data name="ViewPageSettingsAdvancedOptionsLaunchUnlockFpsDescription" xml:space="preserve">
<value>Adicionar a opção de desbloqueio do limite de taxa de quadros na seção de processo da página de inicialização do jogo.</value>
<value>在启动游戏页面的进程部分加入解锁帧率限制选项</value>
</data>
<data name="ViewPageSettingsAdvancedOptionsLaunchUnlockFpsHeader" xml:space="preserve">
<value>Iniciar o jogo - Desbloquear limite de taxa de quadros</value>
<value>启动游戏-解锁帧率限制</value>
</data>
<data name="ViewPageSettingSetDataFolderDescription" xml:space="preserve">
<value>É necessário mover os dados no diretório manualmente, caso contrário, serão criados novos dados de usuário.</value>
@@ -2712,20 +2646,14 @@
<value>Avalie o Snap Hutao</value>
</data>
<data name="ViewPageSettingThemeDescription" xml:space="preserve">
<value>Altere a cor do tema do formulário.</value>
<value>更改窗体的颜色主题</value>
</data>
<data name="ViewPageSettingThemeHeader" xml:space="preserve">
<value>Esquema de cores</value>
<value>颜色主题</value>
</data>
<data name="ViewPageSettingTranslateNavigate" xml:space="preserve">
<value>Contribuir com traduções</value>
</data>
<data name="ViewPageSettingUnobtainedWishItemVisibleDescription" xml:space="preserve">
<value>在祈愿记录页面角色与武器页签显示未抽取到的祈愿物品</value>
</data>
<data name="ViewPageSettingUnobtainedWishItemVisibleHeader" xml:space="preserve">
<value>未抽取到的祈愿物品</value>
</data>
<data name="ViewPageSettingUpdateCheckAction" xml:space="preserve">
<value>Página da loja</value>
</data>
@@ -2906,15 +2834,6 @@
<data name="ViewSpiralAbyssUploadRecord" xml:space="preserve">
<value>Carregar dados</value>
</data>
<data name="ViewTitileUpdatePackageDownloadContent" xml:space="preserve">
<value>是否立即下载?</value>
</data>
<data name="ViewTitileUpdatePackageDownloadFailedMessage" xml:space="preserve">
<value>下载更新失败</value>
</data>
<data name="ViewTitileUpdatePackageDownloadTitle" xml:space="preserve">
<value>胡桃 {0} 版本已发布</value>
</data>
<data name="ViewTitileUpdatePackageReadyContent" xml:space="preserve">
<value>Instalar agora?</value>
</data>
@@ -2924,9 +2843,6 @@
<data name="ViewTitleAutoClicking" xml:space="preserve">
<value>Clique automático</value>
</data>
<data name="ViewTitleUpdatePackageInstallingContent" xml:space="preserve">
<value>正在安装更新</value>
</data>
<data name="ViewToolHeader" xml:space="preserve">
<value>Ferramentas</value>
</data>
@@ -3006,13 +2922,13 @@
<value>Wiki de armas</value>
</data>
<data name="WebAnnouncementMatchPermanentActivityTime" xml:space="preserve">
<value>(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)后永久开放</value>
<value>(?:〓Duração do evento〓|〓Hora de início da missão〓).*?(\d\.\d)a atualização da versão(?:after|)Disponível permanentemente</value>
</data>
<data name="WebAnnouncementMatchPersistentActivityTime" xml:space="preserve">
<value>〓活动时间〓.*?(\d\.\d)版本期间持续开放</value>
<value>〓Duração do evento〓.*?(\d\.\d) Disponível em toda as versões</value>
</data>
<data name="WebAnnouncementMatchTransientActivityTime" xml:space="preserve">
<value>(?:〓活动时间〓|祈愿时间|【上架时间】|〓折扣时间〓).*?(\d\.\d)版本更新后.*?~.*?&amp;lt;t class="t_(?:gl|lc)".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;</value>
<value>(?:〓Duração do evento〓|Duração da oração do evento|【Duração da disponibilidade】).*?(\d\.\d)Após a atualização da versão.*?~.*?&amp;lt;t class="t_(?:gl|lc)".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;</value>
</data>
<data name="WebAnnouncementMatchVersionUpdatePreviewTime" xml:space="preserve">
<value>将于&amp;lt;t class=\"t_(?:gl|lc)\".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;进行版本更新维护</value>
@@ -3171,7 +3087,7 @@
<value>Evento de oração de personagem-2</value>
</data>
<data name="WebGachaConfigTypeChronicledWish" xml:space="preserve">
<value>Orações coletadas</value>
<value>集录祈愿</value>
</data>
<data name="WebGachaConfigTypeNoviceWish" xml:space="preserve">
<value>Oração de Novatos</value>

View File

@@ -192,15 +192,6 @@
<data name="CoreWindowHotkeyCombinationRegisterFailed" xml:space="preserve">
<value>[{0}] 热键 [{1}] 注册失败</value>
</data>
<data name="CoreWindowingNotifyIconExitLabel" xml:space="preserve">
<value>退出</value>
</data>
<data name="CoreWindowingNotifyIconLaunchGameLabel" xml:space="preserve">
<value>启动游戏</value>
</data>
<data name="CoreWindowingNotifyIconViewLabel" xml:space="preserve">
<value>窗口</value>
</data>
<data name="CoreWindowThemeDark" xml:space="preserve">
<value>深色</value>
</data>
@@ -3053,9 +3044,6 @@
<data name="WebBridgeShareCopyToClipboardSuccess" xml:space="preserve">
<value>已复制到剪贴板</value>
</data>
<data name="WebDailyNoteArchonQuestChapterFinished" xml:space="preserve">
<value>所有魔神任务已完成</value>
</data>
<data name="WebDailyNoteArchonQuestStatusFinished" xml:space="preserve">
<value>全部完成</value>
</data>

View File

@@ -60,45 +60,45 @@
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
@@ -145,7 +145,7 @@
<value>Сохранить</value>
</data>
<data name="ControlAutoSuggestBoxNotFoundValue" xml:space="preserve">
<value>Результаты не найдены</value>
<value>未找到结果</value>
</data>
<data name="ControlImageCachedImageInvalidResourceUri" xml:space="preserve">
<value>Ошибка ссылки</value>
@@ -190,16 +190,16 @@
<value>Среда выполнения WebView2 не обнаружена</value>
</data>
<data name="CoreWindowHotkeyCombinationRegisterFailed" xml:space="preserve">
<value>Регистрация [{0}] горячей клавиши [{1}] не удалась</value>
<value>[{0}] 热键 [{1}] 注册失败</value>
</data>
<data name="CoreWindowThemeDark" xml:space="preserve">
<value>Тёмная</value>
<value>深色</value>
</data>
<data name="CoreWindowThemeLight" xml:space="preserve">
<value>Светлая</value>
<value>浅色</value>
</data>
<data name="CoreWindowThemeSystem" xml:space="preserve">
<value>Системная</value>
<value>跟随系统</value>
</data>
<data name="FilePickerExportCommit" xml:space="preserve">
<value>Экспорт</value>
@@ -783,19 +783,19 @@
<value>Демонстрация персонажей: {0:MM-dd HH:mm}</value>
</data>
<data name="ServiceBackgroundImageTypeBing" xml:space="preserve">
<value>Ежедневные обои Bing</value>
<value>必应每日一图</value>
</data>
<data name="ServiceBackgroundImageTypeDaily" xml:space="preserve">
<value>Ежедневные обои Hutao</value>
<value>胡桃每日一图</value>
</data>
<data name="ServiceBackgroundImageTypeLauncher" xml:space="preserve">
<value>Официальные обои лаунчера Genshin</value>
<value>官方启动器壁纸</value>
</data>
<data name="ServiceBackgroundImageTypeLocalFolder" xml:space="preserve">
<value>Ваше случайное изображение</value>
<value>本地随机图片</value>
</data>
<data name="ServiceBackgroundImageTypeNone" xml:space="preserve">
<value>Без обоев</value>
<value>无背景图片</value>
</data>
<data name="ServiceCultivationProjectCurrentUserdataCourrpted" xml:space="preserve">
<value>Не удалось сохранить статус плана разработки.</value>
@@ -855,7 +855,7 @@
<value>Преобразователь готов</value>
</data>
<data name="ServiceDiscordActivityElevationRequiredHint" xml:space="preserve">
<value>Отсутствует разрешение, не удается установить активность в Discord.</value>
<value>权限不足,将无法为您设置 Discord Activity 状态</value>
</data>
<data name="ServiceDiscordGameActivityDetails" xml:space="preserve">
<value>Исследование Тейвата</value>
@@ -870,25 +870,25 @@
<value>Unable to resolve wish history End Id</value>
</data>
<data name="ServiceGachaLogFactoryAvatarWishName" xml:space="preserve">
<value>Молитва события персонажа</value>
<value>角色活动</value>
</data>
<data name="ServiceGachaLogFactoryChronicledWishName" xml:space="preserve">
<value>Хроники желаний</value>
<value>集录祈愿</value>
</data>
<data name="ServiceGachaLogFactoryPermanentWishName" xml:space="preserve">
<value>Жажда странствий</value>
<value>奔行世间</value>
</data>
<data name="ServiceGachaLogFactoryWeaponWishName" xml:space="preserve">
<value>Воплощение божества</value>
<value>神铸赋形</value>
</data>
<data name="ServiceGachaLogHutaoCloudEndIdFetchFailed" xml:space="preserve">
<value>Не удалось получить историю молитв из облака</value>
<value>获取云端祈愿记录失败</value>
</data>
<data name="ServiceGachaLogHutaoCloudServiceNotAllowed" xml:space="preserve">
<value>Услуга загрузки истории молитв недоступна</value>
<value>祈愿记录上传服务不可用</value>
</data>
<data name="ServiceGachaLogUIGFImportItemInvalidFormat" xml:space="preserve">
<value>Данные содержат неожиданный элемент, Id: {0}</value>
<value>数据包含异常物品, Id{0}</value>
</data>
<data name="ServiceGachaLogUrlProviderAuthkeyRequestFailed" xml:space="preserve">
<value>Не удалось получить ключ авторизации</value>
@@ -897,7 +897,7 @@
<value>Путь к Genshin Impact не установлен или содержит ошибки</value>
</data>
<data name="ServiceGachaLogUrlProviderCachePathNotFound" xml:space="preserve">
<value>Не удается найти путь к кэшу встроенного браузера Genshin Impact: \n{0}</value>
<value>找不到原神内置浏览器缓存路径:\n{0}</value>
</data>
<data name="ServiceGachaLogUrlProviderCacheUrlNotFound" xml:space="preserve">
<value>Can't find available URL</value>
@@ -957,19 +957,19 @@
<value>Ограничение FPS успешно разблокировано.</value>
</data>
<data name="ServiceGameLaunchPhaseUnlockingFps" xml:space="preserve">
<value>Попытка снять ограничение частоты кадров</value>
<value>正在尝试解锁帧率上限</value>
</data>
<data name="ServiceGameLaunchPhaseWaitingProcessExit" xml:space="preserve">
<value>Ожидание закрытия процесса игры</value>
<value>等待游戏进程退出</value>
</data>
<data name="ServiceGameLocatorFileOpenPickerCommitText" xml:space="preserve">
<value>Выберите исполняемый файл игры</value>
<value>选择游戏本体</value>
</data>
<data name="ServiceGameLocatorPickerFilterText" xml:space="preserve">
<value>Игровой клиент</value>
</data>
<data name="ServiceGameLocatorUnityLogFileNotFound" xml:space="preserve">
<value>Лог Unity не найден</value>
<value>找不到 Unity 日志文件</value>
</data>
<data name="ServiceGameLocatorUnityLogGamePathNotFound" xml:space="preserve">
<value>Путь к игре не найден в файле журнала Unity</value>
@@ -984,49 +984,49 @@
<value>Изменить: {0}</value>
</data>
<data name="ServiceGamePackageRenameDataFolderFailed" xml:space="preserve">
<value>Не удалось изменить имя папки</value>
<value>重命名数据文件夹名称失败</value>
</data>
<data name="ServiceGamePackageRequestPackageVerion" xml:space="preserve">
<value>Запрашиваемая версия пакета</value>
<value>获取 Package Version</value>
</data>
<data name="ServiceGamePackageRequestPackageVerionFailed" xml:space="preserve">
<value>Не удалось получить версию пакета</value>
<value>获取 Package Version 失败</value>
</data>
<data name="ServiceGamePackageRequestScatteredFileFailed" xml:space="preserve">
<value>Не удалось загрузить файл клиента: {0}</value>
<value>下载客户端文件失败:{0}</value>
</data>
<data name="ServiceGamePathLocateFailed" xml:space="preserve">
<value>Невозможно найти путь к игре. Измените его в настройках.</value>
<value>无法找到游戏路径,请前往设置修改</value>
</data>
<data name="ServiceGameRegisteryInteropLongPathsDisabled" xml:space="preserve">
<value>Невозможно установить ключ реестра. Включен лимит MAX_PATH</value>
<value>未开启长路径功能,无法设置注册表键值</value>
</data>
<data name="ServiceGameSetMultiChannelConfigFileNotFound" xml:space="preserve">
<value>Невозможно прочитать файл конфигурации игры {0}, возможно файл не существует</value>
<value>无法读取游戏配置文件 {0},可能是文件不存在</value>
</data>
<data name="ServiceGameSetMultiChannelUnauthorizedAccess" xml:space="preserve">
<value>Невозможно открыть или сохранить профиль без прав администратора</value>
<value>无法读取或保存配置文件,请以管理员模式重试</value>
</data>
<data name="ServiceGameUnlockerFindModuleNoModuleFound" xml:space="preserve">
<value>Ошибка при поиске необходимых модулей: не удалось прочитать ни один модуль, возможно, загружен драйвер защиты; пожалуйста, повторите попытку</value>
<value>在查找必要的模块时遇到问题:无法读取任何模块,可能是保护驱动已经加载完成,请重试</value>
</data>
<data name="ServiceGameUnlockerFindModuleTimeLimitExeeded" xml:space="preserve">
<value>Ошибка при поиске необходимых модулей: таймаут; пожалуйста, повторите попытку</value>
<value>在查找必要的模块时遇到问题:查找模块超时,请重试</value>
</data>
<data name="ServiceGameUnlockerInterestedPatternNotFound" xml:space="preserve">
<value>Ошибка соответствия шаблону памяти: нет ожидаемого содержимого</value>
<value>在匹配内存时遇到问题:无法匹配到期望的内容</value>
</data>
<data name="ServiceGameUnlockerReadModuleMemoryCopyVirtualMemoryFailed" xml:space="preserve">
<value>Ошибка чтения памяти требуемых модулей: не удалось скопировать память модуля в место назначения</value>
<value>在读取必要的模块内存时遇到问题:无法将模块内存复制到指定位置</value>
</data>
<data name="ServiceGameUnlockerReadProcessMemoryPointerAddressFailed" xml:space="preserve">
<value>Ошибка чтения памяти модулей процесса: не удалось прочитать действительное значение по заданному адресу</value>
<value>在读取游戏进程内存时遇到问题:无法读取到指定地址的有效值</value>
</data>
<data name="ServiceHutaoUserGachaLogExpiredAt" xml:space="preserve">
<value>Запись молитв доступна до \n{0:yyyy.MM.dd HH:mm:ss}</value>
</data>
<data name="ServiceMetadataFileNotFound" xml:space="preserve">
<value>Невозможно найти кэш файл метаданных</value>
<value>无法找到缓存的元数据文件</value>
</data>
<data name="ServiceMetadataHttpRequestFailed" xml:space="preserve">
<value>HTTP {0} | Ошибка {1}: Не удалось загрузить файл проверки метаданных</value>
@@ -1107,7 +1107,7 @@
<value>After Ascension</value>
</data>
<data name="ViewControlElevationText" xml:space="preserve">
<value>Требуются привилегии администратора</value>
<value>需要管理员权限</value>
</data>
<data name="ViewControlLoadingText" xml:space="preserve">
<value>Загрузка, пожалуйста подождите</value>
@@ -1119,7 +1119,7 @@
<value>Гарант</value>
</data>
<data name="ViewControlStatisticsCardOrangeAveragePullText" xml:space="preserve">
<value>Среднее 5-зв. выпадение</value>
<value>五星平均抽数</value>
</data>
<data name="ViewControlStatisticsCardOrangeText" xml:space="preserve">
<value>5-зв.</value>
@@ -1152,13 +1152,13 @@
<value>Статистика</value>
</data>
<data name="ViewControlWebViewerCoreWebView2ProfileQueryInterfaceFailed" xml:space="preserve">
<value>Текущая версия WebView2 не поддерживает конфигурацию управления, дальнейшее использование может привести к ошибкам, пожалуйста, установите обновление</value>
<value>当前 WebView2 版本不支持管理配置,继续使用可能会导致异常,请尽快升级</value>
</data>
<data name="ViewCultivationHeader" xml:space="preserve">
<value>План разработки</value>
</data>
<data name="ViewDailyNoteHeader" xml:space="preserve">
<value>Заметки в реальном времени</value>
<value>实时便笺</value>
</data>
<data name="ViewDataHeader" xml:space="preserve">
<value>Data</value>
@@ -1167,10 +1167,10 @@
<value>Enter here</value>
</data>
<data name="ViewDialogAchievementArchiveCreateTitle" xml:space="preserve">
<value>Установить имя архива достижений</value>
<value>设置成就存档的名称</value>
</data>
<data name="ViewDialogAchievementArchiveImportStrategy" xml:space="preserve">
<value>Режим импорта</value>
<value>导入模式</value>
</data>
<data name="ViewDialogAchievementArchiveImportStrategyAggressive" xml:space="preserve">
<value>贪婪(添加新数据,更新已完成项)</value>
@@ -1182,7 +1182,7 @@
<value>覆盖(删除老数据,添加新的数据)</value>
</data>
<data name="ViewDialogAchievementArchiveImportTitle" xml:space="preserve">
<value>Импорт данных о достижениях в текущий архив</value>
<value>为当前存档导入成就</value>
</data>
<data name="ViewDialogCultivateBatchAvatarLevelTarget" xml:space="preserve">
<value>角色目标等级</value>
@@ -1334,12 +1334,6 @@
<data name="ViewDialogLaunchGameAccountTitle" xml:space="preserve">
<value>为账号命名</value>
</data>
<data name="ViewDialogLaunchGameConfigurationFixDialogHint" xml:space="preserve">
<value>请选择当前游戏路径对应的游戏服务器</value>
</data>
<data name="ViewDialogLaunchGameConfigurationFixDialogTitle" xml:space="preserve">
<value>Восстановление файла конфигурации</value>
</data>
<data name="ViewDialogLaunchGamePackageConvertHint" xml:space="preserve">
<value>转换可能需要花费一段时间,请勿关闭胡桃</value>
</data>
@@ -1361,21 +1355,6 @@
<data name="ViewDialogSettingDeleteUserDataTitle" xml:space="preserve">
<value>是否永久删除用户数据</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginCloseButtonText" xml:space="preserve">
<value>前往登录</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginHint" xml:space="preserve">
<value>当前未登录胡桃账号,上传深渊数据无法获赠胡桃云时长</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginPrimaryButtonText" xml:space="preserve">
<value>继续上传</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginTitle" xml:space="preserve">
<value>上传深渊数据</value>
</data>
<data name="ViewDialogUpdatePackageDownloadUpdatelogLinkContent" xml:space="preserve">
<value>查看更新日志</value>
</data>
<data name="ViewDialogUserDocumentAction" xml:space="preserve">
<value>立即前往</value>
</data>
@@ -1397,9 +1376,6 @@
<data name="ViewGachaLogHeader" xml:space="preserve">
<value>祈愿记录</value>
</data>
<data name="ViewGuideStaticResourceDownloadSize" xml:space="preserve">
<value>预计下载大小:{0}</value>
</data>
<data name="ViewGuideStepAgreementIHaveReadText" xml:space="preserve">
<value>我已阅读并同意</value>
</data>
@@ -1415,12 +1391,6 @@
<data name="ViewGuideStepAgreementTermOfService" xml:space="preserve">
<value>用户使用协议与法律声明</value>
</data>
<data name="ViewGuideStepCommonSetting" xml:space="preserve">
<value>基础设置</value>
</data>
<data name="ViewGuideStepCommonSettingHint" xml:space="preserve">
<value>稍后可以在设置中修改</value>
</data>
<data name="ViewGuideStepDocument" xml:space="preserve">
<value>Документация</value>
</data>
@@ -1431,7 +1401,7 @@
<value>安装完成后重启胡桃以查看是否正常生效</value>
</data>
<data name="ViewGuideStepEnvironmentFontDescription1" xml:space="preserve">
<value>如果上方的图标中存在乱码或方块字,请前往</value>
<value>如果上方的图标中存在乱码,请前往</value>
</data>
<data name="ViewGuideStepEnvironmentFontDescription2" xml:space="preserve">
<value>下载并自行安装图标字体</value>
@@ -1448,24 +1418,6 @@
<data name="ViewGuideStepStaticResource" xml:space="preserve">
<value>Assets</value>
</data>
<data name="ViewGuideStepStaticResourceSetting" xml:space="preserve">
<value>图像资源设置</value>
</data>
<data name="ViewGuideStepStaticResourceSettingHint" xml:space="preserve">
<value>* 除非你卸载并重新安装胡桃,否则你将无法更改这些设置</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumHeader" xml:space="preserve">
<value>图片资源包体</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumOff" xml:space="preserve">
<value>完整包体</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumOn" xml:space="preserve">
<value>精简包体</value>
</data>
<data name="ViewGuideStepStaticResourceSettingQualityHeader" xml:space="preserve">
<value>图片资源质量</value>
</data>
<data name="ViewHutaoDatabaseHeader" xml:space="preserve">
<value>深渊统计</value>
</data>
@@ -1500,7 +1452,7 @@
<value>该操作是不可逆的,该存档和其内的所有成就状态会丢失</value>
</data>
<data name="ViewModelAchievementRemoveArchiveTitle" xml:space="preserve">
<value>Вы уверены, что хотите удалить архив {0}?</value>
<value>确定要删除存档 {0} 吗?</value>
</data>
<data name="ViewModelAchievementUIAFExportPickerTitle" xml:space="preserve">
<value>导出 UIAF Json 文件到指定路径</value>
@@ -1655,12 +1607,6 @@
<data name="ViewModelGuideActionStaticResourceBegin" xml:space="preserve">
<value>下载资源文件中,请稍候</value>
</data>
<data name="ViewModelGuideStaticResourceQualityHigh" xml:space="preserve">
<value>高质量</value>
</data>
<data name="ViewModelGuideStaticResourceQualityRaw" xml:space="preserve">
<value>原图</value>
</data>
<data name="ViewModelHutaoPassportEmailNotValidHint" xml:space="preserve">
<value>请输入正确的邮箱</value>
</data>
@@ -1674,17 +1620,11 @@
<value>请先创建一个成就存档</value>
</data>
<data name="ViewModelImportWarningTitle" xml:space="preserve">
<value>Ошибка загрузки</value>
<value>导入失败</value>
</data>
<data name="ViewModelLaunchGameEnsureGameResourceFail" xml:space="preserve">
<value>切换服务器失败</value>
</data>
<data name="ViewModelLaunchGameFixConfigurationFileButtonText" xml:space="preserve">
<value>Восстановление файла конфигурации</value>
</data>
<data name="ViewModelLaunchGameFixConfigurationFileSuccess" xml:space="preserve">
<value>Восстановление завершено</value>
</data>
<data name="ViewModelLaunchGameIdentifyMonitorsAction" xml:space="preserve">
<value>识别显示器</value>
</data>
@@ -1697,9 +1637,6 @@
<data name="ViewModelLaunchGameSchemeNotSelected" xml:space="preserve">
<value>尚未选择任何服务器</value>
</data>
<data name="ViewModelLaunchGameSetGamePathButtonText" xml:space="preserve">
<value>设置游戏目录</value>
</data>
<data name="ViewModelLaunchGameSwitchGameAccountFail" xml:space="preserve">
<value>切换账号失败</value>
</data>
@@ -1736,9 +1673,6 @@
<data name="ViewModelSettingGeetestCustomUrlSucceed" xml:space="preserve">
<value>无感验证复合 Url 配置成功</value>
</data>
<data name="ViewModelSettingResetStaticResourceProgress" xml:space="preserve">
<value>正在重置图片资源</value>
</data>
<data name="ViewModelSettingSetDataFolderSuccess" xml:space="preserve">
<value>设置数据目录成功,重启以应用更改</value>
</data>
@@ -2577,7 +2511,7 @@
<value>Достижения</value>
</data>
<data name="ViewpageSettingHomeCardItemDailyNoteHeader" xml:space="preserve">
<value>Заметки в реальном времени</value>
<value>实时便笺</value>
</data>
<data name="ViewpageSettingHomeCardItemgachaStatisticsHeader" xml:space="preserve">
<value>祈愿记录</value>
@@ -2720,12 +2654,6 @@
<data name="ViewPageSettingTranslateNavigate" xml:space="preserve">
<value>贡献翻译</value>
</data>
<data name="ViewPageSettingUnobtainedWishItemVisibleDescription" xml:space="preserve">
<value>在祈愿记录页面角色与武器页签显示未抽取到的祈愿物品</value>
</data>
<data name="ViewPageSettingUnobtainedWishItemVisibleHeader" xml:space="preserve">
<value>未抽取到的祈愿物品</value>
</data>
<data name="ViewPageSettingUpdateCheckAction" xml:space="preserve">
<value>前往商店</value>
</data>
@@ -2906,15 +2834,6 @@
<data name="ViewSpiralAbyssUploadRecord" xml:space="preserve">
<value>Загрузить данные</value>
</data>
<data name="ViewTitileUpdatePackageDownloadContent" xml:space="preserve">
<value>是否立即下载?</value>
</data>
<data name="ViewTitileUpdatePackageDownloadFailedMessage" xml:space="preserve">
<value>下载更新失败</value>
</data>
<data name="ViewTitileUpdatePackageDownloadTitle" xml:space="preserve">
<value>胡桃 {0} 版本已发布</value>
</data>
<data name="ViewTitileUpdatePackageReadyContent" xml:space="preserve">
<value>Установить сейчас?</value>
</data>
@@ -2924,9 +2843,6 @@
<data name="ViewTitleAutoClicking" xml:space="preserve">
<value>Авто Клики</value>
</data>
<data name="ViewTitleUpdatePackageInstallingContent" xml:space="preserve">
<value>正在安装更新</value>
</data>
<data name="ViewToolHeader" xml:space="preserve">
<value>Инструменты</value>
</data>
@@ -3171,7 +3087,7 @@
<value>Молитва события персонажа - 2</value>
</data>
<data name="WebGachaConfigTypeChronicledWish" xml:space="preserve">
<value>Хроники желаний</value>
<value>集录祈愿</value>
</data>
<data name="WebGachaConfigTypeNoviceWish" xml:space="preserve">
<value>Молитва новичка</value>

View File

@@ -60,45 +60,45 @@
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
@@ -145,7 +145,7 @@
<value>儲存</value>
</data>
<data name="ControlAutoSuggestBoxNotFoundValue" xml:space="preserve">
<value>未找到果</value>
<value>未找到果</value>
</data>
<data name="ControlImageCachedImageInvalidResourceUri" xml:space="preserve">
<value>無效的 Uri</value>
@@ -1334,12 +1334,6 @@
<data name="ViewDialogLaunchGameAccountTitle" xml:space="preserve">
<value>為帳號命名</value>
</data>
<data name="ViewDialogLaunchGameConfigurationFixDialogHint" xml:space="preserve">
<value>請選擇當前遊戲路徑對應的遊戲服務器</value>
</data>
<data name="ViewDialogLaunchGameConfigurationFixDialogTitle" xml:space="preserve">
<value>正在修複配置文件</value>
</data>
<data name="ViewDialogLaunchGamePackageConvertHint" xml:space="preserve">
<value>轉換可能需要花費一段時間,請勿關閉胡桃</value>
</data>
@@ -1361,21 +1355,6 @@
<data name="ViewDialogSettingDeleteUserDataTitle" xml:space="preserve">
<value>是否永久刪除用戶數據</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginCloseButtonText" xml:space="preserve">
<value>前往登录</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginHint" xml:space="preserve">
<value>当前未登录胡桃账号,上传深渊数据无法获赠胡桃云时长</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginPrimaryButtonText" xml:space="preserve">
<value>继续上传</value>
</data>
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginTitle" xml:space="preserve">
<value>上传深渊数据</value>
</data>
<data name="ViewDialogUpdatePackageDownloadUpdatelogLinkContent" xml:space="preserve">
<value>查看更新日志</value>
</data>
<data name="ViewDialogUserDocumentAction" xml:space="preserve">
<value>立即前往</value>
</data>
@@ -1397,9 +1376,6 @@
<data name="ViewGachaLogHeader" xml:space="preserve">
<value>祈願記錄</value>
</data>
<data name="ViewGuideStaticResourceDownloadSize" xml:space="preserve">
<value>預計下載大小:{0}</value>
</data>
<data name="ViewGuideStepAgreementIHaveReadText" xml:space="preserve">
<value>我已閱讀並同意</value>
</data>
@@ -1415,12 +1391,6 @@
<data name="ViewGuideStepAgreementTermOfService" xml:space="preserve">
<value>用戶使用協議與法律聲明</value>
</data>
<data name="ViewGuideStepCommonSetting" xml:space="preserve">
<value>基礎設置</value>
</data>
<data name="ViewGuideStepCommonSettingHint" xml:space="preserve">
<value>稍後可以在設置中修改</value>
</data>
<data name="ViewGuideStepDocument" xml:space="preserve">
<value>文檔</value>
</data>
@@ -1431,7 +1401,7 @@
<value>安裝完成後重新啟動胡桃以查看是否正常生效</value>
</data>
<data name="ViewGuideStepEnvironmentFontDescription1" xml:space="preserve">
<value>如果上方的圖標中存在亂碼或方塊字,請前往</value>
<value>如果上方的圖標中存在亂碼,請前往</value>
</data>
<data name="ViewGuideStepEnvironmentFontDescription2" xml:space="preserve">
<value>下載並自行安裝圖標字體</value>
@@ -1448,24 +1418,6 @@
<data name="ViewGuideStepStaticResource" xml:space="preserve">
<value>資源</value>
</data>
<data name="ViewGuideStepStaticResourceSetting" xml:space="preserve">
<value>圖像資源設置</value>
</data>
<data name="ViewGuideStepStaticResourceSettingHint" xml:space="preserve">
<value>* 除非你卸載並重新安裝胡桃,否則你將無法更改這些設置</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumHeader" xml:space="preserve">
<value>圖片資源包體</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumOff" xml:space="preserve">
<value>完整包體</value>
</data>
<data name="ViewGuideStepStaticResourceSettingMinimumOn" xml:space="preserve">
<value>精簡包體</value>
</data>
<data name="ViewGuideStepStaticResourceSettingQualityHeader" xml:space="preserve">
<value>圖片資源品質</value>
</data>
<data name="ViewHutaoDatabaseHeader" xml:space="preserve">
<value>深淵統計</value>
</data>
@@ -1655,12 +1607,6 @@
<data name="ViewModelGuideActionStaticResourceBegin" xml:space="preserve">
<value>下載資源文件中,請稍候</value>
</data>
<data name="ViewModelGuideStaticResourceQualityHigh" xml:space="preserve">
<value>高品質</value>
</data>
<data name="ViewModelGuideStaticResourceQualityRaw" xml:space="preserve">
<value>原圖</value>
</data>
<data name="ViewModelHutaoPassportEmailNotValidHint" xml:space="preserve">
<value>請輸入正確的郵箱</value>
</data>
@@ -1679,12 +1625,6 @@
<data name="ViewModelLaunchGameEnsureGameResourceFail" xml:space="preserve">
<value>切換伺服器失敗</value>
</data>
<data name="ViewModelLaunchGameFixConfigurationFileButtonText" xml:space="preserve">
<value>修複配置文件</value>
</data>
<data name="ViewModelLaunchGameFixConfigurationFileSuccess" xml:space="preserve">
<value>修複完成</value>
</data>
<data name="ViewModelLaunchGameIdentifyMonitorsAction" xml:space="preserve">
<value>識別顯示器</value>
</data>
@@ -1697,9 +1637,6 @@
<data name="ViewModelLaunchGameSchemeNotSelected" xml:space="preserve">
<value>還未選擇任何伺服器</value>
</data>
<data name="ViewModelLaunchGameSetGamePathButtonText" xml:space="preserve">
<value>設置遊戲目錄</value>
</data>
<data name="ViewModelLaunchGameSwitchGameAccountFail" xml:space="preserve">
<value>切換帳號失敗</value>
</data>
@@ -1736,9 +1673,6 @@
<data name="ViewModelSettingGeetestCustomUrlSucceed" xml:space="preserve">
<value>無感驗證復合 URL 配置成功</value>
</data>
<data name="ViewModelSettingResetStaticResourceProgress" xml:space="preserve">
<value>正在重置图片资源</value>
</data>
<data name="ViewModelSettingSetDataFolderSuccess" xml:space="preserve">
<value>設置數據目錄成功,重新啟動以應用更改</value>
</data>
@@ -2412,7 +2346,7 @@
<value>請輸入您的 HoYoLAB UID</value>
</data>
<data name="ViewPageLoginMihoyoUserDescription" xml:space="preserve">
<value>你正在通由我提供的內嵌網頁視圖登錄 米哈通行,我們會在你點擊 我已登鈕後,讀取你的 Cookie 信息,由此視圖髪起的網絡通信只髪生於你的計算機與米哈遊服務器之</value>
<value>你正在通由我提供的内嵌网页视图登录 米哈通行,我们会在你点击 我已登钮后,读取你的 Cookie 信息,由此视图发起的网络通信只发生于你的计算机与米哈游服务器之</value>
</data>
<data name="ViewPageLoginMihoyoUserLoggedInAction" xml:space="preserve">
<value>我已登入</value>
@@ -2720,12 +2654,6 @@
<data name="ViewPageSettingTranslateNavigate" xml:space="preserve">
<value>貢獻翻譯</value>
</data>
<data name="ViewPageSettingUnobtainedWishItemVisibleDescription" xml:space="preserve">
<value>在祈願記錄頁面角色與武器頁籤顯示未抽取到的祈願物品</value>
</data>
<data name="ViewPageSettingUnobtainedWishItemVisibleHeader" xml:space="preserve">
<value>未抽取到的祈願物品</value>
</data>
<data name="ViewPageSettingUpdateCheckAction" xml:space="preserve">
<value>前往商店</value>
</data>
@@ -2906,15 +2834,6 @@
<data name="ViewSpiralAbyssUploadRecord" xml:space="preserve">
<value>上傳資料</value>
</data>
<data name="ViewTitileUpdatePackageDownloadContent" xml:space="preserve">
<value>是否立即下载?</value>
</data>
<data name="ViewTitileUpdatePackageDownloadFailedMessage" xml:space="preserve">
<value>下載更新失敗</value>
</data>
<data name="ViewTitileUpdatePackageDownloadTitle" xml:space="preserve">
<value>胡桃 {0} 版本已發佈</value>
</data>
<data name="ViewTitileUpdatePackageReadyContent" xml:space="preserve">
<value>是否立即安裝?</value>
</data>
@@ -2924,9 +2843,6 @@
<data name="ViewTitleAutoClicking" xml:space="preserve">
<value>自動連續點按</value>
</data>
<data name="ViewTitleUpdatePackageInstallingContent" xml:space="preserve">
<value>正在安裝更新</value>
</data>
<data name="ViewToolHeader" xml:space="preserve">
<value>工具</value>
</data>
@@ -3006,19 +2922,19 @@
<value>武器資料</value>
</data>
<data name="WebAnnouncementMatchPermanentActivityTime" xml:space="preserve">
<value>(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)永久放</value>
<value>(?:〓活動時間〓|〓任務開放時間〓).*?(\d\.\d)版本更新(?:完成|)永久放</value>
</data>
<data name="WebAnnouncementMatchPersistentActivityTime" xml:space="preserve">
<value>〓活动时间〓.*?(\d\.\d)版本期间持续开放</value>
<value>〓活動時間〓.*?(\d\.\d)版本期間持續開放</value>
</data>
<data name="WebAnnouncementMatchTransientActivityTime" xml:space="preserve">
<value>(?:〓活动时间〓|祈愿时间|【上架时间】|〓折扣时间〓).*?(\d\.\d)版本更新后.*?~.*?&amp;lt;t class="t_(?:gl|lc)".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;</value>
<value>(?:〓活動時間〓|祈願時間|【上架時間】|〓折扣時間〓).*?(\d\.\d).*?版本更新.*?&amp;lt;t class="t_(?:gl|lc)".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;</value>
</data>
<data name="WebAnnouncementMatchVersionUpdatePreviewTime" xml:space="preserve">
<value>将于&amp;lt;t class=\"t_(?:gl|lc)\".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;进行版本更新维护</value>
<value>親愛.*?&amp;lt;t class=\"t_(?:gl|lc)\".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;</value>
</data>
<data name="WebAnnouncementMatchVersionUpdatePreviewTitle" xml:space="preserve">
<value>\d\.\d版本更新维护预告</value>
<value>\d\.\d版本更新維護預告</value>
</data>
<data name="WebAnnouncementMatchVersionUpdateTime" xml:space="preserve">
<value>〓更新時間〓.+?&amp;lt;t class=\"t_(?:gl|lc)\".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;</value>

View File

@@ -18,13 +18,7 @@ internal static class AppDbServiceCollectionExtension
public static List<TEntity> List<TEntity>(this IAppDbService<TEntity> service, Expression<Func<TEntity, bool>> predicate)
where TEntity : class
{
return service.List(query => query.Where(predicate));
}
public static List<TResult> List<TEntity, TResult>(this IAppDbService<TEntity> service, Func<IQueryable<TEntity>, IQueryable<TResult>> query)
where TEntity : class
{
return service.Query(query1 => query(query1).ToList());
return service.Query(query => query.Where(predicate).ToList());
}
public static ValueTask<List<TEntity>> ListAsync<TEntity>(this IAppDbService<TEntity> service, CancellationToken token = default)

View File

@@ -2,6 +2,7 @@
// Licensed under the MIT license.
using CommunityToolkit.Mvvm.ComponentModel;
using Microsoft.Extensions.Options;
using Snap.Hutao.Core.Database;
using Snap.Hutao.Model.Entity.Database;
using System.Globalization;

View File

@@ -2,8 +2,10 @@
// Licensed under the MIT license.
using Snap.Hutao.Model.Entity;
using Snap.Hutao.Model.Primitive;
using Snap.Hutao.ViewModel.Achievement;
using EntityAchievement = Snap.Hutao.Model.Entity.Achievement;
using MetadataAchievement = Snap.Hutao.Model.Metadata.Achievement.Achievement;
namespace Snap.Hutao.Service.Achievement;

View File

@@ -5,6 +5,7 @@ using Snap.Hutao.Model.InterChange.Achievement;
using Snap.Hutao.ViewModel.Achievement;
using System.Collections.ObjectModel;
using EntityArchive = Snap.Hutao.Model.Entity.AchievementArchive;
using MetadataAchievement = Snap.Hutao.Model.Metadata.Achievement.Achievement;
namespace Snap.Hutao.Service.Achievement;

View File

@@ -1,7 +1,9 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.Model.Primitive;
using Snap.Hutao.ViewModel.Achievement;
using MetadataAchievement = Snap.Hutao.Model.Metadata.Achievement.Achievement;
namespace Snap.Hutao.Service.Achievement;

View File

@@ -7,6 +7,7 @@ using Snap.Hutao.Service.Announcement;
using Snap.Hutao.Web.Hoyolab;
using Snap.Hutao.Web.Hoyolab.Hk4e.Common.Announcement;
using Snap.Hutao.Web.Response;
using System.Collections.Specialized;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;

View File

@@ -12,6 +12,7 @@ using Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate;
using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord;
using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.Avatar;
using Snap.Hutao.Web.Response;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using CalculateAvatar = Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate.Avatar;

View File

@@ -1,6 +1,9 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.EntityFrameworkCore;
using Snap.Hutao.Core.Database;
using Snap.Hutao.Model.Entity.Database;
using Snap.Hutao.Service.Abstraction;
using EntityAvatarInfo = Snap.Hutao.Model.Entity.AvatarInfo;

View File

@@ -2,6 +2,8 @@
// Licensed under the MIT license.
using Snap.Hutao.Core.Abstraction.Extension;
using Snap.Hutao.Model;
using Snap.Hutao.Model.Intrinsic;
using Snap.Hutao.ViewModel.AvatarProperty;
namespace Snap.Hutao.Service.AvatarInfo.Factory.Builder;

View File

@@ -2,6 +2,7 @@
// Licensed under the MIT license.
using Snap.Hutao.Model.Primitive;
using Snap.Hutao.ViewModel.Cultivation;
namespace Snap.Hutao.Service.Cultivation;

View File

@@ -2,8 +2,10 @@
// Licensed under the MIT license.
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query;
using Snap.Hutao.Core.Database;
using Snap.Hutao.Model.Entity;
using Snap.Hutao.Service.Abstraction;
using Snap.Hutao.Model.Entity.Database;
namespace Snap.Hutao.Service.DailyNote;
@@ -13,40 +15,67 @@ internal sealed partial class DailyNoteDbService : IDailyNoteDbService
{
private readonly IServiceProvider serviceProvider;
public IServiceProvider ServiceProvider { get => serviceProvider; }
public bool ContainsUid(string uid)
{
return this.Query(query => query.Any(n => n.Uid == uid));
using (IServiceScope scope = serviceProvider.CreateScope())
{
AppDbContext appDbContext = scope.ServiceProvider.GetRequiredService<AppDbContext>();
return appDbContext.DailyNotes.AsNoTracking().Any(n => n.Uid == uid);
}
}
public ValueTask<bool> ContainsUidAsync(string uid, CancellationToken token = default)
public async ValueTask<bool> ContainsUidAsync(string uid)
{
return this.QueryAsync(query => query.AnyAsync(n => n.Uid == uid));
using (IServiceScope scope = serviceProvider.CreateScope())
{
AppDbContext appDbContext = scope.ServiceProvider.GetRequiredService<AppDbContext>();
return await appDbContext.DailyNotes.AsNoTracking().AnyAsync(n => n.Uid == uid).ConfigureAwait(false);
}
}
public async ValueTask AddDailyNoteEntryAsync(DailyNoteEntry entry, CancellationToken token = default)
public async ValueTask AddDailyNoteEntryAsync(DailyNoteEntry entry)
{
await this.AddAsync(entry, token).ConfigureAwait(false);
using (IServiceScope scope = serviceProvider.CreateScope())
{
AppDbContext appDbContext = scope.ServiceProvider.GetRequiredService<AppDbContext>();
await appDbContext.DailyNotes.AddAndSaveAsync(entry).ConfigureAwait(false);
}
}
public async ValueTask DeleteDailyNoteEntryByIdAsync(Guid entryId, CancellationToken token = default)
public async ValueTask DeleteDailyNoteEntryByIdAsync(Guid entryId)
{
await this.DeleteByInnerIdAsync(entryId, token).ConfigureAwait(false);
using (IServiceScope scope = serviceProvider.CreateScope())
{
AppDbContext appDbContext = scope.ServiceProvider.GetRequiredService<AppDbContext>();
await appDbContext.DailyNotes.ExecuteDeleteWhereAsync(d => d.InnerId == entryId).ConfigureAwait(false);
}
}
public async ValueTask UpdateDailyNoteEntryAsync(DailyNoteEntry entry, CancellationToken token = default)
public async ValueTask UpdateDailyNoteEntryAsync(DailyNoteEntry entry)
{
await this.UpdateAsync(entry, token).ConfigureAwait(false);
using (IServiceScope scope = serviceProvider.CreateScope())
{
AppDbContext appDbContext = scope.ServiceProvider.GetRequiredService<AppDbContext>();
await appDbContext.DailyNotes.UpdateAndSaveAsync(entry).ConfigureAwait(false);
}
}
public List<DailyNoteEntry> GetDailyNoteEntryListIncludingUser()
public List<DailyNoteEntry> GetDailyNoteEntryIncludeUserList()
{
return this.List(query => query.Include(n => n.User));
using (IServiceScope scope = serviceProvider.CreateScope())
{
AppDbContext appDbContext = scope.ServiceProvider.GetRequiredService<AppDbContext>();
IIncludableQueryable<DailyNoteEntry, Model.Entity.User> result = appDbContext.DailyNotes.AsNoTracking().Include(n => n.User);
return [.. result];
}
}
public ValueTask<List<DailyNoteEntry>> GetDailyNoteEntryListIncludingUserAsync(CancellationToken token = default)
public async ValueTask<List<DailyNoteEntry>> GetDailyNoteEntryIncludeUserListAsync()
{
return this.ListAsync(query => query.Include(n => n.User), token);
using (IServiceScope scope = serviceProvider.CreateScope())
{
AppDbContext appDbContext = scope.ServiceProvider.GetRequiredService<AppDbContext>();
return await appDbContext.DailyNotes.AsNoTracking().Include(n => n.User).ToListAsync().ConfigureAwait(false);
}
}
}

View File

@@ -1,13 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.Model.Metadata;
using Snap.Hutao.Service.Metadata.ContextAbstraction;
namespace Snap.Hutao.Service.DailyNote;
internal class DailyNoteMetadataContext : IMetadataContext,
IMetadataListChapterSource
{
public List<Chapter> Chapters { get; set; } = default!;
}

View File

@@ -5,9 +5,9 @@ using CommunityToolkit.WinUI.Notifications;
using Snap.Hutao.Core;
using Snap.Hutao.Core.LifeCycle;
using Snap.Hutao.Model.Entity;
using Snap.Hutao.Service.DailyNote.NotifySuppression;
using Snap.Hutao.Service.Game;
using Snap.Hutao.Web.Hoyolab.Takumi.Binding;
using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.DailyNote;
using Snap.Hutao.Web.Response;
namespace Snap.Hutao.Service.DailyNote;
@@ -41,7 +41,9 @@ internal sealed partial class DailyNoteNotificationOperation
return;
}
NotifySuppressionInvoker.Check(entry, out List<DailyNoteNotifyInfo> notifyInfos);
List<DailyNoteNotifyInfo> notifyInfos = [];
CheckNotifySuppressed(entry, notifyInfos);
if (notifyInfos.Count <= 0)
{
@@ -56,19 +58,19 @@ internal sealed partial class DailyNoteNotificationOperation
}
else
{
Response<ListWrapper<UserGameRole>> rolesResponse;
using (IServiceScope scope = serviceScopeFactory.CreateScope())
{
BindingClient bindingClient = scope.ServiceProvider.GetRequiredService<BindingClient>();
rolesResponse = await bindingClient
Response<ListWrapper<UserGameRole>> rolesResponse = await bindingClient
.GetUserGameRolesOverseaAwareAsync(entry.User)
.ConfigureAwait(false);
}
if (rolesResponse.IsOk())
{
List<UserGameRole> roles = rolesResponse.Data.List;
attribution = roles.SingleOrDefault(r => r.GameUid == entry.Uid)?.ToString() ?? ToastAttributionUnknown;
if (rolesResponse.IsOk())
{
List<UserGameRole> roles = rolesResponse.Data.List;
attribution = roles.SingleOrDefault(r => r.GameUid == entry.Uid)?.ToString() ?? ToastAttributionUnknown;
}
}
}
@@ -77,8 +79,8 @@ internal sealed partial class DailyNoteNotificationOperation
.AddAttributionText(attribution)
.AddButton(new ToastButton()
.SetContent(SH.ServiceDailyNoteNotifierActionLaunchGameButton)
.AddArgument(AppActivation.Action, AppActivation.LaunchGame)
.AddArgument(AppActivation.Uid, entry.Uid))
.AddArgument(Activation.Action, Activation.LaunchGame)
.AddArgument(Activation.Uid, entry.Uid))
.AddButton(new ToastButtonDismiss(SH.ServiceDailyNoteNotifierActionLaunchGameDismiss));
if (options.IsReminderNotification)
@@ -101,7 +103,7 @@ internal sealed partial class DailyNoteNotificationOperation
HintWeight = 1,
Children =
{
// new AdaptiveImage() { Source = info.AdaptiveIcon, HintRemoveMargin = true, },
new AdaptiveImage() { Source = info.AdaptiveIcon, HintRemoveMargin = true, },
new AdaptiveText() { Text = info.AdaptiveHint, HintAlign = AdaptiveTextAlign.Center, },
new AdaptiveText() { Text = info.Title, HintAlign = AdaptiveTextAlign.Center, HintStyle = AdaptiveTextStyle.CaptionSubtle, },
},
@@ -125,6 +127,121 @@ internal sealed partial class DailyNoteNotificationOperation
builder.Show(toast => toast.SuppressPopup = ShouldSuppressPopup(options));
}
private static void CheckNotifySuppressed(DailyNoteEntry entry, List<DailyNoteNotifyInfo> notifyInfos)
{
// Image limitation.
// https://learn.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/send-local-toast?tabs=uwp#adding-images
// NotifySuppressed judge
ChcekResinNotifySuppressed(entry, notifyInfos);
CheckHomeCoinNotifySuppressed(entry, notifyInfos);
CheckDailyTaskNotifySuppressed(entry, notifyInfos);
CheckTransformerNotifySuppressed(entry, notifyInfos);
CheckExpeditionNotifySuppressed(entry, notifyInfos);
}
private static void ChcekResinNotifySuppressed(DailyNoteEntry entry, List<DailyNoteNotifyInfo> notifyInfos)
{
ArgumentNullException.ThrowIfNull(entry.DailyNote);
if (entry.DailyNote.CurrentResin >= entry.ResinNotifyThreshold)
{
if (!entry.ResinNotifySuppressed)
{
notifyInfos.Add(new(
SH.ServiceDailyNoteNotifierResin,
Web.HutaoEndpoints.StaticRaw("ItemIcon", "UI_ItemIcon_210.png"),
$"{entry.DailyNote.CurrentResin}",
SH.FormatServiceDailyNoteNotifierResinCurrent(entry.DailyNote.CurrentResin)));
entry.ResinNotifySuppressed = true;
}
}
else
{
entry.ResinNotifySuppressed = false;
}
}
private static void CheckHomeCoinNotifySuppressed(DailyNoteEntry entry, List<DailyNoteNotifyInfo> notifyInfos)
{
ArgumentNullException.ThrowIfNull(entry.DailyNote);
if (entry.DailyNote.CurrentHomeCoin >= entry.HomeCoinNotifyThreshold)
{
if (!entry.HomeCoinNotifySuppressed)
{
notifyInfos.Add(new(
SH.ServiceDailyNoteNotifierHomeCoin,
Web.HutaoEndpoints.StaticRaw("ItemIcon", "UI_ItemIcon_204.png"),
$"{entry.DailyNote.CurrentHomeCoin}",
SH.FormatServiceDailyNoteNotifierHomeCoinCurrent(entry.DailyNote.CurrentHomeCoin)));
entry.HomeCoinNotifySuppressed = true;
}
}
else
{
entry.HomeCoinNotifySuppressed = false;
}
}
private static void CheckDailyTaskNotifySuppressed(DailyNoteEntry entry, List<DailyNoteNotifyInfo> notifyInfos)
{
if (entry is { DailyTaskNotify: true, DailyNote.IsExtraTaskRewardReceived: false })
{
if (!entry.DailyTaskNotifySuppressed)
{
notifyInfos.Add(new(
SH.ServiceDailyNoteNotifierDailyTask,
Web.HutaoEndpoints.StaticRaw("Bg", "UI_MarkQuest_Events_Proce.png"),
SH.ServiceDailyNoteNotifierDailyTaskHint,
entry.DailyNote.ExtraTaskRewardDescription));
entry.DailyTaskNotifySuppressed = true;
}
}
else
{
entry.DailyTaskNotifySuppressed = false;
}
}
private static void CheckTransformerNotifySuppressed(DailyNoteEntry entry, List<DailyNoteNotifyInfo> notifyInfos)
{
if (entry is { TransformerNotify: true, DailyNote.Transformer: { Obtained: true, RecoveryTime.Reached: true } })
{
if (!entry.TransformerNotifySuppressed)
{
notifyInfos.Add(new(
SH.ServiceDailyNoteNotifierTransformer,
Web.HutaoEndpoints.StaticRaw("ItemIcon", "UI_ItemIcon_220021.png"),
SH.ServiceDailyNoteNotifierTransformerAdaptiveHint,
SH.ServiceDailyNoteNotifierTransformerHint));
entry.TransformerNotifySuppressed = true;
}
}
else
{
entry.TransformerNotifySuppressed = false;
}
}
private static void CheckExpeditionNotifySuppressed(DailyNoteEntry entry, List<DailyNoteNotifyInfo> notifyInfos)
{
ArgumentNullException.ThrowIfNull(entry.DailyNote);
if (entry.ExpeditionNotify && entry.DailyNote.Expeditions.All(e => e.Status == ExpeditionStatus.Finished))
{
if (!entry.ExpeditionNotifySuppressed)
{
notifyInfos.Add(new(
SH.ServiceDailyNoteNotifierExpedition,
Web.HutaoEndpoints.StaticRaw("Bg", "UI_Icon_Intee_Explore_1.png"),
SH.ServiceDailyNoteNotifierExpeditionAdaptiveHint,
SH.ServiceDailyNoteNotifierExpeditionHint));
entry.ExpeditionNotifySuppressed = true;
}
}
else
{
entry.ExpeditionNotifySuppressed = false;
}
}
private bool ShouldSuppressPopup(DailyNoteOptions options)
{
// Prevent notify when we are in game && silent mode.

View File

@@ -6,12 +6,14 @@ namespace Snap.Hutao.Service.DailyNote;
internal readonly struct DailyNoteNotifyInfo
{
public readonly string Title;
public readonly string AdaptiveIcon;
public readonly string AdaptiveHint;
public readonly string Hint;
public DailyNoteNotifyInfo(string title, string adaptiveHint, string hint)
public DailyNoteNotifyInfo(string title, string adaptiveIcon, string adaptiveHint, string hint)
{
Title = title;
AdaptiveIcon = adaptiveIcon;
AdaptiveHint = adaptiveHint;
Hint = hint;
}

View File

@@ -11,6 +11,9 @@ using System.Globalization;
namespace Snap.Hutao.Service.DailyNote;
/// <summary>
/// 实时便笺选项
/// </summary>
[ConstructorGenerated(CallBaseConstructor = true)]
[Injection(InjectAs.Singleton)]
internal sealed partial class DailyNoteOptions : DbStoreOptions
@@ -35,6 +38,9 @@ internal sealed partial class DailyNoteOptions : DbStoreOptions
private bool? isSilentWhenPlayingGame;
private string? webhookUrl;
/// <summary>
/// 刷新时间
/// </summary>
public List<NameValue<int>> RefreshTimes { get => refreshTimes; }
public bool IsAutoRefreshEnabled
@@ -70,6 +76,9 @@ internal sealed partial class DailyNoteOptions : DbStoreOptions
}
}
/// <summary>
/// 选中的刷新时间
/// </summary>
public NameValue<int>? SelectedRefreshTime
{
get
@@ -105,12 +114,18 @@ internal sealed partial class DailyNoteOptions : DbStoreOptions
}
}
/// <summary>
/// 提醒式通知
/// </summary>
public bool IsReminderNotification
{
get => GetOption(ref isReminderNotification, SettingEntry.DailyNoteReminderNotify);
set => SetOption(ref isReminderNotification, SettingEntry.DailyNoteReminderNotify, value);
}
/// <summary>
/// 是否开启免打扰模式
/// </summary>
public bool IsSilentWhenPlayingGame
{
get => GetOption(ref isSilentWhenPlayingGame, SettingEntry.DailyNoteSilentWhenPlayingGame);

View File

@@ -5,11 +5,7 @@ using CommunityToolkit.Mvvm.Messaging;
using Snap.Hutao.Core.DependencyInjection.Abstraction;
using Snap.Hutao.Message;
using Snap.Hutao.Model.Entity;
using Snap.Hutao.Service.Abstraction;
using Snap.Hutao.Service.Metadata;
using Snap.Hutao.Service.Metadata.ContextAbstraction;
using Snap.Hutao.Service.User;
using Snap.Hutao.ViewModel.DailyNote;
using Snap.Hutao.ViewModel.User;
using Snap.Hutao.Web.Hoyolab;
using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord;
@@ -38,138 +34,134 @@ internal sealed partial class DailyNoteService : IDailyNoteService, IRecipient<U
public void Receive(UserRemovedMessage message)
{
// Database items have been deleted by cascade deleting.
taskContext.BeginInvokeOnMainThread(() => entries?.RemoveWhere(n => n.UserId == message.RemovedUserId));
taskContext.InvokeOnMainThread(() => entries?.RemoveWhere(n => n.UserId == message.RemovedUserId));
}
/// <inheritdoc/>
public async ValueTask AddDailyNoteAsync(UserAndUid userAndUid, CancellationToken token = default)
public async ValueTask AddDailyNoteAsync(UserAndUid userAndUid)
{
string roleUid = userAndUid.Uid.Value;
if (await dailyNoteDbService.ContainsUidAsync(roleUid, token).ConfigureAwait(false))
if (!await dailyNoteDbService.ContainsUidAsync(roleUid).ConfigureAwait(false))
{
return;
DailyNoteEntry newEntry = DailyNoteEntry.From(userAndUid);
Web.Response.Response<WebDailyNote> dailyNoteResponse;
using (IServiceScope scope = serviceProvider.CreateScope())
{
IGameRecordClient gameRecordClient = scope.ServiceProvider
.GetRequiredService<IOverseaSupportFactory<IGameRecordClient>>()
.Create(PlayerUid.IsOversea(roleUid));
dailyNoteResponse = await gameRecordClient
.GetDailyNoteAsync(userAndUid)
.ConfigureAwait(false);
}
if (dailyNoteResponse.IsOk())
{
newEntry.UpdateDailyNote(dailyNoteResponse.Data);
}
newEntry.UserGameRole = userService.GetUserGameRoleByUid(roleUid);
await dailyNoteDbService.AddDailyNoteEntryAsync(newEntry).ConfigureAwait(false);
newEntry.User = userAndUid.User;
await taskContext.SwitchToMainThreadAsync();
entries?.Add(newEntry);
}
DailyNoteEntry newEntry = DailyNoteEntry.From(userAndUid);
Web.Response.Response<WebDailyNote> dailyNoteResponse;
using (IServiceScope scope = serviceProvider.CreateScope())
{
IGameRecordClient gameRecordClient = scope.ServiceProvider
.GetRequiredService<IOverseaSupportFactory<IGameRecordClient>>()
.Create(PlayerUid.IsOversea(roleUid));
dailyNoteResponse = await gameRecordClient
.GetDailyNoteAsync(userAndUid, token)
.ConfigureAwait(false);
}
if (dailyNoteResponse.IsOk())
{
newEntry.UpdateDailyNote(dailyNoteResponse.Data);
}
newEntry.UserGameRole = userService.GetUserGameRoleByUid(roleUid);
await dailyNoteDbService.AddDailyNoteEntryAsync(newEntry, token).ConfigureAwait(false);
newEntry.User = userAndUid.User;
await taskContext.SwitchToMainThreadAsync();
entries?.Add(newEntry);
}
/// <inheritdoc/>
public async ValueTask<ObservableCollection<DailyNoteEntry>> GetDailyNoteEntryCollectionAsync(bool forceRefresh = false, CancellationToken token = default)
public async ValueTask<ObservableCollection<DailyNoteEntry>> GetDailyNoteEntryCollectionAsync(bool forceRefresh = false)
{
if (entries is null)
{
// IUserService.GetUserGameRoleByUid only usable after call IUserService.GetRoleCollectionAsync
await userService.GetRoleCollectionAsync().ConfigureAwait(false);
await RefreshDailyNotesCoreAsync(forceRefresh, token).ConfigureAwait(false);
await RefreshDailyNotesCoreAsync(forceRefresh).ConfigureAwait(false);
using (IServiceScope scope = serviceProvider.CreateScope())
{
DailyNoteMetadataContext context = await scope.GetRequiredService<IMetadataService>().GetContextAsync<DailyNoteMetadataContext>(token).ConfigureAwait(false);
List<DailyNoteEntry> entryList = await dailyNoteDbService.GetDailyNoteEntryListIncludingUserAsync(token).ConfigureAwait(false);
entryList.ForEach(entry =>
{
entry.UserGameRole = userService.GetUserGameRoleByUid(entry.Uid);
entry.ArchonQuestView = DailyNoteArchonQuestView.Create(entry.DailyNote, context.Chapters);
});
entries = entryList.ToObservableCollection();
}
List<DailyNoteEntry> entryList = await dailyNoteDbService.GetDailyNoteEntryIncludeUserListAsync().ConfigureAwait(false);
entryList.ForEach(entry => { entry.UserGameRole = userService.GetUserGameRoleByUid(entry.Uid); });
entries = entryList.ToObservableCollection();
}
return entries;
}
/// <inheritdoc/>
public ValueTask RefreshDailyNotesAsync(CancellationToken token = default)
public ValueTask RefreshDailyNotesAsync()
{
return RefreshDailyNotesCoreAsync(true, token);
return RefreshDailyNotesCoreAsync(true);
}
/// <inheritdoc/>
public async ValueTask RemoveDailyNoteAsync(DailyNoteEntry entry, CancellationToken token = default)
public async ValueTask RemoveDailyNoteAsync(DailyNoteEntry entry)
{
await taskContext.SwitchToMainThreadAsync();
ArgumentNullException.ThrowIfNull(entries);
entries.Remove(entry);
await taskContext.SwitchToBackgroundAsync();
await dailyNoteDbService.DeleteDailyNoteEntryByIdAsync(entry.InnerId, token).ConfigureAwait(false);
await dailyNoteDbService.DeleteDailyNoteEntryByIdAsync(entry.InnerId).ConfigureAwait(false);
}
public async ValueTask UpdateDailyNoteAsync(DailyNoteEntry entry, CancellationToken token = default)
public async ValueTask UpdateDailyNoteAsync(DailyNoteEntry entry)
{
await taskContext.SwitchToBackgroundAsync();
await dailyNoteDbService.UpdateDailyNoteEntryAsync(entry, token).ConfigureAwait(false);
await dailyNoteDbService.UpdateDailyNoteEntryAsync(entry).ConfigureAwait(false);
}
private async ValueTask RefreshDailyNotesCoreAsync(bool forceRefresh, CancellationToken token = default)
private async ValueTask RefreshDailyNotesCoreAsync(bool forceRefresh)
{
using (IServiceScope scope = serviceProvider.CreateScope())
{
DailyNoteWebhookOperation dailyNoteWebhookOperation = serviceProvider.GetRequiredService<DailyNoteWebhookOperation>();
DailyNoteWebhookOperation dailyNoteWebhookOperation = serviceProvider.GetRequiredService<DailyNoteWebhookOperation>();
foreach (DailyNoteEntry entry in await dailyNoteDbService.GetDailyNoteEntryListIncludingUserAsync(token).ConfigureAwait(false))
foreach (DailyNoteEntry entry in await dailyNoteDbService.GetDailyNoteEntryIncludeUserListAsync().ConfigureAwait(false))
{
if (!forceRefresh && entry.DailyNote is not null)
{
if (!forceRefresh && entry.DailyNote is not null)
continue;
}
Web.Response.Response<WebDailyNote> dailyNoteResponse;
using (IServiceScope scope = serviceProvider.CreateScope())
{
IGameRecordClient gameRecordClient = serviceProvider
.GetRequiredService<IOverseaSupportFactory<IGameRecordClient>>()
.Create(PlayerUid.IsOversea(entry.Uid));
dailyNoteResponse = await gameRecordClient
.GetDailyNoteAsync(new(entry.User, entry.Uid))
.ConfigureAwait(false);
}
if (dailyNoteResponse.IsOk())
{
WebDailyNote dailyNote = dailyNoteResponse.Data;
// 集合内的实时便笺与数据库取出的非同一个对象,需要分别更新
// cache
await taskContext.SwitchToMainThreadAsync();
if (entries?.SingleOrDefault(e => e.UserId == entry.UserId && e.Uid == entry.Uid) is { } cachedEntry)
{
continue;
cachedEntry.UpdateDailyNote(dailyNote);
cachedEntry.ResinNotifySuppressed = entry.ResinNotifySuppressed;
cachedEntry.HomeCoinNotifySuppressed = entry.HomeCoinNotifySuppressed;
cachedEntry.TransformerNotifySuppressed = entry.TransformerNotifySuppressed;
cachedEntry.DailyTaskNotifySuppressed = entry.DailyTaskNotifySuppressed;
cachedEntry.ExpeditionNotifySuppressed = entry.ExpeditionNotifySuppressed;
}
IGameRecordClient gameRecordClient = scope.ServiceProvider
.GetRequiredService<IOverseaSupportFactory<IGameRecordClient>>()
.Create(PlayerUid.IsOversea(entry.Uid));
Web.Response.Response<WebDailyNote> dailyNoteResponse = await gameRecordClient
.GetDailyNoteAsync(new(entry.User, entry.Uid), token)
.ConfigureAwait(false);
if (dailyNoteResponse.IsOk())
// database
{
WebDailyNote dailyNote = dailyNoteResponse.Data;
entry.UpdateDailyNote(dailyNote);
// 集合内的实时便笺与数据库取出的非同一个对象,需要分别更新
// Cache
await taskContext.SwitchToMainThreadAsync();
if (entries?.SingleOrDefault(e => e.UserId == entry.UserId && e.Uid == entry.Uid) is { } cachedEntry)
{
entry.CopyTo(cachedEntry);
}
// Database
{
// 发送通知必须早于数据库更新,否则会导致通知重复
await dailyNoteNotificationOperation.SendAsync(entry).ConfigureAwait(false);
await dailyNoteDbService.UpdateDailyNoteEntryAsync(entry, token).ConfigureAwait(false);
await dailyNoteWebhookOperation.TryPostDailyNoteToWebhookAsync(entry.Uid, dailyNote, token).ConfigureAwait(false);
}
// 发送通知必须早于数据库更新,否则会导致通知重复
await dailyNoteNotificationOperation.SendAsync(entry).ConfigureAwait(false);
await dailyNoteDbService.UpdateDailyNoteEntryAsync(entry).ConfigureAwait(false);
await dailyNoteWebhookOperation.TryPostDailyNoteToWebhookAsync(entry.Uid, dailyNote).ConfigureAwait(false);
}
}
}
}
}
}

View File

@@ -2,23 +2,22 @@
// Licensed under the MIT license.
using Snap.Hutao.Model.Entity;
using Snap.Hutao.Service.Abstraction;
namespace Snap.Hutao.Service.DailyNote;
internal interface IDailyNoteDbService : IAppDbService<DailyNoteEntry>
internal interface IDailyNoteDbService
{
ValueTask AddDailyNoteEntryAsync(DailyNoteEntry entry, CancellationToken token = default);
ValueTask AddDailyNoteEntryAsync(DailyNoteEntry entry);
bool ContainsUid(string uid);
ValueTask<bool> ContainsUidAsync(string uid, CancellationToken token = default);
ValueTask<bool> ContainsUidAsync(string uid);
ValueTask DeleteDailyNoteEntryByIdAsync(Guid entryId, CancellationToken token = default);
ValueTask DeleteDailyNoteEntryByIdAsync(Guid entryId);
List<DailyNoteEntry> GetDailyNoteEntryListIncludingUser();
List<DailyNoteEntry> GetDailyNoteEntryIncludeUserList();
ValueTask<List<DailyNoteEntry>> GetDailyNoteEntryListIncludingUserAsync(CancellationToken token = default);
ValueTask<List<DailyNoteEntry>> GetDailyNoteEntryIncludeUserListAsync();
ValueTask UpdateDailyNoteEntryAsync(DailyNoteEntry entry, CancellationToken token = default);
ValueTask UpdateDailyNoteEntryAsync(DailyNoteEntry entry);
}

Some files were not shown because too many files have changed in this diff Show More