mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
was 1.2.0
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net7.0-windows10.0.17763.0</TargetFrameworks>
|
<TargetFrameworks>net7.0-windows10.0.18362.0</TargetFrameworks>
|
||||||
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
|
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
|
||||||
<RootNamespace>SettingsUI</RootNamespace>
|
<RootNamespace>SettingsUI</RootNamespace>
|
||||||
<Platforms>x64</Platforms>
|
<Platforms>x64</Platforms>
|
||||||
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.4" />
|
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221109.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
<PublishTrimmed>true</PublishTrimmed>
|
<PublishTrimmed>true</PublishTrimmed>
|
||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
<DebugType>embedded</DebugType>
|
<DebugType>embedded</DebugType>
|
||||||
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SettingsUI", "SettingsUI\Se
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Snap.Hutao.SourceGeneration", "Snap.Hutao.SourceGeneration\Snap.Hutao.SourceGeneration.csproj", "{8B96721E-5604-47D2-9B72-06FEBAD0CE00}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Snap.Hutao.SourceGeneration", "Snap.Hutao.SourceGeneration\Snap.Hutao.SourceGeneration.csproj", "{8B96721E-5604-47D2-9B72-06FEBAD0CE00}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Snap.Hutao.Installer", "Snap.Hutao.Installer\Snap.Hutao.Installer.csproj", "{CEC01691-F65E-4874-9AE2-F571369A7631}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Snap.Hutao.Installer", "Snap.Hutao.Installer\Snap.Hutao.Installer.csproj", "{CEC01691-F65E-4874-9AE2-F571369A7631}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@@ -88,8 +88,8 @@ Global
|
|||||||
{CEC01691-F65E-4874-9AE2-F571369A7631}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{CEC01691-F65E-4874-9AE2-F571369A7631}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{CEC01691-F65E-4874-9AE2-F571369A7631}.Debug|arm64.ActiveCfg = Debug|Any CPU
|
{CEC01691-F65E-4874-9AE2-F571369A7631}.Debug|arm64.ActiveCfg = Debug|Any CPU
|
||||||
{CEC01691-F65E-4874-9AE2-F571369A7631}.Debug|arm64.Build.0 = Debug|Any CPU
|
{CEC01691-F65E-4874-9AE2-F571369A7631}.Debug|arm64.Build.0 = Debug|Any CPU
|
||||||
{CEC01691-F65E-4874-9AE2-F571369A7631}.Debug|x64.ActiveCfg = Debug|Any CPU
|
{CEC01691-F65E-4874-9AE2-F571369A7631}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{CEC01691-F65E-4874-9AE2-F571369A7631}.Debug|x64.Build.0 = Debug|Any CPU
|
{CEC01691-F65E-4874-9AE2-F571369A7631}.Debug|x64.Build.0 = Debug|x64
|
||||||
{CEC01691-F65E-4874-9AE2-F571369A7631}.Debug|x86.ActiveCfg = Debug|Any CPU
|
{CEC01691-F65E-4874-9AE2-F571369A7631}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
{CEC01691-F65E-4874-9AE2-F571369A7631}.Debug|x86.Build.0 = Debug|Any CPU
|
{CEC01691-F65E-4874-9AE2-F571369A7631}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
{CEC01691-F65E-4874-9AE2-F571369A7631}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{CEC01691-F65E-4874-9AE2-F571369A7631}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
// Copyright (c) DGP Studio. All rights reserved.
|
// Copyright (c) DGP Studio. All rights reserved.
|
||||||
// Licensed under the MIT license.
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using CommunityToolkit.WinUI.Notifications;
|
||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
using Microsoft.Windows.AppLifecycle;
|
using Microsoft.Windows.AppLifecycle;
|
||||||
using Snap.Hutao.Core;
|
using Snap.Hutao.Core;
|
||||||
using Snap.Hutao.Core.Exception;
|
using Snap.Hutao.Core.Exception;
|
||||||
using Snap.Hutao.Core.LifeCycle;
|
using Snap.Hutao.Core.LifeCycle;
|
||||||
using Snap.Hutao.Core.Logging;
|
using Snap.Hutao.Core.Logging;
|
||||||
using Snap.Hutao.Extension;
|
|
||||||
using Snap.Hutao.Service.Metadata;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using Windows.Storage;
|
using Windows.Storage;
|
||||||
|
|
||||||
@@ -48,6 +47,7 @@ public partial class App : Application
|
|||||||
// manually invoke
|
// manually invoke
|
||||||
Activation.Activate(firstInstance, activatedEventArgs);
|
Activation.Activate(firstInstance, activatedEventArgs);
|
||||||
firstInstance.Activated += Activation.Activate;
|
firstInstance.Activated += Activation.Activate;
|
||||||
|
ToastNotificationManagerCompat.OnActivated += Activation.NotificationActivate;
|
||||||
|
|
||||||
logger.LogInformation(EventIds.CommonLog, "Snap Hutao | {name} : {version}", CoreEnvironment.FamilyName, CoreEnvironment.Version);
|
logger.LogInformation(EventIds.CommonLog, "Snap Hutao | {name} : {version}", CoreEnvironment.FamilyName, CoreEnvironment.Version);
|
||||||
logger.LogInformation(EventIds.CommonLog, "Cache folder : {folder}", ApplicationData.Current.TemporaryFolder.Path);
|
logger.LogInformation(EventIds.CommonLog, "Cache folder : {folder}", ApplicationData.Current.TemporaryFolder.Path);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) DGP Studio. All rights reserved.
|
// Copyright (c) DGP Studio. All rights reserved.
|
||||||
// Licensed under the MIT license.
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using CommunityToolkit.WinUI.Notifications;
|
||||||
using Microsoft.Windows.AppLifecycle;
|
using Microsoft.Windows.AppLifecycle;
|
||||||
using Snap.Hutao.Extension;
|
using Snap.Hutao.Extension;
|
||||||
using Snap.Hutao.Service.Abstraction;
|
using Snap.Hutao.Service.Abstraction;
|
||||||
@@ -45,8 +46,30 @@ internal static class Activation
|
|||||||
public static void Activate(object? sender, AppActivationArguments args)
|
public static void Activate(object? sender, AppActivationArguments args)
|
||||||
{
|
{
|
||||||
_ = sender;
|
_ = sender;
|
||||||
|
if (!ToastNotificationManagerCompat.WasCurrentProcessToastActivated())
|
||||||
|
{
|
||||||
HandleActivationAsync(args).SafeForget();
|
HandleActivationAsync(args).SafeForget();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 响应通知激活事件
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="args">参数</param>
|
||||||
|
public static void NotificationActivate(ToastNotificationActivatedEventArgsCompat args)
|
||||||
|
{
|
||||||
|
ToastArguments toastArgs = ToastArguments.Parse(args.Argument);
|
||||||
|
_ = toastArgs;
|
||||||
|
|
||||||
|
if (toastArgs.TryGetValue("Action", out string? action))
|
||||||
|
{
|
||||||
|
if (action == LaunchGame)
|
||||||
|
{
|
||||||
|
_ = toastArgs.TryGetValue("Uid", out string? uid);
|
||||||
|
HandleLaunchGameActionAsync(uid).SafeForget();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 异步响应激活事件
|
/// 异步响应激活事件
|
||||||
@@ -87,18 +110,7 @@ internal static class Activation
|
|||||||
|
|
||||||
case LaunchGame:
|
case LaunchGame:
|
||||||
{
|
{
|
||||||
await ThreadHelper.SwitchToMainThreadAsync();
|
await HandleLaunchGameActionAsync().ConfigureAwait(false);
|
||||||
if (!MainWindow.IsPresent)
|
|
||||||
{
|
|
||||||
_ = Ioc.Default.GetRequiredService<LaunchGameWindow>();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
await Ioc.Default
|
|
||||||
.GetRequiredService<INavigationService>()
|
|
||||||
.NavigateAsync<View.Page.LaunchGamePage>(INavigationAwaiter.Default, true).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -108,6 +120,7 @@ internal static class Activation
|
|||||||
|
|
||||||
private static async Task WaitMainWindowAsync()
|
private static async Task WaitMainWindowAsync()
|
||||||
{
|
{
|
||||||
|
await ThreadHelper.SwitchToMainThreadAsync();
|
||||||
_ = Ioc.Default.GetRequiredService<MainWindow>();
|
_ = Ioc.Default.GetRequiredService<MainWindow>();
|
||||||
await Ioc.Default.GetRequiredService<IInfoBarService>().WaitInitializationAsync().ConfigureAwait(false);
|
await Ioc.Default.GetRequiredService<IInfoBarService>().WaitInitializationAsync().ConfigureAwait(false);
|
||||||
|
|
||||||
@@ -177,4 +190,21 @@ internal static class Activation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static async Task HandleLaunchGameActionAsync(string? uid = null)
|
||||||
|
{
|
||||||
|
await ThreadHelper.SwitchToMainThreadAsync();
|
||||||
|
|
||||||
|
// TODO auto switch to account
|
||||||
|
if (!MainWindow.IsPresent)
|
||||||
|
{
|
||||||
|
_ = Ioc.Default.GetRequiredService<LaunchGameWindow>();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await Ioc.Default
|
||||||
|
.GetRequiredService<INavigationService>()
|
||||||
|
.NavigateAsync<View.Page.LaunchGamePage>(INavigationAwaiter.Default, true).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,15 +2,17 @@
|
|||||||
|
|
||||||
<Package
|
<Package
|
||||||
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||||
|
xmlns:com="http://schemas.microsoft.com/appx/manifest/com/windows10"
|
||||||
|
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
|
||||||
xmlns:desktop6="http://schemas.microsoft.com/appx/manifest/desktop/windows10/6"
|
xmlns:desktop6="http://schemas.microsoft.com/appx/manifest/desktop/windows10/6"
|
||||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
|
||||||
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
||||||
IgnorableNamespaces="uap desktop6 rescap">
|
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||||
|
IgnorableNamespaces="com uap desktop desktop6 rescap">
|
||||||
|
|
||||||
<Identity
|
<Identity
|
||||||
Name="7f0db578-026f-4e0b-a75b-d5d06bb0a74d"
|
Name="7f0db578-026f-4e0b-a75b-d5d06bb0a74d"
|
||||||
Publisher="CN=DGP Studio"
|
Publisher="CN=DGP Studio"
|
||||||
Version="1.1.23.0" />
|
Version="1.2.0.0" />
|
||||||
|
|
||||||
<Properties>
|
<Properties>
|
||||||
<DisplayName>胡桃</DisplayName>
|
<DisplayName>胡桃</DisplayName>
|
||||||
@@ -22,7 +24,7 @@
|
|||||||
|
|
||||||
<Dependencies>
|
<Dependencies>
|
||||||
<!--<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />-->
|
<!--<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />-->
|
||||||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.22000.0" />
|
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.18362.0" MaxVersionTested="10.0.22000.0" />
|
||||||
</Dependencies>
|
</Dependencies>
|
||||||
|
|
||||||
<Resources>
|
<Resources>
|
||||||
@@ -43,6 +45,16 @@
|
|||||||
<uap:SplashScreen Image="Assets\SplashScreen.png" />
|
<uap:SplashScreen Image="Assets\SplashScreen.png" />
|
||||||
</uap:VisualElements>
|
</uap:VisualElements>
|
||||||
<Extensions>
|
<Extensions>
|
||||||
|
<desktop:Extension Category="windows.toastNotificationActivation">
|
||||||
|
<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:ExeServer>
|
||||||
|
</com:ComServer>
|
||||||
|
</com:Extension>
|
||||||
<uap:Extension Category="windows.protocol">
|
<uap:Extension Category="windows.protocol">
|
||||||
<uap:Protocol Name="hutao">
|
<uap:Protocol Name="hutao">
|
||||||
<uap:DisplayName>胡桃</uap:DisplayName>
|
<uap:DisplayName>胡桃</uap:DisplayName>
|
||||||
|
|||||||
@@ -83,5 +83,6 @@ internal static partial class ReliquaryWeightConfiguration
|
|||||||
new(AvatarIds.Nilou, 100, 75, 0, 100, 100, 0, 55, 0, "反应流") { { FightProperty.FIGHT_PROP_WATER_ADD_HURT, 100 } },
|
new(AvatarIds.Nilou, 100, 75, 0, 100, 100, 0, 55, 0, "反应流") { { FightProperty.FIGHT_PROP_WATER_ADD_HURT, 100 } },
|
||||||
new(AvatarIds.Cyno, 0, 75, 0, 100, 100, 75, 55, 0) { { FightProperty.FIGHT_PROP_ELEC_ADD_HURT, 100 } },
|
new(AvatarIds.Cyno, 0, 75, 0, 100, 100, 75, 55, 0) { { FightProperty.FIGHT_PROP_ELEC_ADD_HURT, 100 } },
|
||||||
new(AvatarIds.Candace, 100, 75, 0, 100, 100, 0, 55, 0) { { FightProperty.FIGHT_PROP_WATER_ADD_HURT, 100 } },
|
new(AvatarIds.Candace, 100, 75, 0, 100, 100, 0, 55, 0) { { FightProperty.FIGHT_PROP_WATER_ADD_HURT, 100 } },
|
||||||
|
new(AvatarIds.Nahida, 0, 55, 0, 100, 100, 100, 55, 0) { { FightProperty.FIGHT_PROP_GRASS_ADD_HURT, 100 } },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
// Licensed under the MIT license.
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
using CommunityToolkit.Mvvm.Messaging;
|
using CommunityToolkit.Mvvm.Messaging;
|
||||||
|
using CommunityToolkit.WinUI.Notifications;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Snap.Hutao.Context.Database;
|
using Snap.Hutao.Context.Database;
|
||||||
@@ -11,6 +12,7 @@ using Snap.Hutao.Message;
|
|||||||
using Snap.Hutao.Model.Binding.User;
|
using Snap.Hutao.Model.Binding.User;
|
||||||
using Snap.Hutao.Model.Entity;
|
using Snap.Hutao.Model.Entity;
|
||||||
using Snap.Hutao.Service.User;
|
using Snap.Hutao.Service.User;
|
||||||
|
using Snap.Hutao.Web.Hoyolab.Takumi.Binding;
|
||||||
using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord;
|
using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord;
|
||||||
using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.DailyNote;
|
using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.DailyNote;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
@@ -96,6 +98,7 @@ internal class DailyNoteService : IDailyNoteService, IRecipient<UserRemovedMessa
|
|||||||
{
|
{
|
||||||
AppDbContext appDbContext = scope.ServiceProvider.GetRequiredService<AppDbContext>();
|
AppDbContext appDbContext = scope.ServiceProvider.GetRequiredService<AppDbContext>();
|
||||||
GameRecordClient gameRecordClient = scope.ServiceProvider.GetRequiredService<GameRecordClient>();
|
GameRecordClient gameRecordClient = scope.ServiceProvider.GetRequiredService<GameRecordClient>();
|
||||||
|
BindingClient bindingClient = scope.ServiceProvider.GetRequiredService<BindingClient>();
|
||||||
|
|
||||||
foreach (DailyNoteEntry entry in appDbContext.DailyNotes.Include(n => n.User))
|
foreach (DailyNoteEntry entry in appDbContext.DailyNotes.Include(n => n.User))
|
||||||
{
|
{
|
||||||
@@ -111,7 +114,7 @@ internal class DailyNoteService : IDailyNoteService, IRecipient<UserRemovedMessa
|
|||||||
|
|
||||||
if (notify)
|
if (notify)
|
||||||
{
|
{
|
||||||
await NotifyDailyNoteAsync(entry).ConfigureAwait(false);
|
await NotifyDailyNoteAsync(bindingClient, entry).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,7 +134,7 @@ internal class DailyNoteService : IDailyNoteService, IRecipient<UserRemovedMessa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async ValueTask NotifyDailyNoteAsync(DailyNoteEntry entry)
|
private async ValueTask NotifyDailyNoteAsync(BindingClient client,DailyNoteEntry entry)
|
||||||
{
|
{
|
||||||
if (entry.DailyNote == null)
|
if (entry.DailyNote == null)
|
||||||
{
|
{
|
||||||
@@ -139,34 +142,111 @@ internal class DailyNoteService : IDailyNoteService, IRecipient<UserRemovedMessa
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<string> hints = new();
|
List<string> hints = new();
|
||||||
if (!entry.ResinNotifySuppressed && entry.DailyNote.CurrentResin >= entry.ResinNotifyThreshold)
|
|
||||||
|
// NotifySuppressed judge
|
||||||
|
{
|
||||||
|
if (entry.DailyNote.CurrentResin >= entry.ResinNotifyThreshold)
|
||||||
|
{
|
||||||
|
if (!entry.ResinNotifySuppressed)
|
||||||
{
|
{
|
||||||
hints.Add($"当前原粹树脂:{entry.DailyNote.CurrentResin}");
|
hints.Add($"当前原粹树脂:{entry.DailyNote.CurrentResin}");
|
||||||
entry.ResinNotifySuppressed = true;
|
entry.ResinNotifySuppressed = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
entry.ResinNotifySuppressed = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!entry.HomeCoinNotifySuppressed && entry.DailyNote.CurrentHomeCoin >= entry.HomeCoinNotifyThreshold)
|
if (entry.DailyNote.CurrentHomeCoin >= entry.HomeCoinNotifyThreshold)
|
||||||
|
{
|
||||||
|
if (!entry.HomeCoinNotifySuppressed)
|
||||||
{
|
{
|
||||||
hints.Add($"当前洞天宝钱:{entry.DailyNote.CurrentHomeCoin}");
|
hints.Add($"当前洞天宝钱:{entry.DailyNote.CurrentHomeCoin}");
|
||||||
entry.HomeCoinNotifySuppressed = true;
|
entry.HomeCoinNotifySuppressed = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
entry.HomeCoinNotifySuppressed = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!entry.DailyTaskNotifySuppressed && entry.DailyTaskNotify && !entry.DailyNote.IsExtraTaskRewardReceived)
|
if (entry.DailyTaskNotify && !entry.DailyNote.IsExtraTaskRewardReceived)
|
||||||
|
{
|
||||||
|
if (!entry.DailyTaskNotifySuppressed)
|
||||||
{
|
{
|
||||||
hints.Add(entry.DailyNote.ExtraTaskRewardDescription);
|
hints.Add(entry.DailyNote.ExtraTaskRewardDescription);
|
||||||
entry.DailyTaskNotifySuppressed = true;
|
entry.DailyTaskNotifySuppressed = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
entry.DailyTaskNotifySuppressed = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!entry.TransformerNotifySuppressed && entry.TransformerNotify && entry.DailyNote.Transformer.Obtained && entry.DailyNote.Transformer.RecoveryTime.Reached)
|
if (entry.TransformerNotify && entry.DailyNote.Transformer.Obtained && entry.DailyNote.Transformer.RecoveryTime.Reached)
|
||||||
|
{
|
||||||
|
if (!entry.TransformerNotifySuppressed)
|
||||||
{
|
{
|
||||||
hints.Add("参量质变仪已准备完成");
|
hints.Add("参量质变仪已准备完成");
|
||||||
entry.TransformerNotifySuppressed = true;
|
entry.TransformerNotifySuppressed = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
entry.TransformerNotifySuppressed = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!entry.ExpeditionNotifySuppressed && entry.ExpeditionNotify && entry.DailyNote.Expeditions.All(e => e.Status == ExpeditionStatus.Finished))
|
if (entry.ExpeditionNotify && entry.DailyNote.Expeditions.All(e => e.Status == ExpeditionStatus.Finished))
|
||||||
|
{
|
||||||
|
if (!entry.ExpeditionNotifySuppressed)
|
||||||
{
|
{
|
||||||
hints.Add("探索派遣已完成");
|
hints.Add("探索派遣已完成");
|
||||||
entry.ExpeditionNotifySuppressed = true;
|
entry.ExpeditionNotifySuppressed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
entry.ExpeditionNotifySuppressed = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hints.Count <= 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<UserGameRole> roles = await client.GetUserGameRolesAsync(entry.User).ConfigureAwait(false);
|
||||||
|
string attribution = roles.SingleOrDefault(r => r.GameUid == entry.Uid)?.ToString() ?? "未知角色";
|
||||||
|
|
||||||
|
ToastContentBuilder builder = new ToastContentBuilder()
|
||||||
|
.AddHeader("DAILYNOTE", "实时便笺提醒", "DAILYNOTE")
|
||||||
|
.AddAttributionText(attribution)
|
||||||
|
.AddButton(new ToastButton().SetContent("开始游戏").AddArgument("Action", "LaunchGame").AddArgument("Uid", entry.Uid))
|
||||||
|
.AddButton(new ToastButtonDismiss("我知道了"));
|
||||||
|
|
||||||
|
using (IServiceScope scope = scopeFactory.CreateScope())
|
||||||
|
{
|
||||||
|
AppDbContext appDbContext = scope.ServiceProvider.GetRequiredService<AppDbContext>();
|
||||||
|
if (appDbContext.Settings.SingleOrAdd(SettingEntry.DailyNoteReminderNotify, false.ToString()).GetBoolean())
|
||||||
|
{
|
||||||
|
builder.SetToastScenario(ToastScenario.Reminder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hints.Count > 2)
|
||||||
|
{
|
||||||
|
builder.AddText("多个提醒项达到设定值");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (string hint in hints)
|
||||||
|
{
|
||||||
|
builder.AddText(hint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await ThreadHelper.SwitchToMainThreadAsync();
|
||||||
|
builder.Show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
|
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
|
||||||
<PackageCertificateThumbprint>F8C2255969BEA4A681CED102771BF807856AEC02</PackageCertificateThumbprint>
|
<PackageCertificateThumbprint>F8C2255969BEA4A681CED102771BF807856AEC02</PackageCertificateThumbprint>
|
||||||
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
|
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
|
||||||
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
|
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
|
||||||
<AppxSymbolPackageEnabled>True</AppxSymbolPackageEnabled>
|
<AppxSymbolPackageEnabled>True</AppxSymbolPackageEnabled>
|
||||||
<GenerateTestArtifacts>True</GenerateTestArtifacts>
|
<GenerateTestArtifacts>True</GenerateTestArtifacts>
|
||||||
<AppxBundle>Never</AppxBundle>
|
<AppxBundle>Never</AppxBundle>
|
||||||
@@ -145,7 +145,7 @@
|
|||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.25231-preview" />
|
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.25231-preview" />
|
||||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.220930.4-preview2" />
|
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221109.1" />
|
||||||
<PackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.435">
|
<PackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.435">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
|||||||
@@ -38,7 +38,18 @@ internal class BindingClient
|
|||||||
/// <param name="user">用户</param>
|
/// <param name="user">用户</param>
|
||||||
/// <param name="token">取消令牌</param>
|
/// <param name="token">取消令牌</param>
|
||||||
/// <returns>用户角色信息</returns>
|
/// <returns>用户角色信息</returns>
|
||||||
public async Task<List<UserGameRole>> GetUserGameRolesAsync(User user, CancellationToken token = default)
|
public Task<List<UserGameRole>> GetUserGameRolesAsync(User user, CancellationToken token = default)
|
||||||
|
{
|
||||||
|
return GetUserGameRolesAsync(user.Entity, token);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取用户角色信息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="user">用户</param>
|
||||||
|
/// <param name="token">取消令牌</param>
|
||||||
|
/// <returns>用户角色信息</returns>
|
||||||
|
public async Task<List<UserGameRole>> GetUserGameRolesAsync(Model.Entity.User user, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
Response<ListWrapper<UserGameRole>>? resp = await httpClient
|
Response<ListWrapper<UserGameRole>>? resp = await httpClient
|
||||||
.SetUser(user)
|
.SetUser(user)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public class Expedition
|
|||||||
private const string Keqing = "https://upload-bbs.mihoyo.com/game_record/genshin/character_side_icon/UI_AvatarIcon_Side_Keqing.png";
|
private const string Keqing = "https://upload-bbs.mihoyo.com/game_record/genshin/character_side_icon/UI_AvatarIcon_Side_Keqing.png";
|
||||||
private const string Sara = "https://upload-bbs.mihoyo.com/game_record/genshin/character_side_icon/UI_AvatarIcon_Side_Sara.png";
|
private const string Sara = "https://upload-bbs.mihoyo.com/game_record/genshin/character_side_icon/UI_AvatarIcon_Side_Sara.png";
|
||||||
|
|
||||||
private static readonly List<string> ShortExpeditionTimeAvatars = new List<string>()
|
private static readonly List<string> ShortExpeditionTimeAvatars = new()
|
||||||
{
|
{
|
||||||
Bennett, Chongyun, Fischl, Keqing, Sara,
|
Bennett, Chongyun, Fischl, Keqing, Sara,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user