mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
spiral abyss view
This commit is contained in:
@@ -20,9 +20,13 @@ internal class HutaoLocation : IFileSystemLocation
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
string myDocument = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
|
||||
|
||||
#if RELEASE
|
||||
// 将测试版与正式版的文件目录分离
|
||||
string folderName = Package.Current.PublisherDisplayName == "DGP Studio CI" ? "HutaoAlpha" : "Hutao";
|
||||
#else
|
||||
// 使得迁移能正常生成
|
||||
string folderName = "Hutao";
|
||||
#endif
|
||||
path = Path.GetFullPath(Path.Combine(myDocument, folderName));
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Context.FileSystem;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Snap.Hutao.Core.DependencyInjection;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Context.FileSystem;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Diagnostics;
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.UI.Composition;
|
||||
using Microsoft.UI.Composition.SystemBackdrops;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Core.Database;
|
||||
using Snap.Hutao.Model.Entity;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using System.Runtime.InteropServices;
|
||||
using Windows.System;
|
||||
using WinRT;
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
537
src/Snap.Hutao/Snap.Hutao/Migrations/20221231104727_SpiralAbyssEntry.Designer.cs
generated
Normal file
537
src/Snap.Hutao/Snap.Hutao/Migrations/20221231104727_SpiralAbyssEntry.Designer.cs
generated
Normal file
@@ -0,0 +1,537 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Snap.Hutao.Migrations
|
||||
{
|
||||
[DbContext(typeof(AppDbContext))]
|
||||
[Migration("20221231104727_SpiralAbyssEntry")]
|
||||
partial class SpiralAbyssEntry
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "7.0.1");
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.Achievement", b =>
|
||||
{
|
||||
b.Property<Guid>("InnerId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<Guid>("ArchiveId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("Current")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTimeOffset>("Time")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("InnerId");
|
||||
|
||||
b.HasIndex("ArchiveId");
|
||||
|
||||
b.ToTable("achievements");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.AchievementArchive", b =>
|
||||
{
|
||||
b.Property<Guid>("InnerId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("IsSelected")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("InnerId");
|
||||
|
||||
b.ToTable("achievement_archives");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.AvatarInfo", b =>
|
||||
{
|
||||
b.Property<Guid>("InnerId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Info")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Uid")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("InnerId");
|
||||
|
||||
b.ToTable("avatar_infos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.CultivateEntry", b =>
|
||||
{
|
||||
b.Property<Guid>("InnerId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<Guid>("ProjectId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("InnerId");
|
||||
|
||||
b.HasIndex("ProjectId");
|
||||
|
||||
b.ToTable("cultivate_entries");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.CultivateItem", b =>
|
||||
{
|
||||
b.Property<Guid>("InnerId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("Count")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<Guid>("EntryId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("IsFinished")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ItemId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("InnerId");
|
||||
|
||||
b.HasIndex("EntryId");
|
||||
|
||||
b.ToTable("cultivate_items");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.CultivateProject", b =>
|
||||
{
|
||||
b.Property<Guid>("InnerId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("AttachedUid")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("IsSelected")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("InnerId");
|
||||
|
||||
b.ToTable("cultivate_projects");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.DailyNoteEntry", b =>
|
||||
{
|
||||
b.Property<Guid>("InnerId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("DailyNote")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("DailyTaskNotify")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("DailyTaskNotifySuppressed")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("ExpeditionNotify")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("ExpeditionNotifySuppressed")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("HomeCoinNotifySuppressed")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("HomeCoinNotifyThreshold")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("ResinNotifySuppressed")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ResinNotifyThreshold")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("ShowInHomeWidget")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("TransformerNotify")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("TransformerNotifySuppressed")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Uid")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("InnerId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("daily_notes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.GachaArchive", b =>
|
||||
{
|
||||
b.Property<Guid>("InnerId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("IsSelected")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Uid")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("InnerId");
|
||||
|
||||
b.ToTable("gacha_archives");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.GachaItem", b =>
|
||||
{
|
||||
b.Property<Guid>("InnerId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<Guid>("ArchiveId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("GachaType")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<long>("Id")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ItemId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("QueryType")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTimeOffset>("Time")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("InnerId");
|
||||
|
||||
b.HasIndex("ArchiveId");
|
||||
|
||||
b.ToTable("gacha_items");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.GameAccount", b =>
|
||||
{
|
||||
b.Property<Guid>("InnerId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("AttachUid")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("MihoyoSDK")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("InnerId");
|
||||
|
||||
b.ToTable("game_accounts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.InventoryItem", b =>
|
||||
{
|
||||
b.Property<Guid>("InnerId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<uint>("Count")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ItemId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<Guid>("ProjectId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("InnerId");
|
||||
|
||||
b.HasIndex("ProjectId");
|
||||
|
||||
b.ToTable("inventory_items");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.InventoryReliquary", b =>
|
||||
{
|
||||
b.Property<Guid>("InnerId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("AppendPropIdList")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("ItemId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Level")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("MainPropId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<Guid>("ProjectId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("InnerId");
|
||||
|
||||
b.HasIndex("ProjectId");
|
||||
|
||||
b.ToTable("inventory_reliquaries");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.InventoryWeapon", b =>
|
||||
{
|
||||
b.Property<Guid>("InnerId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("ItemId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Level")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<Guid>("ProjectId")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("PromoteLevel")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("InnerId");
|
||||
|
||||
b.HasIndex("ProjectId");
|
||||
|
||||
b.ToTable("inventory_weapons");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.ObjectCacheEntry", b =>
|
||||
{
|
||||
b.Property<string>("Key")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTimeOffset>("ExpireTime")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Key");
|
||||
|
||||
b.ToTable("object_cache");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.SettingEntry", b =>
|
||||
{
|
||||
b.Property<string>("Key")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Key");
|
||||
|
||||
b.ToTable("settings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.SpiralAbyssEntry", b =>
|
||||
{
|
||||
b.Property<Guid>("InnerId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("ScheduleId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("SpiralAbyss")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Uid")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("InnerId");
|
||||
|
||||
b.ToTable("spiral_abysses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.User", b =>
|
||||
{
|
||||
b.Property<Guid>("InnerId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Aid")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("CookieToken")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("IsSelected")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Ltoken")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Mid")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Stoken")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("InnerId");
|
||||
|
||||
b.ToTable("users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.Achievement", b =>
|
||||
{
|
||||
b.HasOne("Snap.Hutao.Model.Entity.AchievementArchive", "Archive")
|
||||
.WithMany()
|
||||
.HasForeignKey("ArchiveId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Archive");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.CultivateEntry", b =>
|
||||
{
|
||||
b.HasOne("Snap.Hutao.Model.Entity.CultivateProject", "Project")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Project");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.CultivateItem", b =>
|
||||
{
|
||||
b.HasOne("Snap.Hutao.Model.Entity.CultivateEntry", "Entry")
|
||||
.WithMany()
|
||||
.HasForeignKey("EntryId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Entry");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.DailyNoteEntry", b =>
|
||||
{
|
||||
b.HasOne("Snap.Hutao.Model.Entity.User", "User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.GachaItem", b =>
|
||||
{
|
||||
b.HasOne("Snap.Hutao.Model.Entity.GachaArchive", "Archive")
|
||||
.WithMany("Items")
|
||||
.HasForeignKey("ArchiveId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Archive");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.InventoryItem", b =>
|
||||
{
|
||||
b.HasOne("Snap.Hutao.Model.Entity.CultivateProject", "Project")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Project");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.InventoryReliquary", b =>
|
||||
{
|
||||
b.HasOne("Snap.Hutao.Model.Entity.CultivateProject", "Project")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Project");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.InventoryWeapon", b =>
|
||||
{
|
||||
b.HasOne("Snap.Hutao.Model.Entity.CultivateProject", "Project")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProjectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Project");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.GachaArchive", b =>
|
||||
{
|
||||
b.Navigation("Items");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
// <auto-generated />
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Snap.Hutao.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class SpiralAbyssEntry : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "spiral_abysses",
|
||||
columns: table => new
|
||||
{
|
||||
InnerId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
ScheduleId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Uid = table.Column<string>(type: "TEXT", nullable: false),
|
||||
SpiralAbyss = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_spiral_abysses", x => x.InnerId);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "spiral_abysses");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
@@ -385,6 +385,28 @@ namespace Snap.Hutao.Migrations
|
||||
b.ToTable("settings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.SpiralAbyssEntry", b =>
|
||||
{
|
||||
b.Property<Guid>("InnerId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("ScheduleId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("SpiralAbyss")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Uid")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("InnerId");
|
||||
|
||||
b.ToTable("spiral_abysses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.User", b =>
|
||||
{
|
||||
b.Property<Guid>("InnerId")
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
|
||||
namespace Snap.Hutao.Model.Binding.SpiralAbyss;
|
||||
|
||||
/// <summary>
|
||||
/// 角色
|
||||
/// </summary>
|
||||
public class Avatar
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造一个新的角色
|
||||
/// </summary>
|
||||
/// <param name="avatarId">角色Id</param>
|
||||
/// <param name="idAvatarMap">Id角色映射</param>
|
||||
public Avatar(AvatarId avatarId, Dictionary<AvatarId, Metadata.Avatar.Avatar> idAvatarMap)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLineIf(!idAvatarMap.ContainsKey(avatarId), avatarId.Value);
|
||||
Metadata.Avatar.Avatar metaAvatar = idAvatarMap[avatarId];
|
||||
Name = metaAvatar.Name;
|
||||
Icon = Metadata.Converter.AvatarIconConverter.IconNameToUri(metaAvatar.Icon);
|
||||
SideIcon = Metadata.Converter.AvatarIconConverter.IconNameToUri(metaAvatar.SideIcon);
|
||||
Quality = metaAvatar.Quality;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 图标
|
||||
/// </summary>
|
||||
public Uri Icon { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 侧面图标
|
||||
/// </summary>
|
||||
public Uri SideIcon { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 星级
|
||||
/// </summary>
|
||||
public ItemQuality Quality { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.SpiralAbyss;
|
||||
|
||||
namespace Snap.Hutao.Model.Binding.SpiralAbyss;
|
||||
|
||||
/// <summary>
|
||||
/// 上下半视图
|
||||
/// </summary>
|
||||
public class BattleView
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造一个新的上下半视图
|
||||
/// </summary>
|
||||
/// <param name="battle">战斗</param>
|
||||
/// <param name="idAvatarMap">Id角色映射</param>
|
||||
public BattleView(Battle battle, Dictionary<AvatarId, Metadata.Avatar.Avatar> idAvatarMap)
|
||||
{
|
||||
Time = DateTimeOffset.FromUnixTimeSeconds(battle.Timestamp).ToLocalTime().ToString("yyyy.MM.dd HH:mm:ss");
|
||||
Avatars = battle.Avatars.Select(a => new Avatar(a.Id, idAvatarMap)).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 时间
|
||||
/// </summary>
|
||||
public string Time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色
|
||||
/// </summary>
|
||||
public List<Avatar> Avatars { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
|
||||
namespace Snap.Hutao.Model.Binding.SpiralAbyss;
|
||||
|
||||
/// <summary>
|
||||
/// 层视图
|
||||
/// </summary>
|
||||
public class FloorView
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造一个新的层视图
|
||||
/// </summary>
|
||||
/// <param name="floor">层</param>
|
||||
/// <param name="idAvatarMap">Id角色映射</param>
|
||||
public FloorView(Web.Hoyolab.Takumi.GameRecord.SpiralAbyss.Floor floor, Dictionary<AvatarId, Metadata.Avatar.Avatar> idAvatarMap)
|
||||
{
|
||||
Index = $"第 {floor.Index} 层";
|
||||
SettleTime = DateTimeOffset.FromUnixTimeSeconds(floor.SettleTime).ToLocalTime().ToString("yyyy.MM.dd HH:mm:ss");
|
||||
Star = floor.Star;
|
||||
Levels = floor.Levels.Select(l => new LevelView(l, idAvatarMap)).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 层号
|
||||
/// </summary>
|
||||
public string Index { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 时间
|
||||
/// </summary>
|
||||
public string SettleTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 星数
|
||||
/// </summary>
|
||||
public int Star { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 间信息
|
||||
/// </summary>
|
||||
public List<LevelView> Levels { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.SpiralAbyss;
|
||||
|
||||
namespace Snap.Hutao.Model.Binding.SpiralAbyss;
|
||||
|
||||
/// <summary>
|
||||
/// 间视图
|
||||
/// </summary>
|
||||
public class LevelView
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造一个新的间视图
|
||||
/// </summary>
|
||||
/// <param name="level">间</param>
|
||||
/// <param name="idAvatarMap">Id角色映射</param>
|
||||
public LevelView(Level level, Dictionary<AvatarId, Metadata.Avatar.Avatar> idAvatarMap)
|
||||
{
|
||||
Index = $"第 {level.Index} 间";
|
||||
Star = level.Star;
|
||||
Battles = level.Battles.Select(b => new BattleView(b, idAvatarMap)).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 间号
|
||||
/// </summary>
|
||||
public string Index { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 星数
|
||||
/// </summary>
|
||||
public int Star { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上下半
|
||||
/// </summary>
|
||||
public List<BattleView> Battles { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
|
||||
namespace Snap.Hutao.Model.Binding.SpiralAbyss;
|
||||
|
||||
/// <summary>
|
||||
/// 排行角色
|
||||
/// </summary>
|
||||
public class RankAvatar : Avatar
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造一个新的角色
|
||||
/// </summary>
|
||||
/// <param name="value">值</param>
|
||||
/// <param name="avatarId">角色Id</param>
|
||||
/// <param name="idAvatarMap">Id角色映射</param>
|
||||
public RankAvatar(int value, AvatarId avatarId, Dictionary<AvatarId, Metadata.Avatar.Avatar> idAvatarMap)
|
||||
: base(avatarId, idAvatarMap)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public int Value { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
|
||||
namespace Snap.Hutao.Model.Binding.SpiralAbyss;
|
||||
|
||||
/// <summary>
|
||||
/// 深渊视图
|
||||
/// </summary>
|
||||
public class SpiralAbyssView
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造一个新的深渊视图
|
||||
/// </summary>
|
||||
/// <param name="spiralAbyss">深渊信息</param>
|
||||
/// <param name="idAvatarMap">Id角色映射</param>
|
||||
public SpiralAbyssView(Web.Hoyolab.Takumi.GameRecord.SpiralAbyss.SpiralAbyss spiralAbyss, Dictionary<AvatarId, Metadata.Avatar.Avatar> idAvatarMap)
|
||||
{
|
||||
Schedule = $"第 {spiralAbyss.ScheduleId} 期";
|
||||
TotalBattleTimes = spiralAbyss.TotalBattleTimes;
|
||||
TotalStar = spiralAbyss.TotalStar;
|
||||
MaxFloor = spiralAbyss.MaxFloor;
|
||||
Reveals = spiralAbyss.RevealRank.Select(r => new RankAvatar(r.Value, r.AvatarId, idAvatarMap)).ToList();
|
||||
Defeat = spiralAbyss.DefeatRank.Select(r => new RankAvatar(r.Value, r.AvatarId, idAvatarMap)).SingleOrDefault();
|
||||
Damage = spiralAbyss.DamageRank.Select(r => new RankAvatar(r.Value, r.AvatarId, idAvatarMap)).SingleOrDefault();
|
||||
TakeDamage = spiralAbyss.TakeDamageRank.Select(r => new RankAvatar(r.Value, r.AvatarId, idAvatarMap)).SingleOrDefault();
|
||||
NormalSkill = spiralAbyss.NormalSkillRank.Select(r => new RankAvatar(r.Value, r.AvatarId, idAvatarMap)).SingleOrDefault();
|
||||
EnergySkill = spiralAbyss.EnergySkillRank.Select(r => new RankAvatar(r.Value, r.AvatarId, idAvatarMap)).SingleOrDefault();
|
||||
Floors = spiralAbyss.Floors.Select(f => new FloorView(f, idAvatarMap)).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 期
|
||||
/// </summary>
|
||||
public string Schedule { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 战斗次数
|
||||
/// </summary>
|
||||
public int TotalBattleTimes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 共获得渊星
|
||||
/// </summary>
|
||||
public int TotalStar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最深抵达
|
||||
/// </summary>
|
||||
public string MaxFloor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 出战次数
|
||||
/// </summary>
|
||||
public List<RankAvatar> Reveals { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 击破次数
|
||||
/// </summary>
|
||||
public RankAvatar? Defeat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最强一击
|
||||
/// </summary>
|
||||
public RankAvatar? Damage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 承受伤害
|
||||
/// </summary>
|
||||
public RankAvatar? TakeDamage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 元素战技
|
||||
/// </summary>
|
||||
public RankAvatar? NormalSkill { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 元素爆发
|
||||
/// </summary>
|
||||
public RankAvatar? EnergySkill { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 层信息
|
||||
/// </summary>
|
||||
public List<FloorView> Floors { get; set; }
|
||||
}
|
||||
@@ -31,4 +31,14 @@ public class UserAndRole
|
||||
/// 角色
|
||||
/// </summary>
|
||||
public UserGameRole Role { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 从用户与选中的角色转换
|
||||
/// </summary>
|
||||
/// <param name="user">角色</param>
|
||||
/// <returns>用户与角色</returns>
|
||||
public static UserAndRole FromUser(User user)
|
||||
{
|
||||
return new UserAndRole(user.Entity, user.SelectedUserGameRole!);
|
||||
}
|
||||
}
|
||||
@@ -18,4 +18,4 @@ internal class DailyNoteEntryConfiguration : IEntityTypeConfiguration<DailyNoteE
|
||||
.HasColumnType("TEXT")
|
||||
.HasConversion<JsonTextValueConverter<Web.Hoyolab.Takumi.GameRecord.DailyNote.DailyNote>>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace Snap.Hutao.Model.Entity.Configuration;
|
||||
|
||||
/// <summary>
|
||||
/// 深渊入口配置
|
||||
/// </summary>
|
||||
internal class SpiralAbyssEntryConfiguration : IEntityTypeConfiguration<SpiralAbyssEntry>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public void Configure(EntityTypeBuilder<SpiralAbyssEntry> builder)
|
||||
{
|
||||
builder.Property(e => e.SpiralAbyss)
|
||||
.HasColumnType("TEXT")
|
||||
.HasConversion<JsonTextValueConverter<Web.Hoyolab.Takumi.GameRecord.SpiralAbyss.SpiralAbyss>>();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Snap.Hutao.Model.Binding.User;
|
||||
using Snap.Hutao.Web.Hoyolab.Takumi.Binding;
|
||||
using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.DailyNote;
|
||||
@@ -13,11 +14,8 @@ namespace Snap.Hutao.Model.Entity;
|
||||
/// 实时便笺入口
|
||||
/// </summary>
|
||||
[Table("daily_notes")]
|
||||
public class DailyNoteEntry : INotifyPropertyChanged
|
||||
public class DailyNoteEntry : ObservableObject
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
|
||||
/// <summary>
|
||||
/// 内部Id
|
||||
/// </summary>
|
||||
@@ -130,6 +128,6 @@ public class DailyNoteEntry : INotifyPropertyChanged
|
||||
public void UpdateDailyNote(DailyNote? dailyNote)
|
||||
{
|
||||
DailyNote = dailyNote;
|
||||
PropertyChanged?.Invoke(this, new(nameof(DailyNote)));
|
||||
OnPropertyChanged(nameof(DailyNote));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Snap.Hutao.Model.Entity;
|
||||
using Snap.Hutao.Model.Entity.Configuration;
|
||||
|
||||
namespace Snap.Hutao.Context.Database;
|
||||
namespace Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
/// <summary>
|
||||
/// 应用程序数据库上下文
|
||||
@@ -117,6 +117,11 @@ public sealed class AppDbContext : DbContext
|
||||
/// </summary>
|
||||
public DbSet<InventoryReliquary> InventoryReliquaries { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 深渊记录
|
||||
/// </summary>
|
||||
public DbSet<SpiralAbyssEntry> SpiralAbysses { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 构造一个临时的应用程序数据库上下文
|
||||
/// </summary>
|
||||
@@ -139,8 +144,9 @@ public sealed class AppDbContext : DbContext
|
||||
{
|
||||
modelBuilder
|
||||
.ApplyConfiguration(new AvatarInfoConfiguration())
|
||||
.ApplyConfiguration(new UserConfiguration())
|
||||
.ApplyConfiguration(new DailyNoteEntryConfiguration())
|
||||
.ApplyConfiguration(new InventoryReliquaryConfiguration());
|
||||
.ApplyConfiguration(new InventoryReliquaryConfiguration())
|
||||
.ApplyConfiguration(new SpiralAbyssEntryConfiguration())
|
||||
.ApplyConfiguration(new UserConfiguration());
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
using Microsoft.EntityFrameworkCore.Design;
|
||||
using Snap.Hutao.Context.FileSystem;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
namespace Snap.Hutao.Context.Database;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Snap.Hutao.Core.Logging;
|
||||
|
||||
namespace Snap.Hutao.Context.Database;
|
||||
namespace Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
/// <summary>
|
||||
/// 日志数据库上下文
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
using Microsoft.EntityFrameworkCore.Design;
|
||||
using Snap.Hutao.Context.FileSystem;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
|
||||
namespace Snap.Hutao.Context.Database;
|
||||
|
||||
69
src/Snap.Hutao/Snap.Hutao/Model/Entity/SpiralAbyssEntry.cs
Normal file
69
src/Snap.Hutao/Snap.Hutao/Model/Entity/SpiralAbyssEntry.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Snap.Hutao.Model.Entity;
|
||||
|
||||
/// <summary>
|
||||
/// 深渊记录入口点
|
||||
/// </summary>
|
||||
[Table("spiral_abysses")]
|
||||
public class SpiralAbyssEntry : ObservableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// 内部Id
|
||||
/// </summary>
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public Guid InnerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 计划Id
|
||||
/// </summary>
|
||||
public int ScheduleId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 计划名称
|
||||
/// </summary>
|
||||
[NotMapped]
|
||||
public string Schedule { get => $"第 {ScheduleId} 期"; }
|
||||
|
||||
/// <summary>
|
||||
/// Uid
|
||||
/// </summary>
|
||||
public string Uid { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Json!!! 深渊记录
|
||||
/// </summary>
|
||||
public Web.Hoyolab.Takumi.GameRecord.SpiralAbyss.SpiralAbyss SpiralAbyss { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 创建一个新的深渊信息
|
||||
/// </summary>
|
||||
/// <param name="uid">uid</param>
|
||||
/// <param name="spiralAbyss">深渊信息</param>
|
||||
/// <returns>新的深渊信息</returns>
|
||||
public static SpiralAbyssEntry Create(string uid, Web.Hoyolab.Takumi.GameRecord.SpiralAbyss.SpiralAbyss spiralAbyss)
|
||||
{
|
||||
return new()
|
||||
{
|
||||
Uid = uid,
|
||||
ScheduleId = spiralAbyss.ScheduleId,
|
||||
SpiralAbyss = spiralAbyss,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新深渊信息
|
||||
/// </summary>
|
||||
/// <param name="spiralAbyss">深渊信息</param>
|
||||
public void UpdateSpiralAbyss(Web.Hoyolab.Takumi.GameRecord.SpiralAbyss.SpiralAbyss spiralAbyss)
|
||||
{
|
||||
SpiralAbyss = spiralAbyss;
|
||||
OnPropertyChanged(nameof(SpiralAbyss));
|
||||
}
|
||||
}
|
||||
@@ -92,4 +92,13 @@ public static class AvatarIds
|
||||
{
|
||||
return avatarId == PlayerBoy || avatarId == PlayerGirl;
|
||||
}
|
||||
|
||||
public static Dictionary<AvatarId, Avatar.Avatar> ExtendAvatars(Dictionary<AvatarId, Avatar.Avatar> idAvatarMap)
|
||||
{
|
||||
return new(idAvatarMap)
|
||||
{
|
||||
[PlayerBoy] = new() { Name = "旅行者", Icon = "UI_AvatarIcon_PlayerBoy", Quality = Intrinsic.ItemQuality.QUALITY_ORANGE },
|
||||
[PlayerGirl] = new() { Name = "旅行者", Icon = "UI_AvatarIcon_PlayerGirl", Quality = Intrinsic.ItemQuality.QUALITY_ORANGE },
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
<Identity
|
||||
Name="7f0db578-026f-4e0b-a75b-d5d06bb0a74d"
|
||||
Publisher="CN=DGP Studio"
|
||||
Version="1.2.19.0" />
|
||||
Version="1.3.0.0" />
|
||||
|
||||
<Properties>
|
||||
<DisplayName>胡桃</DisplayName>
|
||||
|
||||
BIN
src/Snap.Hutao/Snap.Hutao/Resource/Icon/UI_Icon_Tower_Star.png
Normal file
BIN
src/Snap.Hutao/Snap.Hutao/Resource/Icon/UI_Icon_Tower_Star.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
BIN
src/Snap.Hutao/Snap.Hutao/Resource/Icon/UI_MarkTower_Tower.png
Normal file
BIN
src/Snap.Hutao/Snap.Hutao/Resource/Icon/UI_MarkTower_Tower.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.1 KiB |
@@ -1,8 +1,8 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Core.Database;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using Snap.Hutao.Model.InterChange.Achievement;
|
||||
using EntityAchievement = Snap.Hutao.Model.Entity.Achievement;
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Core.Database;
|
||||
using Snap.Hutao.Core.Diagnostics;
|
||||
using Snap.Hutao.Core.Logging;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using Snap.Hutao.Model.InterChange.Achievement;
|
||||
using System.Collections.ObjectModel;
|
||||
using BindingAchievement = Snap.Hutao.Model.Binding.Achievement.Achievement;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Core.Database;
|
||||
using Snap.Hutao.Core.Diagnostics;
|
||||
using Snap.Hutao.Core.Logging;
|
||||
using Snap.Hutao.Model.Binding.AvatarProperty;
|
||||
using Snap.Hutao.Model.Binding.User;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using Snap.Hutao.Model.Metadata;
|
||||
using Snap.Hutao.Service.AvatarInfo.Composer;
|
||||
using Snap.Hutao.Service.AvatarInfo.Factory;
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Core.Database;
|
||||
using Snap.Hutao.Model.Entity;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
using System.Collections.ObjectModel;
|
||||
using BindingCultivateEntry = Snap.Hutao.Model.Binding.Cultivation.CultivateEntry;
|
||||
@@ -335,6 +335,7 @@ internal class CultivationService : ICultivationService
|
||||
"角色培养素材" => true,
|
||||
"天赋培养素材" => true,
|
||||
"武器强化素材" => true,
|
||||
"武器突破素材" => true,
|
||||
_ => false,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,12 +3,14 @@
|
||||
|
||||
using CommunityToolkit.WinUI.Notifications;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Core.Database;
|
||||
using Snap.Hutao.Model.Entity;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using Snap.Hutao.Model.Metadata.Converter;
|
||||
using Snap.Hutao.Web.Hoyolab.Takumi.Auth;
|
||||
using Snap.Hutao.Web.Hoyolab.Takumi.Binding;
|
||||
using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.DailyNote;
|
||||
using Windows.Foundation.Metadata;
|
||||
|
||||
namespace Snap.Hutao.Service.DailyNote;
|
||||
|
||||
@@ -42,7 +44,7 @@ internal class DailyNoteNotifier
|
||||
return;
|
||||
}
|
||||
|
||||
List<string> hints = new();
|
||||
List<NotifyInfo> notifyInfos = new();
|
||||
|
||||
// NotifySuppressed judge
|
||||
{
|
||||
@@ -50,7 +52,11 @@ internal class DailyNoteNotifier
|
||||
{
|
||||
if (!entry.ResinNotifySuppressed)
|
||||
{
|
||||
hints.Add($"当前原粹树脂:{entry.DailyNote.CurrentResin}");
|
||||
notifyInfos.Add(new(
|
||||
"原粹树脂",
|
||||
"ms-appx:///Resource/Icon/UI_ItemIcon_210_256.png",
|
||||
$"{entry.DailyNote.CurrentResin}",
|
||||
$"当前原粹树脂:{entry.DailyNote.CurrentResin}"));
|
||||
entry.ResinNotifySuppressed = true;
|
||||
}
|
||||
}
|
||||
@@ -63,7 +69,11 @@ internal class DailyNoteNotifier
|
||||
{
|
||||
if (!entry.HomeCoinNotifySuppressed)
|
||||
{
|
||||
hints.Add($"当前洞天宝钱:{entry.DailyNote.CurrentHomeCoin}");
|
||||
notifyInfos.Add(new(
|
||||
"洞天宝钱",
|
||||
"ms-appx:///Resource/Icon/UI_ItemIcon_204.png",
|
||||
$"{entry.DailyNote.CurrentHomeCoin}",
|
||||
$"当前洞天宝钱:{entry.DailyNote.CurrentHomeCoin}"));
|
||||
entry.HomeCoinNotifySuppressed = true;
|
||||
}
|
||||
}
|
||||
@@ -76,7 +86,11 @@ internal class DailyNoteNotifier
|
||||
{
|
||||
if (!entry.DailyTaskNotifySuppressed)
|
||||
{
|
||||
hints.Add(entry.DailyNote.ExtraTaskRewardDescription);
|
||||
notifyInfos.Add(new(
|
||||
"每日委托",
|
||||
"ms-appx:///Resource/Icon/UI_MarkQuest_Events_Proce.png",
|
||||
$"奖励待领取",
|
||||
entry.DailyNote.ExtraTaskRewardDescription));
|
||||
entry.DailyTaskNotifySuppressed = true;
|
||||
}
|
||||
}
|
||||
@@ -89,7 +103,11 @@ internal class DailyNoteNotifier
|
||||
{
|
||||
if (!entry.TransformerNotifySuppressed)
|
||||
{
|
||||
hints.Add("参量质变仪已准备完成");
|
||||
notifyInfos.Add(new(
|
||||
"参量质变仪",
|
||||
"ms-appx:///Resource/Icon/UI_ItemIcon_220021.png",
|
||||
$"准备完成",
|
||||
"参量质变仪已准备完成"));
|
||||
entry.TransformerNotifySuppressed = true;
|
||||
}
|
||||
}
|
||||
@@ -102,7 +120,11 @@ internal class DailyNoteNotifier
|
||||
{
|
||||
if (!entry.ExpeditionNotifySuppressed)
|
||||
{
|
||||
hints.Add("探索派遣已完成");
|
||||
notifyInfos.Add(new(
|
||||
"探索派遣",
|
||||
AvatarIconConverter.IconNameToUri("UI_AvatarIcon_Side_None.png").ToString(),
|
||||
$"已完成",
|
||||
"探索派遣已完成"));
|
||||
entry.ExpeditionNotifySuppressed = true;
|
||||
}
|
||||
}
|
||||
@@ -112,7 +134,7 @@ internal class DailyNoteNotifier
|
||||
}
|
||||
}
|
||||
|
||||
if (hints.Count <= 0)
|
||||
if (notifyInfos.Count <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -145,15 +167,41 @@ internal class DailyNoteNotifier
|
||||
builder.SetToastScenario(ToastScenario.Reminder);
|
||||
}
|
||||
|
||||
if (hints.Count > 2)
|
||||
// Desktop and Mobile started supporting adaptive toasts in API contract 3 (Anniversary Update)
|
||||
if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 3))
|
||||
{
|
||||
builder.AddText("多个提醒项达到设定值");
|
||||
AdaptiveGroup group = new();
|
||||
foreach (NotifyInfo info in notifyInfos)
|
||||
{
|
||||
AdaptiveSubgroup subgroup = new()
|
||||
{
|
||||
HintWeight = 1,
|
||||
Children =
|
||||
{
|
||||
new AdaptiveImage() { Source = info.AdaptiveIcon, HintRemoveMargin = true, },
|
||||
new AdaptiveText() { Text = info.AdaptiveHint, HintAlign = AdaptiveTextAlign.Center, },
|
||||
new AdaptiveText() { Text = info.Title, HintAlign = AdaptiveTextAlign.Center, HintStyle = AdaptiveTextStyle.CaptionSubtle, },
|
||||
},
|
||||
};
|
||||
|
||||
group.Children.Add(subgroup);
|
||||
}
|
||||
|
||||
builder.AddVisualChild(group);
|
||||
builder.AddText("一个或多个提醒项达到设定值");
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (string hint in hints)
|
||||
if (notifyInfos.Count > 2)
|
||||
{
|
||||
builder.AddText(hint);
|
||||
builder.AddText("多个提醒项达到设定值");
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (NotifyInfo info in notifyInfos)
|
||||
{
|
||||
builder.AddText(info.Hint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,4 +209,20 @@ internal class DailyNoteNotifier
|
||||
builder.Show();
|
||||
}
|
||||
}
|
||||
|
||||
private struct NotifyInfo
|
||||
{
|
||||
public string Title;
|
||||
public string AdaptiveIcon;
|
||||
public string AdaptiveHint;
|
||||
public string Hint;
|
||||
|
||||
public NotifyInfo(string title, string adaptiveIcon, string adaptiveHint, string hint)
|
||||
{
|
||||
Title = title;
|
||||
AdaptiveIcon = adaptiveIcon;
|
||||
AdaptiveHint = adaptiveHint;
|
||||
Hint = hint;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,12 @@
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Core.Database;
|
||||
using Snap.Hutao.Extension;
|
||||
using Snap.Hutao.Message;
|
||||
using Snap.Hutao.Model.Binding.User;
|
||||
using Snap.Hutao.Model.Entity;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using Snap.Hutao.Service.User;
|
||||
using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Core.Database;
|
||||
using Snap.Hutao.Extension;
|
||||
using Snap.Hutao.Model.Binding.Gacha;
|
||||
using Snap.Hutao.Model.Entity;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Model.Metadata;
|
||||
using Snap.Hutao.Model.Metadata.Avatar;
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Core.Abstraction;
|
||||
using Snap.Hutao.Core.Database;
|
||||
using Snap.Hutao.Core.Diagnostics;
|
||||
@@ -12,6 +11,7 @@ using Snap.Hutao.Extension;
|
||||
using Snap.Hutao.Model.Binding.Gacha;
|
||||
using Snap.Hutao.Model.Binding.Gacha.Abstraction;
|
||||
using Snap.Hutao.Model.Entity;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using Snap.Hutao.Model.InterChange.GachaLog;
|
||||
using Snap.Hutao.Model.Metadata.Abstraction;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Core;
|
||||
using Snap.Hutao.Core.Database;
|
||||
using Snap.Hutao.Core.IO.Ini;
|
||||
using Snap.Hutao.Model.Binding.LaunchGame;
|
||||
using Snap.Hutao.Model.Entity;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using Snap.Hutao.Service.Game.Locator;
|
||||
using Snap.Hutao.Service.Game.Unlocker;
|
||||
using Snap.Hutao.View.Dialog;
|
||||
|
||||
@@ -160,11 +160,7 @@ internal class HutaoCache : IHutaoCache
|
||||
if (idAvatarExtendedMap == null)
|
||||
{
|
||||
Dictionary<AvatarId, Avatar> idAvatarMap = await metadataService.GetIdToAvatarMapAsync().ConfigureAwait(false);
|
||||
idAvatarExtendedMap = new(idAvatarMap)
|
||||
{
|
||||
[AvatarIds.PlayerBoy] = new() { Name = "旅行者", Icon = "UI_AvatarIcon_PlayerBoy", Quality = Model.Intrinsic.ItemQuality.QUALITY_ORANGE },
|
||||
[AvatarIds.PlayerGirl] = new() { Name = "旅行者", Icon = "UI_AvatarIcon_PlayerGirl", Quality = Model.Intrinsic.ItemQuality.QUALITY_ORANGE },
|
||||
};
|
||||
idAvatarExtendedMap = AvatarIds.ExtendAvatars(idAvatarMap);
|
||||
}
|
||||
|
||||
return idAvatarExtendedMap;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Core.Database;
|
||||
using Snap.Hutao.Model.Entity;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using Snap.Hutao.Web.Hutao;
|
||||
using Snap.Hutao.Web.Hutao.Model;
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Binding.User;
|
||||
using Snap.Hutao.Model.Entity;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace Snap.Hutao.Service.SpiralAbyss;
|
||||
|
||||
/// <summary>
|
||||
/// 深渊记录服务
|
||||
/// </summary>
|
||||
internal interface ISpiralAbyssRecordService
|
||||
{
|
||||
/// <summary>
|
||||
/// 异步获取深渊记录集合
|
||||
/// </summary>
|
||||
/// <returns>深渊记录集合</returns>
|
||||
Task<ObservableCollection<SpiralAbyssEntry>> GetSpiralAbyssCollectionAsync();
|
||||
|
||||
/// <summary>
|
||||
/// 异步刷新深渊记录
|
||||
/// </summary>
|
||||
/// <param name="userAndRole">当前角色</param>
|
||||
/// <returns>任务</returns>
|
||||
Task RefreshSpiralAbyssAsync(UserAndRole userAndRole);
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Snap.Hutao.Core.Database;
|
||||
using Snap.Hutao.Model.Binding.User;
|
||||
using Snap.Hutao.Model.Entity;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace Snap.Hutao.Service.SpiralAbyss;
|
||||
|
||||
/// <summary>
|
||||
/// 深渊记录服务
|
||||
/// </summary>
|
||||
[Injection(InjectAs.Scoped, typeof(ISpiralAbyssRecordService))]
|
||||
internal class SpiralAbyssRecordService : ISpiralAbyssRecordService
|
||||
{
|
||||
private readonly AppDbContext appDbContext;
|
||||
private readonly GameRecordClient gameRecordClient;
|
||||
|
||||
private ObservableCollection<SpiralAbyssEntry>? spiralAbysses;
|
||||
|
||||
/// <summary>
|
||||
/// 构造一个新的深渊记录服务
|
||||
/// </summary>
|
||||
/// <param name="appDbContext">数据库上下文</param>
|
||||
/// <param name="gameRecordClient">游戏记录客户端</param>
|
||||
public SpiralAbyssRecordService(AppDbContext appDbContext, GameRecordClient gameRecordClient)
|
||||
{
|
||||
this.appDbContext = appDbContext;
|
||||
this.gameRecordClient = gameRecordClient;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task<ObservableCollection<SpiralAbyssEntry>> GetSpiralAbyssCollectionAsync()
|
||||
{
|
||||
if (spiralAbysses == null)
|
||||
{
|
||||
List<SpiralAbyssEntry> entries = await appDbContext.SpiralAbysses
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(s => s.ScheduleId)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
|
||||
await ThreadHelper.SwitchToMainThreadAsync();
|
||||
spiralAbysses = new(entries);
|
||||
}
|
||||
|
||||
return spiralAbysses;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task RefreshSpiralAbyssAsync(UserAndRole userAndRole)
|
||||
{
|
||||
Web.Hoyolab.Takumi.GameRecord.SpiralAbyss.SpiralAbyss? last = await gameRecordClient
|
||||
.GetSpiralAbyssAsync(userAndRole, SpiralAbyssSchedule.Last)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
if (last != null)
|
||||
{
|
||||
SpiralAbyssEntry? lastEntry = spiralAbysses!.SingleOrDefault(s => s.ScheduleId == last.ScheduleId);
|
||||
if (lastEntry != null)
|
||||
{
|
||||
await ThreadHelper.SwitchToMainThreadAsync();
|
||||
lastEntry.UpdateSpiralAbyss(last);
|
||||
|
||||
await ThreadHelper.SwitchToBackgroundAsync();
|
||||
await appDbContext.SpiralAbysses.UpdateAndSaveAsync(lastEntry).ConfigureAwait(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
SpiralAbyssEntry entry = SpiralAbyssEntry.Create(userAndRole.Role.GameUid, last);
|
||||
|
||||
await appDbContext.SpiralAbysses.AddAndSaveAsync(entry).ConfigureAwait(false);
|
||||
|
||||
await ThreadHelper.SwitchToMainThreadAsync();
|
||||
spiralAbysses!.Insert(0, entry);
|
||||
}
|
||||
}
|
||||
|
||||
Web.Hoyolab.Takumi.GameRecord.SpiralAbyss.SpiralAbyss? current = await gameRecordClient
|
||||
.GetSpiralAbyssAsync(userAndRole, SpiralAbyssSchedule.Current)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
if (current != null)
|
||||
{
|
||||
SpiralAbyssEntry? currentEntry = spiralAbysses!.SingleOrDefault(s => s.ScheduleId == current.ScheduleId);
|
||||
if (currentEntry != null)
|
||||
{
|
||||
await ThreadHelper.SwitchToMainThreadAsync();
|
||||
currentEntry.UpdateSpiralAbyss(current);
|
||||
|
||||
await ThreadHelper.SwitchToBackgroundAsync();
|
||||
await appDbContext.SpiralAbysses.UpdateAndSaveAsync(currentEntry).ConfigureAwait(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
SpiralAbyssEntry entry = SpiralAbyssEntry.Create(userAndRole.Role.GameUid, current);
|
||||
|
||||
await appDbContext.SpiralAbysses.AddAndSaveAsync(entry).ConfigureAwait(false);
|
||||
|
||||
await ThreadHelper.SwitchToMainThreadAsync();
|
||||
spiralAbysses!.Insert(0, entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Core.Database;
|
||||
using Snap.Hutao.Extension;
|
||||
using Snap.Hutao.Message;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using Snap.Hutao.Web.Hoyolab;
|
||||
using Snap.Hutao.Web.Hoyolab.Takumi.Binding;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
|
||||
<PackageCertificateThumbprint>F8C2255969BEA4A681CED102771BF807856AEC02</PackageCertificateThumbprint>
|
||||
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
|
||||
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
|
||||
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
|
||||
<AppxSymbolPackageEnabled>True</AppxSymbolPackageEnabled>
|
||||
<GenerateTestArtifacts>True</GenerateTestArtifacts>
|
||||
<AppxBundle>Never</AppxBundle>
|
||||
@@ -53,6 +53,7 @@
|
||||
<None Remove="Resource\Icon\UI_Icon_Fetter.png" />
|
||||
<None Remove="Resource\Icon\UI_Icon_Locked.png" />
|
||||
<None Remove="Resource\Icon\UI_Icon_None.png" />
|
||||
<None Remove="Resource\Icon\UI_Icon_Tower_Star.png" />
|
||||
<None Remove="Resource\Icon\UI_ItemIcon_201.png" />
|
||||
<None Remove="Resource\Icon\UI_ItemIcon_204.png" />
|
||||
<None Remove="Resource\Icon\UI_ItemIcon_210.png" />
|
||||
@@ -60,6 +61,7 @@
|
||||
<None Remove="Resource\Icon\UI_ItemIcon_220021.png" />
|
||||
<None Remove="Resource\Icon\UI_MarkQuest_Events_Proce.png" />
|
||||
<None Remove="Resource\Icon\UI_MarkTower.png" />
|
||||
<None Remove="Resource\Icon\UI_MarkTower_Tower.png" />
|
||||
<None Remove="Resource\Segoe Fluent Icons.ttf" />
|
||||
<None Remove="stylecop.json" />
|
||||
<None Remove="View\Control\BottomTextControl.xaml" />
|
||||
@@ -95,6 +97,7 @@
|
||||
<None Remove="View\Page\LaunchGamePage.xaml" />
|
||||
<None Remove="View\Page\LoginMihoyoUserPage.xaml" />
|
||||
<None Remove="View\Page\SettingPage.xaml" />
|
||||
<None Remove="View\Page\SpiralAbyssRecordPage.xaml" />
|
||||
<None Remove="View\Page\WikiAvatarPage.xaml" />
|
||||
<None Remove="View\Page\WikiWeaponPage.xaml" />
|
||||
<None Remove="View\TitleView.xaml" />
|
||||
@@ -129,6 +132,7 @@
|
||||
<Content Include="Resource\Icon\UI_Icon_Fetter.png" />
|
||||
<Content Include="Resource\Icon\UI_Icon_Locked.png" />
|
||||
<Content Include="Resource\Icon\UI_Icon_None.png" />
|
||||
<Content Include="Resource\Icon\UI_Icon_Tower_Star.png" />
|
||||
<Content Include="Resource\Icon\UI_ItemIcon_201.png" />
|
||||
<Content Include="Resource\Icon\UI_ItemIcon_204.png" />
|
||||
<Content Include="Resource\Icon\UI_ItemIcon_210.png" />
|
||||
@@ -136,6 +140,7 @@
|
||||
<Content Include="Resource\Icon\UI_ItemIcon_220021.png" />
|
||||
<Content Include="Resource\Icon\UI_MarkQuest_Events_Proce.png" />
|
||||
<Content Include="Resource\Icon\UI_MarkTower.png" />
|
||||
<Content Include="Resource\Icon\UI_MarkTower_Tower.png" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -184,6 +189,11 @@
|
||||
<ItemGroup>
|
||||
<None Include="..\.editorconfig" Link=".editorconfig" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="View\Page\SpiralAbyssRecordPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="View\Dialog\CommunityGameRecordDialog.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -38,33 +38,40 @@
|
||||
Content="祈愿记录"
|
||||
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_BtnIcon_Gacha.png}"/>
|
||||
|
||||
<NavigationViewItem
|
||||
shvh:NavHelper.NavigateTo="shvp:DailyNotePage"
|
||||
Content="实时便笺"
|
||||
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_ItemIcon_210.png}"/>
|
||||
|
||||
<NavigationViewItem
|
||||
shvh:NavHelper.NavigateTo="shvp:AchievementPage"
|
||||
Content="成就管理"
|
||||
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_Icon_Achievement.png}"/>
|
||||
|
||||
<NavigationViewItem
|
||||
shvh:NavHelper.NavigateTo="shvp:DailyNotePage"
|
||||
Content="实时便笺"
|
||||
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_ItemIcon_210.png,
|
||||
ShowAsMonochrome=False}"/>
|
||||
|
||||
<NavigationViewItem
|
||||
shvh:NavHelper.NavigateTo="shvp:AvatarPropertyPage"
|
||||
Content="我的角色"
|
||||
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_Icon_BoostUp.png}"/>
|
||||
|
||||
<NavigationViewItem
|
||||
shvh:NavHelper.NavigateTo="shvp:SpiralAbyssRecordPage"
|
||||
Content="深渊记录"
|
||||
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_MarkTower_Tower.png,
|
||||
ShowAsMonochrome=False}"/>
|
||||
|
||||
<NavigationViewItem
|
||||
shvh:NavHelper.NavigateTo="shvp:CultivationPage"
|
||||
Content="养成计划"
|
||||
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_HomeWorldTabIcon_2_Team.png}"/>
|
||||
|
||||
<NavigationViewItemHeader Content="数据"/>
|
||||
|
||||
<NavigationViewItem
|
||||
shvh:NavHelper.NavigateTo="shvp:HutaoDatabasePage"
|
||||
Content="深渊统计"
|
||||
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_ChapterIcon_Hutao.png}"/>
|
||||
|
||||
<NavigationViewItemHeader Content="WIKI"/>
|
||||
|
||||
<NavigationViewItem
|
||||
shvh:NavHelper.NavigateTo="shvp:WikiAvatarPage"
|
||||
Content="角色资料"
|
||||
|
||||
@@ -69,15 +69,38 @@
|
||||
<AppBarButton Icon="{shcm:FontIcon Glyph=}" Label="详情">
|
||||
<AppBarButton.Flyout>
|
||||
<Flyout Placement="BottomEdgeAlignedRight">
|
||||
<sc:SettingsGroup
|
||||
MinWidth="240"
|
||||
Margin="0,-32,0,0"
|
||||
Header="数据来自「胡桃数据库」">
|
||||
<sc:Setting Content="{Binding Overview.RefreshTime}" Header="数据刷新时间"/>
|
||||
<sc:Setting Content="{Binding Overview.RecordTotal}" Header="上传记录总数"/>
|
||||
<sc:Setting Content="{Binding Overview.SpiralAbyssTotal}" Header="深渊记录总数"/>
|
||||
<sc:Setting Content="{Binding Overview.SpiralAbyssFullStar}" Header="深渊记录满星数"/>
|
||||
</sc:SettingsGroup>
|
||||
<StackPanel MinWidth="260">
|
||||
<sc:SettingsGroup Margin="0,-32,0,0" Header="数据收集统计">
|
||||
<sc:Setting Content="{Binding Overview.RefreshTime}" Header="数据刷新时间"/>
|
||||
<sc:Setting Content="{Binding Overview.RecordTotal}" Header="上传记录总数"/>
|
||||
</sc:SettingsGroup>
|
||||
<sc:SettingsGroup Margin="0,-16,0,0" Header="深渊数据统计">
|
||||
<sc:Setting Content="{Binding Overview.SpiralAbyssTotal}" Header="总计深渊记录"/>
|
||||
<sc:Setting Padding="16,8" Header="通关深渊记录">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Overview.SpiralAbyssPassedPercent}"/>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
Opacity="0.7"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Overview.SpiralAbyssPassed}"/>
|
||||
</StackPanel>
|
||||
</sc:Setting>
|
||||
<sc:Setting Padding="16,8" Header="满星深渊记录">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Overview.SpiralAbyssFullStarPercent}"/>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
Opacity="0.7"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Overview.SpiralAbyssFullStar}"/>
|
||||
</StackPanel>
|
||||
</sc:Setting>
|
||||
<sc:Setting Content="{Binding Overview.SpiralAbyssStarAverage}" Header="平均获取渊星"/>
|
||||
<sc:Setting Content="{Binding Overview.SpiralAbyssBattleAverage}" Header="平均战斗次数"/>
|
||||
</sc:SettingsGroup>
|
||||
</StackPanel>
|
||||
|
||||
</Flyout>
|
||||
</AppBarButton.Flyout>
|
||||
</AppBarButton>
|
||||
|
||||
@@ -178,15 +178,6 @@
|
||||
<Button Command="{Binding ShowSignInWebViewDialogCommand}" Content="打开签到对话框"/>
|
||||
</sc:Setting.ActionContent>
|
||||
</sc:Setting>
|
||||
|
||||
<sc:Setting
|
||||
Description="将当前账号的深渊数据上传到胡桃数据库"
|
||||
Header="上传深渊数据"
|
||||
Icon="">
|
||||
<sc:Setting.ActionContent>
|
||||
<Button Command="{Binding Experimental.UploadSpiralAbyssRecordCommand}" Content="上传"/>
|
||||
</sc:Setting.ActionContent>
|
||||
</sc:Setting>
|
||||
</sc:SettingsGroup>
|
||||
|
||||
<sc:SettingsGroup Foreground="{StaticResource SystemFillColorCriticalBrush}" Header="危险功能">
|
||||
|
||||
291
src/Snap.Hutao/Snap.Hutao/View/Page/SpiralAbyssRecordPage.xaml
Normal file
291
src/Snap.Hutao/Snap.Hutao/View/Page/SpiralAbyssRecordPage.xaml
Normal file
@@ -0,0 +1,291 @@
|
||||
<shc:ScopedPage
|
||||
x:Class="Snap.Hutao.View.Page.SpiralAbyssRecordPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:cwuc="using:CommunityToolkit.WinUI.UI.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:mxi="using:Microsoft.Xaml.Interactivity"
|
||||
xmlns:sc="using:SettingsUI.Controls"
|
||||
xmlns:shc="using:Snap.Hutao.Control"
|
||||
xmlns:shcb="using:Snap.Hutao.Control.Behavior"
|
||||
xmlns:shci="using:Snap.Hutao.Control.Image"
|
||||
xmlns:shcm="using:Snap.Hutao.Control.Markup"
|
||||
xmlns:shv="using:Snap.Hutao.ViewModel"
|
||||
xmlns:shvc="using:Snap.Hutao.View.Control"
|
||||
d:DataContext="{d:DesignInstance shv:SpiralAbyssRecordViewModel}"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<mxi:Interaction.Behaviors>
|
||||
<shcb:InvokeCommandOnLoadedBehavior Command="{Binding OpenUICommand}"/>
|
||||
</mxi:Interaction.Behaviors>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<CommandBar
|
||||
Grid.Row="0"
|
||||
Background="{StaticResource CardBackgroundFillColorDefaultBrush}"
|
||||
DefaultLabelPosition="Right">
|
||||
<AppBarButton
|
||||
Command="{Binding UploadSpiralAbyssRecordCommand}"
|
||||
Icon="{shcm:FontIcon Glyph=}"
|
||||
Label="上传数据"/>
|
||||
<AppBarButton
|
||||
Command="{Binding RefreshCommand}"
|
||||
Icon="{shcm:FontIcon Glyph=}"
|
||||
Label="刷新数据"/>
|
||||
</CommandBar>
|
||||
|
||||
<SplitView
|
||||
Grid.Row="1"
|
||||
DisplayMode="Inline"
|
||||
IsPaneOpen="True"
|
||||
OpenPaneLength="96"
|
||||
PaneBackground="Transparent">
|
||||
<SplitView.Pane>
|
||||
<ListView ItemsSource="{Binding SpiralAbyssEntries}" SelectedItem="{Binding SelectedEntry, Mode=TwoWay}">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Schedule}"/>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</SplitView.Pane>
|
||||
<SplitView.Content>
|
||||
<Grid DataContext="{Binding SpiralAbyssView}">
|
||||
<Pivot>
|
||||
<PivotItem Header="统计数据">
|
||||
<ScrollViewer>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition MaxWidth="600"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0" Margin="16,0,8,16">
|
||||
<sc:SettingsGroup Margin="0,-48,16,0">
|
||||
<sc:Setting Content="{Binding TotalBattleTimes}" Header="战斗次数"/>
|
||||
<sc:Setting Content="{Binding TotalStar}" Header="获得渊星"/>
|
||||
<sc:Setting Content="{Binding MaxFloor}" Header="最深抵达"/>
|
||||
</sc:SettingsGroup>
|
||||
<sc:SettingsGroup Margin="0,0,16,0" Header="出战次数">
|
||||
<ItemsControl HorizontalAlignment="Left" ItemsSource="{Binding Reveals}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<cwuc:UniformGrid ColumnSpacing="16" Columns="4"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shvc:BottomTextControl Text="{Binding Value}">
|
||||
<shvc:ItemIcon Icon="{Binding Icon}" Quality="{Binding Quality}"/>
|
||||
</shvc:BottomTextControl>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
</sc:SettingsGroup>
|
||||
<sc:SettingsGroup Margin="0,0,16,0" Header="战斗数据">
|
||||
<sc:Setting Header="最多击破">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="0,0,16,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Defeat.Value}"/>
|
||||
<shci:CachedImage
|
||||
Width="48"
|
||||
Height="48"
|
||||
Margin="-8,-24,-8,-8"
|
||||
Source="{Binding Defeat.SideIcon}"/>
|
||||
</StackPanel>
|
||||
</sc:Setting>
|
||||
|
||||
<sc:Setting Header="最强一击">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="0,0,16,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Damage.Value}"/>
|
||||
<shci:CachedImage
|
||||
Width="48"
|
||||
Height="48"
|
||||
Margin="-8,-24,-8,-8"
|
||||
Source="{Binding Damage.SideIcon}"/>
|
||||
</StackPanel>
|
||||
</sc:Setting>
|
||||
|
||||
<sc:Setting Header="最多承伤">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="0,0,16,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding TakeDamage.Value}"/>
|
||||
<shci:CachedImage
|
||||
Width="48"
|
||||
Height="48"
|
||||
Margin="-8,-24,-8,-8"
|
||||
Source="{Binding TakeDamage.SideIcon}"/>
|
||||
</StackPanel>
|
||||
</sc:Setting>
|
||||
<sc:Setting Header="元素战技">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="0,0,16,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding NormalSkill.Value}"/>
|
||||
<shci:CachedImage
|
||||
Width="48"
|
||||
Height="48"
|
||||
Margin="-8,-24,-8,-8"
|
||||
Source="{Binding NormalSkill.SideIcon}"/>
|
||||
</StackPanel>
|
||||
</sc:Setting>
|
||||
<sc:Setting Header="元素爆发">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="0,0,16,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding EnergySkill.Value}"/>
|
||||
<shci:CachedImage
|
||||
Width="48"
|
||||
Height="48"
|
||||
Margin="-8,-24,-8,-8"
|
||||
Source="{Binding EnergySkill.SideIcon}"/>
|
||||
</StackPanel>
|
||||
</sc:Setting>
|
||||
</sc:SettingsGroup>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
</ScrollViewer>
|
||||
</PivotItem>
|
||||
<PivotItem Header="详细数据">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Auto">
|
||||
<ItemsControl
|
||||
Margin="16,16,0,0"
|
||||
ItemsPanel="{StaticResource HorizontalStackPanelTemplate}"
|
||||
ItemsSource="{Binding Floors}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border Margin="0,0,16,16" Style="{StaticResource BorderCardStyle}">
|
||||
<Grid VerticalAlignment="Top">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0" Margin="8,8,8,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Style="{StaticResource BaseTextBlockStyle}" Text="{Binding Index}"/>
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<BitmapIcon
|
||||
Width="20"
|
||||
ShowAsMonochrome="True"
|
||||
UriSource="ms-appx:///Resource/Icon/UI_Icon_Tower_Star.png"/>
|
||||
<TextBlock
|
||||
Width="16"
|
||||
Margin="8,0,0,0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{Binding Star}"
|
||||
TextAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<ItemsControl
|
||||
Grid.Row="1"
|
||||
Margin="0,0,0,8"
|
||||
ItemsSource="{Binding Levels}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="0,8,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<MenuFlyoutSeparator/>
|
||||
<Grid Grid.Row="1" Margin="8,8,8,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding Index}"/>
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<BitmapIcon
|
||||
Width="20"
|
||||
ShowAsMonochrome="True"
|
||||
UriSource="ms-appx:///Resource/Icon/UI_Icon_Tower_Star.png"/>
|
||||
<TextBlock
|
||||
Width="16"
|
||||
Margin="8,0,0,0"
|
||||
Text="{Binding Star}"
|
||||
TextAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<ItemsControl
|
||||
Grid.Row="2"
|
||||
Margin="8,0,0,0"
|
||||
ItemsSource="{Binding Battles}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<ItemsControl
|
||||
Margin="0,8,0,0"
|
||||
ItemsPanel="{StaticResource HorizontalStackPanelTemplate}"
|
||||
ItemsSource="{Binding Avatars}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shvc:BottomTextControl Margin="0,0,8,0" Text="{Binding Name}">
|
||||
<shvc:BottomTextControl.Resources>
|
||||
<Style BasedOn="{StaticResource CaptionTextBlockStyle}" TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="NoWrap"/>
|
||||
<Setter Property="TextTrimming" Value="CharacterEllipsis"/>
|
||||
</Style>
|
||||
</shvc:BottomTextControl.Resources>
|
||||
<shvc:ItemIcon
|
||||
Width="60"
|
||||
Height="60"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"/>
|
||||
</shvc:BottomTextControl>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<TextBlock
|
||||
Margin="0,2,0,0"
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Time}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</PivotItem>
|
||||
</Pivot>
|
||||
</Grid>
|
||||
</SplitView.Content>
|
||||
</SplitView>
|
||||
</Grid>
|
||||
</shc:ScopedPage>
|
||||
@@ -0,0 +1,22 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Control;
|
||||
using Snap.Hutao.ViewModel;
|
||||
|
||||
namespace Snap.Hutao.View.Page;
|
||||
|
||||
/// <summary>
|
||||
/// 深渊记录页面
|
||||
/// </summary>
|
||||
public sealed partial class SpiralAbyssRecordPage : ScopedPage
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造一个新的深渊记录页面
|
||||
/// </summary>
|
||||
public SpiralAbyssRecordPage()
|
||||
{
|
||||
InitializeWith<SpiralAbyssRecordViewModel>();
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Control;
|
||||
using Snap.Hutao.Core;
|
||||
using Snap.Hutao.Core.Database;
|
||||
@@ -11,6 +10,7 @@ using Snap.Hutao.Factory.Abstraction;
|
||||
using Snap.Hutao.Model;
|
||||
using Snap.Hutao.Model.Binding.User;
|
||||
using Snap.Hutao.Model.Entity;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using Snap.Hutao.Service.Abstraction;
|
||||
using Snap.Hutao.Service.DailyNote;
|
||||
using Snap.Hutao.Service.User;
|
||||
|
||||
@@ -5,9 +5,9 @@ using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Context.FileSystem.Location;
|
||||
using Snap.Hutao.Factory.Abstraction;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using Snap.Hutao.Service.Abstraction;
|
||||
using Snap.Hutao.Service.User;
|
||||
using Snap.Hutao.Web.Hutao;
|
||||
@@ -38,7 +38,6 @@ internal class ExperimentalFeaturesViewModel : ObservableObject
|
||||
|
||||
OpenCacheFolderCommand = asyncRelayCommandFactory.Create(OpenCacheFolderAsync);
|
||||
OpenDataFolderCommand = asyncRelayCommandFactory.Create(OpenDataFolderAsync);
|
||||
UploadSpiralAbyssRecordCommand = asyncRelayCommandFactory.Create(UploadSpiralAbyssRecordAsync);
|
||||
DeleteUsersCommand = asyncRelayCommandFactory.Create(DangerousDeleteUsersAsync);
|
||||
DeleteAllScheduleTasksCommand = new RelayCommand(DangerousDeleteAllScheduleTasks);
|
||||
}
|
||||
@@ -53,10 +52,7 @@ internal class ExperimentalFeaturesViewModel : ObservableObject
|
||||
/// </summary>
|
||||
public ICommand OpenDataFolderCommand { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 上传深渊记录命令
|
||||
/// </summary>
|
||||
public ICommand UploadSpiralAbyssRecordCommand { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 清空用户命令
|
||||
@@ -78,28 +74,7 @@ internal class ExperimentalFeaturesViewModel : ObservableObject
|
||||
return Launcher.LaunchFolderPathAsync(hutaoLocation.GetPath()).AsTask();
|
||||
}
|
||||
|
||||
private async Task UploadSpiralAbyssRecordAsync()
|
||||
{
|
||||
HomaClient homaClient = Ioc.Default.GetRequiredService<HomaClient>();
|
||||
IUserService userService = Ioc.Default.GetRequiredService<IUserService>();
|
||||
IInfoBarService infoBarService = Ioc.Default.GetRequiredService<IInfoBarService>();
|
||||
|
||||
if (userService.Current is Model.Binding.User.User user)
|
||||
{
|
||||
if (user.SelectedUserGameRole == null)
|
||||
{
|
||||
infoBarService.Warning("尚未选择角色");
|
||||
}
|
||||
|
||||
SimpleRecord record = await homaClient.GetPlayerRecordAsync(user).ConfigureAwait(false);
|
||||
Web.Response.Response<string>? response = await homaClient.UploadRecordAsync(record).ConfigureAwait(false);
|
||||
|
||||
if (response != null && response.IsOk())
|
||||
{
|
||||
infoBarService.Success(response.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task DangerousDeleteUsersAsync()
|
||||
{
|
||||
|
||||
@@ -5,13 +5,13 @@ using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Control;
|
||||
using Snap.Hutao.Core.Database;
|
||||
using Snap.Hutao.Core.LifeCycle;
|
||||
using Snap.Hutao.Factory.Abstraction;
|
||||
using Snap.Hutao.Model.Binding.LaunchGame;
|
||||
using Snap.Hutao.Model.Entity;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using Snap.Hutao.Service.Abstraction;
|
||||
using Snap.Hutao.Service.Game;
|
||||
using Snap.Hutao.Service.Navigation;
|
||||
|
||||
@@ -5,12 +5,12 @@ using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Core.Database;
|
||||
using Snap.Hutao.Core.Windowing;
|
||||
using Snap.Hutao.Factory.Abstraction;
|
||||
using Snap.Hutao.Model;
|
||||
using Snap.Hutao.Model.Entity;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using Snap.Hutao.Service.GachaLog;
|
||||
using Snap.Hutao.Service.Game;
|
||||
using Snap.Hutao.Service.Game.Locator;
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using CommunityToolkit.WinUI.UI;
|
||||
using Microsoft.Extensions.Primitives;
|
||||
using Snap.Hutao.Control;
|
||||
using Snap.Hutao.Extension;
|
||||
using Snap.Hutao.Factory.Abstraction;
|
||||
using Snap.Hutao.Model.Binding.Cultivation;
|
||||
using Snap.Hutao.Model.Binding.Hutao;
|
||||
using Snap.Hutao.Model.Binding.SpiralAbyss;
|
||||
using Snap.Hutao.Model.Binding.User;
|
||||
using Snap.Hutao.Model.Entity;
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Model.Metadata;
|
||||
using Snap.Hutao.Model.Metadata.Weapon;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
using Snap.Hutao.Service.Abstraction;
|
||||
using Snap.Hutao.Service.Cultivation;
|
||||
using Snap.Hutao.Service.Hutao;
|
||||
using Snap.Hutao.Service.Metadata;
|
||||
using Snap.Hutao.Service.SpiralAbyss;
|
||||
using Snap.Hutao.Service.User;
|
||||
using Snap.Hutao.View.Dialog;
|
||||
using Snap.Hutao.Web.Hutao;
|
||||
using Snap.Hutao.Web.Hutao.Model.Post;
|
||||
using System.Collections.Immutable;
|
||||
using System.Collections.ObjectModel;
|
||||
using CalcAvatarPromotionDelta = Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate.AvatarPromotionDelta;
|
||||
using CalcClient = Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate.CalculateClient;
|
||||
using CalcConsumption = Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate.Consumption;
|
||||
|
||||
namespace Snap.Hutao.ViewModel;
|
||||
|
||||
/// <summary>
|
||||
/// 深渊记录视图模型
|
||||
/// </summary>
|
||||
[Injection(InjectAs.Scoped)]
|
||||
internal class SpiralAbyssRecordViewModel : ObservableObject, ISupportCancellation
|
||||
{
|
||||
private readonly ISpiralAbyssRecordService spiralAbyssRecordService;
|
||||
private readonly IMetadataService metadataService;
|
||||
private readonly IUserService userService;
|
||||
private Dictionary<AvatarId, Model.Metadata.Avatar.Avatar>? idAvatarMap;
|
||||
|
||||
private ObservableCollection<SpiralAbyssEntry>? spiralAbyssEntries;
|
||||
private SpiralAbyssEntry? selectedEntry;
|
||||
private SpiralAbyssView? spiralAbyssView;
|
||||
|
||||
/// <summary>
|
||||
/// 构造一个新的深渊记录视图模型
|
||||
/// </summary>
|
||||
/// <param name="spiralAbyssRecordService">深渊记录服务</param>
|
||||
/// <param name="metadataService">元数据服务</param>
|
||||
/// <param name="userService">用户服务</param>
|
||||
/// <param name="asyncRelayCommandFactory">异步命令工厂</param>
|
||||
public SpiralAbyssRecordViewModel(
|
||||
ISpiralAbyssRecordService spiralAbyssRecordService,
|
||||
IMetadataService metadataService,
|
||||
IUserService userService,
|
||||
IAsyncRelayCommandFactory asyncRelayCommandFactory)
|
||||
{
|
||||
this.spiralAbyssRecordService = spiralAbyssRecordService;
|
||||
this.metadataService = metadataService;
|
||||
this.userService = userService;
|
||||
|
||||
OpenUICommand = asyncRelayCommandFactory.Create(OpenUIAsync);
|
||||
RefreshCommand = asyncRelayCommandFactory.Create(RefreshAsync);
|
||||
UploadSpiralAbyssRecordCommand = asyncRelayCommandFactory.Create(UploadSpiralAbyssRecordAsync);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public CancellationToken CancellationToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 深渊记录
|
||||
/// </summary>
|
||||
public ObservableCollection<SpiralAbyssEntry>? SpiralAbyssEntries { get => spiralAbyssEntries; set => SetProperty(ref spiralAbyssEntries, value); }
|
||||
|
||||
/// <summary>
|
||||
/// 选中的深渊信息
|
||||
/// </summary>
|
||||
public SpiralAbyssEntry? SelectedEntry
|
||||
{
|
||||
get => selectedEntry; set
|
||||
{
|
||||
if (SetProperty(ref selectedEntry, value))
|
||||
{
|
||||
if (value != null && idAvatarMap != null)
|
||||
{
|
||||
SpiralAbyssView = new(value.SpiralAbyss, idAvatarMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 深渊的只读视图
|
||||
/// </summary>
|
||||
public SpiralAbyssView? SpiralAbyssView { get => spiralAbyssView; set => SetProperty(ref spiralAbyssView, value); }
|
||||
|
||||
/// <summary>
|
||||
/// 打开界面命令
|
||||
/// </summary>
|
||||
public ICommand OpenUICommand { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 刷新界面命令
|
||||
/// </summary>
|
||||
public ICommand RefreshCommand { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 上传深渊记录命令
|
||||
/// </summary>
|
||||
public ICommand UploadSpiralAbyssRecordCommand { get; }
|
||||
|
||||
private async Task OpenUIAsync()
|
||||
{
|
||||
if (await metadataService.InitializeAsync().ConfigureAwait(false))
|
||||
{
|
||||
idAvatarMap = await metadataService.GetIdToAvatarMapAsync().ConfigureAwait(false);
|
||||
idAvatarMap = AvatarIds.ExtendAvatars(idAvatarMap);
|
||||
ObservableCollection<SpiralAbyssEntry> temp = await spiralAbyssRecordService.GetSpiralAbyssCollectionAsync().ConfigureAwait(false);
|
||||
|
||||
await ThreadHelper.SwitchToMainThreadAsync();
|
||||
SpiralAbyssEntries = temp;
|
||||
SelectedEntry = SpiralAbyssEntries.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task RefreshAsync()
|
||||
{
|
||||
if (await metadataService.InitializeAsync().ConfigureAwait(false))
|
||||
{
|
||||
if (userService.Current?.SelectedUserGameRole != null)
|
||||
{
|
||||
await spiralAbyssRecordService
|
||||
.RefreshSpiralAbyssAsync(UserAndRole.FromUser(userService.Current))
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task UploadSpiralAbyssRecordAsync()
|
||||
{
|
||||
HomaClient homaClient = Ioc.Default.GetRequiredService<HomaClient>();
|
||||
IInfoBarService infoBarService = Ioc.Default.GetRequiredService<IInfoBarService>();
|
||||
|
||||
if (userService.Current is Model.Binding.User.User user)
|
||||
{
|
||||
if (user.SelectedUserGameRole == null)
|
||||
{
|
||||
infoBarService.Warning("尚未选择角色");
|
||||
}
|
||||
|
||||
SimpleRecord record = await homaClient.GetPlayerRecordAsync(user).ConfigureAwait(false);
|
||||
Web.Response.Response<string>? response = await homaClient.UploadRecordAsync(record).ConfigureAwait(false);
|
||||
|
||||
if (response != null)
|
||||
{
|
||||
if (response.IsOk())
|
||||
{
|
||||
infoBarService.Success(response.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
infoBarService.Information(response.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -231,4 +231,4 @@ internal class WikiWeaponViewModel : ObservableObject, ISupportCancellation
|
||||
return keep;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Web.WebView2.Core;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Core.Convert;
|
||||
using Snap.Hutao.Core.Database;
|
||||
using Snap.Hutao.Extension;
|
||||
using Snap.Hutao.Model.Binding.User;
|
||||
using Snap.Hutao.Model.Entity.Database;
|
||||
using Snap.Hutao.Service.User;
|
||||
using Snap.Hutao.Web.Bridge.Model;
|
||||
using Snap.Hutao.Web.Hoyolab;
|
||||
|
||||
@@ -109,6 +109,18 @@ internal class GameRecordClient
|
||||
return resp?.Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取玩家深渊信息
|
||||
/// </summary>
|
||||
/// <param name="userAndRole">用户</param>
|
||||
/// <param name="schedule">1:当期,2:上期</param>
|
||||
/// <param name="token">取消令牌</param>
|
||||
/// <returns>深渊信息</returns>
|
||||
public Task<SpiralAbyss.SpiralAbyss?> GetSpiralAbyssAsync(UserAndRole userAndRole, SpiralAbyssSchedule schedule, CancellationToken token = default)
|
||||
{
|
||||
return GetSpiralAbyssAsync(userAndRole.User, userAndRole.Role, schedule, token);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取玩家深渊信息
|
||||
/// </summary>
|
||||
|
||||
@@ -18,19 +18,12 @@ public class Battle
|
||||
/// 时间戳
|
||||
/// </summary>
|
||||
[JsonPropertyName("timestamp")]
|
||||
public string Timestamp { get; set; } = default!;
|
||||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)]
|
||||
public long Timestamp { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 参战角色
|
||||
/// </summary>
|
||||
[JsonPropertyName("avatars")]
|
||||
public List<Avatar> Avatars { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 时间
|
||||
/// </summary>
|
||||
public DateTime Time
|
||||
{
|
||||
get => DateTimeOffset.FromUnixTimeSeconds(int.Parse(Timestamp)).LocalDateTime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,8 @@ public class Floor
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("settle_time")]
|
||||
public string SettleTime { get; set; } = default!;
|
||||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)]
|
||||
public long SettleTime { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 星数
|
||||
|
||||
@@ -18,14 +18,14 @@ public class SpiralAbyss
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("start_time")]
|
||||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)]
|
||||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)]
|
||||
public long StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
[JsonPropertyName("end_time")]
|
||||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)]
|
||||
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString)]
|
||||
public long EndTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -28,21 +28,45 @@ public class Overview
|
||||
/// </summary>
|
||||
public int SpiralAbyssPassed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 通关玩家比例
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public string SpiralAbyssPassedPercent { get => $"{(double)SpiralAbyssPassed / SpiralAbyssTotal:P2}"; }
|
||||
|
||||
/// <summary>
|
||||
/// 总星数
|
||||
/// </summary>
|
||||
public int SpiralAbyssStarTotal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 平均星数
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public string SpiralAbyssStarAverage { get => $"{(double)SpiralAbyssStarTotal / SpiralAbyssTotal:F2}"; }
|
||||
|
||||
/// <summary>
|
||||
/// 满星数
|
||||
/// </summary>
|
||||
public int SpiralAbyssFullStar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 满星比例
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public string SpiralAbyssFullStarPercent { get => $"{(double)SpiralAbyssFullStar / SpiralAbyssTotal:P2}"; }
|
||||
|
||||
/// <summary>
|
||||
/// 总战斗次数
|
||||
/// </summary>
|
||||
public long SpiralAbyssBattleTotal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 平均战斗次数
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public string SpiralAbyssBattleAverage { get => $"{(double)SpiralAbyssBattleTotal / SpiralAbyssTotal:F2}"; }
|
||||
|
||||
/// <summary>
|
||||
/// 统计时间
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user