mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
Merge pull request #1701 from DGP-Studio/develop
This commit is contained in:
65
.github/workflows/alpha.yml
vendored
65
.github/workflows/alpha.yml
vendored
@@ -29,14 +29,7 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.runner }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
runner:
|
||||
- self-hosted
|
||||
- windows-latest
|
||||
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -52,13 +45,55 @@ jobs:
|
||||
run: dotnet tool restore && dotnet cake
|
||||
env:
|
||||
VERSION_API_TOKEN: ${{ secrets.VERSION_API_TOKEN }}
|
||||
|
||||
- name: Sign Msix
|
||||
if: success() && github.event_name != 'pull_request'
|
||||
shell: pwsh
|
||||
run: |
|
||||
[System.Convert]::FromBase64String("${{ secrets.CERTIFICATE }}") | Set-Content -AsByteStream temp.pfx
|
||||
signtool.exe sign /debug /v /a /fd SHA256 /f temp.pfx /p ${{ secrets.PW }} ${{ github.workspace }}\src\output\Snap.Hutao.Alpha-${{ steps.cake.outputs.version }}.msix
|
||||
CERTIFICATE: ${{ secrets.CERTIFICATE }}
|
||||
PW: ${{ secrets.PW }}
|
||||
|
||||
- name: Upload signed msix
|
||||
if: success() && github.event_name != 'pull_request'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Snap.Hutao.Alpha-${{ steps.cake.outputs.version }}
|
||||
path: ${{ github.workspace }}/src/output/Snap.Hutao.Alpha-${{ steps.cake.outputs.version }}.msix
|
||||
|
||||
- name: Add summary
|
||||
if: success() && github.event_name != 'pull_request'
|
||||
shell: pwsh
|
||||
run: |
|
||||
$summary = "
|
||||
> [!WARNING]
|
||||
> 该版本是由 CI 程序自动打包生成的 `Alpha` 测试版本,**仅供开发者测试使用**
|
||||
|
||||
> [!TIP]
|
||||
> 普通用户请[点击这里](https://github.com/DGP-Studio/Snap.Hutao/releases/latest/)下载最新的稳定版本
|
||||
|
||||
> [!IMPORTANT]
|
||||
> 请注意,从 Snap Hutao Alpha 2023.12.21.3 开始,我们将使用全新的 CI 证书,原有的 Snap.Hutao.CI.cer 将在几天后过期停止使用。
|
||||
>
|
||||
> 请安装 [DGP_Studio_CA.crt](https://github.com/DGP-Automation/Hutao-Auto-Release/releases/download/certificate-ca/DGP_Studio_CA.crt) 到 `受信任的根证书颁发机构` 以安装测试版安装包
|
||||
"
|
||||
|
||||
echo $summary >> $Env:GITHUB_STEP_SUMMARY
|
||||
fallback_build:
|
||||
runs-on: windows-latest
|
||||
needs: build
|
||||
if: failure()
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 8.0
|
||||
|
||||
- name: Cake
|
||||
id: cake
|
||||
shell: pwsh
|
||||
run: dotnet tool restore && dotnet cake
|
||||
env:
|
||||
VERSION_API_TOKEN: ${{ secrets.VERSION_API_TOKEN }}
|
||||
CERTIFICATE: ${{ secrets.CERTIFICATE }}
|
||||
PW: ${{ secrets.PW }}
|
||||
|
||||
- name: Upload signed msix
|
||||
if: success() && github.event_name != 'pull_request'
|
||||
|
||||
65
build.cake
65
build.cake
@@ -11,6 +11,9 @@ var version = "version";
|
||||
var repoDir = "repoDir";
|
||||
var outputPath = "outputPath";
|
||||
|
||||
var pfxPath = "pfxPath";
|
||||
var pw = "pw";
|
||||
|
||||
// Extension
|
||||
|
||||
static ProcessArgumentBuilder AppendIf(this ProcessArgumentBuilder builder, string text, bool condition)
|
||||
@@ -62,6 +65,11 @@ if (GitHubActions.IsRunningOnGitHubActions)
|
||||
}
|
||||
);
|
||||
|
||||
var certificateBase64 = HasEnvironmentVariable("CERTIFICATE") ? EnvironmentVariable("CERTIFICATE") : throw new Exception("Cannot find CERTIFICATE");
|
||||
pw = HasEnvironmentVariable("PW") ? EnvironmentVariable("PW") : throw new Exception("Cannot find PW");
|
||||
pfxPath = System.IO.Path.Combine(repoDir, "temp.pfx");
|
||||
System.IO.File.WriteAllBytes(pfxPath, System.Convert.FromBase64String(certificateBase64));
|
||||
|
||||
Information($"Version: {version}");
|
||||
}
|
||||
|
||||
@@ -88,10 +96,19 @@ else // Local
|
||||
Information($"Version: {version}");
|
||||
}
|
||||
|
||||
// Windows SDK
|
||||
var registry = new WindowsRegistry();
|
||||
var winsdkRegistry = registry.LocalMachine.OpenKey(@"SOFTWARE\Microsoft\Windows Kits\Installed Roots");
|
||||
var winsdkVersion = winsdkRegistry.GetSubKeyNames().MaxBy(key => int.Parse(key.Split(".")[2]));
|
||||
var winsdkPath = (string)winsdkRegistry.GetValue("KitsRoot10");
|
||||
var winsdkBinPath = System.IO.Path.Combine(winsdkPath, "bin", winsdkVersion, "x64");
|
||||
Information($"Windows SDK: {winsdkPath}");
|
||||
|
||||
Task("Build")
|
||||
.IsDependentOn("Build binary package")
|
||||
.IsDependentOn("Copy files")
|
||||
.IsDependentOn("Build MSIX");
|
||||
.IsDependentOn("Build MSIX")
|
||||
.IsDependentOn("Sign");
|
||||
|
||||
Task("NuGet Restore")
|
||||
.Does(() =>
|
||||
@@ -207,8 +224,11 @@ Task("Build MSIX")
|
||||
{
|
||||
arguments = "pack /d " + binPath + " /p " + System.IO.Path.Combine(outputPath, $"Snap.Hutao.Local-{version}.msix");
|
||||
}
|
||||
|
||||
var makeappxPath = System.IO.Path.Combine(winsdkBinPath, "makeappx.exe");
|
||||
|
||||
var p = StartProcess(
|
||||
"makeappx.exe",
|
||||
makeappxPath,
|
||||
new ProcessSettings
|
||||
{
|
||||
Arguments = arguments
|
||||
@@ -216,7 +236,46 @@ Task("Build MSIX")
|
||||
);
|
||||
if (p != 0)
|
||||
{
|
||||
throw new InvalidOperationException("Build failed with exit code " + p);
|
||||
throw new InvalidOperationException("Build MSIX failed with exit code " + p);
|
||||
}
|
||||
});
|
||||
|
||||
Task("Sign")
|
||||
.IsDependentOn("Build MSIX")
|
||||
.Does(() =>
|
||||
{
|
||||
if (AppVeyor.IsRunningOnAppVeyor)
|
||||
{
|
||||
Information("Move to SignPath. Skip signing.");
|
||||
return;
|
||||
}
|
||||
else if (GitHubActions.IsRunningOnGitHubActions)
|
||||
{
|
||||
if (GitHubActions.Environment.PullRequest.IsPullRequest)
|
||||
{
|
||||
Information("Is Pull Request. Skip signing.");
|
||||
return;
|
||||
}
|
||||
|
||||
var signPath = System.IO.Path.Combine(winsdkBinPath, "signtool.exe");
|
||||
var arguments = $"sign /debug /v /a /fd SHA256 /f {pfxPath} /p {pw} {System.IO.Path.Combine(outputPath, $"Snap.Hutao.Alpha-{version}.msix")}";
|
||||
|
||||
var p = StartProcess(
|
||||
signPath,
|
||||
new ProcessSettings
|
||||
{
|
||||
Arguments = arguments
|
||||
}
|
||||
);
|
||||
if (p != 0)
|
||||
{
|
||||
throw new InvalidOperationException("Sign failed with exit code " + p);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Information("Local configuration. Skip signing.");
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -6,14 +6,25 @@ namespace Snap.Hutao.Test.IncomingFeature;
|
||||
public class SpiralAbyssScheduleIdTest
|
||||
{
|
||||
private static readonly TimeSpan Utc8 = new(8, 0, 0);
|
||||
private static readonly DateTimeOffset AcrobaticsBattleIntroducedTime = new(2024, 7, 1, 4, 0, 0, Utc8);
|
||||
|
||||
[TestMethod]
|
||||
public void Test()
|
||||
{
|
||||
Console.WriteLine($"当前第 {GetForDateTimeOffset(DateTimeOffset.Now)} 期");
|
||||
|
||||
DateTimeOffset dateTimeOffset = new(2020, 7, 1, 4, 0, 0, Utc8);
|
||||
Console.WriteLine($"2020-07-01 04:00:00 为第 {GetForDateTimeOffset(dateTimeOffset)} 期");
|
||||
// 2020-07-01 04:00:00 为第 1 期
|
||||
// 2024-06-16 04:00:00 为第 96 期
|
||||
// 2024-07-01 04:00:00 为第 97 期
|
||||
// 2024-07-16 04:00:00 为第 98 期
|
||||
// 2024-08-01 04:00:00 为第 99 期
|
||||
Console.WriteLine($"2020-07-01 04:00:00 为第 {GetForDateTimeOffset(new(2020, 07, 01, 4, 0, 0, Utc8))} 期");
|
||||
Console.WriteLine($"2024-06-16 04:00:00 为第 {GetForDateTimeOffset(new(2024, 06, 16, 4, 0, 0, Utc8))} 期");
|
||||
Console.WriteLine($"2024-07-01 04:00:00 为第 {GetForDateTimeOffset(new(2024, 07, 01, 4, 0, 0, Utc8))} 期");
|
||||
Console.WriteLine($"2024-07-16 04:00:00 为第 {GetForDateTimeOffset(new(2024, 07, 16, 4, 0, 0, Utc8))} 期");
|
||||
Console.WriteLine($"2024-08-01 04:00:00 为第 {GetForDateTimeOffset(new(2024, 08, 01, 4, 0, 0, Utc8))} 期");
|
||||
Console.WriteLine($"2024-08-16 04:00:00 为第 {GetForDateTimeOffset(new(2024, 08, 16, 4, 0, 0, Utc8))} 期");
|
||||
Console.WriteLine($"2024-09-01 04:00:00 为第 {GetForDateTimeOffset(new(2024, 09, 01, 4, 0, 0, Utc8))} 期");
|
||||
}
|
||||
|
||||
public static int GetForDateTimeOffset(DateTimeOffset dateTimeOffset)
|
||||
@@ -38,6 +49,12 @@ public class SpiralAbyssScheduleIdTest
|
||||
periodNum--;
|
||||
}
|
||||
|
||||
if (dateTimeOffset >= AcrobaticsBattleIntroducedTime)
|
||||
{
|
||||
// 当超过 96 期时,每一个月一期
|
||||
periodNum = (4 * 12 * 2) + ((periodNum - (4 * 12 * 2)) / 2);
|
||||
}
|
||||
|
||||
return periodNum;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using System.Drawing;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Json;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Snap.Hutao.Test.RuntimeBehavior;
|
||||
|
||||
[TestClass]
|
||||
public sealed class HttpClientBehaviorTest
|
||||
{
|
||||
private const int MessageNotYetSent = 0;
|
||||
|
||||
[TestMethod]
|
||||
public async Task RetrySendHttpRequestMessage()
|
||||
{
|
||||
using (HttpClient httpClient = new())
|
||||
{
|
||||
HttpRequestMessage requestMessage = new(HttpMethod.Post, "https://jsonplaceholder.typicode.com/posts");
|
||||
JsonContent content = JsonContent.Create(new Point(12, 34));
|
||||
requestMessage.Content = content;
|
||||
using (requestMessage)
|
||||
{
|
||||
await httpClient.SendAsync(requestMessage).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
Interlocked.Exchange(ref GetPrivateSendStatus(requestMessage), MessageNotYetSent);
|
||||
Volatile.Write(ref GetPrivateDisposed(content), false);
|
||||
await httpClient.SendAsync(requestMessage).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
// private int _sendStatus
|
||||
[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "_sendStatus")]
|
||||
private static extern ref int GetPrivateSendStatus(HttpRequestMessage message);
|
||||
|
||||
// private bool _disposed
|
||||
[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "_disposed")]
|
||||
private static extern ref bool GetPrivateDisposed(HttpRequestMessage message);
|
||||
|
||||
// private bool _disposed
|
||||
[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "_disposed")]
|
||||
private static extern ref bool GetPrivateDisposed(HttpContent content);
|
||||
}
|
||||
@@ -13,9 +13,9 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.3.1" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.3.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.4.3" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.4.3" />
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
|
||||
@@ -59,7 +59,7 @@ public sealed partial class App : Application
|
||||
|
||||
public new void Exit()
|
||||
{
|
||||
XamlWindowLifetime.ApplicationExiting = true;
|
||||
XamlLifetime.ApplicationExiting = true;
|
||||
base.Exit();
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ public sealed partial class App : Application
|
||||
|
||||
if (serviceProvider.GetRequiredService<PrivateNamedPipeClient>().TryRedirectActivationTo(activatedEventArgs))
|
||||
{
|
||||
logger.LogDebug("Application exiting on RedirectActivationTo");
|
||||
Exit();
|
||||
return;
|
||||
}
|
||||
@@ -80,12 +81,19 @@ public sealed partial class App : Application
|
||||
LogDiagnosticInformation();
|
||||
|
||||
// Manually invoke
|
||||
activation.Activate(HutaoActivationArguments.FromAppActivationArguments(activatedEventArgs));
|
||||
HutaoActivationArguments hutaoArgs = HutaoActivationArguments.FromAppActivationArguments(activatedEventArgs);
|
||||
if (hutaoArgs.Kind is HutaoActivationKind.Toast)
|
||||
{
|
||||
Exit();
|
||||
return;
|
||||
}
|
||||
|
||||
activation.Activate(hutaoArgs);
|
||||
activation.PostInitialization();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine(ex);
|
||||
logger.LogError(ex, "Application failed in App.OnLaunched");
|
||||
Process.GetCurrentProcess().Kill();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Windows.Foundation.Collections;
|
||||
|
||||
namespace Snap.Hutao.Control.Collection.Alternating;
|
||||
|
||||
[Obsolete("Use SettingsCard instead")]
|
||||
[DependencyProperty("ItemAlternateBackground", typeof(Microsoft.UI.Xaml.Media.Brush))]
|
||||
internal sealed partial class AlternatingItemsControl : ItemsControl
|
||||
{
|
||||
private readonly VectorChangedEventHandler<object> itemsVectorChangedEventHandler;
|
||||
|
||||
public AlternatingItemsControl()
|
||||
{
|
||||
itemsVectorChangedEventHandler = OnItemsVectorChanged;
|
||||
Items.VectorChanged += itemsVectorChangedEventHandler;
|
||||
}
|
||||
|
||||
private void OnItemsVectorChanged(IObservableVector<object> items, IVectorChangedEventArgs args)
|
||||
{
|
||||
if (args.CollectionChange is CollectionChange.Reset)
|
||||
{
|
||||
int index = (int)args.Index;
|
||||
for (int i = index; i < items.Count; i++)
|
||||
{
|
||||
if (items[i] is IAlternatingItem item)
|
||||
{
|
||||
item.Background = i % 2 is 0 ? default : ItemAlternateBackground;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Control.Collection.Alternating;
|
||||
|
||||
[Obsolete("Use SettingsCard instead")]
|
||||
internal interface IAlternatingItem
|
||||
{
|
||||
public Microsoft.UI.Xaml.Media.Brush? Background { get; set; }
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Markup;
|
||||
|
||||
namespace Snap.Hutao.Control;
|
||||
|
||||
@@ -36,9 +37,18 @@ internal class Loading : Microsoft.UI.Xaml.Controls.ContentControl
|
||||
private static void IsLoadingPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
Loading control = (Loading)d;
|
||||
control.presenter ??= control.GetTemplateChild("ContentGrid") as FrameworkElement;
|
||||
|
||||
control?.Update();
|
||||
if ((bool)e.NewValue)
|
||||
{
|
||||
control.presenter ??= control.GetTemplateChild("ContentGrid") as FrameworkElement;
|
||||
}
|
||||
else if (control.presenter is not null)
|
||||
{
|
||||
XamlMarkupHelper.UnloadObject(control.presenter);
|
||||
control.presenter = null;
|
||||
}
|
||||
|
||||
control.Update();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
<ContentPresenter
|
||||
x:Name="ContentGrid"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
x:Load="False">
|
||||
<ContentPresenter.RenderTransform>
|
||||
<CompositeTransform/>
|
||||
</ContentPresenter.RenderTransform>
|
||||
@@ -84,4 +85,4 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary>
|
||||
@@ -3,8 +3,11 @@
|
||||
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Markup;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using Snap.Hutao.Core.Abstraction;
|
||||
using Snap.Hutao.Service.Navigation;
|
||||
using Snap.Hutao.View.Helper;
|
||||
using Snap.Hutao.ViewModel.Abstraction;
|
||||
|
||||
namespace Snap.Hutao.Control;
|
||||
@@ -36,6 +39,11 @@ internal class ScopedPage : Page
|
||||
extra.NotifyNavigationCompleted();
|
||||
}
|
||||
|
||||
public virtual void UnloadObjectOverride(DependencyObject unloadableObject)
|
||||
{
|
||||
XamlMarkupHelper.UnloadObject(unloadableObject);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 初始化
|
||||
/// 应当在 InitializeComponent() 前调用
|
||||
@@ -46,8 +54,14 @@ internal class ScopedPage : Page
|
||||
{
|
||||
try
|
||||
{
|
||||
IViewModel viewModel = pageScope.ServiceProvider.GetRequiredService<TViewModel>();
|
||||
viewModel.CancellationToken = viewCancellationTokenSource.Token;
|
||||
TViewModel viewModel = pageScope.ServiceProvider.GetRequiredService<TViewModel>();
|
||||
using (viewModel.DisposeLock.Enter())
|
||||
{
|
||||
viewModel.IsViewDisposed = false;
|
||||
viewModel.CancellationToken = viewCancellationTokenSource.Token;
|
||||
viewModel.DeferContentLoader = new DeferContentLoader(this);
|
||||
}
|
||||
|
||||
DataContext = viewModel;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -96,10 +110,9 @@ internal class ScopedPage : Page
|
||||
viewCancellationTokenSource.Cancel();
|
||||
IViewModel viewModel = (IViewModel)DataContext;
|
||||
|
||||
using (SemaphoreSlim locker = viewModel.DisposeLock)
|
||||
using (viewModel.DisposeLock.Enter())
|
||||
{
|
||||
// Wait to ensure viewmodel operation is completed
|
||||
locker.Wait();
|
||||
viewModel.IsViewDisposed = true;
|
||||
|
||||
// Dispose the scope
|
||||
|
||||
@@ -52,6 +52,12 @@
|
||||
<Thickness x:Key="InfoBarIconMargin">19,16,19,16</Thickness>
|
||||
<Thickness x:Key="InfoBarContentRootPadding">0,0,0,0</Thickness>
|
||||
<x:Double x:Key="InfoBarIconFontSize">20</x:Double>
|
||||
|
||||
<Thickness x:Key="InfoBarTitleHorizontalOrientationMargin">0,0,0,0</Thickness>
|
||||
<Thickness x:Key="InfoBarMessageHorizontalOrientationMargin">12,0,0,0</Thickness>
|
||||
<Thickness x:Key="InfoBarTitleVerticalOrientationMargin">0,16,0,0</Thickness>
|
||||
<Thickness x:Key="InfoBarMessageVerticalOrientationMargin">0,6,0,0</Thickness>
|
||||
|
||||
<!-- TODO: When will DefaultInfoBarStyle added -->
|
||||
<Style TargetType="InfoBar">
|
||||
<Setter Property="shch:InfoBarHelper.IsTextSelectionEnabled" Value="False"/>
|
||||
@@ -128,6 +134,7 @@
|
||||
<InfoBarPanel
|
||||
Grid.Column="1"
|
||||
Margin="{StaticResource InfoBarPanelMargin}"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalOrientationPadding="{StaticResource InfoBarPanelHorizontalOrientationPadding}"
|
||||
VerticalOrientationPadding="{StaticResource InfoBarPanelVerticalOrientationPadding}">
|
||||
<TextBlock
|
||||
@@ -173,6 +180,7 @@
|
||||
<Button
|
||||
Name="CloseButton"
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Top"
|
||||
Command="{TemplateBinding CloseButtonCommand}"
|
||||
CommandParameter="{TemplateBinding CloseButtonCommandParameter}"
|
||||
Style="{TemplateBinding CloseButtonStyle}">
|
||||
@@ -236,7 +244,14 @@
|
||||
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="SeverityLevels">
|
||||
<VisualState x:Name="Informational"/>
|
||||
<VisualState x:Name="Informational">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="ContentRoot.Background" Value="{ThemeResource InfoBarInformationalSeverityBackgroundBrush}"/>
|
||||
<Setter Target="IconBackground.Foreground" Value="{ThemeResource InfoBarInformationalSeverityIconBackground}"/>
|
||||
<Setter Target="StandardIcon.Text" Value="{StaticResource InfoBarInformationalIconGlyph}"/>
|
||||
<Setter Target="StandardIcon.Foreground" Value="{ThemeResource InfoBarInformationalSeverityIconForeground}"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Error">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="ContentRoot.Background" Value="{ThemeResource InfoBarErrorSeverityBackgroundBrush}"/>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<TransitionCollection x:Key="ContentThemeTransitions">
|
||||
<ContentThemeTransition/>
|
||||
</TransitionCollection>
|
||||
@@ -20,4 +20,4 @@
|
||||
<TransitionCollection x:Key="NavigationThemeTransitions">
|
||||
<NavigationThemeTransition/>
|
||||
</TransitionCollection>
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary>
|
||||
@@ -5,5 +5,5 @@ namespace Snap.Hutao.Core.Abstraction;
|
||||
|
||||
internal interface IPinnable<TData>
|
||||
{
|
||||
ref readonly TData GetPinnableReference();
|
||||
ref TData GetPinnableReference();
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Core.Abstraction;
|
||||
|
||||
internal interface IResurrectable
|
||||
{
|
||||
void Resurrect();
|
||||
}
|
||||
@@ -11,16 +11,13 @@ using Snap.Hutao.Web.Request.Builder;
|
||||
using Snap.Hutao.Web.Request.Builder.Abstraction;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Frozen;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
|
||||
namespace Snap.Hutao.Core.Caching;
|
||||
|
||||
/// <summary>
|
||||
/// Provides methods and tools to cache files in a folder
|
||||
/// The class's name will become the cache folder's name
|
||||
/// </summary>
|
||||
[HighQuality]
|
||||
[ConstructorGenerated]
|
||||
[Injection(InjectAs.Singleton, typeof(IImageCache))]
|
||||
@@ -28,10 +25,9 @@ namespace Snap.Hutao.Core.Caching;
|
||||
[PrimaryHttpMessageHandler(MaxConnectionsPerServer = 8)]
|
||||
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(
|
||||
private static readonly FrozenDictionary<int, TimeSpan> DelayFromRetryCount = FrozenDictionary.ToFrozenDictionary(
|
||||
[
|
||||
KeyValuePair.Create(0, TimeSpan.FromSeconds(4)),
|
||||
KeyValuePair.Create(1, TimeSpan.FromSeconds(16)),
|
||||
@@ -46,16 +42,13 @@ internal sealed partial class ImageCache : IImageCache, IImageCacheFilePathOpera
|
||||
private readonly ILogger<ImageCache> logger;
|
||||
private readonly IMemoryCache memoryCache;
|
||||
|
||||
private string? baseFolder;
|
||||
private string? cacheFolder;
|
||||
|
||||
private string CacheFolder
|
||||
{
|
||||
get => LazyInitializer.EnsureInitialized(ref cacheFolder, () =>
|
||||
{
|
||||
baseFolder ??= serviceProvider.GetRequiredService<RuntimeOptions>().LocalCache;
|
||||
DirectoryInfo info = Directory.CreateDirectory(Path.Combine(baseFolder, CacheFolderName));
|
||||
return info.FullName;
|
||||
return serviceProvider.GetRequiredService<RuntimeOptions>().GetLocalCacheImageCacheFolder();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -149,8 +142,7 @@ internal sealed partial class ImageCache : IImageCache, IImageCacheFilePathOpera
|
||||
return treatNullFileAsInvalid;
|
||||
}
|
||||
|
||||
FileInfo fileInfo = new(file);
|
||||
return fileInfo.Length == 0;
|
||||
return new FileInfo(file).Length == 0;
|
||||
}
|
||||
|
||||
private void RemoveCore(IEnumerable<string> filePaths)
|
||||
@@ -172,80 +164,76 @@ internal sealed partial class ImageCache : IImageCache, IImageCacheFilePathOpera
|
||||
[SuppressMessage("", "SH003")]
|
||||
private async Task DownloadFileAsync(Uri uri, string baseFile)
|
||||
{
|
||||
int retryCount = 0;
|
||||
HttpClient httpClient = httpClientFactory.CreateClient(nameof(ImageCache));
|
||||
while (retryCount < 3)
|
||||
using (HttpClient httpClient = httpClientFactory.CreateClient(nameof(ImageCache)))
|
||||
{
|
||||
int retryCount = 0;
|
||||
|
||||
HttpRequestMessageBuilder requestMessageBuilder = httpRequestMessageBuilderFactory
|
||||
.Create()
|
||||
.SetRequestUri(uri)
|
||||
|
||||
// These headers are only available for our own api
|
||||
.SetStaticResourceControlHeadersIf(uri.Host.Contains("api.snapgenshin.com", StringComparison.OrdinalIgnoreCase))
|
||||
.SetStaticResourceControlHeadersIf(uri.Host.Contains("api.snapgenshin.com", StringComparison.OrdinalIgnoreCase)) // These headers are only available for our own api
|
||||
.Get();
|
||||
|
||||
using (HttpRequestMessage requestMessage = requestMessageBuilder.HttpRequestMessage)
|
||||
while (retryCount < 3)
|
||||
{
|
||||
using (HttpResponseMessage responseMessage = await httpClient.SendAsync(requestMessage, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false))
|
||||
{
|
||||
if (responseMessage.RequestMessage is { RequestUri: { } target } && target != uri)
|
||||
{
|
||||
logger.LogDebug("The Request '{Source}' has been redirected to '{Target}'", uri, target);
|
||||
}
|
||||
requestMessageBuilder.Resurrect();
|
||||
|
||||
if (responseMessage.IsSuccessStatusCode)
|
||||
using (HttpRequestMessage requestMessage = requestMessageBuilder.HttpRequestMessage)
|
||||
{
|
||||
using (HttpResponseMessage responseMessage = await httpClient.SendAsync(requestMessage, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false))
|
||||
{
|
||||
if (responseMessage.Content.Headers.ContentType?.MediaType is "application/json")
|
||||
// Redirect detection
|
||||
if (responseMessage.RequestMessage is { RequestUri: { } target } && target != uri)
|
||||
{
|
||||
#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;
|
||||
logger.LogDebug("The Request '{Source}' has been redirected to '{Target}'", uri, target);
|
||||
}
|
||||
|
||||
using (Stream httpStream = await responseMessage.Content.ReadAsStreamAsync().ConfigureAwait(false))
|
||||
if (responseMessage.IsSuccessStatusCode)
|
||||
{
|
||||
using (FileStream fileStream = File.Create(baseFile))
|
||||
if (responseMessage.Content.Headers.ContentType?.MediaType is "application/json")
|
||||
{
|
||||
await httpStream.CopyToAsync(fileStream).ConfigureAwait(false);
|
||||
DebugTrackFailedUri(uri);
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (responseMessage.StatusCode)
|
||||
{
|
||||
case HttpStatusCode.TooManyRequests:
|
||||
using (Stream httpStream = await responseMessage.Content.ReadAsStreamAsync().ConfigureAwait(false))
|
||||
{
|
||||
retryCount++;
|
||||
TimeSpan delay = responseMessage.Headers.RetryAfter?.Delta ?? retryCountToDelay[retryCount];
|
||||
logger.LogInformation("Retry download '{Uri}' after {Delay}.", uri, delay);
|
||||
await Task.Delay(delay).ConfigureAwait(false);
|
||||
break;
|
||||
using (FileStream fileStream = File.Create(baseFile))
|
||||
{
|
||||
await httpStream.CopyToAsync(fileStream).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
#if DEBUG
|
||||
DebugTrack(uri);
|
||||
#endif
|
||||
logger.LogColorizedCritical("Failed to download '{Uri}' with status code '{StatusCode}'", (uri, ConsoleColor.Red), (responseMessage.StatusCode, ConsoleColor.DarkYellow));
|
||||
return;
|
||||
switch (responseMessage.StatusCode)
|
||||
{
|
||||
case HttpStatusCode.TooManyRequests:
|
||||
{
|
||||
retryCount++;
|
||||
TimeSpan delay = responseMessage.Headers.RetryAfter?.Delta ?? DelayFromRetryCount[retryCount];
|
||||
logger.LogInformation("Retry download '{Uri}' after {Delay}.", uri, delay);
|
||||
await Task.Delay(delay).ConfigureAwait(false);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
DebugTrackFailedUri(uri);
|
||||
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)
|
||||
[Conditional("DEBUG")]
|
||||
private void DebugTrackFailedUri(Uri uri)
|
||||
{
|
||||
HashSet<string>? set = memoryCache.GetOrCreate(CacheFailedDownloadTasksName, entry => entry.Value ??= new HashSet<string>()) as HashSet<string>;
|
||||
HashSet<string>? set = memoryCache.GetOrCreate(CacheFailedDownloadTasksName, entry => new HashSet<string>());
|
||||
set?.Add(uri.ToString());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -70,7 +70,7 @@ internal sealed class ObservableReorderableDbCollection<TEntity> : ObservableCol
|
||||
|
||||
[SuppressMessage("", "SA1402")]
|
||||
internal sealed class ObservableReorderableDbCollection<TEntityOnly, TEntity> : ObservableCollection<TEntityOnly>
|
||||
where TEntityOnly : class, IEntityOnly<TEntity>
|
||||
where TEntityOnly : class, IEntityAccess<TEntity>
|
||||
where TEntity : class, IReorderable
|
||||
{
|
||||
private readonly IServiceProvider serviceProvider;
|
||||
|
||||
@@ -73,7 +73,7 @@ internal sealed partial class ScopedDbCurrent<TEntity, TMessage>
|
||||
|
||||
[ConstructorGenerated]
|
||||
internal sealed partial class ScopedDbCurrent<TEntityOnly, TEntity, TMessage>
|
||||
where TEntityOnly : class, IEntityOnly<TEntity>
|
||||
where TEntityOnly : class, IEntityAccess<TEntity>
|
||||
where TEntity : class, ISelectable
|
||||
where TMessage : Message.ValueChangedMessage<TEntityOnly>, new()
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ internal static class DependencyInjection
|
||||
.AddJsonOptions()
|
||||
.AddDatabase()
|
||||
.AddInjections()
|
||||
.AddAllHttpClients()
|
||||
.AddConfiguredHttpClients()
|
||||
|
||||
// Discrete services
|
||||
.AddSingleton<IMessenger, WeakReferenceMessenger>()
|
||||
|
||||
@@ -34,27 +34,27 @@ internal static class IocConfiguration
|
||||
.AddTransient(typeof(Database.ScopedDbCurrent<,>))
|
||||
.AddTransient(typeof(Database.ScopedDbCurrent<,,>))
|
||||
.AddDbContextPool<AppDbContext>(AddDbContextCore);
|
||||
}
|
||||
|
||||
private static void AddDbContextCore(IServiceProvider serviceProvider, DbContextOptionsBuilder builder)
|
||||
{
|
||||
RuntimeOptions runtimeOptions = serviceProvider.GetRequiredService<RuntimeOptions>();
|
||||
string dbFile = System.IO.Path.Combine(runtimeOptions.DataFolder, "Userdata.db");
|
||||
string sqlConnectionString = $"Data Source={dbFile}";
|
||||
|
||||
// Temporarily create a context
|
||||
using (AppDbContext context = AppDbContext.Create(serviceProvider, sqlConnectionString))
|
||||
static void AddDbContextCore(IServiceProvider serviceProvider, DbContextOptionsBuilder builder)
|
||||
{
|
||||
if (context.Database.GetPendingMigrations().Any())
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("[Database] Performing AppDbContext Migrations");
|
||||
context.Database.Migrate();
|
||||
}
|
||||
}
|
||||
RuntimeOptions runtimeOptions = serviceProvider.GetRequiredService<RuntimeOptions>();
|
||||
string dbFile = System.IO.Path.Combine(runtimeOptions.DataFolder, "Userdata.db");
|
||||
string sqlConnectionString = $"Data Source={dbFile}";
|
||||
|
||||
builder
|
||||
.EnableSensitiveDataLogging()
|
||||
.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking)
|
||||
.UseSqlite(sqlConnectionString);
|
||||
// Temporarily create a context
|
||||
using (AppDbContext context = AppDbContext.Create(serviceProvider, sqlConnectionString))
|
||||
{
|
||||
if (context.Database.GetPendingMigrations().Any())
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("[Database] Performing AppDbContext Migrations");
|
||||
context.Database.Migrate();
|
||||
}
|
||||
}
|
||||
|
||||
builder
|
||||
.EnableSensitiveDataLogging()
|
||||
.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking)
|
||||
.UseSqlite(sqlConnectionString);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ internal static partial class IocHttpClientConfiguration
|
||||
{
|
||||
private const string ApplicationJson = "application/json";
|
||||
|
||||
public static IServiceCollection AddAllHttpClients(this IServiceCollection services)
|
||||
public static IServiceCollection AddConfiguredHttpClients(this IServiceCollection services)
|
||||
{
|
||||
services
|
||||
.ConfigureHttpClientDefaults(clientBuilder =>
|
||||
@@ -27,7 +27,7 @@ internal static partial class IocHttpClientConfiguration
|
||||
HttpClientHandler clientHandler = (HttpClientHandler)handler;
|
||||
clientHandler.AllowAutoRedirect = true;
|
||||
clientHandler.UseProxy = true;
|
||||
clientHandler.Proxy = provider.GetRequiredService<DynamicHttpProxy>();
|
||||
clientHandler.Proxy = provider.GetRequiredService<HttpProxyUsingSystemProxy>();
|
||||
});
|
||||
})
|
||||
.AddHttpClients();
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Snap.Hutao.Core.ExceptionService;
|
||||
|
||||
/// <summary>
|
||||
/// 帮助更好的抛出异常
|
||||
/// </summary>
|
||||
[HighQuality]
|
||||
[System.Diagnostics.StackTraceHidden]
|
||||
[Obsolete("Use HutaoException instead")]
|
||||
internal static class ThrowHelper
|
||||
{
|
||||
[DoesNotReturn]
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
public static ArgumentException Argument(string message, string? paramName)
|
||||
{
|
||||
throw new ArgumentException(message, paramName);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,12 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.VisualBasic.FileIO;
|
||||
using Snap.Hutao.Win32.System.Com;
|
||||
using Snap.Hutao.Win32.UI.Shell;
|
||||
using System.IO;
|
||||
using static Snap.Hutao.Win32.Macros;
|
||||
using static Snap.Hutao.Win32.Ole32;
|
||||
using static Snap.Hutao.Win32.Shell32;
|
||||
|
||||
namespace Snap.Hutao.Core.IO;
|
||||
|
||||
@@ -18,4 +23,29 @@ internal static class DirectoryOperation
|
||||
FileSystem.MoveDirectory(sourceDirName, destDirName, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static unsafe bool UnsafeRename(string path, string name, FILEOPERATION_FLAGS flags = FILEOPERATION_FLAGS.FOF_ALLOWUNDO | FILEOPERATION_FLAGS.FOF_NOCONFIRMMKDIR)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if (SUCCEEDED(CoCreateInstance(in Win32.UI.Shell.FileOperation.CLSID, default, CLSCTX.CLSCTX_INPROC_SERVER, in IFileOperation.IID, out IFileOperation* pFileOperation)))
|
||||
{
|
||||
if (SUCCEEDED(SHCreateItemFromParsingName(path, default, in IShellItem.IID, out IShellItem* pShellItem)))
|
||||
{
|
||||
pFileOperation->SetOperationFlags(flags);
|
||||
pFileOperation->RenameItem(pShellItem, name, default);
|
||||
|
||||
if (SUCCEEDED(pFileOperation->PerformOperations()))
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
|
||||
IUnknownMarshal.Release(pShellItem);
|
||||
}
|
||||
|
||||
IUnknownMarshal.Release(pFileOperation);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,30 @@ internal static class FileOperation
|
||||
return true;
|
||||
}
|
||||
|
||||
public static unsafe bool UnsafeDelete(string path)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if (SUCCEEDED(CoCreateInstance(in Win32.UI.Shell.FileOperation.CLSID, default, CLSCTX.CLSCTX_INPROC_SERVER, in IFileOperation.IID, out IFileOperation* pFileOperation)))
|
||||
{
|
||||
if (SUCCEEDED(SHCreateItemFromParsingName(path, default, in IShellItem.IID, out IShellItem* pShellItem)))
|
||||
{
|
||||
pFileOperation->DeleteItem(pShellItem, default);
|
||||
|
||||
if (SUCCEEDED(pFileOperation->PerformOperations()))
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
|
||||
IUnknownMarshal.Release(pShellItem);
|
||||
}
|
||||
|
||||
IUnknownMarshal.Release(pFileOperation);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static unsafe bool UnsafeMove(string sourceFileName, string destFileName)
|
||||
{
|
||||
bool result = false;
|
||||
@@ -73,28 +97,4 @@ internal static class FileOperation
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static unsafe bool UnsafeDelete(string path)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if (SUCCEEDED(CoCreateInstance(in Win32.UI.Shell.FileOperation.CLSID, default, CLSCTX.CLSCTX_INPROC_SERVER, in IFileOperation.IID, out IFileOperation* pFileOperation)))
|
||||
{
|
||||
if (SUCCEEDED(SHCreateItemFromParsingName(path, default, in IShellItem.IID, out IShellItem* pShellItem)))
|
||||
{
|
||||
pFileOperation->DeleteItem(pShellItem, default);
|
||||
|
||||
if (SUCCEEDED(pFileOperation->PerformOperations()))
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
|
||||
IUnknownMarshal.Release(pShellItem);
|
||||
}
|
||||
|
||||
IUnknownMarshal.Release(pFileOperation);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,9 @@ using System.Text;
|
||||
|
||||
namespace Snap.Hutao.Core.IO.Hashing;
|
||||
|
||||
#if NET9_0_OR_GREATER
|
||||
[Obsolete]
|
||||
#endif
|
||||
internal static class Hash
|
||||
{
|
||||
public static unsafe string SHA1HexString(string input)
|
||||
|
||||
@@ -3,13 +3,14 @@
|
||||
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Snap.Hutao.Win32.Registry;
|
||||
using System.Linq.Expressions;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Snap.Hutao.Core.IO.Http.Proxy;
|
||||
|
||||
[Injection(InjectAs.Singleton)]
|
||||
internal sealed partial class DynamicHttpProxy : ObservableObject, IWebProxy, IDisposable
|
||||
internal sealed partial class HttpProxyUsingSystemProxy : ObservableObject, IWebProxy, IDisposable
|
||||
{
|
||||
private const string ProxySettingPath = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections";
|
||||
|
||||
@@ -20,7 +21,7 @@ internal sealed partial class DynamicHttpProxy : ObservableObject, IWebProxy, ID
|
||||
|
||||
private IWebProxy innerProxy = default!;
|
||||
|
||||
public DynamicHttpProxy(IServiceProvider serviceProvider)
|
||||
public HttpProxyUsingSystemProxy(IServiceProvider serviceProvider)
|
||||
{
|
||||
this.serviceProvider = serviceProvider;
|
||||
UpdateInnerProxy();
|
||||
@@ -50,13 +50,6 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi
|
||||
/// <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;
|
||||
}
|
||||
|
||||
HandleActivationAsync(args).SafeForget();
|
||||
}
|
||||
|
||||
@@ -69,6 +62,7 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi
|
||||
using (activateSemaphore.Enter())
|
||||
{
|
||||
// TODO: Introduced in 1.10.2, remove in later version
|
||||
serviceProvider.GetRequiredService<IJumpListInterop>().ClearAsync().SafeForget();
|
||||
serviceProvider.GetRequiredService<IScheduleTaskInterop>().UnregisterAllTasks();
|
||||
|
||||
if (UnsafeLocalSetting.Get(SettingKeys.Major1Minor10Revision0GuideState, GuideState.Language) < GuideState.Completed)
|
||||
@@ -80,7 +74,7 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi
|
||||
|
||||
if (serviceProvider.GetRequiredService<AppOptions>().IsNotifyIconEnabled)
|
||||
{
|
||||
XamlWindowLifetime.ApplicationLaunchedWithNotifyIcon = true;
|
||||
XamlLifetime.ApplicationLaunchedWithNotifyIcon = true;
|
||||
serviceProvider.GetRequiredService<App>().DispatcherShutdownMode = DispatcherShutdownMode.OnExplicitShutdown;
|
||||
_ = serviceProvider.GetRequiredService<NotifyIconController>();
|
||||
}
|
||||
@@ -102,25 +96,31 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi
|
||||
|
||||
await taskContext.SwitchToMainThreadAsync();
|
||||
|
||||
if (currentWindowReference.Window is null)
|
||||
switch (currentWindowReference.Window)
|
||||
{
|
||||
currentWindowReference.Window = serviceProvider.GetRequiredService<LaunchGameWindow>();
|
||||
return;
|
||||
}
|
||||
case null:
|
||||
LaunchGameWindow launchGameWindow = serviceProvider.GetRequiredService<LaunchGameWindow>();
|
||||
currentWindowReference.Window = launchGameWindow;
|
||||
|
||||
if (currentWindowReference.Window is MainWindow)
|
||||
{
|
||||
await serviceProvider
|
||||
.GetRequiredService<INavigationService>()
|
||||
.NavigateAsync<View.Page.LaunchGamePage>(INavigationAwaiter.Default, true)
|
||||
.ConfigureAwait(false);
|
||||
launchGameWindow.SwitchTo();
|
||||
launchGameWindow.BringToForeground();
|
||||
return;
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// We have a non-Main Window, just exit current process anyway
|
||||
Process.GetCurrentProcess().Kill();
|
||||
case MainWindow:
|
||||
await serviceProvider
|
||||
.GetRequiredService<INavigationService>()
|
||||
.NavigateAsync<View.Page.LaunchGamePage>(INavigationAwaiter.Default, true)
|
||||
.ConfigureAwait(false);
|
||||
return;
|
||||
|
||||
case LaunchGameWindow currentLaunchGameWindow:
|
||||
currentLaunchGameWindow.SwitchTo();
|
||||
currentLaunchGameWindow.BringToForeground();
|
||||
return;
|
||||
|
||||
default:
|
||||
Process.GetCurrentProcess().Kill();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,48 +163,61 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi
|
||||
{
|
||||
default:
|
||||
{
|
||||
await HandleNormalLaunchActionAsync().ConfigureAwait(false);
|
||||
await HandleNormalLaunchActionAsync(args.IsRedirectTo).ConfigureAwait(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async ValueTask HandleNormalLaunchActionAsync()
|
||||
private async ValueTask HandleNormalLaunchActionAsync(bool isRedirectTo)
|
||||
{
|
||||
// Increase launch times
|
||||
LocalSetting.Update(SettingKeys.LaunchTimes, 0, x => unchecked(x + 1));
|
||||
|
||||
// If the guide is completed, we check if there's any unfulfilled resource category present.
|
||||
if (UnsafeLocalSetting.Get(SettingKeys.Major1Minor10Revision0GuideState, GuideState.Language) >= GuideState.StaticResourceBegin)
|
||||
if (!isRedirectTo)
|
||||
{
|
||||
if (StaticResource.IsAnyUnfulfilledCategoryPresent())
|
||||
// Increase launch times
|
||||
LocalSetting.Update(SettingKeys.LaunchTimes, 0, x => unchecked(x + 1));
|
||||
|
||||
// If the guide is completed, we check if there's any unfulfilled resource category present.
|
||||
if (UnsafeLocalSetting.Get(SettingKeys.Major1Minor10Revision0GuideState, GuideState.Language) >= GuideState.StaticResourceBegin)
|
||||
{
|
||||
UnsafeLocalSetting.Set(SettingKeys.Major1Minor10Revision0GuideState, GuideState.StaticResourceBegin);
|
||||
if (StaticResource.IsAnyUnfulfilledCategoryPresent())
|
||||
{
|
||||
UnsafeLocalSetting.Set(SettingKeys.Major1Minor10Revision0GuideState, GuideState.StaticResourceBegin);
|
||||
}
|
||||
}
|
||||
|
||||
if (UnsafeLocalSetting.Get(SettingKeys.Major1Minor10Revision0GuideState, GuideState.Language) < GuideState.Completed)
|
||||
{
|
||||
await taskContext.SwitchToMainThreadAsync();
|
||||
|
||||
GuideWindow guideWindow = serviceProvider.GetRequiredService<GuideWindow>();
|
||||
currentWindowReference.Window = guideWindow;
|
||||
|
||||
guideWindow.SwitchTo();
|
||||
guideWindow.BringToForeground();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (UnsafeLocalSetting.Get(SettingKeys.Major1Minor10Revision0GuideState, GuideState.Language) < GuideState.Completed)
|
||||
{
|
||||
await taskContext.SwitchToMainThreadAsync();
|
||||
currentWindowReference.Window = serviceProvider.GetRequiredService<GuideWindow>();
|
||||
}
|
||||
else
|
||||
{
|
||||
await WaitMainWindowAsync().ConfigureAwait(false);
|
||||
}
|
||||
await WaitMainWindowOrCurrentAsync().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async ValueTask WaitMainWindowAsync()
|
||||
private async ValueTask WaitMainWindowOrCurrentAsync()
|
||||
{
|
||||
if (currentWindowReference.Window is not null)
|
||||
if (currentWindowReference.Window is { } window)
|
||||
{
|
||||
window.SwitchTo();
|
||||
window.BringToForeground();
|
||||
return;
|
||||
}
|
||||
|
||||
await taskContext.SwitchToMainThreadAsync();
|
||||
|
||||
currentWindowReference.Window = serviceProvider.GetRequiredService<MainWindow>();
|
||||
MainWindow mainWindow = serviceProvider.GetRequiredService<MainWindow>();
|
||||
currentWindowReference.Window = mainWindow;
|
||||
|
||||
mainWindow.SwitchTo();
|
||||
mainWindow.BringToForeground();
|
||||
|
||||
await taskContext.SwitchToBackgroundAsync();
|
||||
|
||||
@@ -233,7 +246,7 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi
|
||||
{
|
||||
case CategoryAchievement:
|
||||
{
|
||||
await WaitMainWindowAsync().ConfigureAwait(false);
|
||||
await WaitMainWindowOrCurrentAsync().ConfigureAwait(false);
|
||||
await HandleAchievementActionAsync(action, parameter, isRedirectTo).ConfigureAwait(false);
|
||||
break;
|
||||
}
|
||||
@@ -246,7 +259,7 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi
|
||||
|
||||
default:
|
||||
{
|
||||
await HandleNormalLaunchActionAsync().ConfigureAwait(false);
|
||||
await HandleNormalLaunchActionAsync(isRedirectTo).ConfigureAwait(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.Extensions.Primitives;
|
||||
using Microsoft.Windows.AppLifecycle;
|
||||
|
||||
namespace Snap.Hutao.Core.LifeCycle;
|
||||
@@ -9,6 +10,8 @@ internal sealed class HutaoActivationArguments
|
||||
{
|
||||
public bool IsRedirectTo { get; set; }
|
||||
|
||||
public bool IsToastActivated { get; set; }
|
||||
|
||||
public HutaoActivationKind Kind { get; set; }
|
||||
|
||||
public Uri? ProtocolActivatedUri { get; set; }
|
||||
@@ -30,6 +33,15 @@ internal sealed class HutaoActivationArguments
|
||||
if (args.TryGetLaunchActivatedArguments(out string? arguments))
|
||||
{
|
||||
result.LaunchActivatedArguments = arguments;
|
||||
|
||||
foreach (StringSegment segment in new StringTokenizer(arguments, [' ']))
|
||||
{
|
||||
if (segment.AsSpan().SequenceEqual("-ToastActivated"))
|
||||
{
|
||||
result.Kind = HutaoActivationKind.Toast;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -7,5 +7,6 @@ internal enum HutaoActivationKind
|
||||
{
|
||||
None,
|
||||
Launch,
|
||||
Toast,
|
||||
Protocol,
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Core.LifeCycle.InterProcess.Model;
|
||||
|
||||
internal sealed class ElevationStatusResponse
|
||||
{
|
||||
public ElevationStatusResponse(bool isElevated)
|
||||
{
|
||||
IsElevated = isElevated;
|
||||
}
|
||||
|
||||
public bool IsElevated { get; set; }
|
||||
}
|
||||
@@ -6,6 +6,9 @@ namespace Snap.Hutao.Core.LifeCycle.InterProcess;
|
||||
internal enum PipePacketCommand : byte
|
||||
{
|
||||
None = 0,
|
||||
Exit = 1,
|
||||
|
||||
RedirectActivation = 10,
|
||||
RequestElevationStatus = 11,
|
||||
ResponseElevationStatus = 12,
|
||||
}
|
||||
@@ -8,5 +8,5 @@ internal enum PipePacketType : byte
|
||||
None = 0,
|
||||
Request = 1,
|
||||
Response = 2,
|
||||
Termination = 3,
|
||||
SessionTermination = 3,
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Core.ExceptionService;
|
||||
using System.Buffers;
|
||||
using System.IO.Hashing;
|
||||
using System.IO.Pipes;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Snap.Hutao.Core.LifeCycle.InterProcess;
|
||||
|
||||
internal static class PipeStreamExtension
|
||||
{
|
||||
public static TData? ReadJsonContent<TData>(this PipeStream stream, ref readonly PipePacketHeader header)
|
||||
{
|
||||
using (IMemoryOwner<byte> memoryOwner = MemoryPool<byte>.Shared.Rent(header.ContentLength))
|
||||
{
|
||||
Span<byte> content = memoryOwner.Memory.Span[..header.ContentLength];
|
||||
stream.ReadExactly(content);
|
||||
|
||||
HutaoException.ThrowIf(XxHash64.HashToUInt64(content) != header.Checksum, "PipePacket Content Hash incorrect");
|
||||
return JsonSerializer.Deserialize<TData>(content);
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void ReadPacket<TData>(this PipeStream stream, out PipePacketHeader header, out TData? data)
|
||||
where TData : class
|
||||
{
|
||||
data = default;
|
||||
|
||||
stream.ReadPacket(out header);
|
||||
if (header.ContentType is PipePacketContentType.Json)
|
||||
{
|
||||
data = stream.ReadJsonContent<TData>(in header);
|
||||
}
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static unsafe void ReadPacket(this PipeStream stream, out PipePacketHeader header)
|
||||
{
|
||||
fixed (PipePacketHeader* pHeader = &header)
|
||||
{
|
||||
stream.ReadExactly(new(pHeader, sizeof(PipePacketHeader)));
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void WritePacketWithJsonContent<TData>(this PipeStream stream, byte version, PipePacketType type, PipePacketCommand command, TData data)
|
||||
{
|
||||
PipePacketHeader header = default;
|
||||
header.Version = version;
|
||||
header.Type = type;
|
||||
header.Command = command;
|
||||
header.ContentType = PipePacketContentType.Json;
|
||||
|
||||
stream.WritePacket(ref header, JsonSerializer.SerializeToUtf8Bytes(data));
|
||||
}
|
||||
|
||||
public static unsafe void WritePacket(this PipeStream stream, ref PipePacketHeader header, byte[] content)
|
||||
{
|
||||
header.ContentLength = content.Length;
|
||||
header.Checksum = XxHash64.HashToUInt64(content);
|
||||
|
||||
stream.WritePacket(in header);
|
||||
stream.Write(content);
|
||||
}
|
||||
|
||||
public static unsafe void WritePacket(this PipeStream stream, byte version, PipePacketType type, PipePacketCommand command)
|
||||
{
|
||||
PipePacketHeader header = default;
|
||||
header.Version = version;
|
||||
header.Type = type;
|
||||
header.Command = command;
|
||||
|
||||
stream.WritePacket(in header);
|
||||
}
|
||||
|
||||
public static unsafe void WritePacket(this PipeStream stream, ref readonly PipePacketHeader header)
|
||||
{
|
||||
fixed (PipePacketHeader* pHeader = &header)
|
||||
{
|
||||
stream.Write(new(pHeader, sizeof(PipePacketHeader)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Core.LifeCycle.InterProcess;
|
||||
|
||||
internal static class PrivateNamedPipe
|
||||
{
|
||||
public const int Version = 1;
|
||||
public const string Name = "Snap.Hutao.PrivateNamedPipe";
|
||||
}
|
||||
@@ -2,45 +2,39 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.Windows.AppLifecycle;
|
||||
using System.IO.Hashing;
|
||||
using Snap.Hutao.Core.LifeCycle.InterProcess.Model;
|
||||
using System.IO.Pipes;
|
||||
|
||||
namespace Snap.Hutao.Core.LifeCycle.InterProcess;
|
||||
|
||||
[Injection(InjectAs.Singleton)]
|
||||
internal sealed class PrivateNamedPipeClient : IDisposable
|
||||
[ConstructorGenerated]
|
||||
internal sealed partial class PrivateNamedPipeClient : IDisposable
|
||||
{
|
||||
private readonly NamedPipeClientStream clientStream = new(".", "Snap.Hutao.PrivateNamedPipe", PipeDirection.InOut, PipeOptions.Asynchronous | PipeOptions.WriteThrough);
|
||||
private readonly NamedPipeClientStream clientStream = new(".", PrivateNamedPipe.Name, PipeDirection.InOut, PipeOptions.Asynchronous | PipeOptions.WriteThrough);
|
||||
private readonly RuntimeOptions runtimeOptions;
|
||||
|
||||
public unsafe bool TryRedirectActivationTo(AppActivationArguments args)
|
||||
{
|
||||
if (clientStream.TryConnectOnce())
|
||||
{
|
||||
clientStream.WritePacket(PrivateNamedPipe.Version, PipePacketType.Request, PipePacketCommand.RequestElevationStatus);
|
||||
clientStream.ReadPacket(out PipePacketHeader header, out ElevationStatusResponse? response);
|
||||
ArgumentNullException.ThrowIfNull(response);
|
||||
|
||||
// Prefer elevated instance
|
||||
if (runtimeOptions.IsElevated && !response.IsElevated)
|
||||
{
|
||||
PipePacketHeader redirectActivationPacket = default;
|
||||
redirectActivationPacket.Version = 1;
|
||||
redirectActivationPacket.Type = PipePacketType.Request;
|
||||
redirectActivationPacket.Command = PipePacketCommand.RedirectActivation;
|
||||
redirectActivationPacket.ContentType = PipePacketContentType.Json;
|
||||
|
||||
HutaoActivationArguments hutaoArgs = HutaoActivationArguments.FromAppActivationArguments(args, isRedirected: true);
|
||||
byte[] jsonBytes = JsonSerializer.SerializeToUtf8Bytes(hutaoArgs);
|
||||
|
||||
redirectActivationPacket.ContentLength = jsonBytes.Length;
|
||||
redirectActivationPacket.Checksum = XxHash64.HashToUInt64(jsonBytes);
|
||||
|
||||
clientStream.Write(new(&redirectActivationPacket, sizeof(PipePacketHeader)));
|
||||
clientStream.Write(jsonBytes);
|
||||
}
|
||||
|
||||
{
|
||||
PipePacketHeader terminationPacket = default;
|
||||
terminationPacket.Version = 1;
|
||||
terminationPacket.Type = PipePacketType.Termination;
|
||||
|
||||
clientStream.Write(new(&terminationPacket, sizeof(PipePacketHeader)));
|
||||
// Notify previous instance to exit
|
||||
clientStream.WritePacket(PrivateNamedPipe.Version, PipePacketType.SessionTermination, PipePacketCommand.Exit);
|
||||
clientStream.Flush();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Redirect to previous instance
|
||||
HutaoActivationArguments hutaoArgs = HutaoActivationArguments.FromAppActivationArguments(args, isRedirected: true);
|
||||
clientStream.WritePacketWithJsonContent(PrivateNamedPipe.Version, PipePacketType.Request, PipePacketCommand.RedirectActivation, hutaoArgs);
|
||||
clientStream.WritePacket(PrivateNamedPipe.Version, PipePacketType.SessionTermination, PipePacketCommand.None);
|
||||
clientStream.Flush();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -18,4 +18,11 @@ internal sealed partial class PrivateNamedPipeMessageDispatcher
|
||||
|
||||
serviceProvider.GetRequiredService<IAppActivation>().Activate(args);
|
||||
}
|
||||
|
||||
public void ExitApplication()
|
||||
{
|
||||
ITaskContext taskContext = serviceProvider.GetRequiredService<ITaskContext>();
|
||||
App app = serviceProvider.GetRequiredService<App>();
|
||||
taskContext.BeginInvokeOnMainThread(app.Exit);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,50 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Core.ExceptionService;
|
||||
using System.IO.Hashing;
|
||||
using Snap.Hutao.Core.LifeCycle.InterProcess.Model;
|
||||
using System.IO.Pipes;
|
||||
using System.Security.AccessControl;
|
||||
using System.Security.Principal;
|
||||
|
||||
namespace Snap.Hutao.Core.LifeCycle.InterProcess;
|
||||
|
||||
[Injection(InjectAs.Singleton)]
|
||||
[ConstructorGenerated]
|
||||
internal sealed partial class PrivateNamedPipeServer : IDisposable
|
||||
{
|
||||
private readonly PrivateNamedPipeMessageDispatcher messageDispatcher;
|
||||
private readonly RuntimeOptions runtimeOptions;
|
||||
|
||||
private readonly NamedPipeServerStream serverStream = new("Snap.Hutao.PrivateNamedPipe", PipeDirection.InOut, NamedPipeServerStream.MaxAllowedServerInstances, PipeTransmissionMode.Byte, PipeOptions.Asynchronous | PipeOptions.WriteThrough);
|
||||
private readonly CancellationTokenSource serverTokenSource = new();
|
||||
private readonly SemaphoreSlim serverSemaphore = new(1);
|
||||
|
||||
private readonly NamedPipeServerStream serverStream;
|
||||
|
||||
public PrivateNamedPipeServer(IServiceProvider serviceProvider)
|
||||
{
|
||||
messageDispatcher = serviceProvider.GetRequiredService<PrivateNamedPipeMessageDispatcher>();
|
||||
runtimeOptions = serviceProvider.GetRequiredService<RuntimeOptions>();
|
||||
|
||||
PipeSecurity? pipeSecurity = default;
|
||||
|
||||
if (runtimeOptions.IsElevated)
|
||||
{
|
||||
SecurityIdentifier everyOne = new(WellKnownSidType.WorldSid, null);
|
||||
|
||||
pipeSecurity = new();
|
||||
pipeSecurity.AddAccessRule(new PipeAccessRule(everyOne, PipeAccessRights.FullControl, AccessControlType.Allow));
|
||||
}
|
||||
|
||||
serverStream = NamedPipeServerStreamAcl.Create(
|
||||
PrivateNamedPipe.Name,
|
||||
PipeDirection.InOut,
|
||||
NamedPipeServerStream.MaxAllowedServerInstances,
|
||||
PipeTransmissionMode.Byte,
|
||||
PipeOptions.Asynchronous | PipeOptions.WriteThrough,
|
||||
0,
|
||||
0,
|
||||
pipeSecurity);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
serverTokenSource.Cancel();
|
||||
@@ -45,36 +73,30 @@ internal sealed partial class PrivateNamedPipeServer : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
private static unsafe byte[] GetValidatedContent(NamedPipeServerStream serverStream, PipePacketHeader* header)
|
||||
{
|
||||
byte[] content = new byte[header->ContentLength];
|
||||
serverStream.ReadAtLeast(content, header->ContentLength, false);
|
||||
HutaoException.ThrowIf(XxHash64.HashToUInt64(content) != header->Checksum, "PipePacket Content Hash incorrect");
|
||||
return content;
|
||||
}
|
||||
|
||||
private unsafe void RunPacketSession(NamedPipeServerStream serverStream, CancellationToken token)
|
||||
{
|
||||
Span<byte> headerSpan = stackalloc byte[sizeof(PipePacketHeader)];
|
||||
bool sessionTerminated = false;
|
||||
while (serverStream.IsConnected && !sessionTerminated && !token.IsCancellationRequested)
|
||||
while (serverStream.IsConnected && !token.IsCancellationRequested)
|
||||
{
|
||||
serverStream.ReadExactly(headerSpan);
|
||||
fixed (byte* pHeader = headerSpan)
|
||||
serverStream.ReadPacket(out PipePacketHeader header);
|
||||
switch ((header.Type, header.Command))
|
||||
{
|
||||
PipePacketHeader* header = (PipePacketHeader*)pHeader;
|
||||
case (PipePacketType.Request, PipePacketCommand.RequestElevationStatus):
|
||||
ElevationStatusResponse resp = new(runtimeOptions.IsElevated);
|
||||
serverStream.WritePacketWithJsonContent(PrivateNamedPipe.Version, PipePacketType.Response, PipePacketCommand.ResponseElevationStatus, resp);
|
||||
serverStream.Flush();
|
||||
break;
|
||||
case (PipePacketType.Request, PipePacketCommand.RedirectActivation):
|
||||
HutaoActivationArguments? hutaoArgs = serverStream.ReadJsonContent<HutaoActivationArguments>(in header);
|
||||
messageDispatcher.RedirectActivation(hutaoArgs);
|
||||
break;
|
||||
case (PipePacketType.SessionTermination, _):
|
||||
serverStream.Disconnect();
|
||||
if (header.Command is PipePacketCommand.Exit)
|
||||
{
|
||||
messageDispatcher.ExitApplication();
|
||||
}
|
||||
|
||||
switch ((header->Type, header->Command, header->ContentType))
|
||||
{
|
||||
case (PipePacketType.Request, PipePacketCommand.RedirectActivation, PipePacketContentType.Json):
|
||||
ReadOnlySpan<byte> content = GetValidatedContent(serverStream, header);
|
||||
messageDispatcher.RedirectActivation(JsonSerializer.Deserialize<HutaoActivationArguments>(content));
|
||||
break;
|
||||
case (PipePacketType.Termination, _, _):
|
||||
serverStream.Disconnect();
|
||||
sessionTerminated = true;
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,4 +27,11 @@ internal static class RuntimeOptionsExtension
|
||||
Directory.CreateDirectory(directory);
|
||||
return directory;
|
||||
}
|
||||
|
||||
public static string GetLocalCacheImageCacheFolder(this RuntimeOptions options)
|
||||
{
|
||||
string directory = Path.Combine(options.LocalCache, "ImageCache");
|
||||
Directory.CreateDirectory(directory);
|
||||
return directory;
|
||||
}
|
||||
}
|
||||
9
src/Snap.Hutao/Snap.Hutao/Core/Shell/IJumpListInterop.cs
Normal file
9
src/Snap.Hutao/Snap.Hutao/Core/Shell/IJumpListInterop.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Core.Shell;
|
||||
|
||||
internal interface IJumpListInterop
|
||||
{
|
||||
ValueTask ClearAsync();
|
||||
}
|
||||
22
src/Snap.Hutao/Snap.Hutao/Core/Shell/JumpListInterop.cs
Normal file
22
src/Snap.Hutao/Snap.Hutao/Core/Shell/JumpListInterop.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Windows.UI.StartScreen;
|
||||
|
||||
namespace Snap.Hutao.Core.Shell;
|
||||
|
||||
[Injection(InjectAs.Transient, typeof(IJumpListInterop))]
|
||||
internal sealed class JumpListInterop : IJumpListInterop
|
||||
{
|
||||
public async ValueTask ClearAsync()
|
||||
{
|
||||
if (JumpList.IsSupported())
|
||||
{
|
||||
JumpList list = await JumpList.LoadCurrentAsync();
|
||||
|
||||
list.Items.Clear();
|
||||
|
||||
await list.SaveAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,7 +67,7 @@ internal sealed partial class ShellLinkInterop : IShellLinkInterop
|
||||
IUnknownMarshal.Release(pPersistFile);
|
||||
}
|
||||
|
||||
uint value = IUnknownMarshal.Release(pShellLink);
|
||||
IUnknownMarshal.Release(pShellLink);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -7,22 +7,22 @@ namespace Snap.Hutao.Core.Threading;
|
||||
|
||||
internal static class SpinWaitPolyfill
|
||||
{
|
||||
public static unsafe void SpinUntil<T>(ref T state, delegate*<ref readonly T, bool> condition)
|
||||
public static unsafe void SpinUntil<T>(ref readonly T state, delegate*<ref readonly T, bool> condition)
|
||||
{
|
||||
SpinWait spinner = default;
|
||||
while (!condition(ref state))
|
||||
while (!condition(in state))
|
||||
{
|
||||
spinner.SpinOnce();
|
||||
}
|
||||
}
|
||||
|
||||
[SuppressMessage("", "SH002")]
|
||||
public static unsafe bool SpinUntil<T>(ref T state, delegate*<ref readonly T, bool> condition, TimeSpan timeout)
|
||||
public static unsafe bool SpinUntil<T>(ref readonly T state, delegate*<ref readonly T, bool> condition, TimeSpan timeout)
|
||||
{
|
||||
long startTime = Stopwatch.GetTimestamp();
|
||||
|
||||
SpinWait spinner = default;
|
||||
while (!condition(ref state))
|
||||
while (!condition(in state))
|
||||
{
|
||||
spinner.SpinOnce();
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ internal static class TypeNameHelper
|
||||
|
||||
if (builder is null)
|
||||
{
|
||||
if (options.NestedTypeDelimiter != DefaultNestedTypeDelimiter)
|
||||
if (options.NestedTypeDelimiter is not DefaultNestedTypeDelimiter)
|
||||
{
|
||||
return name.Replace(DefaultNestedTypeDelimiter, options.NestedTypeDelimiter);
|
||||
}
|
||||
@@ -112,7 +112,7 @@ internal static class TypeNameHelper
|
||||
}
|
||||
|
||||
builder.Append(name);
|
||||
if (options.NestedTypeDelimiter != DefaultNestedTypeDelimiter)
|
||||
if (options.NestedTypeDelimiter is not DefaultNestedTypeDelimiter)
|
||||
{
|
||||
builder.Replace(DefaultNestedTypeDelimiter, options.NestedTypeDelimiter, builder.Length - name.Length, name.Length);
|
||||
}
|
||||
|
||||
@@ -8,4 +8,6 @@ namespace Snap.Hutao.Core.Windowing.Abstraction;
|
||||
internal interface IXamlWindowHasInitSize
|
||||
{
|
||||
SizeInt32 InitSize { get; }
|
||||
|
||||
SizeInt32 MinSize { get; }
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Snap.Hutao.Control.Extension;
|
||||
using Snap.Hutao.ViewModel;
|
||||
|
||||
namespace Snap.Hutao.Core.Windowing.NotifyIcon;
|
||||
@@ -12,6 +13,6 @@ internal sealed partial class NotifyIconContextMenu : Flyout
|
||||
{
|
||||
AllowFocusOnInteraction = false;
|
||||
InitializeComponent();
|
||||
Root.DataContext = serviceProvider.GetRequiredService<NotifyIconViewModel>();
|
||||
Root.InitializeDataContext<NotifyIconViewModel>(serviceProvider);
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,7 @@ internal sealed class NotifyIconController : IDisposable
|
||||
{
|
||||
TaskbarCreated = OnRecreateNotifyIconRequested,
|
||||
ContextMenuRequested = OnContextMenuRequested,
|
||||
IconSelected = OnContextMenuRequested,
|
||||
};
|
||||
|
||||
CreateNotifyIcon();
|
||||
|
||||
@@ -62,6 +62,8 @@ internal sealed class NotifyIconMessageWindow : IDisposable
|
||||
|
||||
public Action<NotifyIconMessageWindow, PointUInt16>? ContextMenuRequested { get; set; }
|
||||
|
||||
public Action<NotifyIconMessageWindow, PointUInt16>? IconSelected { get; set; }
|
||||
|
||||
public HWND HWND { get; }
|
||||
|
||||
public void Dispose()
|
||||
@@ -116,6 +118,7 @@ internal sealed class NotifyIconMessageWindow : IDisposable
|
||||
break;
|
||||
case NIN_SELECT:
|
||||
// X: wParam2.X Y: wParam2.Y Low: NIN_SELECT
|
||||
window.IconSelected?.Invoke(window, wParam2);
|
||||
break;
|
||||
case NIN_POPUPOPEN:
|
||||
// X: wParam2.X Y: 0? Low: NIN_POPUPOPEN
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
using Windows.Graphics;
|
||||
|
||||
namespace Snap.Hutao.Core.Windowing;
|
||||
|
||||
internal readonly struct CompactRect
|
||||
internal readonly struct RectInt16
|
||||
{
|
||||
private readonly short x;
|
||||
private readonly short y;
|
||||
private readonly short width;
|
||||
private readonly short height;
|
||||
|
||||
private CompactRect(int x, int y, int width, int height)
|
||||
private RectInt16(int x, int y, int width, int height)
|
||||
{
|
||||
this.x = (short)x;
|
||||
this.y = (short)y;
|
||||
@@ -21,24 +20,22 @@ internal readonly struct CompactRect
|
||||
this.height = (short)height;
|
||||
}
|
||||
|
||||
public static implicit operator RectInt32(CompactRect rect)
|
||||
public static implicit operator RectInt32(RectInt16 rect)
|
||||
{
|
||||
return new(rect.x, rect.y, rect.width, rect.height);
|
||||
}
|
||||
|
||||
public static explicit operator CompactRect(RectInt32 rect)
|
||||
public static explicit operator RectInt16(RectInt32 rect)
|
||||
{
|
||||
return new(rect.X, rect.Y, rect.Width, rect.Height);
|
||||
}
|
||||
|
||||
public static unsafe explicit operator CompactRect(ulong value)
|
||||
public static unsafe explicit operator RectInt16(ulong value)
|
||||
{
|
||||
Unsafe.SkipInit(out CompactRect rect);
|
||||
*(ulong*)&rect = value;
|
||||
return rect;
|
||||
return *(RectInt16*)&value;
|
||||
}
|
||||
|
||||
public static unsafe implicit operator ulong(CompactRect rect)
|
||||
public static unsafe implicit operator ulong(RectInt16 rect)
|
||||
{
|
||||
return *(ulong*)▭
|
||||
}
|
||||
@@ -63,7 +63,8 @@ internal static class WindowExtension
|
||||
{
|
||||
ShowWindow(hwnd, SHOW_WINDOW_CMD.SW_SHOW);
|
||||
}
|
||||
else if (IsIconic(hwnd))
|
||||
|
||||
if (IsIconic(hwnd))
|
||||
{
|
||||
ShowWindow(hwnd, SHOW_WINDOW_CMD.SW_RESTORE);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
namespace Snap.Hutao.Core.Windowing;
|
||||
|
||||
internal static class XamlWindowLifetime
|
||||
internal static class XamlLifetime
|
||||
{
|
||||
public static bool ApplicationLaunchedWithNotifyIcon { get; set; }
|
||||
|
||||
@@ -99,14 +99,12 @@ internal sealed class XamlWindowController
|
||||
|
||||
private void OnWindowClosed(object sender, WindowEventArgs args)
|
||||
{
|
||||
if (XamlWindowLifetime.ApplicationLaunchedWithNotifyIcon && !XamlWindowLifetime.ApplicationExiting)
|
||||
if (XamlLifetime.ApplicationLaunchedWithNotifyIcon && !XamlLifetime.ApplicationExiting)
|
||||
{
|
||||
args.Handled = true;
|
||||
window.Hide();
|
||||
|
||||
RECT iconRect = serviceProvider.GetRequiredService<NotifyIconController>().GetRect();
|
||||
RECT primaryRect = StructMarshal.RECT(DisplayArea.Primary.OuterBounds);
|
||||
if (!IntersectRect(out _, in primaryRect, in iconRect))
|
||||
if (!IsNotifyIconVisible())
|
||||
{
|
||||
new ToastContentBuilder()
|
||||
.AddText(SH.CoreWindowingNotifyIconPromotedHint)
|
||||
@@ -133,6 +131,35 @@ internal sealed class XamlWindowController
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsNotifyIconVisible()
|
||||
{
|
||||
// Shell_NotifyIconGetRect returns E_FAIL when Shell_TrayWnd is not present,
|
||||
// We pre-check it to avoid the exception.
|
||||
HWND shellTrayWnd = FindWindowExW(default, default, "Shell_TrayWnd", default);
|
||||
if (shellTrayWnd == default)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
RECT iconRect = serviceProvider.GetRequiredService<NotifyIconController>().GetRect();
|
||||
|
||||
if (UniversalApiContract.IsPresent(WindowsVersion.Windows11))
|
||||
{
|
||||
RECT primaryRect = StructMarshal.RECT(DisplayArea.Primary.OuterBounds);
|
||||
return IntersectRect(out _, in primaryRect, in iconRect);
|
||||
}
|
||||
|
||||
HWND trayNotifyWnd = FindWindowExW(shellTrayWnd, default, "TrayNotifyWnd", default);
|
||||
HWND button = FindWindowExW(trayNotifyWnd, default, "Button", default);
|
||||
|
||||
if (GetWindowRect(button, out RECT buttonRect))
|
||||
{
|
||||
return !EqualRect(in buttonRect, in iconRect);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#region SystemBackdrop & ElementTheme
|
||||
|
||||
private void OnOptionsPropertyChanged(object? sender, PropertyChangedEventArgs e)
|
||||
@@ -210,15 +237,18 @@ internal sealed class XamlWindowController
|
||||
private void RecoverOrInitWindowSize(IXamlWindowHasInitSize xamlWindow)
|
||||
{
|
||||
double scale = window.GetRasterizationScale();
|
||||
SizeInt32 scaledSize = xamlWindow.InitSize.Scale(scale);
|
||||
RectInt32 rect = StructMarshal.RectInt32(scaledSize);
|
||||
RectInt32 rect = StructMarshal.RectInt32(xamlWindow.InitSize.Scale(scale));
|
||||
|
||||
if (window is IXamlWindowRectPersisted rectPersisted)
|
||||
{
|
||||
RectInt32 persistedRect = (CompactRect)LocalSetting.Get(rectPersisted.PersistRectKey, (CompactRect)rect);
|
||||
if (persistedRect.Size() >= xamlWindow.InitSize.Size())
|
||||
RectInt32 nonDpiPersistedRect = (RectInt16)LocalSetting.Get(rectPersisted.PersistRectKey, (RectInt16)rect);
|
||||
RectInt32 persistedRect = nonDpiPersistedRect.Scale(scale);
|
||||
|
||||
// If the persisted size is less than min size, we want to reset to the init size.
|
||||
// So we only recover the size when it's greater than or equal to the min size.
|
||||
if (persistedRect.Size() >= xamlWindow.MinSize.Size())
|
||||
{
|
||||
rect = persistedRect.Scale(scale);
|
||||
rect = persistedRect;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,8 +264,9 @@ internal sealed class XamlWindowController
|
||||
// prevent save value when we are maximized.
|
||||
if (!windowPlacement.ShowCmd.HasFlag(SHOW_WINDOW_CMD.SW_SHOWMAXIMIZED))
|
||||
{
|
||||
// We save the non-dpi rect here
|
||||
double scale = 1.0 / window.GetRasterizationScale();
|
||||
LocalSetting.Set(rectPersisted.PersistRectKey, (CompactRect)window.AppWindow.GetRect().Scale(scale));
|
||||
LocalSetting.Set(rectPersisted.PersistRectKey, (RectInt16)window.AppWindow.GetRect().Scale(scale));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -96,7 +96,7 @@ internal sealed class XamlWindowSubclass : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
if (XamlWindowLifetime.ApplicationExiting)
|
||||
if (XamlLifetime.ApplicationExiting)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
namespace Snap.Hutao.Core;
|
||||
|
||||
// See %PROGRAMFILES(X86)%\Windows Kits\10\Platforms\UAP\
|
||||
// Windows.Foundation.UniversalApiContract
|
||||
internal enum WindowsVersion : ushort
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -104,7 +104,7 @@ internal static partial class EnumerableExtension
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static ObservableReorderableDbCollection<TEntityOnly, TEntity> ToObservableReorderableDbCollection<TEntityOnly, TEntity>(this IEnumerable<TEntityOnly> source, IServiceProvider serviceProvider)
|
||||
where TEntityOnly : class, IEntityOnly<TEntity>
|
||||
where TEntityOnly : class, IEntityAccess<TEntity>
|
||||
where TEntity : class, IReorderable
|
||||
{
|
||||
return source is List<TEntityOnly> list
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.UI.Windowing;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Snap.Hutao.Core.Setting;
|
||||
using Snap.Hutao.Core.Windowing;
|
||||
@@ -28,6 +29,12 @@ internal sealed partial class GuideWindow : Window,
|
||||
public GuideWindow(IServiceProvider serviceProvider)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
if (AppWindow.Presenter is OverlappedPresenter presenter)
|
||||
{
|
||||
presenter.IsMaximizable = false;
|
||||
}
|
||||
|
||||
this.InitializeController(serviceProvider);
|
||||
}
|
||||
|
||||
@@ -37,6 +44,8 @@ internal sealed partial class GuideWindow : Window,
|
||||
|
||||
public SizeInt32 InitSize { get; } = new(MinWidth, MinHeight);
|
||||
|
||||
public SizeInt32 MinSize { get; } = new(MinWidth, MinHeight);
|
||||
|
||||
public unsafe void HandleMinMaxInfo(ref MINMAXINFO info, double scalingFactor)
|
||||
{
|
||||
info.ptMinTrackSize.x = (int)Math.Max(MinWidth * scalingFactor, info.ptMinTrackSize.x);
|
||||
|
||||
@@ -47,6 +47,8 @@ internal sealed partial class LaunchGameWindow : Window,
|
||||
|
||||
public SizeInt32 InitSize { get; } = new(MaxWidth, MaxHeight);
|
||||
|
||||
public SizeInt32 MinSize { get; } = new(MinWidth, MinHeight);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Dispose()
|
||||
{
|
||||
|
||||
@@ -39,6 +39,8 @@ internal sealed partial class MainWindow : Window,
|
||||
|
||||
public SizeInt32 InitSize { get; } = new(1200, 741);
|
||||
|
||||
public SizeInt32 MinSize { get; } = new(MinWidth, MinHeight);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public unsafe void HandleMinMaxInfo(ref MINMAXINFO pInfo, double scalingFactor)
|
||||
{
|
||||
|
||||
14
src/Snap.Hutao/Snap.Hutao/Model/IEntityAccessWithMetadata.cs
Normal file
14
src/Snap.Hutao/Snap.Hutao/Model/IEntityAccessWithMetadata.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Model;
|
||||
|
||||
internal interface IEntityAccessWithMetadata<out TEntity, out TMetadata> : IEntityAccess<TEntity>
|
||||
{
|
||||
TMetadata Inner { get; }
|
||||
}
|
||||
|
||||
internal interface IEntityAccess<out TEntity>
|
||||
{
|
||||
TEntity Entity { get; }
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Model;
|
||||
|
||||
/// <summary>
|
||||
/// 实体与元数据
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity">实体</typeparam>
|
||||
/// <typeparam name="TMetadata">元数据</typeparam>
|
||||
[HighQuality]
|
||||
internal interface IEntityWithMetadata<out TEntity, out TMetadata> : IEntityOnly<TEntity>
|
||||
{
|
||||
/// <summary>
|
||||
/// 元数据
|
||||
/// </summary>
|
||||
TMetadata Inner { get; }
|
||||
}
|
||||
|
||||
internal interface IEntityOnly<out TEntity>
|
||||
{
|
||||
/// <summary>
|
||||
/// 实体
|
||||
/// </summary>
|
||||
TEntity Entity { get; }
|
||||
}
|
||||
@@ -97,6 +97,11 @@ internal static class AvatarIds
|
||||
public static readonly AvatarId Navia = 10000091;
|
||||
public static readonly AvatarId Gaming = 10000092;
|
||||
public static readonly AvatarId Xianyun = 10000093;
|
||||
public static readonly AvatarId Chiori = 10000094;
|
||||
public static readonly AvatarId Sigewinne = 10000095;
|
||||
public static readonly AvatarId Arlecchino = 10000096;
|
||||
public static readonly AvatarId Sethos = 10000097;
|
||||
public static readonly AvatarId Clorinde = 10000098;
|
||||
|
||||
/// <summary>
|
||||
/// 检查该角色是否为主角
|
||||
|
||||
@@ -75,7 +75,7 @@ internal sealed class Material : DisplayItem
|
||||
DayOfWeek.Monday or DayOfWeek.Thursday => Materials.MondayThursdayItems.Contains(Id),
|
||||
DayOfWeek.Tuesday or DayOfWeek.Friday => Materials.TuesdayFridayItems.Contains(Id),
|
||||
DayOfWeek.Wednesday or DayOfWeek.Saturday => Materials.WednesdaySaturdayItems.Contains(Id),
|
||||
_ => treatSundayAsTrue,
|
||||
_ => treatSundayAsTrue && (Materials.MondayThursdayItems.Contains(Id) || Materials.TuesdayFridayItems.Contains(Id) || Materials.WednesdaySaturdayItems.Contains(Id)),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<Identity
|
||||
Name="60568DGPStudio.SnapHutao"
|
||||
Publisher="CN=35C8E923-85DF-49A7-9172-B39DC6312C52"
|
||||
Version="1.10.2.0" />
|
||||
Version="1.10.3.0" />
|
||||
|
||||
<Properties>
|
||||
<DisplayName>Snap Hutao</DisplayName>
|
||||
@@ -46,12 +46,12 @@
|
||||
</uap:VisualElements>
|
||||
<Extensions>
|
||||
<desktop:Extension Category="windows.toastNotificationActivation">
|
||||
<desktop:ToastNotificationActivation ToastActivatorCLSID="5760ec4d-f7e8-4666-a965-9886d7dffe7d"/>
|
||||
<desktop:ToastNotificationActivation ToastActivatorCLSID="5760EC4D-F7E8-4666-A965-9886D7DFFE7D"/>
|
||||
</desktop:Extension>
|
||||
<com:Extension Category="windows.comServer">
|
||||
<com:ComServer>
|
||||
<com:ExeServer Executable="Snap.Hutao.exe" Arguments="-ToastActivated" DisplayName="Snap Hutao Toast Activator">
|
||||
<com:Class Id="5760ec4d-f7e8-4666-a965-9886d7dffe7d" DisplayName="Snap Hutao Toast Activator"/>
|
||||
<com:Class Id="5760EC4D-F7E8-4666-A965-9886D7DFFE7D" DisplayName="Snap Hutao Toast Activator"/>
|
||||
</com:ExeServer>
|
||||
</com:ComServer>
|
||||
</com:Extension>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<Identity
|
||||
Name="60568DGPStudio.SnapHutaoDev"
|
||||
Publisher="CN=35C8E923-85DF-49A7-9172-B39DC6312C52"
|
||||
Version="1.10.2.0" />
|
||||
Version="1.10.3.0" />
|
||||
|
||||
<Properties>
|
||||
<DisplayName>Snap Hutao Dev</DisplayName>
|
||||
@@ -46,12 +46,12 @@
|
||||
</uap:VisualElements>
|
||||
<Extensions>
|
||||
<desktop:Extension Category="windows.toastNotificationActivation">
|
||||
<desktop:ToastNotificationActivation ToastActivatorCLSID="5760ec4d-f7e8-4666-a965-9886d7dffe7d"/>
|
||||
<desktop:ToastNotificationActivation ToastActivatorCLSID="F32B561D-752E-472B-A22C-85824D421E1A"/>
|
||||
</desktop:Extension>
|
||||
<com:Extension Category="windows.comServer">
|
||||
<com:ComServer>
|
||||
<com:ExeServer Executable="Snap.Hutao.exe" Arguments="-ToastActivated" DisplayName="Snap Hutao Dev Toast Activator">
|
||||
<com:Class Id="5760ec4d-f7e8-4666-a965-9886d7dffe7d" DisplayName="Snap Hutao Dev Toast Activator"/>
|
||||
<com:Class Id="F32B561D-752E-472B-A22C-85824D421E1A" DisplayName="Snap Hutao Dev Toast Activator"/>
|
||||
</com:ExeServer>
|
||||
</com:ComServer>
|
||||
</com:Extension>
|
||||
|
||||
@@ -192,6 +192,18 @@
|
||||
<data name="CoreWindowHotkeyCombinationRegisterFailed" xml:space="preserve">
|
||||
<value>Register [{0}] hotkey [{1}] failed</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconExitLabel" xml:space="preserve">
|
||||
<value>退出</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconLaunchGameLabel" xml:space="preserve">
|
||||
<value>Launch</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconPromotedHint" xml:space="preserve">
|
||||
<value>胡桃已进入后台运行</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconViewLabel" xml:space="preserve">
|
||||
<value>窗口</value>
|
||||
</data>
|
||||
<data name="CoreWindowThemeDark" xml:space="preserve">
|
||||
<value>Dark</value>
|
||||
</data>
|
||||
@@ -1556,6 +1568,12 @@
|
||||
<data name="ViewModelCultivationProjectInvalidName" xml:space="preserve">
|
||||
<value>Can't add plan with invalid name</value>
|
||||
</data>
|
||||
<data name="ViewModelCultivationRemoveProjectContent" xml:space="preserve">
|
||||
<value>此操作不可逆,此计划的养成物品与背包材料将会丢失</value>
|
||||
</data>
|
||||
<data name="ViewModelCultivationRemoveProjectTitle" xml:space="preserve">
|
||||
<value>确认要删除当前计划吗?</value>
|
||||
</data>
|
||||
<data name="ViewModelDailyNoteConfigWebhookUrlComplete" xml:space="preserve">
|
||||
<value>Realtime Note Webhook URL successfully configured</value>
|
||||
</data>
|
||||
@@ -1946,6 +1964,9 @@
|
||||
<data name="ViewPageDailyNoteNotificationSetting" xml:space="preserve">
|
||||
<value>Notification Settings</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteNotificationUnavailableHint" xml:space="preserve">
|
||||
<value>胡桃的通知权限已被关闭</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteRefresh" xml:space="preserve">
|
||||
<value>Refresh</value>
|
||||
</data>
|
||||
@@ -1976,6 +1997,9 @@
|
||||
<data name="ViewPageDailyNoteSettingRefreshHeader" xml:space="preserve">
|
||||
<value>Refresh</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteSettingRefreshNotifyIconDisabledHint" xml:space="preserve">
|
||||
<value>未启用通知区域图标,关闭窗口后自动刷新将不会执行</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteSlientModeDescription" xml:space="preserve">
|
||||
<value>Do not disturb during Genshin gaming</value>
|
||||
</data>
|
||||
@@ -2654,6 +2678,12 @@
|
||||
<data name="ViewPageSettingKeyShortcutHeader" xml:space="preserve">
|
||||
<value>Shortcut Keys</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingNotifyIconDescription" xml:space="preserve">
|
||||
<value>在通知区域显示图标,以允许执行后台任务,重启后生效</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingNotifyIconHeader" xml:space="preserve">
|
||||
<value>通知区域图标</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingOfficialSiteNavigate" xml:space="preserve">
|
||||
<value>Official Website</value>
|
||||
</data>
|
||||
@@ -2966,6 +2996,9 @@
|
||||
<data name="ViewUserDocumentationHeader" xml:space="preserve">
|
||||
<value>Document</value>
|
||||
</data>
|
||||
<data name="ViewUserLoginMihoyoUserDisabledTooltip" xml:space="preserve">
|
||||
<value>由于米游社安全策略的相关更改,网页登录暂不可用</value>
|
||||
</data>
|
||||
<data name="ViewUserNoUserHint" xml:space="preserve">
|
||||
<value>Haven't logged in</value>
|
||||
</data>
|
||||
@@ -3006,7 +3039,7 @@
|
||||
<value>Weapon WIKI</value>
|
||||
</data>
|
||||
<data name="WebAnnouncementMatchPermanentActivityTime" xml:space="preserve">
|
||||
<value>(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)后永久开放</value>
|
||||
<value>(?:(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)|&lt;t class=\"t_(?:gl|lc)\".*?&gt;(.*?)&lt;/t&gt;)后永久开放</value>
|
||||
</data>
|
||||
<data name="WebAnnouncementMatchPersistentActivityTime" xml:space="preserve">
|
||||
<value>〓活动时间〓.*?(\d\.\d)版本期间持续开放</value>
|
||||
@@ -3044,6 +3077,9 @@
|
||||
<data name="WebBridgeShareCopyToClipboardSuccess" xml:space="preserve">
|
||||
<value>Copied to clipboard</value>
|
||||
</data>
|
||||
<data name="WebDailyNoteArchonQuestChapterFinished" xml:space="preserve">
|
||||
<value>All Archon Quest Completed</value>
|
||||
</data>
|
||||
<data name="WebDailyNoteArchonQuestStatusFinished" xml:space="preserve">
|
||||
<value>Completed</value>
|
||||
</data>
|
||||
@@ -3224,6 +3260,9 @@
|
||||
<data name="WebResponseRequestExceptionFormat" xml:space="preserve">
|
||||
<value>[{1}] network request exception in [{0}] please try again later</value>
|
||||
</data>
|
||||
<data name="WebResponseSignInErrorHint" xml:space="preserve">
|
||||
<value>登录失败,请前往 HoYoLAB 初始化账号,原始消息:{0}</value>
|
||||
</data>
|
||||
<data name="WindowIdentifyMonitorHeader" xml:space="preserve">
|
||||
<value>Monitor ID</value>
|
||||
</data>
|
||||
|
||||
@@ -192,6 +192,18 @@
|
||||
<data name="CoreWindowHotkeyCombinationRegisterFailed" xml:space="preserve">
|
||||
<value>Échec de l'enregistrement de [{0}] en touche de raccourci [{1}]</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconExitLabel" xml:space="preserve">
|
||||
<value>退出</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconLaunchGameLabel" xml:space="preserve">
|
||||
<value>Lanceur de jeu</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconPromotedHint" xml:space="preserve">
|
||||
<value>胡桃已进入后台运行</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconViewLabel" xml:space="preserve">
|
||||
<value>窗口</value>
|
||||
</data>
|
||||
<data name="CoreWindowThemeDark" xml:space="preserve">
|
||||
<value>Sombre</value>
|
||||
</data>
|
||||
@@ -409,7 +421,7 @@
|
||||
<comment>Need EXACT same string in game</comment>
|
||||
</data>
|
||||
<data name="ModelMetadataAvatarPlayerName" xml:space="preserve">
|
||||
<value>旅行者</value>
|
||||
<value>Voyageur</value>
|
||||
</data>
|
||||
<data name="ModelMetadataFetterInfoBirthdayFormat" xml:space="preserve">
|
||||
<value>{0} 月 {1} 日</value>
|
||||
@@ -1473,7 +1485,7 @@
|
||||
<value>有新的通知</value>
|
||||
</data>
|
||||
<data name="ViewLaunchGameHeader" xml:space="preserve">
|
||||
<value>启动游戏</value>
|
||||
<value>Lanceur de jeu</value>
|
||||
</data>
|
||||
<data name="ViewListViewDragElevatedHint" xml:space="preserve">
|
||||
<value>管理员模式下无法拖动排序</value>
|
||||
@@ -1556,6 +1568,12 @@
|
||||
<data name="ViewModelCultivationProjectInvalidName" xml:space="preserve">
|
||||
<value>不能添加名称无效的计划</value>
|
||||
</data>
|
||||
<data name="ViewModelCultivationRemoveProjectContent" xml:space="preserve">
|
||||
<value>此操作不可逆,此计划的养成物品与背包材料将会丢失</value>
|
||||
</data>
|
||||
<data name="ViewModelCultivationRemoveProjectTitle" xml:space="preserve">
|
||||
<value>确认要删除当前计划吗?</value>
|
||||
</data>
|
||||
<data name="ViewModelDailyNoteConfigWebhookUrlComplete" xml:space="preserve">
|
||||
<value>实时便笺 Webhook Url 配置成功</value>
|
||||
</data>
|
||||
@@ -1647,7 +1665,7 @@
|
||||
<value>我已阅读并同意上方的条款</value>
|
||||
</data>
|
||||
<data name="ViewModelGuideActionComplete" xml:space="preserve">
|
||||
<value>完成</value>
|
||||
<value>Terminer</value>
|
||||
</data>
|
||||
<data name="ViewModelGuideActionNext" xml:space="preserve">
|
||||
<value>下一步</value>
|
||||
@@ -1773,7 +1791,7 @@
|
||||
<value>下载完成</value>
|
||||
</data>
|
||||
<data name="ViewModelWelcomeDownloadSummaryComplete" xml:space="preserve">
|
||||
<value>完成</value>
|
||||
<value>Terminer</value>
|
||||
</data>
|
||||
<data name="ViewModelWelcomeDownloadSummaryContentTypeNotMatch" xml:space="preserve">
|
||||
<value>响应内容不是有效的文件字节流</value>
|
||||
@@ -1791,7 +1809,7 @@
|
||||
<value>创建新存档以继续</value>
|
||||
</data>
|
||||
<data name="ViewPageAchievementExportLabel" xml:space="preserve">
|
||||
<value>导出</value>
|
||||
<value>Exporter</value>
|
||||
</data>
|
||||
<data name="ViewPageAchievementImportFromClipboard" xml:space="preserve">
|
||||
<value>从剪贴板导入</value>
|
||||
@@ -1800,7 +1818,7 @@
|
||||
<value>从 UIAF 文件导入</value>
|
||||
</data>
|
||||
<data name="ViewPageAchievementImportLabel" xml:space="preserve">
|
||||
<value>导入</value>
|
||||
<value>Importer</value>
|
||||
</data>
|
||||
<data name="ViewPageAchievementRemoveArchive" xml:space="preserve">
|
||||
<value>删除当前存档</value>
|
||||
@@ -1946,6 +1964,9 @@
|
||||
<data name="ViewPageDailyNoteNotificationSetting" xml:space="preserve">
|
||||
<value>通知设置</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteNotificationUnavailableHint" xml:space="preserve">
|
||||
<value>胡桃的通知权限已被关闭</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteRefresh" xml:space="preserve">
|
||||
<value>立即刷新</value>
|
||||
</data>
|
||||
@@ -1976,6 +1997,9 @@
|
||||
<data name="ViewPageDailyNoteSettingRefreshHeader" xml:space="preserve">
|
||||
<value>刷新</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteSettingRefreshNotifyIconDisabledHint" xml:space="preserve">
|
||||
<value>未启用通知区域图标,关闭窗口后自动刷新将不会执行</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteSlientModeDescription" xml:space="preserve">
|
||||
<value>在我游玩原神时不通知我</value>
|
||||
</data>
|
||||
@@ -2031,7 +2055,7 @@
|
||||
<value>全量刷新</value>
|
||||
</data>
|
||||
<data name="ViewPageGachaLogExportAction" xml:space="preserve">
|
||||
<value>导出</value>
|
||||
<value>Exporter</value>
|
||||
</data>
|
||||
<data name="ViewPageGachaLogHint" xml:space="preserve">
|
||||
<value>尚未获取任何祈愿记录</value>
|
||||
@@ -2067,7 +2091,7 @@
|
||||
<value>上传当前的祈愿存档</value>
|
||||
</data>
|
||||
<data name="ViewPageGachaLogImportAction" xml:space="preserve">
|
||||
<value>导入</value>
|
||||
<value>Importer</value>
|
||||
</data>
|
||||
<data name="ViewPageGachaLogImportDescription" xml:space="preserve">
|
||||
<value>导入来自其它 App 的数据</value>
|
||||
@@ -2238,7 +2262,7 @@
|
||||
<value>请输入验证码</value>
|
||||
</data>
|
||||
<data name="ViewPageLaunchGameAction" xml:space="preserve">
|
||||
<value>启动游戏</value>
|
||||
<value>Lanceur de jeu</value>
|
||||
</data>
|
||||
<data name="ViewPageLaunchGameAdvanceHeader" xml:space="preserve">
|
||||
<value>高级功能</value>
|
||||
@@ -2583,7 +2607,7 @@
|
||||
<value>祈愿记录</value>
|
||||
</data>
|
||||
<data name="ViewpageSettingHomeCardItemLaunchGameHeader" xml:space="preserve">
|
||||
<value>启动游戏</value>
|
||||
<value>Lanceur de jeu</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingHomeCardOff" xml:space="preserve">
|
||||
<value>隐藏</value>
|
||||
@@ -2654,6 +2678,12 @@
|
||||
<data name="ViewPageSettingKeyShortcutHeader" xml:space="preserve">
|
||||
<value>快捷键</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingNotifyIconDescription" xml:space="preserve">
|
||||
<value>在通知区域显示图标,以允许执行后台任务,重启后生效</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingNotifyIconHeader" xml:space="preserve">
|
||||
<value>通知区域图标</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingOfficialSiteNavigate" xml:space="preserve">
|
||||
<value>前往官网</value>
|
||||
</data>
|
||||
@@ -2966,6 +2996,9 @@
|
||||
<data name="ViewUserDocumentationHeader" xml:space="preserve">
|
||||
<value>文档</value>
|
||||
</data>
|
||||
<data name="ViewUserLoginMihoyoUserDisabledTooltip" xml:space="preserve">
|
||||
<value>由于米游社安全策略的相关更改,网页登录暂不可用</value>
|
||||
</data>
|
||||
<data name="ViewUserNoUserHint" xml:space="preserve">
|
||||
<value>尚未登录</value>
|
||||
</data>
|
||||
@@ -3006,7 +3039,7 @@
|
||||
<value>武器资料</value>
|
||||
</data>
|
||||
<data name="WebAnnouncementMatchPermanentActivityTime" xml:space="preserve">
|
||||
<value>(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)后永久开放</value>
|
||||
<value>(?:(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)|&lt;t class=\"t_(?:gl|lc)\".*?&gt;(.*?)&lt;/t&gt;)后永久开放</value>
|
||||
</data>
|
||||
<data name="WebAnnouncementMatchPersistentActivityTime" xml:space="preserve">
|
||||
<value>〓活动时间〓.*?(\d\.\d)版本期间持续开放</value>
|
||||
@@ -3044,6 +3077,9 @@
|
||||
<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>
|
||||
@@ -3224,6 +3260,9 @@
|
||||
<data name="WebResponseRequestExceptionFormat" xml:space="preserve">
|
||||
<value>[{0}] 中的 [{1}] 网络请求异常,请稍后再试</value>
|
||||
</data>
|
||||
<data name="WebResponseSignInErrorHint" xml:space="preserve">
|
||||
<value>登录失败,请前往 HoYoLAB 初始化账号,原始消息:{0}</value>
|
||||
</data>
|
||||
<data name="WindowIdentifyMonitorHeader" xml:space="preserve">
|
||||
<value>显示器编号</value>
|
||||
</data>
|
||||
|
||||
@@ -192,6 +192,18 @@
|
||||
<data name="CoreWindowHotkeyCombinationRegisterFailed" xml:space="preserve">
|
||||
<value>[{0}] Hotkey [{1}] gagal terdaftar</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconExitLabel" xml:space="preserve">
|
||||
<value>退出</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconLaunchGameLabel" xml:space="preserve">
|
||||
<value>Luncurkan</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconPromotedHint" xml:space="preserve">
|
||||
<value>胡桃已进入后台运行</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconViewLabel" xml:space="preserve">
|
||||
<value>窗口</value>
|
||||
</data>
|
||||
<data name="CoreWindowThemeDark" xml:space="preserve">
|
||||
<value>深色</value>
|
||||
</data>
|
||||
@@ -1556,6 +1568,12 @@
|
||||
<data name="ViewModelCultivationProjectInvalidName" xml:space="preserve">
|
||||
<value>Tidak dapat menambahkan rencana dengan nama yang salah.</value>
|
||||
</data>
|
||||
<data name="ViewModelCultivationRemoveProjectContent" xml:space="preserve">
|
||||
<value>此操作不可逆,此计划的养成物品与背包材料将会丢失</value>
|
||||
</data>
|
||||
<data name="ViewModelCultivationRemoveProjectTitle" xml:space="preserve">
|
||||
<value>确认要删除当前计划吗?</value>
|
||||
</data>
|
||||
<data name="ViewModelDailyNoteConfigWebhookUrlComplete" xml:space="preserve">
|
||||
<value>URL Webhook Catatan Realtime berhasil dikonfigurasi.</value>
|
||||
</data>
|
||||
@@ -1946,6 +1964,9 @@
|
||||
<data name="ViewPageDailyNoteNotificationSetting" xml:space="preserve">
|
||||
<value>Pengaturan notifikasi</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteNotificationUnavailableHint" xml:space="preserve">
|
||||
<value>胡桃的通知权限已被关闭</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteRefresh" xml:space="preserve">
|
||||
<value>Segarkan sekarang</value>
|
||||
</data>
|
||||
@@ -1976,6 +1997,9 @@
|
||||
<data name="ViewPageDailyNoteSettingRefreshHeader" xml:space="preserve">
|
||||
<value>Perbarui</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteSettingRefreshNotifyIconDisabledHint" xml:space="preserve">
|
||||
<value>未启用通知区域图标,关闭窗口后自动刷新将不会执行</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteSlientModeDescription" xml:space="preserve">
|
||||
<value>Jangan ganggu selama bermain Genshin</value>
|
||||
</data>
|
||||
@@ -2654,6 +2678,12 @@
|
||||
<data name="ViewPageSettingKeyShortcutHeader" xml:space="preserve">
|
||||
<value>Tombol Pintas</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingNotifyIconDescription" xml:space="preserve">
|
||||
<value>在通知区域显示图标,以允许执行后台任务,重启后生效</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingNotifyIconHeader" xml:space="preserve">
|
||||
<value>通知区域图标</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingOfficialSiteNavigate" xml:space="preserve">
|
||||
<value>Website Resmi</value>
|
||||
</data>
|
||||
@@ -2966,6 +2996,9 @@
|
||||
<data name="ViewUserDocumentationHeader" xml:space="preserve">
|
||||
<value>Dokumen</value>
|
||||
</data>
|
||||
<data name="ViewUserLoginMihoyoUserDisabledTooltip" xml:space="preserve">
|
||||
<value>由于米游社安全策略的相关更改,网页登录暂不可用</value>
|
||||
</data>
|
||||
<data name="ViewUserNoUserHint" xml:space="preserve">
|
||||
<value>Tidak masuk</value>
|
||||
</data>
|
||||
@@ -3006,7 +3039,7 @@
|
||||
<value>Senjata WIKI</value>
|
||||
</data>
|
||||
<data name="WebAnnouncementMatchPermanentActivityTime" xml:space="preserve">
|
||||
<value>(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)后永久开放</value>
|
||||
<value>(?:(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)|&lt;t class=\"t_(?:gl|lc)\".*?&gt;(.*?)&lt;/t&gt;)后永久开放</value>
|
||||
</data>
|
||||
<data name="WebAnnouncementMatchPersistentActivityTime" xml:space="preserve">
|
||||
<value>〓活动时间〓.*?(\d\.\d)版本期间持续开放</value>
|
||||
@@ -3044,6 +3077,9 @@
|
||||
<data name="WebBridgeShareCopyToClipboardSuccess" xml:space="preserve">
|
||||
<value>Disalin ke clipboard</value>
|
||||
</data>
|
||||
<data name="WebDailyNoteArchonQuestChapterFinished" xml:space="preserve">
|
||||
<value>所有魔神任务已完成</value>
|
||||
</data>
|
||||
<data name="WebDailyNoteArchonQuestStatusFinished" xml:space="preserve">
|
||||
<value>Selesai</value>
|
||||
</data>
|
||||
@@ -3224,6 +3260,9 @@
|
||||
<data name="WebResponseRequestExceptionFormat" xml:space="preserve">
|
||||
<value>[{1}] pengecualian permintaan jaringan di [{0}], harap coba lagi nanti</value>
|
||||
</data>
|
||||
<data name="WebResponseSignInErrorHint" xml:space="preserve">
|
||||
<value>登录失败,请前往 HoYoLAB 初始化账号,原始消息:{0}</value>
|
||||
</data>
|
||||
<data name="WindowIdentifyMonitorHeader" xml:space="preserve">
|
||||
<value>ID Monitor</value>
|
||||
</data>
|
||||
|
||||
@@ -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>無効なURL</value>
|
||||
@@ -192,6 +192,18 @@
|
||||
<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="CoreWindowingNotifyIconPromotedHint" xml:space="preserve">
|
||||
<value>胡桃已进入后台运行</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconViewLabel" xml:space="preserve">
|
||||
<value>窗口</value>
|
||||
</data>
|
||||
<data name="CoreWindowThemeDark" xml:space="preserve">
|
||||
<value>深色</value>
|
||||
</data>
|
||||
@@ -783,13 +795,13 @@
|
||||
<value>キャラクターラインナップ:{0:MM-dd HH:mm}</value>
|
||||
</data>
|
||||
<data name="ServiceBackgroundImageTypeBing" xml:space="preserve">
|
||||
<value>必应每日一图</value>
|
||||
<value>Bingからのランダム画像</value>
|
||||
</data>
|
||||
<data name="ServiceBackgroundImageTypeDaily" xml:space="preserve">
|
||||
<value>胡桃每日一图</value>
|
||||
<value>日替わり胡桃画像</value>
|
||||
</data>
|
||||
<data name="ServiceBackgroundImageTypeLauncher" xml:space="preserve">
|
||||
<value>官方启动器壁纸</value>
|
||||
<value>公式ランチャー背景</value>
|
||||
</data>
|
||||
<data name="ServiceBackgroundImageTypeLocalFolder" xml:space="preserve">
|
||||
<value>本地随机图片</value>
|
||||
@@ -873,7 +885,7 @@
|
||||
<value>イベント祈願・キャラクター</value>
|
||||
</data>
|
||||
<data name="ServiceGachaLogFactoryChronicledWishName" xml:space="preserve">
|
||||
<value>集录祈愿</value>
|
||||
<value>集録祈願</value>
|
||||
</data>
|
||||
<data name="ServiceGachaLogFactoryPermanentWishName" xml:space="preserve">
|
||||
<value>奔走世間</value>
|
||||
@@ -1556,6 +1568,12 @@
|
||||
<data name="ViewModelCultivationProjectInvalidName" xml:space="preserve">
|
||||
<value>育成計画名に無効な言葉が入っています</value>
|
||||
</data>
|
||||
<data name="ViewModelCultivationRemoveProjectContent" xml:space="preserve">
|
||||
<value>此操作不可逆,此计划的养成物品与背包材料将会丢失</value>
|
||||
</data>
|
||||
<data name="ViewModelCultivationRemoveProjectTitle" xml:space="preserve">
|
||||
<value>确认要删除当前计划吗?</value>
|
||||
</data>
|
||||
<data name="ViewModelDailyNoteConfigWebhookUrlComplete" xml:space="preserve">
|
||||
<value>リアルタイムノートのWebhook URLの設定に成功しました。</value>
|
||||
</data>
|
||||
@@ -1946,6 +1964,9 @@
|
||||
<data name="ViewPageDailyNoteNotificationSetting" xml:space="preserve">
|
||||
<value>通知設定</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteNotificationUnavailableHint" xml:space="preserve">
|
||||
<value>胡桃的通知权限已被关闭</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteRefresh" xml:space="preserve">
|
||||
<value>すぐに更新</value>
|
||||
</data>
|
||||
@@ -1976,6 +1997,9 @@
|
||||
<data name="ViewPageDailyNoteSettingRefreshHeader" xml:space="preserve">
|
||||
<value>更新</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteSettingRefreshNotifyIconDisabledHint" xml:space="preserve">
|
||||
<value>未启用通知区域图标,关闭窗口后自动刷新将不会执行</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteSlientModeDescription" xml:space="preserve">
|
||||
<value>プレイ中に通知をオフ</value>
|
||||
</data>
|
||||
@@ -2654,14 +2678,20 @@
|
||||
<data name="ViewPageSettingKeyShortcutHeader" xml:space="preserve">
|
||||
<value>ショートカットキー</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingNotifyIconDescription" xml:space="preserve">
|
||||
<value>在通知区域显示图标,以允许执行后台任务,重启后生效</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingNotifyIconHeader" xml:space="preserve">
|
||||
<value>通知区域图标</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingOfficialSiteNavigate" xml:space="preserve">
|
||||
<value>公式サイト</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingOpenBackgroundImageFolderDescription" xml:space="preserve">
|
||||
<value>自定义背景图片,支持 bmp / gif / ico / jpg / jpeg / png / tiff / webp 格式</value>
|
||||
<value>カスタム背景を設定する / bmp、git、ico、jpg、jpeg、png、tiff、webp形式をサポートしています</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingOpenBackgroundImageFolderHeader" xml:space="preserve">
|
||||
<value>打开背景图片文件夹</value>
|
||||
<value>カスタム背景フォルダーを開く</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingResetAction" xml:space="preserve">
|
||||
<value>リセット</value>
|
||||
@@ -2966,6 +2996,9 @@
|
||||
<data name="ViewUserDocumentationHeader" xml:space="preserve">
|
||||
<value>ドキュメント</value>
|
||||
</data>
|
||||
<data name="ViewUserLoginMihoyoUserDisabledTooltip" xml:space="preserve">
|
||||
<value>由于米游社安全策略的相关更改,网页登录暂不可用</value>
|
||||
</data>
|
||||
<data name="ViewUserNoUserHint" xml:space="preserve">
|
||||
<value>ログインしていません</value>
|
||||
</data>
|
||||
@@ -3006,7 +3039,7 @@
|
||||
<value>武器一覧</value>
|
||||
</data>
|
||||
<data name="WebAnnouncementMatchPermanentActivityTime" xml:space="preserve">
|
||||
<value>(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)后永久开放</value>
|
||||
<value>(?:(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)|&lt;t class=\"t_(?:gl|lc)\".*?&gt;(.*?)&lt;/t&gt;)后永久开放</value>
|
||||
</data>
|
||||
<data name="WebAnnouncementMatchPersistentActivityTime" xml:space="preserve">
|
||||
<value>〓活动时间〓.*?(\d\.\d)版本期间持续开放</value>
|
||||
@@ -3044,6 +3077,9 @@
|
||||
<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>
|
||||
@@ -3171,7 +3207,7 @@
|
||||
<value>イベント祈願・キャラクター2</value>
|
||||
</data>
|
||||
<data name="WebGachaConfigTypeChronicledWish" xml:space="preserve">
|
||||
<value>集录祈愿</value>
|
||||
<value>集録祈願</value>
|
||||
</data>
|
||||
<data name="WebGachaConfigTypeNoviceWish" xml:space="preserve">
|
||||
<value>初心者祈願</value>
|
||||
@@ -3224,6 +3260,9 @@
|
||||
<data name="WebResponseRequestExceptionFormat" xml:space="preserve">
|
||||
<value>[{0}] の[{1}] のリクエストにエラーが発生、時間をおいてから試してください</value>
|
||||
</data>
|
||||
<data name="WebResponseSignInErrorHint" xml:space="preserve">
|
||||
<value>登录失败,请前往 HoYoLAB 初始化账号,原始消息:{0}</value>
|
||||
</data>
|
||||
<data name="WindowIdentifyMonitorHeader" xml:space="preserve">
|
||||
<value>モニターID</value>
|
||||
</data>
|
||||
|
||||
@@ -192,6 +192,18 @@
|
||||
<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="CoreWindowingNotifyIconPromotedHint" xml:space="preserve">
|
||||
<value>胡桃已进入后台运行</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconViewLabel" xml:space="preserve">
|
||||
<value>窗口</value>
|
||||
</data>
|
||||
<data name="CoreWindowThemeDark" xml:space="preserve">
|
||||
<value>深色</value>
|
||||
</data>
|
||||
@@ -1556,6 +1568,12 @@
|
||||
<data name="ViewModelCultivationProjectInvalidName" xml:space="preserve">
|
||||
<value>잘못된 이름을 가진 일정은 추가할 수 없습니다</value>
|
||||
</data>
|
||||
<data name="ViewModelCultivationRemoveProjectContent" xml:space="preserve">
|
||||
<value>此操作不可逆,此计划的养成物品与背包材料将会丢失</value>
|
||||
</data>
|
||||
<data name="ViewModelCultivationRemoveProjectTitle" xml:space="preserve">
|
||||
<value>确认要删除当前计划吗?</value>
|
||||
</data>
|
||||
<data name="ViewModelDailyNoteConfigWebhookUrlComplete" xml:space="preserve">
|
||||
<value>实时便笺 Webhook Url 配置成功</value>
|
||||
</data>
|
||||
@@ -1946,6 +1964,9 @@
|
||||
<data name="ViewPageDailyNoteNotificationSetting" xml:space="preserve">
|
||||
<value>알림 설정</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteNotificationUnavailableHint" xml:space="preserve">
|
||||
<value>胡桃的通知权限已被关闭</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteRefresh" xml:space="preserve">
|
||||
<value>지금 동기화</value>
|
||||
</data>
|
||||
@@ -1976,6 +1997,9 @@
|
||||
<data name="ViewPageDailyNoteSettingRefreshHeader" xml:space="preserve">
|
||||
<value>동기화</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteSettingRefreshNotifyIconDisabledHint" xml:space="preserve">
|
||||
<value>未启用通知区域图标,关闭窗口后自动刷新将不会执行</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteSlientModeDescription" xml:space="preserve">
|
||||
<value>원신을 플레이 할 때 알리지 않음</value>
|
||||
</data>
|
||||
@@ -2654,6 +2678,12 @@
|
||||
<data name="ViewPageSettingKeyShortcutHeader" xml:space="preserve">
|
||||
<value>快捷键</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingNotifyIconDescription" xml:space="preserve">
|
||||
<value>在通知区域显示图标,以允许执行后台任务,重启后生效</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingNotifyIconHeader" xml:space="preserve">
|
||||
<value>通知区域图标</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingOfficialSiteNavigate" xml:space="preserve">
|
||||
<value>공식 홈페이지로 이동</value>
|
||||
</data>
|
||||
@@ -2966,6 +2996,9 @@
|
||||
<data name="ViewUserDocumentationHeader" xml:space="preserve">
|
||||
<value>문서</value>
|
||||
</data>
|
||||
<data name="ViewUserLoginMihoyoUserDisabledTooltip" xml:space="preserve">
|
||||
<value>由于米游社安全策略的相关更改,网页登录暂不可用</value>
|
||||
</data>
|
||||
<data name="ViewUserNoUserHint" xml:space="preserve">
|
||||
<value>尚未登录</value>
|
||||
</data>
|
||||
@@ -3006,7 +3039,7 @@
|
||||
<value>무기 자료</value>
|
||||
</data>
|
||||
<data name="WebAnnouncementMatchPermanentActivityTime" xml:space="preserve">
|
||||
<value>(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)后永久开放</value>
|
||||
<value>(?:(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)|&lt;t class=\"t_(?:gl|lc)\".*?&gt;(.*?)&lt;/t&gt;)后永久开放</value>
|
||||
</data>
|
||||
<data name="WebAnnouncementMatchPersistentActivityTime" xml:space="preserve">
|
||||
<value>〓活动时间〓.*?(\d\.\d)版本期间持续开放</value>
|
||||
@@ -3044,6 +3077,9 @@
|
||||
<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>
|
||||
@@ -3224,6 +3260,9 @@
|
||||
<data name="WebResponseRequestExceptionFormat" xml:space="preserve">
|
||||
<value>[{0}] 中的 [{1}] 网络请求异常,请稍后再试</value>
|
||||
</data>
|
||||
<data name="WebResponseSignInErrorHint" xml:space="preserve">
|
||||
<value>登录失败,请前往 HoYoLAB 初始化账号,原始消息:{0}</value>
|
||||
</data>
|
||||
<data name="WindowIdentifyMonitorHeader" xml:space="preserve">
|
||||
<value>显示器编号</value>
|
||||
</data>
|
||||
|
||||
@@ -192,6 +192,18 @@
|
||||
<data name="CoreWindowHotkeyCombinationRegisterFailed" xml:space="preserve">
|
||||
<value>Falha ao definir atalho [{0}] para [{1}].</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconExitLabel" xml:space="preserve">
|
||||
<value>退出</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconLaunchGameLabel" xml:space="preserve">
|
||||
<value>Iniciar</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconPromotedHint" xml:space="preserve">
|
||||
<value>胡桃已进入后台运行</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconViewLabel" xml:space="preserve">
|
||||
<value>窗口</value>
|
||||
</data>
|
||||
<data name="CoreWindowThemeDark" xml:space="preserve">
|
||||
<value>Tema Escuro</value>
|
||||
</data>
|
||||
@@ -1556,6 +1568,12 @@
|
||||
<data name="ViewModelCultivationProjectInvalidName" xml:space="preserve">
|
||||
<value>Não é possível adicionar um plano com nome inválido</value>
|
||||
</data>
|
||||
<data name="ViewModelCultivationRemoveProjectContent" xml:space="preserve">
|
||||
<value>此操作不可逆,此计划的养成物品与背包材料将会丢失</value>
|
||||
</data>
|
||||
<data name="ViewModelCultivationRemoveProjectTitle" xml:space="preserve">
|
||||
<value>确认要删除当前计划吗?</value>
|
||||
</data>
|
||||
<data name="ViewModelDailyNoteConfigWebhookUrlComplete" xml:space="preserve">
|
||||
<value>URL do webhook de lembrete de tempo real configurado com sucesso</value>
|
||||
</data>
|
||||
@@ -1946,6 +1964,9 @@
|
||||
<data name="ViewPageDailyNoteNotificationSetting" xml:space="preserve">
|
||||
<value>Configurações de notificação</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteNotificationUnavailableHint" xml:space="preserve">
|
||||
<value>胡桃的通知权限已被关闭</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteRefresh" xml:space="preserve">
|
||||
<value>Atualizar</value>
|
||||
</data>
|
||||
@@ -1976,6 +1997,9 @@
|
||||
<data name="ViewPageDailyNoteSettingRefreshHeader" xml:space="preserve">
|
||||
<value>Atualizar</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteSettingRefreshNotifyIconDisabledHint" xml:space="preserve">
|
||||
<value>未启用通知区域图标,关闭窗口后自动刷新将不会执行</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteSlientModeDescription" xml:space="preserve">
|
||||
<value>Não incomodar durante o Genshin</value>
|
||||
</data>
|
||||
@@ -2654,6 +2678,12 @@
|
||||
<data name="ViewPageSettingKeyShortcutHeader" xml:space="preserve">
|
||||
<value>Teclas de atalho</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingNotifyIconDescription" xml:space="preserve">
|
||||
<value>在通知区域显示图标,以允许执行后台任务,重启后生效</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingNotifyIconHeader" xml:space="preserve">
|
||||
<value>通知区域图标</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingOfficialSiteNavigate" xml:space="preserve">
|
||||
<value>Site oficial</value>
|
||||
</data>
|
||||
@@ -2966,6 +2996,9 @@
|
||||
<data name="ViewUserDocumentationHeader" xml:space="preserve">
|
||||
<value>Documentação</value>
|
||||
</data>
|
||||
<data name="ViewUserLoginMihoyoUserDisabledTooltip" xml:space="preserve">
|
||||
<value>由于米游社安全策略的相关更改,网页登录暂不可用</value>
|
||||
</data>
|
||||
<data name="ViewUserNoUserHint" xml:space="preserve">
|
||||
<value>Sem login</value>
|
||||
</data>
|
||||
@@ -3006,7 +3039,7 @@
|
||||
<value>Wiki de armas</value>
|
||||
</data>
|
||||
<data name="WebAnnouncementMatchPermanentActivityTime" xml:space="preserve">
|
||||
<value>(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)后永久开放</value>
|
||||
<value>(?:(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)|&lt;t class=\"t_(?:gl|lc)\".*?&gt;(.*?)&lt;/t&gt;)后永久开放</value>
|
||||
</data>
|
||||
<data name="WebAnnouncementMatchPersistentActivityTime" xml:space="preserve">
|
||||
<value>〓活动时间〓.*?(\d\.\d)版本期间持续开放</value>
|
||||
@@ -3044,6 +3077,9 @@
|
||||
<data name="WebBridgeShareCopyToClipboardSuccess" xml:space="preserve">
|
||||
<value>Copiado para a área de transferência</value>
|
||||
</data>
|
||||
<data name="WebDailyNoteArchonQuestChapterFinished" xml:space="preserve">
|
||||
<value>Todas as missões de arconte concluídas</value>
|
||||
</data>
|
||||
<data name="WebDailyNoteArchonQuestStatusFinished" xml:space="preserve">
|
||||
<value>Concluído</value>
|
||||
</data>
|
||||
@@ -3224,6 +3260,9 @@
|
||||
<data name="WebResponseRequestExceptionFormat" xml:space="preserve">
|
||||
<value>[{1}] erro de solicitação de rede em [{0}], tente novamente mais tarde</value>
|
||||
</data>
|
||||
<data name="WebResponseSignInErrorHint" xml:space="preserve">
|
||||
<value>登录失败,请前往 HoYoLAB 初始化账号,原始消息:{0}</value>
|
||||
</data>
|
||||
<data name="WindowIdentifyMonitorHeader" xml:space="preserve">
|
||||
<value>ID do monitor</value>
|
||||
</data>
|
||||
|
||||
@@ -2996,6 +2996,9 @@
|
||||
<data name="ViewUserDocumentationHeader" xml:space="preserve">
|
||||
<value>文档</value>
|
||||
</data>
|
||||
<data name="ViewUserLoginMihoyoUserDisabledTooltip" xml:space="preserve">
|
||||
<value>由于米游社安全策略的相关更改,网页登录暂不可用</value>
|
||||
</data>
|
||||
<data name="ViewUserNoUserHint" xml:space="preserve">
|
||||
<value>尚未登录</value>
|
||||
</data>
|
||||
|
||||
@@ -192,6 +192,18 @@
|
||||
<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>Game Launcher</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconPromotedHint" xml:space="preserve">
|
||||
<value>胡桃已进入后台运行</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconViewLabel" xml:space="preserve">
|
||||
<value>窗口</value>
|
||||
</data>
|
||||
<data name="CoreWindowThemeDark" xml:space="preserve">
|
||||
<value>Тёмная</value>
|
||||
</data>
|
||||
@@ -1173,40 +1185,40 @@
|
||||
<value>Режим импорта</value>
|
||||
</data>
|
||||
<data name="ViewDialogAchievementArchiveImportStrategyAggressive" xml:space="preserve">
|
||||
<value>贪婪(添加新数据,更新已完成项)</value>
|
||||
<value>Жадно (добавляют новые данные, обновляют завершенные записи)</value>
|
||||
</data>
|
||||
<data name="ViewDialogAchievementArchiveImportStrategyLazy" xml:space="preserve">
|
||||
<value>懒惰(添加新数据,跳过已完成项)</value>
|
||||
<value>Лениво (добавление новых данных, пропуск завершенных записей)</value>
|
||||
</data>
|
||||
<data name="ViewDialogAchievementArchiveImportStrategyOverwrite" xml:space="preserve">
|
||||
<value>覆盖(删除老数据,添加新的数据)</value>
|
||||
<value>Перезапись (удаление старых данных, добавление новых)</value>
|
||||
</data>
|
||||
<data name="ViewDialogAchievementArchiveImportTitle" xml:space="preserve">
|
||||
<value>Импорт данных о достижениях в текущий архив</value>
|
||||
</data>
|
||||
<data name="ViewDialogCultivateBatchAvatarLevelTarget" xml:space="preserve">
|
||||
<value>角色目标等级</value>
|
||||
<value>Целевой уровень персонажа</value>
|
||||
</data>
|
||||
<data name="ViewDialogCultivateBatchSkillATarget" xml:space="preserve">
|
||||
<value>普通攻击目标等级</value>
|
||||
<value>Уровень цели обычной атаки</value>
|
||||
</data>
|
||||
<data name="ViewDialogCultivateBatchSkillETarget" xml:space="preserve">
|
||||
<value>元素战技目标等级</value>
|
||||
<value>Целевой уровень Элементального навыка</value>
|
||||
</data>
|
||||
<data name="ViewDialogCultivateBatchSkillQTarget" xml:space="preserve">
|
||||
<value>元素爆发目标等级</value>
|
||||
<value>Целевой уровень Взрыва стихий</value>
|
||||
</data>
|
||||
<data name="ViewDialogCultivateBatchWeaponLevelTarget" xml:space="preserve">
|
||||
<value>武器目标等级</value>
|
||||
<value>Целевой уровень оружия</value>
|
||||
</data>
|
||||
<data name="ViewDialogCultivateProjectAttachUid" xml:space="preserve">
|
||||
<value>绑定当前用户与角色</value>
|
||||
<value>Связать текущего пользователя и роль</value>
|
||||
</data>
|
||||
<data name="ViewDialogCultivateProjectInputPlaceholder" xml:space="preserve">
|
||||
<value>在此处输入计划名称</value>
|
||||
<value>Введите название плана</value>
|
||||
</data>
|
||||
<data name="ViewDialogCultivateProjectTitle" xml:space="preserve">
|
||||
<value>创建新的养成计划</value>
|
||||
<value>Создание нового плана</value>
|
||||
</data>
|
||||
<data name="ViewDialogCultivatePromotionDeltaBatchTitle" xml:space="preserve">
|
||||
<value>批量添加或更新到当前养成计划</value>
|
||||
@@ -1218,7 +1230,7 @@
|
||||
<value>每日委托上线提醒</value>
|
||||
</data>
|
||||
<data name="ViewDialogDailyNoteNotificationExpeditionNotify" xml:space="preserve">
|
||||
<value>探索派遣完成提醒</value>
|
||||
<value>Уведомление об окончании экспедиции</value>
|
||||
</data>
|
||||
<data name="ViewDialogDailyNoteNotificationHomeCoinNotifyThreshold" xml:space="preserve">
|
||||
<value>洞天宝钱提醒阈值</value>
|
||||
@@ -1236,7 +1248,7 @@
|
||||
<value>参量质变仪提醒</value>
|
||||
</data>
|
||||
<data name="ViewDialogDailyNoteWebhookUrlInputPlaceholder" xml:space="preserve">
|
||||
<value>请输入 Url</value>
|
||||
<value>Пожалуйста, введите URL</value>
|
||||
</data>
|
||||
<data name="ViewDialogDailyNoteWebhookUrlTitle" xml:space="preserve">
|
||||
<value>实时便笺 Webhook Url</value>
|
||||
@@ -1260,7 +1272,7 @@
|
||||
<value>获取祈愿物品中</value>
|
||||
</data>
|
||||
<data name="ViewDialogGachaLogUrlInputPlaceholder" xml:space="preserve">
|
||||
<value>请输入 Url</value>
|
||||
<value>Пожалуйста, введите URL</value>
|
||||
</data>
|
||||
<data name="ViewDialogGachaLogUrlTitle" xml:space="preserve">
|
||||
<value>手动输入祈愿记录 Url</value>
|
||||
@@ -1287,7 +1299,7 @@
|
||||
<value>将会通过 GET 方式对接口发送请求</value>
|
||||
</data>
|
||||
<data name="ViewDialogGeetestCustomUrlSampleHeader" xml:space="preserve">
|
||||
<value>示例</value>
|
||||
<value>Пример</value>
|
||||
</data>
|
||||
<data name="ViewDialogGeetestCustomUrlTitle" xml:space="preserve">
|
||||
<value>配置无感验证接口</value>
|
||||
@@ -1329,13 +1341,13 @@
|
||||
<value>UIGF 版本</value>
|
||||
</data>
|
||||
<data name="ViewDialogLaunchGameAccountInputPlaceholder" xml:space="preserve">
|
||||
<value>在此处输入名称</value>
|
||||
<value>Введите имя</value>
|
||||
</data>
|
||||
<data name="ViewDialogLaunchGameAccountTitle" xml:space="preserve">
|
||||
<value>为账号命名</value>
|
||||
<value>Назовите ваш аккаунт</value>
|
||||
</data>
|
||||
<data name="ViewDialogLaunchGameConfigurationFixDialogHint" xml:space="preserve">
|
||||
<value>请选择当前游戏路径对应的游戏服务器</value>
|
||||
<value>Пожалуйста, выберите ваш игровой сервер</value>
|
||||
</data>
|
||||
<data name="ViewDialogLaunchGameConfigurationFixDialogTitle" xml:space="preserve">
|
||||
<value>Восстановление файла конфигурации</value>
|
||||
@@ -1347,7 +1359,7 @@
|
||||
<value>正在转换客户端</value>
|
||||
</data>
|
||||
<data name="ViewDialogQRCodeTitle" xml:space="preserve">
|
||||
<value>使用米游社扫描二维码</value>
|
||||
<value>Отсканируйте QR-код с помощью Miyusha</value>
|
||||
</data>
|
||||
<data name="ViewDialogReconfirmTextHeader" xml:space="preserve">
|
||||
<value>为防止你在无意间启用,请输入正在启用的功能开关的<b>标题名称</b></value>
|
||||
@@ -1356,7 +1368,7 @@
|
||||
<value>你正在启用一个危险功能</value>
|
||||
</data>
|
||||
<data name="ViewDialogSettingDeleteUserDataContent" xml:space="preserve">
|
||||
<value>该操作是不可逆的,所有用户登录状态会丢失</value>
|
||||
<value>Эта операция необратима, и все входы пользователей в систему будут удалены</value>
|
||||
</data>
|
||||
<data name="ViewDialogSettingDeleteUserDataTitle" xml:space="preserve">
|
||||
<value>是否永久删除用户数据</value>
|
||||
@@ -1368,7 +1380,7 @@
|
||||
<value>当前未登录胡桃账号,上传深渊数据无法获赠胡桃云时长</value>
|
||||
</data>
|
||||
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginPrimaryButtonText" xml:space="preserve">
|
||||
<value>继续上传</value>
|
||||
<value>Продолжить загрузку</value>
|
||||
</data>
|
||||
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginTitle" xml:space="preserve">
|
||||
<value>上传深渊数据</value>
|
||||
@@ -1389,37 +1401,37 @@
|
||||
<value>在此处输入包含 SToken 的 Cookie</value>
|
||||
</data>
|
||||
<data name="ViewDialogUserTitle" xml:space="preserve">
|
||||
<value>设置 Cookie</value>
|
||||
<value>Установка cookie-файлов</value>
|
||||
</data>
|
||||
<data name="ViewFeedbackHeader" xml:space="preserve">
|
||||
<value>反馈中心</value>
|
||||
<value>Центр обратной связи</value>
|
||||
</data>
|
||||
<data name="ViewGachaLogHeader" xml:space="preserve">
|
||||
<value>祈愿记录</value>
|
||||
<value>История молитв</value>
|
||||
</data>
|
||||
<data name="ViewGuideStaticResourceDownloadSize" xml:space="preserve">
|
||||
<value>预计下载大小:{0}</value>
|
||||
<value>Примерный размер загрузки: {0}</value>
|
||||
</data>
|
||||
<data name="ViewGuideStepAgreementIHaveReadText" xml:space="preserve">
|
||||
<value>我已阅读并同意</value>
|
||||
<value>Я прочитал и согласен с</value>
|
||||
</data>
|
||||
<data name="ViewGuideStepAgreementIssueReport" xml:space="preserve">
|
||||
<value>问题报告方式与流程</value>
|
||||
</data>
|
||||
<data name="ViewGuideStepAgreementOpenSourceLicense" xml:space="preserve">
|
||||
<value>Snap Hutao 开源许可</value>
|
||||
<value>Лицензия с открытым исходным кодом Snap Hutao</value>
|
||||
</data>
|
||||
<data name="ViewGuideStepAgreementPrivacyPolicy" xml:space="preserve">
|
||||
<value>用户数据与隐私权益</value>
|
||||
<value>Данные пользователя и права на конфиденциальность</value>
|
||||
</data>
|
||||
<data name="ViewGuideStepAgreementTermOfService" xml:space="preserve">
|
||||
<value>用户使用协议与法律声明</value>
|
||||
<value>Пользовательское соглашение</value>
|
||||
</data>
|
||||
<data name="ViewGuideStepCommonSetting" xml:space="preserve">
|
||||
<value>基础设置</value>
|
||||
<value>Основные настройки</value>
|
||||
</data>
|
||||
<data name="ViewGuideStepCommonSettingHint" xml:space="preserve">
|
||||
<value>稍后可以在设置中修改</value>
|
||||
<value>Это можно изменить позже в настройках</value>
|
||||
</data>
|
||||
<data name="ViewGuideStepDocument" xml:space="preserve">
|
||||
<value>Документация</value>
|
||||
@@ -1556,6 +1568,12 @@
|
||||
<data name="ViewModelCultivationProjectInvalidName" xml:space="preserve">
|
||||
<value>不能添加名称无效的计划</value>
|
||||
</data>
|
||||
<data name="ViewModelCultivationRemoveProjectContent" xml:space="preserve">
|
||||
<value>此操作不可逆,此计划的养成物品与背包材料将会丢失</value>
|
||||
</data>
|
||||
<data name="ViewModelCultivationRemoveProjectTitle" xml:space="preserve">
|
||||
<value>确认要删除当前计划吗?</value>
|
||||
</data>
|
||||
<data name="ViewModelDailyNoteConfigWebhookUrlComplete" xml:space="preserve">
|
||||
<value>实时便笺 Webhook Url 配置成功</value>
|
||||
</data>
|
||||
@@ -1946,6 +1964,9 @@
|
||||
<data name="ViewPageDailyNoteNotificationSetting" xml:space="preserve">
|
||||
<value>Настройки уведомлений</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteNotificationUnavailableHint" xml:space="preserve">
|
||||
<value>胡桃的通知权限已被关闭</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteRefresh" xml:space="preserve">
|
||||
<value>Обновить</value>
|
||||
</data>
|
||||
@@ -1976,6 +1997,9 @@
|
||||
<data name="ViewPageDailyNoteSettingRefreshHeader" xml:space="preserve">
|
||||
<value>Обновить</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteSettingRefreshNotifyIconDisabledHint" xml:space="preserve">
|
||||
<value>未启用通知区域图标,关闭窗口后自动刷新将不会执行</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteSlientModeDescription" xml:space="preserve">
|
||||
<value>在我游玩原神时不通知我</value>
|
||||
</data>
|
||||
@@ -2544,7 +2568,7 @@
|
||||
<value>前往反馈</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingGachaLogHeader" xml:space="preserve">
|
||||
<value>祈愿记录</value>
|
||||
<value>История молитв</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingGameHeader" xml:space="preserve">
|
||||
<value>游戏</value>
|
||||
@@ -2580,7 +2604,7 @@
|
||||
<value>Заметки в реальном времени</value>
|
||||
</data>
|
||||
<data name="ViewpageSettingHomeCardItemgachaStatisticsHeader" xml:space="preserve">
|
||||
<value>祈愿记录</value>
|
||||
<value>История молитв</value>
|
||||
</data>
|
||||
<data name="ViewpageSettingHomeCardItemLaunchGameHeader" xml:space="preserve">
|
||||
<value>Game Launcher</value>
|
||||
@@ -2654,6 +2678,12 @@
|
||||
<data name="ViewPageSettingKeyShortcutHeader" xml:space="preserve">
|
||||
<value>快捷键</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingNotifyIconDescription" xml:space="preserve">
|
||||
<value>在通知区域显示图标,以允许执行后台任务,重启后生效</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingNotifyIconHeader" xml:space="preserve">
|
||||
<value>通知区域图标</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingOfficialSiteNavigate" xml:space="preserve">
|
||||
<value>前往官网</value>
|
||||
</data>
|
||||
@@ -2966,6 +2996,9 @@
|
||||
<data name="ViewUserDocumentationHeader" xml:space="preserve">
|
||||
<value>Документация</value>
|
||||
</data>
|
||||
<data name="ViewUserLoginMihoyoUserDisabledTooltip" xml:space="preserve">
|
||||
<value>由于米游社安全策略的相关更改,网页登录暂不可用</value>
|
||||
</data>
|
||||
<data name="ViewUserNoUserHint" xml:space="preserve">
|
||||
<value>Вы не вошли в приложение</value>
|
||||
</data>
|
||||
@@ -3006,7 +3039,7 @@
|
||||
<value>武器资料</value>
|
||||
</data>
|
||||
<data name="WebAnnouncementMatchPermanentActivityTime" xml:space="preserve">
|
||||
<value>(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)后永久开放</value>
|
||||
<value>(?:(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)|&lt;t class=\"t_(?:gl|lc)\".*?&gt;(.*?)&lt;/t&gt;)后永久开放</value>
|
||||
</data>
|
||||
<data name="WebAnnouncementMatchPersistentActivityTime" xml:space="preserve">
|
||||
<value>〓活动时间〓.*?(\d\.\d)版本期间持续开放</value>
|
||||
@@ -3044,6 +3077,9 @@
|
||||
<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>
|
||||
@@ -3224,6 +3260,9 @@
|
||||
<data name="WebResponseRequestExceptionFormat" xml:space="preserve">
|
||||
<value>[{1}] исключение сетевого запроса в [{0}] пожалуйста, повторите попытку позже</value>
|
||||
</data>
|
||||
<data name="WebResponseSignInErrorHint" xml:space="preserve">
|
||||
<value>登录失败,请前往 HoYoLAB 初始化账号,原始消息:{0}</value>
|
||||
</data>
|
||||
<data name="WindowIdentifyMonitorHeader" xml:space="preserve">
|
||||
<value>显示器编号</value>
|
||||
</data>
|
||||
|
||||
3269
src/Snap.Hutao/Snap.Hutao/Resource/Localization/SH.vi.resx
Normal file
3269
src/Snap.Hutao/Snap.Hutao/Resource/Localization/SH.vi.resx
Normal file
File diff suppressed because it is too large
Load Diff
@@ -121,7 +121,7 @@
|
||||
<value>胡桃 Dev {0}</value>
|
||||
</data>
|
||||
<data name="AppElevatedDevNameAndVersion" xml:space="preserve">
|
||||
<value>胡桃Dev {0} [系統管理员]</value>
|
||||
<value>胡桃 Dev {0} [系統管理員]</value>
|
||||
</data>
|
||||
<data name="AppElevatedNameAndVersion" xml:space="preserve">
|
||||
<value>胡桃 {0} [系統管理員]</value>
|
||||
@@ -163,19 +163,19 @@
|
||||
<value>清單</value>
|
||||
</data>
|
||||
<data name="CoreExceptionServiceDatabaseCorruptedMessage" xml:space="preserve">
|
||||
<value>資料庫已損壞:{0}</value>
|
||||
<value>數據庫已損壞:{0}</value>
|
||||
</data>
|
||||
<data name="CoreExceptionServiceUserdataCorruptedMessage" xml:space="preserve">
|
||||
<value>用户數據已損壞:{0}</value>
|
||||
<value>用戶數據已損壞:{0}</value>
|
||||
</data>
|
||||
<data name="CoreIOPickerExtensionPickerExceptionInfoBarMessage" xml:space="preserve">
|
||||
<value>請勿在系統管理員模式下使用此功能 {0}</value>
|
||||
</data>
|
||||
<data name="CoreIOPickerExtensionPickerExceptionInfoBarTitle" xml:space="preserve">
|
||||
<value>無法打開文件選擇器</value>
|
||||
<value>無法打開檔案選擇器</value>
|
||||
</data>
|
||||
<data name="CoreIOTempFileCreateFail" xml:space="preserve">
|
||||
<value>權限不足,創建臨時文件失敗</value>
|
||||
<value>權限不足,創建臨時檔案失敗</value>
|
||||
</data>
|
||||
<data name="CoreJumpListHelperLaunchGameItemDisplayName" xml:space="preserve">
|
||||
<value>啟動遊戲</value>
|
||||
@@ -192,6 +192,18 @@
|
||||
<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="CoreWindowingNotifyIconPromotedHint" xml:space="preserve">
|
||||
<value>胡桃已進入後臺運行</value>
|
||||
</data>
|
||||
<data name="CoreWindowingNotifyIconViewLabel" xml:space="preserve">
|
||||
<value>窗口</value>
|
||||
</data>
|
||||
<data name="CoreWindowThemeDark" xml:space="preserve">
|
||||
<value>深色</value>
|
||||
</data>
|
||||
@@ -262,16 +274,16 @@
|
||||
<value>上場 {0} 次</value>
|
||||
</data>
|
||||
<data name="ModelBindingLaunchGameLaunchSchemeBilibili" xml:space="preserve">
|
||||
<value>渠道伺服器</value>
|
||||
<value>渠道服</value>
|
||||
</data>
|
||||
<data name="ModelBindingLaunchGameLaunchSchemeChinese" xml:space="preserve">
|
||||
<value>官方伺服器</value>
|
||||
<value>官方服</value>
|
||||
</data>
|
||||
<data name="ModelBindingLaunchGameLaunchSchemeOversea" xml:space="preserve">
|
||||
<value>國際伺服器</value>
|
||||
<value>國際服</value>
|
||||
</data>
|
||||
<data name="ModelBindingUserInitializationFailed" xml:space="preserve">
|
||||
<value>網路連線錯誤</value>
|
||||
<value>網絡異常</value>
|
||||
</data>
|
||||
<data name="ModelEntityDailyNoteNotRefreshed" xml:space="preserve">
|
||||
<value>尚未重新整理</value>
|
||||
@@ -340,7 +352,7 @@
|
||||
<value>蘿莉</value>
|
||||
</data>
|
||||
<data name="ModelIntrinsicBodyTypeMale" xml:space="preserve">
|
||||
<value>成年男子</value>
|
||||
<value>成男</value>
|
||||
</data>
|
||||
<data name="ModelIntrinsicElementNameElec" xml:space="preserve">
|
||||
<value>雷</value>
|
||||
@@ -409,7 +421,7 @@
|
||||
<comment>Need EXACT same string in game</comment>
|
||||
</data>
|
||||
<data name="ModelMetadataAvatarPlayerName" xml:space="preserve">
|
||||
<value>旅人</value>
|
||||
<value>旅行者</value>
|
||||
</data>
|
||||
<data name="ModelMetadataFetterInfoBirthdayFormat" xml:space="preserve">
|
||||
<value>{0} 月 {1} 日</value>
|
||||
@@ -540,7 +552,7 @@
|
||||
<value>精煉 {0} 階</value>
|
||||
</data>
|
||||
<data name="MustSelectUserAndUid" xml:space="preserve">
|
||||
<value>必须登入 米遊社/HoYoLAB 並選定一個用戶與角色</value>
|
||||
<value>必須登入 米游社/ HoYoLAB 並選擇一個用戶與角色</value>
|
||||
</data>
|
||||
<data name="ServerGachaLogServiceDeleteEntrySucceed" xml:space="preserve">
|
||||
<value>刪除了 UID:{0} 的 {1} 筆祈願記錄</value>
|
||||
@@ -561,7 +573,7 @@
|
||||
<value>上傳了 UID:{0} 的 {1} 筆祈願記錄,儲存了 {2} 筆</value>
|
||||
</data>
|
||||
<data name="ServerPassportLoginRequired" xml:space="preserve">
|
||||
<value>請先登入或注冊胡桃帳號</value>
|
||||
<value>請先登入或註冊胡桃帳號</value>
|
||||
</data>
|
||||
<data name="ServerPassportLoginSucceed" xml:space="preserve">
|
||||
<value>登入成功</value>
|
||||
@@ -573,25 +585,25 @@
|
||||
<value>新密碼設定成功</value>
|
||||
</data>
|
||||
<data name="ServerPassportServiceEmailHasNotRegistered" xml:space="preserve">
|
||||
<value>當前郵箱尚未註冊</value>
|
||||
<value>當前電子郵件地址尚未註冊</value>
|
||||
</data>
|
||||
<data name="ServerPassportServiceEmailHasRegistered" xml:space="preserve">
|
||||
<value>當前郵箱已被註冊</value>
|
||||
<value>當前電子郵件地址已被註冊</value>
|
||||
</data>
|
||||
<data name="ServerPassportServiceInternalException" xml:space="preserve">
|
||||
<value>註冊失敗,伺服器異常,請盡快聯繫開發者解決</value>
|
||||
</data>
|
||||
<data name="ServerPassportServiceUnregisterFailed" xml:space="preserve">
|
||||
<value>使用者不存在,刪除帳號失敗</value>
|
||||
<value>用戶不存在,刪除帳號失敗</value>
|
||||
</data>
|
||||
<data name="ServerPassportUnregisterSucceed" xml:space="preserve">
|
||||
<value>使用者刪除成功</value>
|
||||
<value>用戶刪除成功</value>
|
||||
</data>
|
||||
<data name="ServerPassportUserInfoNotExist" xml:space="preserve">
|
||||
<value>使用者不存在,獲取使用者信息失敗</value>
|
||||
<value>用戶不存在,獲取用戶信息失敗</value>
|
||||
</data>
|
||||
<data name="ServerPassportUserNameOrPasswordIncorrect" xml:space="preserve">
|
||||
<value>使用者名稱或密碼錯誤</value>
|
||||
<value>用戶名稱或密碼錯誤</value>
|
||||
</data>
|
||||
<data name="ServerPassportVerifyFailed" xml:space="preserve">
|
||||
<value>驗證失敗</value>
|
||||
@@ -600,10 +612,10 @@
|
||||
<value>驗證請求失敗,不是當前登入的帳號</value>
|
||||
</data>
|
||||
<data name="ServerPassportVerifyRequestSuccess" xml:space="preserve">
|
||||
<value>驗證碼已發送至郵箱</value>
|
||||
<value>驗證碼已發送至信箱</value>
|
||||
</data>
|
||||
<data name="ServerPassportVerifyRequestUserAlreadyExisted" xml:space="preserve">
|
||||
<value>驗證請求失敗,當前郵箱已被註冊</value>
|
||||
<value>驗證請求失敗,當前電子郵件地址已被註冊</value>
|
||||
</data>
|
||||
<data name="ServerPassportVerifyTooFrequent" xml:space="preserve">
|
||||
<value>驗證請求過快,請 1 分鐘後再試</value>
|
||||
@@ -639,7 +651,7 @@
|
||||
<value>上傳深淵記錄成功,但未登入胡桃通行證,無法獲贈祈願記錄上傳服務時長</value>
|
||||
</data>
|
||||
<data name="ServerRecordUploadSuccessButNoSuchUser" xml:space="preserve">
|
||||
<value>上傳深淵記錄成功,但無法找到使用者,無法獲贈祈願記錄上傳服務時長</value>
|
||||
<value>上傳深淵記錄成功,但無法找到用戶,無法獲贈祈願記錄上傳服務時長</value>
|
||||
</data>
|
||||
<data name="ServerRecordUploadSuccessButNotFirstTimeAtCurrentSchedule" xml:space="preserve">
|
||||
<value>上傳深淵記錄成功,但不是本期首次提交,無法獲贈祈願記錄上傳服務時長</value>
|
||||
@@ -651,7 +663,7 @@
|
||||
<value>UIAF Json 檔案</value>
|
||||
</data>
|
||||
<data name="ServiceAchievementUIAFImportPickerTitile" xml:space="preserve">
|
||||
<value>打開 UIAF Json 文件</value>
|
||||
<value>打開 UIAF Json 檔案</value>
|
||||
</data>
|
||||
<data name="ServiceAchievementUserdataCorruptedAchievementIdNotUnique" xml:space="preserve">
|
||||
<value>單個成就存檔內發現多個相同的成就 Id</value>
|
||||
@@ -771,10 +783,10 @@
|
||||
<value>養成計算:{0:MM-dd HH:mm}</value>
|
||||
</data>
|
||||
<data name="ServiceAvatarInfoSummaryGameRecordNotRefreshed" xml:space="preserve">
|
||||
<value>原神戰績:尚未重新整理</value>
|
||||
<value>戰績:尚未重新整理</value>
|
||||
</data>
|
||||
<data name="ServiceAvatarInfoSummaryGameRecordRefreshTimeFormat" xml:space="preserve">
|
||||
<value>原神戰績:{0:MM-dd HH:mm}</value>
|
||||
<value>戰績:{0:MM-dd HH:mm}</value>
|
||||
</data>
|
||||
<data name="ServiceAvatarInfoSummaryShowcaseNotRefreshed" xml:space="preserve">
|
||||
<value>角色櫥窗:尚未重新整理</value>
|
||||
@@ -843,7 +855,7 @@
|
||||
<value>目前原粹樹脂:{0}</value>
|
||||
</data>
|
||||
<data name="ServiceDailyNoteNotifierTitle" xml:space="preserve">
|
||||
<value>實時便箋提醒</value>
|
||||
<value>即時便箋提醒</value>
|
||||
</data>
|
||||
<data name="ServiceDailyNoteNotifierTransformer" xml:space="preserve">
|
||||
<value>參數質變儀</value>
|
||||
@@ -894,7 +906,7 @@
|
||||
<value>請求驗證密鑰失敗</value>
|
||||
</data>
|
||||
<data name="ServiceGachaLogUrlProviderCachePathInvalid" xml:space="preserve">
|
||||
<value>未正確提供原神路徑,或目前設置的路徑不正確</value>
|
||||
<value>未正確提供原神路徑,或目前設定的路徑不正確</value>
|
||||
</data>
|
||||
<data name="ServiceGachaLogUrlProviderCachePathNotFound" xml:space="preserve">
|
||||
<value>找不到原神內置瀏覽器緩存路徑:\n{0}</value>
|
||||
@@ -915,13 +927,13 @@
|
||||
<value>不支持的 Item Id:{0}</value>
|
||||
</data>
|
||||
<data name="ServiceGachaUIGFImportLanguageNotMatch" xml:space="preserve">
|
||||
<value>UIGF 文件的語言:{0} 與胡桃的語言:{1} 不對應,請切換到對應語言重試</value>
|
||||
<value>UIGF 檔案的語言:{0} 與胡桃的語言:{1} 不對應,請切換到對應語言重試</value>
|
||||
</data>
|
||||
<data name="ServiceGameDetectGameAccountMultiMatched" xml:space="preserve">
|
||||
<value>存在多個匹配賬號,請刪除重複的賬號</value>
|
||||
</data>
|
||||
<data name="ServiceGameEnsureGameResourceInsufficientDirectoryPermissions" xml:space="preserve">
|
||||
<value>文件系統權限不足,無法轉換伺服器</value>
|
||||
<value>檔案系統權限不足,無法轉換伺服器</value>
|
||||
</data>
|
||||
<data name="ServiceGameEnsureGameResourceQueryResourceInformation" xml:space="preserve">
|
||||
<value>下載遊戲資源索引</value>
|
||||
@@ -969,10 +981,10 @@
|
||||
<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>
|
||||
<value>在 Unity 日誌檔案中無法找到遊戲路徑</value>
|
||||
</data>
|
||||
<data name="ServiceGamePackageConvertMoveFileBackupFormat" xml:space="preserve">
|
||||
<value>備份:{0}</value>
|
||||
@@ -984,7 +996,7 @@
|
||||
<value>替換:{0}</value>
|
||||
</data>
|
||||
<data name="ServiceGamePackageRenameDataFolderFailed" xml:space="preserve">
|
||||
<value>重新命名資料文件夾名稱失敗</value>
|
||||
<value>重新命名資料檔案夾名稱失敗</value>
|
||||
</data>
|
||||
<data name="ServiceGamePackageRequestPackageVerion" xml:space="preserve">
|
||||
<value>正在獲取 Package Version</value>
|
||||
@@ -993,19 +1005,19 @@
|
||||
<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>
|
||||
</data>
|
||||
<data name="ServiceGameRegisteryInteropLongPathsDisabled" xml:space="preserve">
|
||||
<value>未開啟長路徑功能,無法設定註冊表鍵值</value>
|
||||
<value>未開啟長路徑功能,無法設定登錄檔鍵值</value>
|
||||
</data>
|
||||
<data name="ServiceGameSetMultiChannelConfigFileNotFound" xml:space="preserve">
|
||||
<value>無法讀取遊戲設定檔 {0},可能是檔案不存在</value>
|
||||
</data>
|
||||
<data name="ServiceGameSetMultiChannelUnauthorizedAccess" xml:space="preserve">
|
||||
<value>無法讀取或儲存配置文件,請用系統管理員模式重試</value>
|
||||
<value>無法讀取或儲存配置檔案,請用系統管理員模式重試</value>
|
||||
</data>
|
||||
<data name="ServiceGameUnlockerFindModuleNoModuleFound" xml:space="preserve">
|
||||
<value>在尋找必要的模組時遇到問題:無法讀取任何模組,可能是保護驅動已經載入完成,請重試</value>
|
||||
@@ -1026,19 +1038,19 @@
|
||||
<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} | Error:{1}:元資料校驗文件下載失敗</value>
|
||||
<value>HTTP {0} | Error:{1}:元資料校驗檔案下載失敗</value>
|
||||
</data>
|
||||
<data name="ServiceMetadataNotInitialized" xml:space="preserve">
|
||||
<value>元數據服務未初始化或初始化失敗</value>
|
||||
</data>
|
||||
<data name="ServiceMetadataParseFailed" xml:space="preserve">
|
||||
<value>元數據文件解析失敗</value>
|
||||
<value>元數據校驗檔案解析失敗</value>
|
||||
</data>
|
||||
<data name="ServiceMetadataRequestFailed" xml:space="preserve">
|
||||
<value>元數據文件下載失敗</value>
|
||||
<value>元數據校驗檔案下載失敗</value>
|
||||
</data>
|
||||
<data name="ServiceMetadataVersionNotSupported" xml:space="preserve">
|
||||
<value>你的胡桃版本過低,請盡快升級</value>
|
||||
@@ -1053,7 +1065,7 @@
|
||||
<value>獲取獎勵清單失敗</value>
|
||||
</data>
|
||||
<data name="ServiceSignInRiskVerificationFailed" xml:space="preserve">
|
||||
<value>驗證失敗,請前往HoYoLAB原神簽到頁面自行領取獎勵</value>
|
||||
<value>驗證失敗,請前往 HoYoLAB 原神簽到頁面自行領取獎勵</value>
|
||||
</data>
|
||||
<data name="ServiceSignInSuccessRewardFormat" xml:space="preserve">
|
||||
<value>簽到成功,{0}×{1}</value>
|
||||
@@ -1065,7 +1077,7 @@
|
||||
<value>發現新版本 {0}</value>
|
||||
</data>
|
||||
<data name="ServiceUserCurrentMultiMatched" xml:space="preserve">
|
||||
<value>已选中多条用户记录</value>
|
||||
<value>多個用戶記錄為選中狀態</value>
|
||||
</data>
|
||||
<data name="ServiceUserCurrentUpdateAndSaveFailed" xml:space="preserve">
|
||||
<value>用戶 {0} 狀態儲存失敗</value>
|
||||
@@ -1167,7 +1179,7 @@
|
||||
<value>在此處輸入</value>
|
||||
</data>
|
||||
<data name="ViewDialogAchievementArchiveCreateTitle" xml:space="preserve">
|
||||
<value>設置成就存檔的名稱</value>
|
||||
<value>設定成就存檔的名稱</value>
|
||||
</data>
|
||||
<data name="ViewDialogAchievementArchiveImportStrategy" xml:space="preserve">
|
||||
<value>匯入模式</value>
|
||||
@@ -1230,7 +1242,7 @@
|
||||
<value>在主頁顯示卡片</value>
|
||||
</data>
|
||||
<data name="ViewDialogDailyNoteNotificationTitle" xml:space="preserve">
|
||||
<value>實時便箋通知設置</value>
|
||||
<value>即時便箋通知設定</value>
|
||||
</data>
|
||||
<data name="ViewDialogDailyNoteNotificationTransformerNotify" xml:space="preserve">
|
||||
<value>參數質變儀提醒</value>
|
||||
@@ -1335,10 +1347,10 @@
|
||||
<value>為帳號命名</value>
|
||||
</data>
|
||||
<data name="ViewDialogLaunchGameConfigurationFixDialogHint" xml:space="preserve">
|
||||
<value>請選擇當前遊戲路徑對應的遊戲服務器</value>
|
||||
<value>請選擇當前遊戲路徑對應的遊戲伺服器</value>
|
||||
</data>
|
||||
<data name="ViewDialogLaunchGameConfigurationFixDialogTitle" xml:space="preserve">
|
||||
<value>正在修複配置文件</value>
|
||||
<value>正在修複配置檔案</value>
|
||||
</data>
|
||||
<data name="ViewDialogLaunchGamePackageConvertHint" xml:space="preserve">
|
||||
<value>轉換可能需要花費一段時間,請勿關閉胡桃</value>
|
||||
@@ -1347,7 +1359,7 @@
|
||||
<value>正在轉換客戶端</value>
|
||||
</data>
|
||||
<data name="ViewDialogQRCodeTitle" xml:space="preserve">
|
||||
<value>使用米遊社掃描 QR 碼</value>
|
||||
<value>使用米游社掃描 QR 碼</value>
|
||||
</data>
|
||||
<data name="ViewDialogReconfirmTextHeader" xml:space="preserve">
|
||||
<value>為防止你在無意間啟用,請輸入正在啟用的功能開關的<b>標題名稱</b></value>
|
||||
@@ -1362,19 +1374,19 @@
|
||||
<value>是否永久刪除用戶數據</value>
|
||||
</data>
|
||||
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginCloseButtonText" xml:space="preserve">
|
||||
<value>前往登录</value>
|
||||
<value>前往登入畫面</value>
|
||||
</data>
|
||||
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginHint" xml:space="preserve">
|
||||
<value>当前未登录胡桃账号,上传深渊数据无法获赠胡桃云时长</value>
|
||||
<value>當前未登入胡桃賬號,上傳深淵數據無法獲贈胡桃雲時長</value>
|
||||
</data>
|
||||
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginPrimaryButtonText" xml:space="preserve">
|
||||
<value>继续上传</value>
|
||||
<value>繼續上傳</value>
|
||||
</data>
|
||||
<data name="ViewDialogSpiralAbyssUploadRecordHomaNotLoginTitle" xml:space="preserve">
|
||||
<value>上传深渊数据</value>
|
||||
<value>Загрузите данные о Бездне</value>
|
||||
</data>
|
||||
<data name="ViewDialogUpdatePackageDownloadUpdatelogLinkContent" xml:space="preserve">
|
||||
<value>查看更新日志</value>
|
||||
<value>查看更新日誌</value>
|
||||
</data>
|
||||
<data name="ViewDialogUserDocumentAction" xml:space="preserve">
|
||||
<value>立即前往</value>
|
||||
@@ -1416,10 +1428,10 @@
|
||||
<value>用戶使用協議與法律聲明</value>
|
||||
</data>
|
||||
<data name="ViewGuideStepCommonSetting" xml:space="preserve">
|
||||
<value>基礎設置</value>
|
||||
<value>基礎設定</value>
|
||||
</data>
|
||||
<data name="ViewGuideStepCommonSettingHint" xml:space="preserve">
|
||||
<value>稍後可以在設置中修改</value>
|
||||
<value>稍後可以在設定中修改</value>
|
||||
</data>
|
||||
<data name="ViewGuideStepDocument" xml:space="preserve">
|
||||
<value>文檔</value>
|
||||
@@ -1449,10 +1461,10 @@
|
||||
<value>資源</value>
|
||||
</data>
|
||||
<data name="ViewGuideStepStaticResourceSetting" xml:space="preserve">
|
||||
<value>圖像資源設置</value>
|
||||
<value>圖像資源設定</value>
|
||||
</data>
|
||||
<data name="ViewGuideStepStaticResourceSettingHint" xml:space="preserve">
|
||||
<value>* 除非你卸載並重新安裝胡桃,否則你將無法更改這些設置</value>
|
||||
<value>* 除非你卸載並重新安裝胡桃,否則你將無法更改這些設定</value>
|
||||
</data>
|
||||
<data name="ViewGuideStepStaticResourceSettingMinimumHeader" xml:space="preserve">
|
||||
<value>圖片資源包體</value>
|
||||
@@ -1556,11 +1568,17 @@
|
||||
<data name="ViewModelCultivationProjectInvalidName" xml:space="preserve">
|
||||
<value>不能新增名稱無效的計劃</value>
|
||||
</data>
|
||||
<data name="ViewModelCultivationRemoveProjectContent" xml:space="preserve">
|
||||
<value>此操作不可逆,此計劃的養成物品與背包材料將會丟失</value>
|
||||
</data>
|
||||
<data name="ViewModelCultivationRemoveProjectTitle" xml:space="preserve">
|
||||
<value>確定要刪除當前計劃嗎?</value>
|
||||
</data>
|
||||
<data name="ViewModelDailyNoteConfigWebhookUrlComplete" xml:space="preserve">
|
||||
<value>即時便箋 Webhook URL 配置成功</value>
|
||||
</data>
|
||||
<data name="ViewModelDailyNoteHoyolabVerificationUnsupported" xml:space="preserve">
|
||||
<value>HoYoLAB 賬號不支持驗證實时便箋</value>
|
||||
<value>HoYoLAB 賬號不支持驗證即時便箋</value>
|
||||
</data>
|
||||
<data name="ViewModelDailyNoteModifyTaskFail" xml:space="preserve">
|
||||
<value>修改計劃任務失敗</value>
|
||||
@@ -1581,7 +1599,7 @@
|
||||
<value>8 分鐘 | 1 樹脂</value>
|
||||
</data>
|
||||
<data name="ViewModelDailyNoteRequestProgressTitle" xml:space="preserve">
|
||||
<value>正在獲取實時便箋信息,請稍候</value>
|
||||
<value>正在獲取即時便箋信息,請稍候</value>
|
||||
</data>
|
||||
<data name="ViewModelExportSuccessMessage" xml:space="preserve">
|
||||
<value>成功儲存至指定位置</value>
|
||||
@@ -1590,13 +1608,13 @@
|
||||
<value>匯出成功</value>
|
||||
</data>
|
||||
<data name="ViewModelExportWarningMessage" xml:space="preserve">
|
||||
<value>寫入文件時遇到問題</value>
|
||||
<value>寫入檔案時遇到問題</value>
|
||||
</data>
|
||||
<data name="ViewModelExportWarningTitle" xml:space="preserve">
|
||||
<value>匯出失敗</value>
|
||||
</data>
|
||||
<data name="ViewModelGachaLogExportFileType" xml:space="preserve">
|
||||
<value>UIFG JSON 文件</value>
|
||||
<value>UIFG JSON 檔案</value>
|
||||
</data>
|
||||
<data name="ViewModelGachaLogImportComplete" xml:space="preserve">
|
||||
<value>匯入完成</value>
|
||||
@@ -1653,7 +1671,7 @@
|
||||
<value>下一步</value>
|
||||
</data>
|
||||
<data name="ViewModelGuideActionStaticResourceBegin" xml:space="preserve">
|
||||
<value>下載資源文件中,請稍候</value>
|
||||
<value>下載資源檔案中,請稍候</value>
|
||||
</data>
|
||||
<data name="ViewModelGuideStaticResourceQualityHigh" xml:space="preserve">
|
||||
<value>高品質</value>
|
||||
@@ -1662,7 +1680,7 @@
|
||||
<value>原圖</value>
|
||||
</data>
|
||||
<data name="ViewModelHutaoPassportEmailNotValidHint" xml:space="preserve">
|
||||
<value>請輸入正確的郵箱</value>
|
||||
<value>請輸入正確的電子郵件地址</value>
|
||||
</data>
|
||||
<data name="ViewModelImportFromClipboardErrorTitle" xml:space="preserve">
|
||||
<value>剪貼板中的文本格式不正塙</value>
|
||||
@@ -1680,7 +1698,7 @@
|
||||
<value>切換伺服器失敗</value>
|
||||
</data>
|
||||
<data name="ViewModelLaunchGameFixConfigurationFileButtonText" xml:space="preserve">
|
||||
<value>修複配置文件</value>
|
||||
<value>修複配置檔案</value>
|
||||
</data>
|
||||
<data name="ViewModelLaunchGameFixConfigurationFileSuccess" xml:space="preserve">
|
||||
<value>修複完成</value>
|
||||
@@ -1710,7 +1728,7 @@
|
||||
<value>操作完成</value>
|
||||
</data>
|
||||
<data name="ViewModelSettingClearWebCacheFail" xml:space="preserve">
|
||||
<value>清除失敗,文件目錄權限不足,請使用系統管理員模式重試</value>
|
||||
<value>清除失敗,檔案目錄權限不足,請使用系統管理員模式重試</value>
|
||||
</data>
|
||||
<data name="ViewModelSettingClearWebCachePathInvalid" xml:space="preserve">
|
||||
<value>清除失敗,找不到目錄:{0}</value>
|
||||
@@ -1737,7 +1755,7 @@
|
||||
<value>無感驗證復合 URL 配置成功</value>
|
||||
</data>
|
||||
<data name="ViewModelSettingResetStaticResourceProgress" xml:space="preserve">
|
||||
<value>正在重置图片资源</value>
|
||||
<value>正在重設圖片資源</value>
|
||||
</data>
|
||||
<data name="ViewModelSettingSetDataFolderSuccess" xml:space="preserve">
|
||||
<value>設置數據目錄成功,重新啟動以應用更改</value>
|
||||
@@ -1782,7 +1800,7 @@
|
||||
<value>待處理</value>
|
||||
</data>
|
||||
<data name="ViewModelWelcomeDownloadSummaryException" xml:space="preserve">
|
||||
<value>文件下載異常</value>
|
||||
<value>檔案下載異常</value>
|
||||
</data>
|
||||
<data name="ViewPageAchievementAddArchive" xml:space="preserve">
|
||||
<value>建立新存檔</value>
|
||||
@@ -1797,7 +1815,7 @@
|
||||
<value>從剪貼簿匯入</value>
|
||||
</data>
|
||||
<data name="ViewPageAchievementImportFromFile" xml:space="preserve">
|
||||
<value>從 UIAF 文件匯入</value>
|
||||
<value>從 UIAF 檔案匯入</value>
|
||||
</data>
|
||||
<data name="ViewPageAchievementImportLabel" xml:space="preserve">
|
||||
<value>匯入</value>
|
||||
@@ -1860,7 +1878,7 @@
|
||||
<value>同步角色天賦信息</value>
|
||||
</data>
|
||||
<data name="ViewPageAvatarPropertyRefreshFromHoyolabGameRecord" xml:space="preserve">
|
||||
<value>從米遊社原神戰績同步</value>
|
||||
<value>從 HoYoLAB - 戰績同步</value>
|
||||
</data>
|
||||
<data name="ViewPageAvatarPropertyRefreshFromHoyolabGameRecordDescription" xml:space="preserve">
|
||||
<value>同步角色天賦外的大部分信息</value>
|
||||
@@ -1946,6 +1964,9 @@
|
||||
<data name="ViewPageDailyNoteNotificationSetting" xml:space="preserve">
|
||||
<value>通知設定</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteNotificationUnavailableHint" xml:space="preserve">
|
||||
<value>胡桃的通知權限已被關閉</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteRefresh" xml:space="preserve">
|
||||
<value>立即重新整理</value>
|
||||
</data>
|
||||
@@ -1968,7 +1989,7 @@
|
||||
<value>自動重新整理</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteSettingAutoRefreshDescription" xml:space="preserve">
|
||||
<value>間隔選定的時間後重新整理添加的實時便箋</value>
|
||||
<value>間隔選定的時間後重新整理添加的即時便箋</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteSettingRefreshElevatedHint" xml:space="preserve">
|
||||
<value>這些選項僅允許在非系統管理員模式下更改</value>
|
||||
@@ -1976,6 +1997,9 @@
|
||||
<data name="ViewPageDailyNoteSettingRefreshHeader" xml:space="preserve">
|
||||
<value>重新整理</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteSettingRefreshNotifyIconDisabledHint" xml:space="preserve">
|
||||
<value>為啟用通知區域圖標,關閉窗口後自動重新整理將不會執行</value>
|
||||
</data>
|
||||
<data name="ViewPageDailyNoteSlientModeDescription" xml:space="preserve">
|
||||
<value>在我游玩原神時不通知我</value>
|
||||
</data>
|
||||
@@ -2040,7 +2064,7 @@
|
||||
<value>胡桃雲</value>
|
||||
</data>
|
||||
<data name="ViewPageGachaLogHutaoCloudAfdianPurchaseDescription" xml:space="preserve">
|
||||
<value>前往愛發電購買相關服務</value>
|
||||
<value>前往爱发电購買相關服務</value>
|
||||
</data>
|
||||
<data name="ViewPageGachaLogHutaoCloudAfdianPurchaseHeader" xml:space="preserve">
|
||||
<value>購買/續費雲服務</value>
|
||||
@@ -2079,7 +2103,7 @@
|
||||
<value>輸入</value>
|
||||
</data>
|
||||
<data name="ViewPageGachaLogRecoverFromHutaoCloudDescription" xml:space="preserve">
|
||||
<value>從胡桃云恢復祈願紀錄</value>
|
||||
<value>從胡桃雲恢復祈願紀錄</value>
|
||||
</data>
|
||||
<data name="ViewPageGachaLogRefresh" xml:space="preserve">
|
||||
<value>重新整理</value>
|
||||
@@ -2229,7 +2253,7 @@
|
||||
<value>刪除帳號的數據將永遠丢失,無法恢復</value>
|
||||
</data>
|
||||
<data name="ViewPageHutaoPassportUserNameHint" xml:space="preserve">
|
||||
<value>請輸入電郵地址</value>
|
||||
<value>請輸入電子郵件地址</value>
|
||||
</data>
|
||||
<data name="ViewPageHutaoPassportVerifyCodeAction" xml:space="preserve">
|
||||
<value>取得驗證碼</value>
|
||||
@@ -2367,7 +2391,7 @@
|
||||
<value>綁定當前用戶的角色</value>
|
||||
</data>
|
||||
<data name="ViewPageLaunchGameSwitchAccountDescription" xml:space="preserve">
|
||||
<value>在游戲内切換賬號,網絡環境發生變化后需要重新手動檢測</value>
|
||||
<value>在游戲内切換賬號,網絡環境發生變化後需要重新手動檢測</value>
|
||||
</data>
|
||||
<data name="ViewPageLaunchGameSwitchAccountDetectAction" xml:space="preserve">
|
||||
<value>檢測</value>
|
||||
@@ -2382,7 +2406,7 @@
|
||||
<value>重新命名</value>
|
||||
</data>
|
||||
<data name="ViewPageLaunchGameSwitchSchemeDescription" xml:space="preserve">
|
||||
<value>切換遊戲伺服器(陸服/渠道服/國際服)</value>
|
||||
<value>切換遊戲伺服器(大陸伺服器/渠道伺服器/國際伺服器)</value>
|
||||
</data>
|
||||
<data name="ViewPageLaunchGameSwitchSchemeHeader" xml:space="preserve">
|
||||
<value>伺服器</value>
|
||||
@@ -2412,16 +2436,16 @@
|
||||
<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>
|
||||
</data>
|
||||
<data name="ViewPageLoginMihoyoUserTitle" xml:space="preserve">
|
||||
<value>在下方登入 miHoYo 通行證賬號</value>
|
||||
<value>在下方登入米哈游通行证</value>
|
||||
</data>
|
||||
<data name="ViewPageOpenScreenshotFolderAction" xml:space="preserve">
|
||||
<value>開啟截圖資料夾</value>
|
||||
<value>開啟截圖檔案夾</value>
|
||||
</data>
|
||||
<data name="ViewPageResetGamePathAction" xml:space="preserve">
|
||||
<value>選定遊戲路徑</value>
|
||||
@@ -2460,7 +2484,7 @@
|
||||
<value>圖片暫存存放在此</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingCacheFolderHeader" xml:space="preserve">
|
||||
<value>暫存檔案夾</value>
|
||||
<value>暫存 檔案夾</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingCardHutaoPassportHeader" xml:space="preserve">
|
||||
<value>胡桃通行證</value>
|
||||
@@ -2490,7 +2514,7 @@
|
||||
<value>用戶數據/元數據 存放在此</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingDataFolderHeader" xml:space="preserve">
|
||||
<value>資料檔案夾</value>
|
||||
<value>資料 檔案夾</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingDeleteCacheAction" xml:space="preserve">
|
||||
<value>刪除</value>
|
||||
@@ -2577,7 +2601,7 @@
|
||||
<value>成就管理</value>
|
||||
</data>
|
||||
<data name="ViewpageSettingHomeCardItemDailyNoteHeader" xml:space="preserve">
|
||||
<value>實時便籤</value>
|
||||
<value>即時便籤</value>
|
||||
</data>
|
||||
<data name="ViewpageSettingHomeCardItemgachaStatisticsHeader" xml:space="preserve">
|
||||
<value>祈願紀錄</value>
|
||||
@@ -2640,7 +2664,7 @@
|
||||
<value>刪除帳號</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingIsAdvancedLaunchOptionsEnabledDescription" xml:space="preserve">
|
||||
<value>在完整閱讀原神和胡桃工具箱使用者協定後,我選擇啟用「啟動遊戲 - 進階功能」</value>
|
||||
<value>在完整閱讀原神和胡桃工具箱用戶協定後,我選擇啟用「啟動遊戲 - 進階功能」</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingIsAdvancedLaunchOptionsEnabledHeader" xml:space="preserve">
|
||||
<value>進階功能</value>
|
||||
@@ -2654,6 +2678,12 @@
|
||||
<data name="ViewPageSettingKeyShortcutHeader" xml:space="preserve">
|
||||
<value>快速鍵</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingNotifyIconDescription" xml:space="preserve">
|
||||
<value>在通知區域顯示圖標,以允許執行後臺任務,重新啟動後生效</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingNotifyIconHeader" xml:space="preserve">
|
||||
<value>通知區域圖標</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingOfficialSiteNavigate" xml:space="preserve">
|
||||
<value>前往官網</value>
|
||||
</data>
|
||||
@@ -2661,7 +2691,7 @@
|
||||
<value>自定義背景圖片,支援 bmp / gif / ico / jpg / jpeg / png / tiff / webp 格式</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingOpenBackgroundImageFolderHeader" xml:space="preserve">
|
||||
<value>打開背景圖片資料夾</value>
|
||||
<value>打開背景圖片檔案夾</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingResetAction" xml:space="preserve">
|
||||
<value>重設</value>
|
||||
@@ -2691,7 +2721,7 @@
|
||||
<value>遊戲路徑</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingSetGamePathHint" xml:space="preserve">
|
||||
<value>設置遊戲路徑時,請選擇遊戲本體(YuanShen.exe 或 GenshinImpact.exe) 而不是啟動器(launcher.exe)</value>
|
||||
<value>設定遊戲路徑時,請選擇遊戲本體(YuanShen.exe 或 GenshinImpact.exe) 而不是啟動器(launcher.exe)</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingShellExperienceHeader" xml:space="preserve">
|
||||
<value>Shell 體驗</value>
|
||||
@@ -2895,7 +2925,7 @@
|
||||
<value>出戰次數</value>
|
||||
</data>
|
||||
<data name="ViewSpiralAbyssStatistics" xml:space="preserve">
|
||||
<value>統計數據</value>
|
||||
<value>統計資料</value>
|
||||
</data>
|
||||
<data name="ViewSpiralAbyssTakeDamage" xml:space="preserve">
|
||||
<value>最多承傷</value>
|
||||
@@ -2907,7 +2937,7 @@
|
||||
<value>上傳資料</value>
|
||||
</data>
|
||||
<data name="ViewTitileUpdatePackageDownloadContent" xml:space="preserve">
|
||||
<value>是否立即下载?</value>
|
||||
<value>是否立即下載?</value>
|
||||
</data>
|
||||
<data name="ViewTitileUpdatePackageDownloadFailedMessage" xml:space="preserve">
|
||||
<value>下載更新失敗</value>
|
||||
@@ -2931,7 +2961,7 @@
|
||||
<value>工具</value>
|
||||
</data>
|
||||
<data name="ViewUserCookieOperation" xml:space="preserve">
|
||||
<value>米遊社</value>
|
||||
<value>米游社</value>
|
||||
</data>
|
||||
<data name="ViewUserCookieOperation2" xml:space="preserve">
|
||||
<value>HoYoLAB</value>
|
||||
@@ -2966,6 +2996,9 @@
|
||||
<data name="ViewUserDocumentationHeader" xml:space="preserve">
|
||||
<value>文檔</value>
|
||||
</data>
|
||||
<data name="ViewUserLoginMihoyoUserDisabledTooltip" xml:space="preserve">
|
||||
<value>由于米游社安全策略的相关更改,网页登录暂不可用</value>
|
||||
</data>
|
||||
<data name="ViewUserNoUserHint" xml:space="preserve">
|
||||
<value>尚未登入</value>
|
||||
</data>
|
||||
@@ -3006,19 +3039,19 @@
|
||||
<value>武器資料</value>
|
||||
</data>
|
||||
<data name="WebAnnouncementMatchPermanentActivityTime" xml:space="preserve">
|
||||
<value>(?:〓活动时间〓|〓任务开放时间〓).*?(\d\.\d)版本更新(?:完成|)后永久开放</value>
|
||||
<value>(?:(?:〓活動時間〓|〓任務開放時間〓).*?(\d\.\d)版本更新(?:完成|)|&lt;t class=\"t_(?:gl|lc)\".*?&gt;(.*?)&lt;/t&gt;)後永久開放</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)版本更新后.*?~.*?&lt;t class="t_(?:gl|lc)".*?&gt;(.*?)&lt;/t&gt;</value>
|
||||
<value>(?:〓活動時間〓|祈願時間|【上架時間】|〓折扣時間〓).*?(\d\.\d)版本更新後.*?~.*?&lt;t class="t_(?:gl|lc)".*?&gt;(.*?)&lt;/t&gt;</value>
|
||||
</data>
|
||||
<data name="WebAnnouncementMatchVersionUpdatePreviewTime" xml:space="preserve">
|
||||
<value>将于&lt;t class=\"t_(?:gl|lc)\".*?&gt;(.*?)&lt;/t&gt;进行版本更新维护</value>
|
||||
<value>將於&lt;t class=\"t_(?:gl|lc)\".*?&gt;(.*?)&lt;/t&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>〓更新時間〓.+?&lt;t class=\"t_(?:gl|lc)\".*?&gt;(.*?)&lt;/t&gt;</value>
|
||||
@@ -3044,6 +3077,9 @@
|
||||
<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>
|
||||
@@ -3141,7 +3177,7 @@
|
||||
<value>{0} 秒</value>
|
||||
</data>
|
||||
<data name="WebDailyNoteVerificationFailed" xml:space="preserve">
|
||||
<value>驗證失敗,請手動進行驗證或前往「米遊社-旅行工具-原神戰績-實時便箋」頁面查看。</value>
|
||||
<value>驗證失敗,請手動進行驗證或前往「 HoYoLAB -工具箱-戰績-即時便箋」頁面查看。</value>
|
||||
</data>
|
||||
<data name="WebEnkaResponseStatusCode400" xml:space="preserve">
|
||||
<value>錯誤的 UID 格式</value>
|
||||
@@ -3213,7 +3249,7 @@
|
||||
<value>胡桃服務維護中</value>
|
||||
</data>
|
||||
<data name="WebIndexOrSpiralAbyssVerificationFailed" xml:space="preserve">
|
||||
<value>驗證失敗,請手動進行驗證或前往「米遊社-旅行工具-原神戰績」頁面查看。</value>
|
||||
<value>驗證失敗,請手動進行驗證或前往「 HoYoLAB -工具箱-戰績」頁面查看。</value>
|
||||
</data>
|
||||
<data name="WebResponseFormat" xml:space="preserve">
|
||||
<value>狀態:{0} | 信息:{1}</value>
|
||||
@@ -3224,6 +3260,9 @@
|
||||
<data name="WebResponseRequestExceptionFormat" xml:space="preserve">
|
||||
<value>[{0}] 中的 [{1}] 網路請求異常,請稍後再試</value>
|
||||
</data>
|
||||
<data name="WebResponseSignInErrorHint" xml:space="preserve">
|
||||
<value>登入失敗,請前往 HoYoLAB 初始化賬號,原始消息:{0}</value>
|
||||
</data>
|
||||
<data name="WindowIdentifyMonitorHeader" xml:space="preserve">
|
||||
<value>顯示器編號</value>
|
||||
</data>
|
||||
|
||||
@@ -82,31 +82,10 @@ internal abstract partial class DbStoreOptions : ObservableObject
|
||||
return storage.Value;
|
||||
}
|
||||
|
||||
[return: NotNull]
|
||||
protected T GetOption<T>(ref T? storage, string key, Func<string, T> deserializer, [DisallowNull] T defaultValue)
|
||||
[return: NotNullIfNotNull(nameof(defaultValue))]
|
||||
protected T GetOption<T>(ref T? storage, string key, Func<string, T> deserializer, T defaultValue)
|
||||
{
|
||||
if (storage is not null)
|
||||
{
|
||||
return storage;
|
||||
}
|
||||
|
||||
using (IServiceScope scope = serviceProvider.CreateScope())
|
||||
{
|
||||
AppDbContext appDbContext = scope.ServiceProvider.GetRequiredService<AppDbContext>();
|
||||
string? value = appDbContext.Settings.SingleOrDefault(e => e.Key == key)?.Value;
|
||||
if (value is null)
|
||||
{
|
||||
storage = defaultValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
T targetValue = deserializer(value);
|
||||
ArgumentNullException.ThrowIfNull(targetValue);
|
||||
storage = targetValue;
|
||||
}
|
||||
}
|
||||
|
||||
return storage;
|
||||
return GetOption(ref storage, key, deserializer, () => defaultValue);
|
||||
}
|
||||
|
||||
protected T GetOption<T>(ref T? storage, string key, Func<string, T> deserializer, Func<T> defaultValueFactory)
|
||||
|
||||
@@ -32,6 +32,6 @@ internal sealed partial class DailyNoteWebhookOperation
|
||||
.SetHeader("x-uid", $"{playerUid}")
|
||||
.PostJson(dailyNote);
|
||||
|
||||
await builder.TryCatchSendAsync(httpClient, logger, token).ConfigureAwait(false);
|
||||
await builder.SendAsync(httpClient, logger, token).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using Snap.Hutao.Win32.Graphics.Direct3D;
|
||||
using Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
using Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
using Snap.Hutao.Win32.System.Com;
|
||||
using Windows.Graphics.DirectX.Direct3D11;
|
||||
using WinRT;
|
||||
using static Snap.Hutao.Win32.ConstValues;
|
||||
using static Snap.Hutao.Win32.D3d11;
|
||||
using static Snap.Hutao.Win32.Dxgi;
|
||||
using static Snap.Hutao.Win32.Macros;
|
||||
|
||||
namespace Snap.Hutao.Service.Game.Automation.ScreenCapture;
|
||||
|
||||
internal static class DirectX
|
||||
{
|
||||
public static unsafe bool TryCreateDXGIFactory(uint flags, out IDXGIFactory6* factory, out HRESULT hr)
|
||||
{
|
||||
hr = CreateDXGIFactory2(flags, in IDXGIFactory6.IID, out factory);
|
||||
return SUCCEEDED(hr);
|
||||
}
|
||||
|
||||
public static unsafe bool TryGetHighPerformanceAdapter(IDXGIFactory6* factory, out IDXGIAdapter* adapter, out HRESULT hr)
|
||||
{
|
||||
hr = factory->EnumAdapterByGpuPreference(0U, DXGI_GPU_PREFERENCE.DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE, in IDXGIAdapter.IID, out adapter);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
IUnknownMarshal.Release(adapter);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static unsafe bool TryCreateD3D11Device(IDXGIAdapter* adapter, D3D11_CREATE_DEVICE_FLAG flags, out ID3D11Device* device, out HRESULT hr)
|
||||
{
|
||||
hr = D3D11CreateDevice(adapter, D3D_DRIVER_TYPE.D3D_DRIVER_TYPE_HARDWARE, default, flags, [], D3D11_SDK_VERSION, out device, out _, out _);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
IUnknownMarshal.Release(device);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static unsafe bool TryAsDXGIDevice(ID3D11Device* device, out IDXGIDevice* dxgiDevice, out HRESULT hr)
|
||||
{
|
||||
hr = IUnknownMarshal.QueryInterface(device, in IDXGIDevice.IID, out dxgiDevice);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
IUnknownMarshal.Release(dxgiDevice);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static unsafe bool TryCreateDirect3D11Device(IDXGIDevice* dxgiDevice, [NotNullWhen(true)] out IDirect3DDevice? direct3DDevice, out HRESULT hr)
|
||||
{
|
||||
hr = CreateDirect3D11DeviceFromDXGIDevice(dxgiDevice, out Win32.System.WinRT.IInspectable* inspectable);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
direct3DDevice = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
direct3DDevice = IInspectable.FromAbi((nint)inspectable).ObjRef.AsInterface<IDirect3DDevice>();
|
||||
return true;
|
||||
}
|
||||
|
||||
public static unsafe bool TryCreateSwapChainForComposition(IDXGIFactory6* factory, ID3D11Device* device, ref readonly DXGI_SWAP_CHAIN_DESC1 desc, out IDXGISwapChain1* swapChain, out HRESULT hr)
|
||||
{
|
||||
hr = factory->CreateSwapChainForComposition((IUnknown*)device, in desc, default, out swapChain);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -4,44 +4,106 @@
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
using Snap.Hutao.Win32.Graphics.Dwm;
|
||||
using Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
using Snap.Hutao.Win32.Graphics.Dxgi.Common;
|
||||
using Snap.Hutao.Win32.Graphics.Gdi;
|
||||
using Snap.Hutao.Win32.System.Com;
|
||||
using Snap.Hutao.Win32.System.WinRT.Graphics.Capture;
|
||||
using Windows.Graphics.Capture;
|
||||
using Windows.Graphics.DirectX;
|
||||
using Windows.Graphics.DirectX.Direct3D11;
|
||||
using static Snap.Hutao.Win32.ConstValues;
|
||||
using static Snap.Hutao.Win32.DwmApi;
|
||||
using static Snap.Hutao.Win32.Gdi32;
|
||||
using static Snap.Hutao.Win32.User32;
|
||||
|
||||
namespace Snap.Hutao.Service.Game.Automation.ScreenCapture;
|
||||
|
||||
internal readonly struct GameScreenCaptureContext
|
||||
internal struct GameScreenCaptureContext : IDisposable
|
||||
{
|
||||
public readonly GraphicsCaptureItem Item;
|
||||
public readonly bool PreviewEnabled;
|
||||
|
||||
private const uint CreateDXGIFactoryFlag =
|
||||
#if DEBUG
|
||||
DXGI_CREATE_FACTORY_DEBUG;
|
||||
#else
|
||||
0;
|
||||
#endif
|
||||
|
||||
private const D3D11_CREATE_DEVICE_FLAG D3d11CreateDeviceFlag =
|
||||
D3D11_CREATE_DEVICE_FLAG.D3D11_CREATE_DEVICE_BGRA_SUPPORT
|
||||
#if DEBUG
|
||||
| D3D11_CREATE_DEVICE_FLAG.D3D11_CREATE_DEVICE_DEBUG
|
||||
#endif
|
||||
;
|
||||
|
||||
private readonly IDirect3DDevice direct3DDevice;
|
||||
private readonly HWND hwnd;
|
||||
|
||||
[SuppressMessage("", "SH002")]
|
||||
public GameScreenCaptureContext(IDirect3DDevice direct3DDevice, HWND hwnd)
|
||||
{
|
||||
this.direct3DDevice = direct3DDevice;
|
||||
this.hwnd = hwnd;
|
||||
private unsafe IDXGIFactory6* factory;
|
||||
private unsafe IDXGIAdapter* adapter;
|
||||
private unsafe ID3D11Device* d3d11Device;
|
||||
private unsafe IDXGIDevice* dxgiDevice;
|
||||
private IDirect3DDevice? direct3DDevice;
|
||||
private unsafe IDXGISwapChain1* swapChain;
|
||||
|
||||
[SuppressMessage("", "SH002")]
|
||||
private unsafe GameScreenCaptureContext(HWND hwnd, bool preview)
|
||||
{
|
||||
this.hwnd = hwnd;
|
||||
GraphicsCaptureItem.As<IGraphicsCaptureItemInterop>().CreateForWindow(hwnd, out Item);
|
||||
|
||||
PreviewEnabled = preview;
|
||||
}
|
||||
|
||||
[SuppressMessage("", "SH002")]
|
||||
public static unsafe GameScreenCaptureContextCreationResult Create(HWND hwnd, bool preview)
|
||||
{
|
||||
GameScreenCaptureContext context = new(hwnd, preview);
|
||||
|
||||
if (!DirectX.TryCreateDXGIFactory(CreateDXGIFactoryFlag, out context.factory, out HRESULT hr))
|
||||
{
|
||||
return new(GameScreenCaptureContextCreationResultKind.CreateDxgiFactoryFailed, hr);
|
||||
}
|
||||
|
||||
if (!DirectX.TryGetHighPerformanceAdapter(context.factory, out context.adapter, out hr))
|
||||
{
|
||||
return new(GameScreenCaptureContextCreationResultKind.EnumAdapterByGpuPreferenceFailed, hr);
|
||||
}
|
||||
|
||||
if (!DirectX.TryCreateD3D11Device(default, D3d11CreateDeviceFlag, out context.d3d11Device, out hr))
|
||||
{
|
||||
return new(GameScreenCaptureContextCreationResultKind.D3D11CreateDeviceFailed, hr);
|
||||
}
|
||||
|
||||
if (!DirectX.TryAsDXGIDevice(context.d3d11Device, out context.dxgiDevice, out hr))
|
||||
{
|
||||
return new(GameScreenCaptureContextCreationResultKind.D3D11DeviceQueryDXGIDeviceFailed, hr);
|
||||
}
|
||||
|
||||
if (!DirectX.TryCreateDirect3D11Device(context.dxgiDevice, out context.direct3DDevice, out hr))
|
||||
{
|
||||
return new(GameScreenCaptureContextCreationResultKind.CreateDirect3D11DeviceFromDXGIDeviceFailed, hr);
|
||||
}
|
||||
|
||||
return new GameScreenCaptureContextCreationResult(GameScreenCaptureContextCreationResultKind.Success, context);
|
||||
}
|
||||
|
||||
public Direct3D11CaptureFramePool CreatePool()
|
||||
{
|
||||
return Direct3D11CaptureFramePool.CreateFreeThreaded(direct3DDevice, DeterminePixelFormat(hwnd), 2, Item.Size);
|
||||
(DirectXPixelFormat winrt, DXGI_FORMAT dx) = DeterminePixelFormat(hwnd);
|
||||
CreateOrUpdateDXGISwapChain(dx);
|
||||
return Direct3D11CaptureFramePool.CreateFreeThreaded(direct3DDevice, winrt, 2, Item.Size);
|
||||
}
|
||||
|
||||
public void RecreatePool(Direct3D11CaptureFramePool framePool)
|
||||
{
|
||||
framePool.Recreate(direct3DDevice, DeterminePixelFormat(hwnd), 2, Item.Size);
|
||||
(DirectXPixelFormat winrt, DXGI_FORMAT dx) = DeterminePixelFormat(hwnd);
|
||||
CreateOrUpdateDXGISwapChain(dx);
|
||||
framePool.Recreate(direct3DDevice, winrt, 2, Item.Size);
|
||||
}
|
||||
|
||||
public GraphicsCaptureSession CreateSession(Direct3D11CaptureFramePool framePool)
|
||||
public readonly GraphicsCaptureSession CreateSession(Direct3D11CaptureFramePool framePool)
|
||||
{
|
||||
GraphicsCaptureSession session = framePool.CreateCaptureSession(Item);
|
||||
session.IsCursorCaptureEnabled = false;
|
||||
@@ -49,7 +111,7 @@ internal readonly struct GameScreenCaptureContext
|
||||
return session;
|
||||
}
|
||||
|
||||
public bool TryGetClientBox(uint width, uint height, out D3D11_BOX clientBox)
|
||||
public readonly bool TryGetClientBox(uint width, uint height, out D3D11_BOX clientBox)
|
||||
{
|
||||
clientBox = default;
|
||||
|
||||
@@ -88,8 +150,39 @@ internal readonly struct GameScreenCaptureContext
|
||||
return clientBox.right <= width && clientBox.bottom <= height;
|
||||
}
|
||||
|
||||
public unsafe readonly void AttachPreview(GameScreenCaptureDebugPreviewWindow? window)
|
||||
{
|
||||
if (PreviewEnabled && window is not null)
|
||||
{
|
||||
window.UpdateSwapChain(swapChain);
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe readonly void UpdatePreview(GameScreenCaptureDebugPreviewWindow? window, IDirect3DSurface surface)
|
||||
{
|
||||
if (PreviewEnabled && window is not null)
|
||||
{
|
||||
window.UnsafeUpdatePreview(d3d11Device, surface);
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe readonly void DetachPreview(GameScreenCaptureDebugPreviewWindow? window)
|
||||
{
|
||||
if (PreviewEnabled && window is not null)
|
||||
{
|
||||
window.UpdateSwapChain(null);
|
||||
window.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe readonly void Dispose()
|
||||
{
|
||||
IUnknownMarshal.Release(factory);
|
||||
IUnknownMarshal.Release(swapChain);
|
||||
}
|
||||
|
||||
[SuppressMessage("", "SH002")]
|
||||
private static DirectXPixelFormat DeterminePixelFormat(HWND hwnd)
|
||||
private static (DirectXPixelFormat WinRTFormat, DXGI_FORMAT DXFormat) DeterminePixelFormat(HWND hwnd)
|
||||
{
|
||||
HDC hdc = GetDC(hwnd);
|
||||
if (hdc != HDC.NULL)
|
||||
@@ -98,10 +191,31 @@ internal readonly struct GameScreenCaptureContext
|
||||
_ = ReleaseDC(hwnd, hdc);
|
||||
if (bitsPerPixel >= 32)
|
||||
{
|
||||
return DirectXPixelFormat.R16G16B16A16Float;
|
||||
return (DirectXPixelFormat.R16G16B16A16Float, DXGI_FORMAT.DXGI_FORMAT_R16G16B16A16_FLOAT);
|
||||
}
|
||||
}
|
||||
|
||||
return DirectXPixelFormat.B8G8R8A8UIntNormalized;
|
||||
return (DirectXPixelFormat.B8G8R8A8UIntNormalized, DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM);
|
||||
}
|
||||
|
||||
private unsafe void CreateOrUpdateDXGISwapChain(DXGI_FORMAT format)
|
||||
{
|
||||
if (!PreviewEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DXGI_SWAP_CHAIN_DESC1 desc = default;
|
||||
desc.Width = (uint)Item.Size.Width;
|
||||
desc.Height = (uint)Item.Size.Height;
|
||||
desc.Format = format;
|
||||
desc.SampleDesc.Count = 1;
|
||||
desc.BufferUsage = DXGI_USAGE.DXGI_USAGE_RENDER_TARGET_OUTPUT;
|
||||
desc.BufferCount = 2;
|
||||
desc.Scaling = DXGI_SCALING.DXGI_SCALING_STRETCH;
|
||||
desc.SwapEffect = DXGI_SWAP_EFFECT.DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
|
||||
desc.AlphaMode = DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_PREMULTIPLIED;
|
||||
|
||||
DirectX.TryCreateSwapChainForComposition(factory, d3d11Device, in desc, out swapChain, out HRESULT hr);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
|
||||
namespace Snap.Hutao.Service.Game.Automation.ScreenCapture;
|
||||
|
||||
internal readonly struct GameScreenCaptureContextCreationResult
|
||||
{
|
||||
public readonly GameScreenCaptureContextCreationResultKind Kind;
|
||||
public readonly HRESULT HResult;
|
||||
public readonly GameScreenCaptureContext Context;
|
||||
|
||||
public GameScreenCaptureContextCreationResult(GameScreenCaptureContextCreationResultKind kind, HRESULT hResult)
|
||||
{
|
||||
Kind = kind;
|
||||
HResult = hResult;
|
||||
}
|
||||
|
||||
public GameScreenCaptureContextCreationResult(GameScreenCaptureContextCreationResultKind kind, GameScreenCaptureContext context)
|
||||
{
|
||||
Kind = kind;
|
||||
Context = context;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Service.Game.Automation.ScreenCapture;
|
||||
|
||||
internal enum GameScreenCaptureContextCreationResultKind
|
||||
{
|
||||
Success,
|
||||
CreateDxgiFactoryFailed,
|
||||
EnumAdapterByGpuPreferenceFailed,
|
||||
D3D11CreateDeviceFailed,
|
||||
D3D11DeviceQueryDXGIDeviceFailed,
|
||||
CreateDirect3D11DeviceFromDXGIDeviceFailed,
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<Window
|
||||
x:Class="Snap.Hutao.Service.Game.Automation.ScreenCapture.GameScreenCaptureDebugPreviewWindow"
|
||||
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:local="using:Snap.Hutao.Service.Game.Automation.ScreenCapture"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<SwapChainPanel
|
||||
x:Name="Presenter"
|
||||
AllowFocusOnInteraction="False"
|
||||
AllowFocusWhenDisabled="False"/>
|
||||
</Window>
|
||||
@@ -0,0 +1,47 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.UI.Windowing;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Snap.Hutao.Core.Windowing;
|
||||
using Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
using Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
using Snap.Hutao.Win32.System.WinRT.Graphics.Capture;
|
||||
using Snap.Hutao.Win32.System.WinRT.Xaml;
|
||||
using Windows.Graphics.DirectX.Direct3D11;
|
||||
using WinRT;
|
||||
|
||||
namespace Snap.Hutao.Service.Game.Automation.ScreenCapture;
|
||||
|
||||
internal sealed partial class GameScreenCaptureDebugPreviewWindow : Window
|
||||
{
|
||||
private unsafe IDXGISwapChain1* swapChain1;
|
||||
|
||||
public GameScreenCaptureDebugPreviewWindow()
|
||||
{
|
||||
if (AppWindow.Presenter is OverlappedPresenter presenter)
|
||||
{
|
||||
presenter.IsMaximizable = false;
|
||||
}
|
||||
|
||||
InitializeComponent();
|
||||
this.InitializeController(Ioc.Default);
|
||||
}
|
||||
|
||||
public unsafe void UpdateSwapChain(IDXGISwapChain1* swapChain1)
|
||||
{
|
||||
this.swapChain1 = swapChain1;
|
||||
ISwapChainPanelNative native = Presenter.As<IInspectable>().ObjRef.AsInterface<ISwapChainPanelNative>();
|
||||
native.SetSwapChain((IDXGISwapChain*)swapChain1);
|
||||
}
|
||||
|
||||
public unsafe void UnsafeUpdatePreview(ID3D11Device* device, IDirect3DSurface surface)
|
||||
{
|
||||
IDirect3DDxgiInterfaceAccess access = surface.As<IDirect3DDxgiInterfaceAccess>();
|
||||
swapChain1->GetBuffer(0, in ID3D11Texture2D.IID, out ID3D11Texture2D* buffer);
|
||||
device->GetImmediateContext(out ID3D11DeviceContext* deviceContext);
|
||||
access.GetInterface(in ID3D11Resource.IID, out ID3D11Resource* resource);
|
||||
deviceContext->CopyResource((ID3D11Resource*)buffer, resource);
|
||||
swapChain1->Present(0, default);
|
||||
}
|
||||
}
|
||||
@@ -3,16 +3,9 @@
|
||||
|
||||
using Snap.Hutao.Core;
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using Snap.Hutao.Win32.Graphics.Direct3D;
|
||||
using Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
using Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
using Snap.Hutao.Win32.System.Com;
|
||||
using Windows.Graphics.Capture;
|
||||
using Windows.Graphics.DirectX.Direct3D11;
|
||||
using WinRT;
|
||||
using static Snap.Hutao.Win32.ConstValues;
|
||||
using static Snap.Hutao.Win32.D3D11;
|
||||
using static Snap.Hutao.Win32.Macros;
|
||||
|
||||
namespace Snap.Hutao.Service.Game.Automation.ScreenCapture;
|
||||
|
||||
@@ -20,11 +13,25 @@ namespace Snap.Hutao.Service.Game.Automation.ScreenCapture;
|
||||
[Injection(InjectAs.Singleton, typeof(IGameScreenCaptureService))]
|
||||
internal sealed partial class GameScreenCaptureService : IGameScreenCaptureService
|
||||
{
|
||||
private const uint CreateDXGIFactoryFlag =
|
||||
#if DEBUG
|
||||
DXGI_CREATE_FACTORY_DEBUG;
|
||||
#else
|
||||
0;
|
||||
#endif
|
||||
|
||||
private const D3D11_CREATE_DEVICE_FLAG D3d11CreateDeviceFlag =
|
||||
D3D11_CREATE_DEVICE_FLAG.D3D11_CREATE_DEVICE_BGRA_SUPPORT
|
||||
#if DEBUG
|
||||
| D3D11_CREATE_DEVICE_FLAG.D3D11_CREATE_DEVICE_DEBUG
|
||||
#endif
|
||||
;
|
||||
|
||||
private readonly ILogger<GameScreenCaptureService> logger;
|
||||
|
||||
public bool IsSupported()
|
||||
{
|
||||
if (!Core.UniversalApiContract.IsPresent(WindowsVersion.Windows10Version1903))
|
||||
if (!UniversalApiContract.IsPresent(WindowsVersion.Windows10Version1903))
|
||||
{
|
||||
logger.LogWarning("Windows 10 Version 1903 or later is required for Windows.Graphics.Capture API.");
|
||||
return false;
|
||||
@@ -40,47 +47,34 @@ internal sealed partial class GameScreenCaptureService : IGameScreenCaptureServi
|
||||
}
|
||||
|
||||
[SuppressMessage("", "SH002")]
|
||||
public unsafe bool TryStartCapture(HWND hwnd, [NotNullWhen(true)] out GameScreenCaptureSession? session)
|
||||
public unsafe bool TryStartCapture(HWND hwnd, bool preview, [NotNullWhen(true)] out GameScreenCaptureSession? session)
|
||||
{
|
||||
session = default;
|
||||
|
||||
D3D11_CREATE_DEVICE_FLAG flag = D3D11_CREATE_DEVICE_FLAG.D3D11_CREATE_DEVICE_BGRA_SUPPORT
|
||||
#if DEBUG
|
||||
| D3D11_CREATE_DEVICE_FLAG.D3D11_CREATE_DEVICE_DEBUG
|
||||
#endif
|
||||
;
|
||||
GameScreenCaptureContextCreationResult result = GameScreenCaptureContext.Create(hwnd, preview);
|
||||
|
||||
HRESULT hr;
|
||||
hr = D3D11CreateDevice(default, D3D_DRIVER_TYPE.D3D_DRIVER_TYPE_HARDWARE, default, flag, [], D3D11_SDK_VERSION, out ID3D11Device* pD3D11Device, out _, out _);
|
||||
if (FAILED(hr))
|
||||
switch (result.Kind)
|
||||
{
|
||||
logger.LogWarning("D3D11CreateDevice failed with code: {Code}", hr);
|
||||
return false;
|
||||
case GameScreenCaptureContextCreationResultKind.Success:
|
||||
session = new(result.Context, logger);
|
||||
return true;
|
||||
case GameScreenCaptureContextCreationResultKind.CreateDxgiFactoryFailed:
|
||||
logger.LogWarning("CreateDXGIFactory2 failed with code: {Code}", result.HResult);
|
||||
return false;
|
||||
case GameScreenCaptureContextCreationResultKind.EnumAdapterByGpuPreferenceFailed:
|
||||
logger.LogWarning("IDXGIFactory6.EnumAdapterByGpuPreference failed with code: {Code}", result.HResult);
|
||||
return false;
|
||||
case GameScreenCaptureContextCreationResultKind.D3D11CreateDeviceFailed:
|
||||
logger.LogWarning("D3D11CreateDevice failed with code: {Code}", result.HResult);
|
||||
return false;
|
||||
case GameScreenCaptureContextCreationResultKind.D3D11DeviceQueryDXGIDeviceFailed:
|
||||
logger.LogWarning("ID3D11Device.QueryInterface<IDXGIDevice> failed with code: {Code}", result.HResult);
|
||||
return false;
|
||||
case GameScreenCaptureContextCreationResultKind.CreateDirect3D11DeviceFromDXGIDeviceFailed:
|
||||
logger.LogWarning("CreateDirect3D11DeviceFromDXGIDevice failed with code: {Code}", result.HResult);
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
hr = IUnknownMarshal.QueryInterface(pD3D11Device, in IDXGIDevice.IID, out IDXGIDevice* pDXGIDevice);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
logger.LogWarning("ID3D11Device.QueryInterface<IDXGIDevice> failed with code: {Code}", hr);
|
||||
return false;
|
||||
}
|
||||
|
||||
IUnknownMarshal.Release(pDXGIDevice);
|
||||
|
||||
hr = CreateDirect3D11DeviceFromDXGIDevice(pDXGIDevice, out Win32.System.WinRT.IInspectable* inspectable);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
logger.LogWarning("CreateDirect3D11DeviceFromDXGIDevice failed with code: {Code}", hr);
|
||||
return false;
|
||||
}
|
||||
|
||||
IUnknownMarshal.Release(inspectable);
|
||||
|
||||
IDirect3DDevice direct3DDevice = IInspectable.FromAbi((nint)inspectable).ObjRef.AsInterface<IDirect3DDevice>();
|
||||
|
||||
GameScreenCaptureContext captureContext = new(direct3DDevice, hwnd);
|
||||
session = new(captureContext, logger);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ using Snap.Hutao.Core.ExceptionService;
|
||||
using Snap.Hutao.Win32.Graphics.Direct3D11;
|
||||
using Snap.Hutao.Win32.Graphics.Dxgi;
|
||||
using Snap.Hutao.Win32.Graphics.Dxgi.Common;
|
||||
using Snap.Hutao.Win32.System.Com;
|
||||
using Snap.Hutao.Win32.System.WinRT.Graphics.Capture;
|
||||
using System.Buffers;
|
||||
using System.Runtime.CompilerServices;
|
||||
@@ -24,6 +25,7 @@ internal sealed class GameScreenCaptureSession : IDisposable
|
||||
private static readonly Half ByteMaxValue = 255;
|
||||
|
||||
private readonly GameScreenCaptureContext captureContext;
|
||||
private readonly GameScreenCaptureDebugPreviewWindow? previewWindow;
|
||||
private readonly Direct3D11CaptureFramePool framePool;
|
||||
private readonly GraphicsCaptureSession session;
|
||||
private readonly ILogger logger;
|
||||
@@ -35,16 +37,23 @@ internal sealed class GameScreenCaptureSession : IDisposable
|
||||
private bool isDisposed;
|
||||
|
||||
[SuppressMessage("", "SH002")]
|
||||
public GameScreenCaptureSession(GameScreenCaptureContext captureContext, ILogger logger)
|
||||
public unsafe GameScreenCaptureSession(GameScreenCaptureContext captureContext, ILogger logger)
|
||||
{
|
||||
this.captureContext = captureContext;
|
||||
this.logger = logger;
|
||||
|
||||
contentSize = captureContext.Item.Size;
|
||||
|
||||
if (captureContext.PreviewEnabled)
|
||||
{
|
||||
previewWindow = new();
|
||||
}
|
||||
|
||||
captureContext.Item.Closed += OnItemClosed;
|
||||
|
||||
framePool = captureContext.CreatePool();
|
||||
captureContext.AttachPreview(previewWindow);
|
||||
|
||||
framePool.FrameArrived += OnFrameArrived;
|
||||
|
||||
session = captureContext.CreateSession(framePool);
|
||||
@@ -76,6 +85,7 @@ internal sealed class GameScreenCaptureSession : IDisposable
|
||||
return;
|
||||
}
|
||||
|
||||
captureContext.DetachPreview(previewWindow);
|
||||
session.Dispose();
|
||||
framePool.Dispose();
|
||||
isDisposed = true;
|
||||
@@ -111,7 +121,9 @@ internal sealed class GameScreenCaptureSession : IDisposable
|
||||
|
||||
try
|
||||
{
|
||||
UnsafeProcessFrameSurface(frame.Surface);
|
||||
captureContext.UpdatePreview(previewWindow, frame.Surface);
|
||||
|
||||
// UnsafeProcessFrameSurface(frame.Surface);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -135,6 +147,8 @@ internal sealed class GameScreenCaptureSession : IDisposable
|
||||
return;
|
||||
}
|
||||
|
||||
IUnknownMarshal.Release(pDXGISurface);
|
||||
|
||||
if (FAILED(pDXGISurface->GetDesc(out DXGI_SURFACE_DESC dxgiSurfaceDesc)))
|
||||
{
|
||||
return;
|
||||
@@ -151,6 +165,8 @@ internal sealed class GameScreenCaptureSession : IDisposable
|
||||
return;
|
||||
}
|
||||
|
||||
IUnknownMarshal.Release(pD3D11Device);
|
||||
|
||||
D3D11_TEXTURE2D_DESC d3d11Texture2DDesc = default;
|
||||
d3d11Texture2DDesc.Width = textureWidth;
|
||||
d3d11Texture2DDesc.Height = textureHeight;
|
||||
@@ -166,12 +182,17 @@ internal sealed class GameScreenCaptureSession : IDisposable
|
||||
return;
|
||||
}
|
||||
|
||||
IUnknownMarshal.Release(pD3D11Texture2D);
|
||||
|
||||
if (FAILED(access.GetInterface(in ID3D11Resource.IID, out ID3D11Resource* pD3D11Resource)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IUnknownMarshal.Release(pD3D11Resource);
|
||||
|
||||
pD3D11Device->GetImmediateContext(out ID3D11DeviceContext* pD3D11DeviceContext);
|
||||
IUnknownMarshal.Release(pD3D11DeviceContext);
|
||||
|
||||
if (boxAvailable)
|
||||
{
|
||||
|
||||
@@ -9,5 +9,5 @@ internal interface IGameScreenCaptureService
|
||||
{
|
||||
bool IsSupported();
|
||||
|
||||
bool TryStartCapture(HWND hwnd, [NotNullWhen(true)] out GameScreenCaptureSession? session);
|
||||
bool TryStartCapture(HWND hwnd, bool preview, [NotNullWhen(true)] out GameScreenCaptureSession? session);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Service.Game.Scheme;
|
||||
using System.IO;
|
||||
|
||||
namespace Snap.Hutao.Service.Game;
|
||||
@@ -38,4 +39,6 @@ internal sealed class GameFileSystem
|
||||
public string PCGameSDKFilePath { get => pcGameSDKFilePath ??= Path.Combine(GameDirectory, GameConstants.PCGameSDKFilePath); }
|
||||
|
||||
public string ScreenShotDirectory { get => Path.Combine(GameDirectory, "ScreenShot"); }
|
||||
|
||||
public string DataDirectory { get => Path.Combine(GameDirectory, LaunchScheme.ExecutableIsOversea(GameFileName) ? GameConstants.GenshinImpactData : GameConstants.YuanShenData); }
|
||||
}
|
||||
@@ -19,7 +19,12 @@ internal sealed class LaunchExecutionUnlockFpsHandler : ILaunchExecutionDelegate
|
||||
|
||||
IProgressFactory progressFactory = context.ServiceProvider.GetRequiredService<IProgressFactory>();
|
||||
IProgress<GameFpsUnlockerContext> progress = progressFactory.CreateForMainThread<GameFpsUnlockerContext>(c => context.Progress.Report(LaunchStatus.FromUnlockerContext(c)));
|
||||
GameFpsUnlocker unlocker = new(context.ServiceProvider, context.Process, new(100, 20000, 3000), progress);
|
||||
if (!context.TryGetGameFileSystem(out GameFileSystem? gameFileSystem))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GameFpsUnlocker unlocker = new(context.ServiceProvider, context.Process, new(gameFileSystem, 100, 20000, 3000), progress);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -16,43 +16,30 @@ internal static class GameFpsAddress
|
||||
private const byte ASM_JMP = 0xE9;
|
||||
#pragma warning restore SA1310
|
||||
|
||||
public static unsafe void UnsafeFindFpsAddress(GameFpsUnlockerContext state, in RequiredGameModule requiredGameModule)
|
||||
public static unsafe void UnsafeFindFpsAddress(GameFpsUnlockerContext context, in RequiredRemoteModule remoteModule, in RequiredLocalModule localModule)
|
||||
{
|
||||
bool readOk = UnsafeReadModulesMemory(state.GameProcess, requiredGameModule, out VirtualMemory localMemory);
|
||||
HutaoException.ThrowIfNot(readOk, SH.ServiceGameUnlockerReadModuleMemoryCopyVirtualMemoryFailed);
|
||||
int offsetToUserAssembly = IndexOfPattern(localModule.UserAssembly.AsSpan());
|
||||
HutaoException.ThrowIfNot(offsetToUserAssembly >= 0, SH.ServiceGameUnlockerInterestedPatternNotFound);
|
||||
|
||||
using (localMemory)
|
||||
nuint rip = localModule.UserAssembly.Address + (uint)offsetToUserAssembly;
|
||||
rip += 5U;
|
||||
rip += (nuint)(*(int*)(rip + 2U) + 6);
|
||||
|
||||
nuint remoteVirtualAddress = remoteModule.UserAssembly.Address + (rip - localModule.UserAssembly.Address);
|
||||
|
||||
nuint ptr = 0;
|
||||
SpinWait.SpinUntil(() => UnsafeReadProcessMemory(context.GameProcess, remoteVirtualAddress, out ptr) && ptr != 0);
|
||||
|
||||
nuint localVirtualAddress = ptr - remoteModule.UnityPlayer.Address + localModule.UnityPlayer.Address;
|
||||
|
||||
while (*(byte*)localVirtualAddress is ASM_CALL or ASM_JMP)
|
||||
{
|
||||
int offset = IndexOfPattern(localMemory.AsSpan()[(int)requiredGameModule.UnityPlayer.Size..]);
|
||||
HutaoException.ThrowIfNot(offset >= 0, SH.ServiceGameUnlockerInterestedPatternNotFound);
|
||||
|
||||
byte* pLocalMemory = (byte*)localMemory.Pointer;
|
||||
ref readonly Module unityPlayer = ref requiredGameModule.UnityPlayer;
|
||||
ref readonly Module userAssembly = ref requiredGameModule.UserAssembly;
|
||||
|
||||
nuint localMemoryUnityPlayerAddress = (nuint)pLocalMemory;
|
||||
nuint localMemoryUserAssemblyAddress = localMemoryUnityPlayerAddress + unityPlayer.Size;
|
||||
|
||||
nuint rip = localMemoryUserAssemblyAddress + (uint)offset;
|
||||
rip += 5U;
|
||||
rip += (nuint)(*(int*)(rip + 2U) + 6);
|
||||
|
||||
nuint address = userAssembly.Address + (rip - localMemoryUserAssemblyAddress);
|
||||
|
||||
nuint ptr = 0;
|
||||
SpinWait.SpinUntil(() => UnsafeReadProcessMemory(state.GameProcess, address, out ptr) && ptr != 0);
|
||||
|
||||
rip = ptr - unityPlayer.Address + localMemoryUnityPlayerAddress;
|
||||
|
||||
while (*(byte*)rip is ASM_CALL or ASM_JMP)
|
||||
{
|
||||
rip += (nuint)(*(int*)(rip + 1) + 5);
|
||||
}
|
||||
|
||||
nuint localMemoryActualAddress = rip + *(uint*)(rip + 2) + 6;
|
||||
nuint actualOffset = localMemoryActualAddress - localMemoryUnityPlayerAddress;
|
||||
state.FpsAddress = unityPlayer.Address + actualOffset;
|
||||
localVirtualAddress += (nuint)(*(int*)(localVirtualAddress + 1) + 5);
|
||||
}
|
||||
|
||||
localVirtualAddress += *(uint*)(localVirtualAddress + 2) + 6;
|
||||
nuint relativeVirtualAddress = localVirtualAddress - localModule.UnityPlayer.Address;
|
||||
context.FpsAddress = remoteModule.UnityPlayer.Address + relativeVirtualAddress;
|
||||
}
|
||||
|
||||
private static int IndexOfPattern(in ReadOnlySpan<byte> memory)
|
||||
@@ -62,16 +49,6 @@ internal static class GameFpsAddress
|
||||
return memory.IndexOf(part);
|
||||
}
|
||||
|
||||
private static unsafe bool UnsafeReadModulesMemory(Process process, in RequiredGameModule moduleEntryInfo, out VirtualMemory memory)
|
||||
{
|
||||
ref readonly Module unityPlayer = ref moduleEntryInfo.UnityPlayer;
|
||||
ref readonly Module userAssembly = ref moduleEntryInfo.UserAssembly;
|
||||
|
||||
memory = new VirtualMemory(unityPlayer.Size + userAssembly.Size);
|
||||
return ReadProcessMemory(process.Handle, (void*)unityPlayer.Address, memory.AsSpan()[..(int)unityPlayer.Size], out _)
|
||||
&& ReadProcessMemory(process.Handle, (void*)userAssembly.Address, memory.AsSpan()[(int)unityPlayer.Size..], out _);
|
||||
}
|
||||
|
||||
private static unsafe bool UnsafeReadProcessMemory(Process process, nuint baseAddress, out nuint value)
|
||||
{
|
||||
value = 0;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
using Snap.Hutao.Core.ExceptionService;
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using Snap.Hutao.Win32.System.LibraryLoader;
|
||||
using System.Diagnostics;
|
||||
using static Snap.Hutao.Win32.Kernel32;
|
||||
|
||||
@@ -18,12 +19,12 @@ internal sealed class GameFpsUnlocker : IGameFpsUnlocker
|
||||
private readonly LaunchOptions launchOptions;
|
||||
private readonly GameFpsUnlockerContext context = new();
|
||||
|
||||
public GameFpsUnlocker(IServiceProvider serviceProvider, Process gameProcess, in UnlockTimingOptions options, IProgress<GameFpsUnlockerContext> progress)
|
||||
public GameFpsUnlocker(IServiceProvider serviceProvider, Process gameProcess, in UnlockOptions options, IProgress<GameFpsUnlockerContext> progress)
|
||||
{
|
||||
launchOptions = serviceProvider.GetRequiredService<LaunchOptions>();
|
||||
|
||||
context.GameProcess = gameProcess;
|
||||
context.TimingOptions = options;
|
||||
context.Options = options;
|
||||
context.Progress = progress;
|
||||
}
|
||||
|
||||
@@ -31,18 +32,22 @@ internal sealed class GameFpsUnlocker : IGameFpsUnlocker
|
||||
public async ValueTask<bool> UnlockAsync(CancellationToken token = default)
|
||||
{
|
||||
HutaoException.ThrowIfNot(context.IsUnlockerValid, "This Unlocker is invalid");
|
||||
(FindModuleResult result, RequiredGameModule gameModule) = await GameProcessModule.FindModuleAsync(context).ConfigureAwait(false);
|
||||
(FindModuleResult result, RequiredRemoteModule remoteModule) = await GameProcessModule.FindModuleAsync(context).ConfigureAwait(false);
|
||||
HutaoException.ThrowIfNot(result != FindModuleResult.TimeLimitExeeded, SH.ServiceGameUnlockerFindModuleTimeLimitExeeded);
|
||||
HutaoException.ThrowIfNot(result != FindModuleResult.NoModuleFound, SH.ServiceGameUnlockerFindModuleNoModuleFound);
|
||||
|
||||
GameFpsAddress.UnsafeFindFpsAddress(context, gameModule);
|
||||
using (RequiredLocalModule localModule = LoadRequiredLocalModule(context.Options.GameFileSystem))
|
||||
{
|
||||
GameFpsAddress.UnsafeFindFpsAddress(context, remoteModule, localModule);
|
||||
}
|
||||
|
||||
context.Report();
|
||||
return context.FpsAddress != 0U;
|
||||
}
|
||||
|
||||
public async ValueTask PostUnlockAsync(CancellationToken token = default)
|
||||
{
|
||||
using (PeriodicTimer timer = new(context.TimingOptions.AdjustFpsDelay))
|
||||
using (PeriodicTimer timer = new(context.Options.AdjustFpsDelay))
|
||||
{
|
||||
while (await timer.WaitForNextTickAsync(token).ConfigureAwait(false))
|
||||
{
|
||||
@@ -66,4 +71,15 @@ internal sealed class GameFpsUnlocker : IGameFpsUnlocker
|
||||
{
|
||||
return WriteProcessMemory((HANDLE)process.Handle, (void*)baseAddress, ref value, out _);
|
||||
}
|
||||
|
||||
private static RequiredLocalModule LoadRequiredLocalModule(GameFileSystem gameFileSystem)
|
||||
{
|
||||
string gameFoler = gameFileSystem.GameDirectory;
|
||||
string dataFoler = gameFileSystem.DataDirectory;
|
||||
LOAD_LIBRARY_FLAGS flags = LOAD_LIBRARY_FLAGS.LOAD_LIBRARY_AS_IMAGE_RESOURCE;
|
||||
HMODULE unityPlayerAddress = LoadLibraryExW(System.IO.Path.Combine(gameFoler, "UnityPlayer.dll"), default, flags);
|
||||
HMODULE userAssemblyAddress = LoadLibraryExW(System.IO.Path.Combine(dataFoler, "Native", "UserAssembly.dll"), default, flags);
|
||||
|
||||
return new(unityPlayerAddress, userAssemblyAddress);
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ internal sealed class GameFpsUnlockerContext
|
||||
|
||||
public nuint FpsAddress { get; set; }
|
||||
|
||||
public UnlockTimingOptions TimingOptions { get; set; }
|
||||
public UnlockOptions Options { get; set; }
|
||||
|
||||
public Process GameProcess { get; set; } = default!;
|
||||
|
||||
|
||||
@@ -12,14 +12,14 @@ namespace Snap.Hutao.Service.Game.Unlocker;
|
||||
|
||||
internal static class GameProcessModule
|
||||
{
|
||||
public static async ValueTask<ValueResult<FindModuleResult, RequiredGameModule>> FindModuleAsync(GameFpsUnlockerContext state)
|
||||
public static async ValueTask<ValueResult<FindModuleResult, RequiredRemoteModule>> FindModuleAsync(GameFpsUnlockerContext state)
|
||||
{
|
||||
ValueStopwatch watch = ValueStopwatch.StartNew();
|
||||
using (PeriodicTimer timer = new(state.TimingOptions.FindModuleDelay))
|
||||
using (PeriodicTimer timer = new(state.Options.FindModuleDelay))
|
||||
{
|
||||
while (await timer.WaitForNextTickAsync().ConfigureAwait(false))
|
||||
{
|
||||
FindModuleResult result = UnsafeGetGameModuleInfo((HANDLE)state.GameProcess.Handle, out RequiredGameModule gameModule);
|
||||
FindModuleResult result = UnsafeGetGameModuleInfo((HANDLE)state.GameProcess.Handle, out RequiredRemoteModule gameModule);
|
||||
if (result == FindModuleResult.Ok)
|
||||
{
|
||||
return new(FindModuleResult.Ok, gameModule);
|
||||
@@ -30,7 +30,7 @@ internal static class GameProcessModule
|
||||
return new(FindModuleResult.NoModuleFound, default);
|
||||
}
|
||||
|
||||
if (watch.GetElapsedTime() > state.TimingOptions.FindModuleLimit)
|
||||
if (watch.GetElapsedTime() > state.Options.FindModuleLimit)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -40,7 +40,7 @@ internal static class GameProcessModule
|
||||
return new(FindModuleResult.TimeLimitExeeded, default);
|
||||
}
|
||||
|
||||
private static FindModuleResult UnsafeGetGameModuleInfo(in HANDLE hProcess, out RequiredGameModule info)
|
||||
private static FindModuleResult UnsafeGetGameModuleInfo(in HANDLE hProcess, out RequiredRemoteModule info)
|
||||
{
|
||||
FindModuleResult unityPlayerResult = UnsafeFindModule(hProcess, "UnityPlayer.dll", out Module unityPlayer);
|
||||
FindModuleResult userAssemblyResult = UnsafeFindModule(hProcess, "UserAssembly.dll", out Module userAssembly);
|
||||
|
||||
@@ -15,4 +15,9 @@ internal readonly struct Module
|
||||
Address = address;
|
||||
Size = size;
|
||||
}
|
||||
|
||||
public unsafe Span<byte> AsSpan()
|
||||
{
|
||||
return new((void*)Address, (int)Size);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using Snap.Hutao.Win32.System.Diagnostics.Debug;
|
||||
using Snap.Hutao.Win32.System.SystemService;
|
||||
using System.Runtime.CompilerServices;
|
||||
using static Snap.Hutao.Win32.Kernel32;
|
||||
|
||||
namespace Snap.Hutao.Service.Game.Unlocker;
|
||||
|
||||
internal readonly struct RequiredLocalModule : IDisposable
|
||||
{
|
||||
public readonly bool HasValue = false;
|
||||
public readonly Module UnityPlayer;
|
||||
public readonly Module UserAssembly;
|
||||
|
||||
[SuppressMessage("", "SH002")]
|
||||
public RequiredLocalModule(HMODULE unityPlayer, HMODULE userAssembly)
|
||||
{
|
||||
// Align the pointer
|
||||
unityPlayer = (nint)(unityPlayer & ~0x3L);
|
||||
userAssembly = (nint)(userAssembly & ~0x3L);
|
||||
|
||||
HasValue = true;
|
||||
UnityPlayer = new((nuint)(nint)unityPlayer, GetImageSize(unityPlayer));
|
||||
UserAssembly = new((nuint)(nint)userAssembly, GetImageSize(userAssembly));
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
FreeLibrary((nint)UnityPlayer.Address);
|
||||
FreeLibrary((nint)UserAssembly.Address);
|
||||
}
|
||||
|
||||
[SuppressMessage("", "SH002")]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private unsafe uint GetImageSize(HMODULE hModule)
|
||||
{
|
||||
IMAGE_DOS_HEADER* pImageDosHeader = (IMAGE_DOS_HEADER*)(nint)hModule;
|
||||
IMAGE_NT_HEADERS64* pImageNtHeader = (IMAGE_NT_HEADERS64*)(pImageDosHeader->e_lfanew + hModule);
|
||||
return pImageNtHeader->OptionalHeader.SizeOfImage;
|
||||
}
|
||||
}
|
||||
@@ -3,13 +3,13 @@
|
||||
|
||||
namespace Snap.Hutao.Service.Game.Unlocker;
|
||||
|
||||
internal readonly struct RequiredGameModule
|
||||
internal readonly struct RequiredRemoteModule
|
||||
{
|
||||
public readonly bool HasValue = false;
|
||||
public readonly Module UnityPlayer;
|
||||
public readonly Module UserAssembly;
|
||||
|
||||
public RequiredGameModule(in Module unityPlayer, in Module userAssembly)
|
||||
public RequiredRemoteModule(in Module unityPlayer, in Module userAssembly)
|
||||
{
|
||||
HasValue = true;
|
||||
UnityPlayer = unityPlayer;
|
||||
@@ -0,0 +1,20 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Service.Game.Unlocker;
|
||||
|
||||
internal readonly struct UnlockOptions
|
||||
{
|
||||
public readonly GameFileSystem GameFileSystem;
|
||||
public readonly TimeSpan FindModuleDelay;
|
||||
public readonly TimeSpan FindModuleLimit;
|
||||
public readonly TimeSpan AdjustFpsDelay;
|
||||
|
||||
public UnlockOptions(GameFileSystem gameFileSystem, int findModuleDelayMilliseconds, int findModuleLimitMilliseconds, int adjustFpsDelayMilliseconds)
|
||||
{
|
||||
GameFileSystem = gameFileSystem;
|
||||
FindModuleDelay = TimeSpan.FromMilliseconds(findModuleDelayMilliseconds);
|
||||
FindModuleLimit = TimeSpan.FromMilliseconds(findModuleLimitMilliseconds);
|
||||
AdjustFpsDelay = TimeSpan.FromMilliseconds(adjustFpsDelayMilliseconds);
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Service.Game.Unlocker;
|
||||
|
||||
/// <summary>
|
||||
/// 解锁时机选项
|
||||
/// </summary>
|
||||
internal readonly struct UnlockTimingOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// 每次查找 Module 的延时
|
||||
/// </summary>
|
||||
public readonly TimeSpan FindModuleDelay;
|
||||
|
||||
/// <summary>
|
||||
/// 查找 Module 的最大时间阈值
|
||||
/// </summary>
|
||||
public readonly TimeSpan FindModuleLimit;
|
||||
|
||||
/// <summary>
|
||||
/// 每次循环调整的间隔时间
|
||||
/// </summary>
|
||||
public readonly TimeSpan AdjustFpsDelay;
|
||||
|
||||
/// <summary>
|
||||
/// 构造一个新的解锁器选项
|
||||
/// </summary>
|
||||
/// <param name="findModuleDelayMilliseconds">每次查找UnityPlayer的延时,推荐100毫秒</param>
|
||||
/// <param name="findModuleLimitMilliseconds">查找UnityPlayer的最大阈值,推荐10000毫秒</param>
|
||||
/// <param name="adjustFpsDelayMilliseconds">每次循环调整的间隔时间,推荐2000毫秒</param>
|
||||
public UnlockTimingOptions(int findModuleDelayMilliseconds, int findModuleLimitMilliseconds, int adjustFpsDelayMilliseconds)
|
||||
{
|
||||
FindModuleDelay = TimeSpan.FromMilliseconds(findModuleDelayMilliseconds);
|
||||
FindModuleLimit = TimeSpan.FromMilliseconds(findModuleLimitMilliseconds);
|
||||
AdjustFpsDelay = TimeSpan.FromMilliseconds(adjustFpsDelayMilliseconds);
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ internal static class SupportedCultures
|
||||
ToNameValue(CultureInfo.GetCultureInfo("ru")),
|
||||
/*ToNameValue(CultureInfo.GetCultureInfo("th")),*/
|
||||
/*ToNameValue(CultureInfo.GetCultureInfo("tr")),*/
|
||||
/*ToNameValue(CultureInfo.GetCultureInfo("vi")),*/
|
||||
ToNameValue(CultureInfo.GetCultureInfo("vi")),
|
||||
];
|
||||
|
||||
public static List<NameValue<CultureInfo>> Get()
|
||||
|
||||
@@ -142,6 +142,7 @@
|
||||
<None Remove="Resource\Navigation\WikiWeapon.png" />
|
||||
<None Remove="Resource\Segoe Fluent Icons.ttf" />
|
||||
<None Remove="Resource\WelcomeView_Background.png" />
|
||||
<None Remove="Service\Game\Automation\ScreenCapture\GameScreenCaptureDebugPreviewWindow.xaml" />
|
||||
<None Remove="stylecop.json" />
|
||||
<None Remove="View\Card\AchievementCard.xaml" />
|
||||
<None Remove="View\Card\CardBlock.xaml" />
|
||||
@@ -223,6 +224,7 @@
|
||||
<AdditionalFiles Include="Resource\Localization\SH.ko.resx" />
|
||||
<AdditionalFiles Include="Resource\Localization\SH.pt.resx" />
|
||||
<AdditionalFiles Include="Resource\Localization\SH.ru.resx" />
|
||||
<AdditionalFiles Include="Resource\Localization\SH.vi.resx" />
|
||||
<AdditionalFiles Include="Resource\Localization\SH.zh-Hant.resx" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -339,7 +341,7 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Snap.Hutao.SourceGeneration" Version="1.0.8">
|
||||
<PackageReference Include="Snap.Hutao.SourceGeneration" Version="1.0.11">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
@@ -360,6 +362,11 @@
|
||||
<ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnablePreviewMsixTooling)'=='true'">
|
||||
<ProjectCapability Include="Msix" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="Service\Game\Automation\ScreenCapture\GameScreenCaptureDebugPreviewWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="Core\Windowing\NotifyIcon\NotifyIconContextMenu.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
CornerRadius="{ThemeResource ControlCornerRadiusTop}">
|
||||
<shci:CachedImage Source="{Binding Event.Banner}" Stretch="UniformToFill"/>
|
||||
</cwc:ConstrainedBox>
|
||||
<Border Margin="-1" Background="{ThemeResource DarkOnlyOverlayMaskColorBrush}"/>
|
||||
</Grid>
|
||||
|
||||
<ScrollViewer Grid.Row="1">
|
||||
|
||||
40
src/Snap.Hutao/Snap.Hutao/View/Helper/DeferContentLoader.cs
Normal file
40
src/Snap.Hutao/Snap.Hutao/View/Helper/DeferContentLoader.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Markup;
|
||||
using Snap.Hutao.Control;
|
||||
|
||||
namespace Snap.Hutao.View.Helper;
|
||||
|
||||
internal sealed class DeferContentLoader : IDeferContentLoader
|
||||
{
|
||||
private readonly WeakReference<FrameworkElement> reference = new(default!);
|
||||
|
||||
public DeferContentLoader(FrameworkElement element)
|
||||
{
|
||||
reference.SetTarget(element);
|
||||
}
|
||||
|
||||
public DependencyObject? Load(string name)
|
||||
{
|
||||
if (reference.TryGetTarget(out FrameworkElement? element))
|
||||
{
|
||||
return element.FindName(name) as DependencyObject;
|
||||
}
|
||||
|
||||
return default;
|
||||
}
|
||||
|
||||
public void Unload(DependencyObject @object)
|
||||
{
|
||||
if (reference.TryGetTarget(out FrameworkElement? element) && element is ScopedPage scopedPage)
|
||||
{
|
||||
scopedPage.UnloadObjectOverride(@object);
|
||||
}
|
||||
else
|
||||
{
|
||||
XamlMarkupHelper.UnloadObject(@object);
|
||||
}
|
||||
}
|
||||
}
|
||||
13
src/Snap.Hutao/Snap.Hutao/View/Helper/IDeferContentLoader.cs
Normal file
13
src/Snap.Hutao/Snap.Hutao/View/Helper/IDeferContentLoader.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.UI.Xaml;
|
||||
|
||||
namespace Snap.Hutao.View.Helper;
|
||||
|
||||
internal interface IDeferContentLoader
|
||||
{
|
||||
DependencyObject? Load(string name);
|
||||
|
||||
void Unload(DependencyObject @object);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user