mirror of
https://github.com/wangdage12/Snap.Hutao.git
synced 2026-02-18 02:42:15 +08:00
Compare commits
4 Commits
db6df72791
...
1.18.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f148488f4 | ||
|
|
df92894307 | ||
|
|
5fad9ad855 | ||
|
|
1ed2f4f29e |
Binary file not shown.
@@ -2,7 +2,7 @@
|
|||||||
<Package
|
<Package
|
||||||
Name="Snap.Hutao"
|
Name="Snap.Hutao"
|
||||||
Manufacturer="Millennium Science Technology R-D Inst"
|
Manufacturer="Millennium Science Technology R-D Inst"
|
||||||
Version="1.17.4.0"
|
Version="1.18.2.0"
|
||||||
UpgradeCode="121203be-60cb-408f-92cc-7080f6598e68"
|
UpgradeCode="121203be-60cb-408f-92cc-7080f6598e68"
|
||||||
Scope="perMachine">
|
Scope="perMachine">
|
||||||
|
|
||||||
|
|||||||
@@ -126,6 +126,9 @@ internal static class AvatarIds
|
|||||||
public static readonly AvatarId Nefer = 10000122;
|
public static readonly AvatarId Nefer = 10000122;
|
||||||
public static readonly AvatarId Durin = 10000123;
|
public static readonly AvatarId Durin = 10000123;
|
||||||
public static readonly AvatarId Jahoda = 10000124;
|
public static readonly AvatarId Jahoda = 10000124;
|
||||||
|
public static readonly AvatarId Columbina = 10000125;
|
||||||
|
public static readonly AvatarId Zibai = 10000126;
|
||||||
|
public static readonly AvatarId Illuga = 10000127;
|
||||||
|
|
||||||
private static readonly FrozenSet<AvatarId> StandardWishIds =
|
private static readonly FrozenSet<AvatarId> StandardWishIds =
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -22,9 +22,8 @@ internal static class WeaponIds
|
|||||||
11401U, 11402U, 11403U, 11405U,
|
11401U, 11402U, 11403U, 11405U,
|
||||||
12401U, 12402U, 12403U, 12405U,
|
12401U, 12402U, 12403U, 12405U,
|
||||||
13401U, 13407U,
|
13401U, 13407U,
|
||||||
14401U, 14402U, 14403U, 14409U,
|
14401U, 14402U, 14403U, 14409U, 14433U, 14434U,
|
||||||
15401U, 15402U, 15403U, 15405U,
|
15401U, 15402U, 15403U, 15405U, 15434U
|
||||||
15434U
|
|
||||||
];
|
];
|
||||||
|
|
||||||
public static readonly FrozenSet<WeaponId> OrangeStandardWishIds =
|
public static readonly FrozenSet<WeaponId> OrangeStandardWishIds =
|
||||||
@@ -34,7 +33,8 @@ internal static class WeaponIds
|
|||||||
13502U, 13505U,
|
13502U, 13505U,
|
||||||
14501U, 14502U,
|
14501U, 14502U,
|
||||||
15501U, 15502U,
|
15501U, 15502U,
|
||||||
15515U, 11518U
|
15515U, 11518U,
|
||||||
|
14522U, 11519U
|
||||||
];
|
];
|
||||||
|
|
||||||
public static bool IsOrangeStandardWish(in WeaponId weaponId)
|
public static bool IsOrangeStandardWish(in WeaponId weaponId)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<Identity
|
<Identity
|
||||||
Name="60568DGPStudio.SnapHutao"
|
Name="60568DGPStudio.SnapHutao"
|
||||||
Publisher="CN=35C8E923-85DF-49A7-9172-B39DC6312C52"
|
Publisher="CN=35C8E923-85DF-49A7-9172-B39DC6312C52"
|
||||||
Version="1.18.0.0" />
|
Version="1.18.1.0" />
|
||||||
|
|
||||||
<Properties>
|
<Properties>
|
||||||
<DisplayName>Snap Hutao</DisplayName>
|
<DisplayName>Snap Hutao</DisplayName>
|
||||||
|
|||||||
@@ -139,6 +139,13 @@ internal sealed class GameFpsUnlockInterop : IGameIslandInterop, IDisposable
|
|||||||
category: "fps.unlocker",
|
category: "fps.unlocker",
|
||||||
level: Sentry.BreadcrumbLevel.Info);
|
level: Sentry.BreadcrumbLevel.Info);
|
||||||
|
|
||||||
|
// 构建游戏启动参数,传递给 unlockfps.exe
|
||||||
|
string gameArguments = BuildGameArguments(context);
|
||||||
|
SentrySdk.AddBreadcrumb(
|
||||||
|
$"Game arguments for unlocker: {gameArguments}",
|
||||||
|
category: "fps.unlocker",
|
||||||
|
level: Sentry.BreadcrumbLevel.Info);
|
||||||
|
|
||||||
ProcessStartInfo startInfo = new()
|
ProcessStartInfo startInfo = new()
|
||||||
{
|
{
|
||||||
FileName = unlockerPath,
|
FileName = unlockerPath,
|
||||||
@@ -148,6 +155,7 @@ internal sealed class GameFpsUnlockInterop : IGameIslandInterop, IDisposable
|
|||||||
RedirectStandardOutput = true,
|
RedirectStandardOutput = true,
|
||||||
RedirectStandardError = true,
|
RedirectStandardError = true,
|
||||||
WindowStyle = ProcessWindowStyle.Normal,
|
WindowStyle = ProcessWindowStyle.Normal,
|
||||||
|
Arguments = gameArguments,
|
||||||
};
|
};
|
||||||
|
|
||||||
unlockerProcess = new Process { StartInfo = startInfo };
|
unlockerProcess = new Process { StartInfo = startInfo };
|
||||||
@@ -197,6 +205,53 @@ internal sealed class GameFpsUnlockInterop : IGameIslandInterop, IDisposable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string BuildGameArguments(BeforeLaunchExecutionContext context)
|
||||||
|
{
|
||||||
|
LaunchOptions launchOptions = context.LaunchOptions;
|
||||||
|
|
||||||
|
if (!launchOptions.AreCommandLineArgumentsEnabled.Value)
|
||||||
|
{
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder arguments = new();
|
||||||
|
|
||||||
|
// 构建与 GameProcessFactory.CreateForDefault 相同的命令行参数
|
||||||
|
if (launchOptions.IsBorderless.Value)
|
||||||
|
{
|
||||||
|
arguments.Append(" -popupwindow");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (launchOptions.IsExclusive.Value)
|
||||||
|
{
|
||||||
|
arguments.Append(" -window-mode exclusive");
|
||||||
|
}
|
||||||
|
|
||||||
|
arguments.Append($" -screen-fullscreen {(launchOptions.IsFullScreen.Value ? "1" : "0")}");
|
||||||
|
|
||||||
|
if (launchOptions.IsScreenWidthEnabled.Value)
|
||||||
|
{
|
||||||
|
arguments.Append($" -screen-width {launchOptions.ScreenWidth.Value}");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (launchOptions.IsScreenHeightEnabled.Value)
|
||||||
|
{
|
||||||
|
arguments.Append($" -screen-height {launchOptions.ScreenHeight.Value}");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (launchOptions.IsMonitorEnabled.Value)
|
||||||
|
{
|
||||||
|
arguments.Append($" -monitor {launchOptions.Monitor.Value?.Value ?? 1}");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (launchOptions.IsPlatformTypeEnabled.Value)
|
||||||
|
{
|
||||||
|
arguments.Append($" -platform_type {launchOptions.PlatformType.Value:G}");
|
||||||
|
}
|
||||||
|
|
||||||
|
return arguments.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
private async ValueTask MonitorExistingUnlockerAsync(LaunchExecutionContext context, CancellationToken token)
|
private async ValueTask MonitorExistingUnlockerAsync(LaunchExecutionContext context, CancellationToken token)
|
||||||
{
|
{
|
||||||
// 恢复模式下,检查是否有解锁器进程在运行
|
// 恢复模式下,检查是否有解锁器进程在运行
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ internal sealed partial class HutaoAsAService : IHutaoAsAService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Filter announcements by Distribution
|
||||||
|
array = [.. array.Where(a => string.IsNullOrEmpty(a.Distribution) || a.Distribution == "Snap Hutao")]; // 请自行修改发行版名称
|
||||||
|
|
||||||
foreach (HutaoAnnouncement item in array)
|
foreach (HutaoAnnouncement item in array)
|
||||||
{
|
{
|
||||||
item.DismissCommand = dismissCommand;
|
item.DismissCommand = dismissCommand;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<UseWinUI>true</UseWinUI>
|
<UseWinUI>true</UseWinUI>
|
||||||
<UseWPF>False</UseWPF>
|
<UseWPF>False</UseWPF>
|
||||||
<!-- 配置版本号 -->
|
<!-- 配置版本号 -->
|
||||||
<Version>1.18.0.0</Version>
|
<Version>1.18.2.0</Version>
|
||||||
|
|
||||||
<UseWindowsForms>False</UseWindowsForms>
|
<UseWindowsForms>False</UseWindowsForms>
|
||||||
<ImplicitUsings>False</ImplicitUsings>
|
<ImplicitUsings>False</ImplicitUsings>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
// Copyright (c) DGP Studio. All rights reserved.
|
// Copyright (c) DGP Studio. All rights reserved.
|
||||||
|
// Copyright (c) Millennium-Science-Technology-R-D-Inst. All rights reserved.
|
||||||
// Licensed under the MIT license.
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
using Snap.Hutao.Core.ExceptionService;
|
using Snap.Hutao.Core.ExceptionService;
|
||||||
@@ -129,20 +130,48 @@ internal sealed partial class LaunchGameViewModel : Abstraction.ViewModel, IView
|
|||||||
await HandleGamePathEntryChangeAsync().ConfigureAwait(false);
|
await HandleGamePathEntryChangeAsync().ConfigureAwait(false);
|
||||||
Shared.ResumeLaunchExecutionAsync(this).SafeForget();
|
Shared.ResumeLaunchExecutionAsync(this).SafeForget();
|
||||||
|
|
||||||
// 初始化第三方工具列表
|
// 初始化第三方工具列表(不阻塞页面加载)
|
||||||
|
_ = InitializeThirdPartyToolsInBackgroundAsync(token);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task InitializeThirdPartyToolsInBackgroundAsync(CancellationToken token)
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ImmutableArray<ToolInfo> tools = await InitializeThirdPartyToolsAsync().ConfigureAwait(false);
|
// Yield to let navigation/UI finish first.
|
||||||
SentrySdk.AddBreadcrumb($"Initialized {tools.Length} third party tools", category: "ThirdPartyTool");
|
await Task.Yield();
|
||||||
|
|
||||||
|
if (token.IsCancellationRequested || IsViewUnloaded.Value)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ImmutableArray<ToolInfo> tools = await InitializeThirdPartyToolsAsync(token).ConfigureAwait(false);
|
||||||
|
|
||||||
|
if (token.IsCancellationRequested || IsViewUnloaded.Value)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await taskContext.SwitchToMainThreadAsync();
|
||||||
|
if (!token.IsCancellationRequested && !IsViewUnloaded.Value)
|
||||||
|
{
|
||||||
thirdPartyToolsField.Value = tools;
|
thirdPartyToolsField.Value = tools;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (OperationCanceledException)
|
||||||
|
{
|
||||||
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
SentrySdk.AddBreadcrumb($"Failed to initialize third party tools: {ex.Message}", category: "ThirdPartyTool");
|
SentrySdk.AddBreadcrumb($"Failed to initialize third party tools: {ex.Message}", category: "ThirdPartyTool");
|
||||||
SentrySdk.CaptureException(ex);
|
SentrySdk.CaptureException(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("IdentifyMonitorsCommand")]
|
[Command("IdentifyMonitorsCommand")]
|
||||||
@@ -337,7 +366,7 @@ internal sealed partial class LaunchGameViewModel : Abstraction.ViewModel, IView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async ValueTask<ImmutableArray<ToolInfo>> InitializeThirdPartyToolsAsync()
|
private async ValueTask<ImmutableArray<ToolInfo>> InitializeThirdPartyToolsAsync(CancellationToken token)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -345,11 +374,18 @@ internal sealed partial class LaunchGameViewModel : Abstraction.ViewModel, IView
|
|||||||
IThirdPartyToolService thirdPartyToolService = serviceProvider.GetRequiredService<IThirdPartyToolService>();
|
IThirdPartyToolService thirdPartyToolService = serviceProvider.GetRequiredService<IThirdPartyToolService>();
|
||||||
SentrySdk.AddBreadcrumb("Got IThirdPartyToolService instance", category: "ThirdPartyTool");
|
SentrySdk.AddBreadcrumb("Got IThirdPartyToolService instance", category: "ThirdPartyTool");
|
||||||
|
|
||||||
|
// Note: service API is not cancellable; we only honor cancellation before/after the call.
|
||||||
|
token.ThrowIfCancellationRequested();
|
||||||
ImmutableArray<ToolInfo> tools = await thirdPartyToolService.GetToolsAsync().ConfigureAwait(false);
|
ImmutableArray<ToolInfo> tools = await thirdPartyToolService.GetToolsAsync().ConfigureAwait(false);
|
||||||
SentrySdk.AddBreadcrumb($"Got {tools.Length} tools from service", category: "ThirdPartyTool");
|
token.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
SentrySdk.AddBreadcrumb($"Got {tools.Length} tools from service", category: "ThirdPartyTool");
|
||||||
return tools;
|
return tools;
|
||||||
}
|
}
|
||||||
|
catch (OperationCanceledException)
|
||||||
|
{
|
||||||
|
return ImmutableArray<ToolInfo>.Empty;
|
||||||
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
SentrySdk.AddBreadcrumb($"Failed to initialize third party tools: {ex.Message}", category: "ThirdPartyTool");
|
SentrySdk.AddBreadcrumb($"Failed to initialize third party tools: {ex.Message}", category: "ThirdPartyTool");
|
||||||
|
|||||||
@@ -16,4 +16,6 @@ internal class UploadAnnouncement
|
|||||||
public string Link { get; set; } = default!;
|
public string Link { get; set; } = default!;
|
||||||
|
|
||||||
public string? MaxPresentVersion { get; set; }
|
public string? MaxPresentVersion { get; set; }
|
||||||
|
|
||||||
|
public string? Distribution { get; set; }
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user