mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
xaml styles
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
|
||||
* [biuuu/genshin-wish-export](https://github.com/biuuu/genshin-wish-export)
|
||||
* [HolographicHat/YaeAchievement](https://github.com/HolographicHat/YaeAchievement)
|
||||
* [HolographicHat/MiHoYoWebBridge](https://github.com/HolographicHat/MiHoYoWebBridge)
|
||||
* [xunkong/xunkong](https://github.com/xunkong/xunkong)
|
||||
* [YuehaiTeam/cocogoat](https://github.com/YuehaiTeam/cocogoat)
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ internal static partial class IocHttpClientConfiguration
|
||||
|
||||
foreach (INamedTypeSymbol classSymbol in receiver.Classes)
|
||||
{
|
||||
lineBuilder.Clear().Append(Environment.NewLine);
|
||||
lineBuilder.Clear().Append("\r\n");
|
||||
lineBuilder.Append(@" services.AddHttpClient<");
|
||||
lineBuilder.Append($"{classSymbol.ToDisplayString()}>(");
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// This file is used by Code Analysis to maintain SuppressMessage
|
||||
// attributes that are applied to this project.
|
||||
// Project-level suppressions either have no target or are given
|
||||
// a specific target and scoped to a namespace, type, member, etc.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
[assembly: SuppressMessage("MicrosoftCodeAnalysisReleaseTracking", "RS2008:启用分析器发布跟踪", Justification = "<挂起>", Scope = "member", Target = "~F:Snap.Hutao.SourceGeneration.TodoAnalyzer.Descriptor")]
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
@@ -6,6 +6,7 @@
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>x64</Platforms>
|
||||
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -17,15 +18,11 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" />
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4-beta1.22518.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
52
src/Snap.Hutao/Snap.Hutao.SourceGeneration/TodoAnalyzer.cs
Normal file
52
src/Snap.Hutao/Snap.Hutao.SourceGeneration/TodoAnalyzer.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
using System.Collections.Immutable;
|
||||
|
||||
namespace Snap.Hutao.SourceGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// 高亮TODO
|
||||
/// </summary>
|
||||
[DiagnosticAnalyzer(LanguageNames.CSharp)]
|
||||
internal class TodoAnalyzer : DiagnosticAnalyzer
|
||||
{
|
||||
private static readonly DiagnosticDescriptor Descriptor =
|
||||
new("SH0001", "TODO 项尚未实现", "此 TODO 项需要实现", "Standard", DiagnosticSeverity.Info, true);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get => ImmutableArray.Create(Descriptor); }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Initialize(AnalysisContext context)
|
||||
{
|
||||
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None);
|
||||
context.EnableConcurrentExecution();
|
||||
|
||||
context.RegisterSyntaxTreeAction(HandleSyntaxTree);
|
||||
}
|
||||
|
||||
private static void HandleSyntaxTree(SyntaxTreeAnalysisContext context)
|
||||
{
|
||||
SyntaxNode root = context.Tree.GetCompilationUnitRoot(context.CancellationToken);
|
||||
foreach (SyntaxTrivia node in root.DescendantTrivia(descendIntoTrivia: true))
|
||||
{
|
||||
switch (node.Kind())
|
||||
{
|
||||
case SyntaxKind.SingleLineCommentTrivia:
|
||||
case SyntaxKind.MultiLineCommentTrivia:
|
||||
string text = node.ToString().ToLowerInvariant();
|
||||
if (text.Contains("todo:"))
|
||||
{
|
||||
string hint = node.ToString().Substring(text.IndexOf("todo:") + 6);
|
||||
DiagnosticDescriptor descriptor = new("SH0001", "TODO 项尚未实现", hint, "Standard", DiagnosticSeverity.Info, true);
|
||||
context.ReportDiagnostic(Diagnostic.Create(descriptor, node.GetLocation()));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,15 @@
|
||||
<ResourceDictionary Source="ms-appx:///SettingsUI/Themes/SettingsUI.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<Color x:Key="CompatBackgroundColor">#FFF4F4F4</Color>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<Color x:Key="CompatBackgroundColor">#FF272727</Color>
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
|
||||
<!--Modify Window title bar color-->
|
||||
<StaticResource x:Key="WindowCaptionBackground" ResourceKey="ControlFillColorTransparentBrush"/>
|
||||
<StaticResource x:Key="WindowCaptionBackgroundDisabled" ResourceKey="ControlFillColorTransparentBrush"/>
|
||||
|
||||
@@ -87,6 +87,21 @@ public sealed class AppDbContext : DbContext
|
||||
/// </summary>
|
||||
public DbSet<ObjectCacheEntry> ObjectCache { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 培养计划
|
||||
/// </summary>
|
||||
public DbSet<CultivateProject> CultivateProjects { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 培养入口点
|
||||
/// </summary>
|
||||
public DbSet<CultivateEntry> CultivateEntries { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 培养消耗物品
|
||||
/// </summary>
|
||||
public DbSet<CultivateItem> CultivateItems { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 构造一个临时的应用程序数据库上下文
|
||||
/// </summary>
|
||||
|
||||
95
src/Snap.Hutao/Snap.Hutao/Control/Image/Bgra8.cs
Normal file
95
src/Snap.Hutao/Snap.Hutao/Control/Image/Bgra8.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using Windows.UI;
|
||||
|
||||
namespace Snap.Hutao.Control.Image;
|
||||
|
||||
/// <summary>
|
||||
/// BGRA8 结构
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
public struct Bgra8
|
||||
{
|
||||
/// <summary>
|
||||
/// B
|
||||
/// </summary>
|
||||
[FieldOffset(0)]
|
||||
public byte B;
|
||||
|
||||
/// <summary>
|
||||
/// G
|
||||
/// </summary>
|
||||
[FieldOffset(1)]
|
||||
public byte G;
|
||||
|
||||
/// <summary>
|
||||
/// R
|
||||
/// </summary>
|
||||
[FieldOffset(2)]
|
||||
public byte R;
|
||||
|
||||
/// <summary>
|
||||
/// A
|
||||
/// </summary>
|
||||
[FieldOffset(3)]
|
||||
public byte A;
|
||||
|
||||
[FieldOffset(0)]
|
||||
private readonly uint data;
|
||||
|
||||
/// <summary>
|
||||
/// 构造一个新的 BGRA8 结构
|
||||
/// </summary>
|
||||
/// <param name="b">B</param>
|
||||
/// <param name="g">G</param>
|
||||
/// <param name="r">R</param>
|
||||
/// <param name="a">A</param>
|
||||
public Bgra8(byte b, byte g, byte r, byte a)
|
||||
{
|
||||
B = b;
|
||||
G = g;
|
||||
R = r;
|
||||
A = a;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从Color值转换
|
||||
/// </summary>
|
||||
/// <param name="color">颜色</param>
|
||||
/// <returns>新的 BGRA8 结构</returns>
|
||||
public static Bgra8 FromColor(Color color)
|
||||
{
|
||||
return new(color.B, color.G, color.R, color.A);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从RGB值转换
|
||||
/// </summary>
|
||||
/// <param name="r">R</param>
|
||||
/// <param name="g">G</param>
|
||||
/// <param name="b">B</param>
|
||||
/// <returns>新的 BGRA8 结构</returns>
|
||||
public static Bgra8 FromRgb(byte r, byte g, byte b)
|
||||
{
|
||||
return new(b, g, r, 0xFF);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加入噪声
|
||||
/// </summary>
|
||||
/// <param name="source">源</param>
|
||||
/// <returns>噪声</returns>
|
||||
public static Bgra8 Noise(Bgra8 source)
|
||||
{
|
||||
Bgra8 target = new(0, 0, 0, 0)
|
||||
{
|
||||
B = (byte)Math.Max(0, Math.Min(255, source.B + Random.Shared.Next(-20, 20))),
|
||||
G = (byte)Math.Max(0, Math.Min(255, source.G + Random.Shared.Next(-20, 20))),
|
||||
R = (byte)Math.Max(0, Math.Min(255, source.R + Random.Shared.Next(-20, 20))),
|
||||
A = source.A,
|
||||
};
|
||||
return target;
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,30 @@
|
||||
<UserControl
|
||||
x:Class="Snap.Hutao.Control.Panel.PanelSelector"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:shcm="using:Snap.Hutao.Control.Markup"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<SplitButton Padding="0,6" Click="SplitButtonClick" Loaded="SplitButtonLoaded">
|
||||
<SplitButton
|
||||
Padding="0,6"
|
||||
Click="SplitButtonClick"
|
||||
Loaded="SplitButtonLoaded">
|
||||
<SplitButton.Content>
|
||||
<FontIcon Name="IconPresenter" Glyph=""/>
|
||||
</SplitButton.Content>
|
||||
<SplitButton.Flyout>
|
||||
<MenuFlyout>
|
||||
<RadioMenuFlyoutItem
|
||||
Tag="List"
|
||||
Click="RadioMenuFlyoutItemClick"
|
||||
Icon="{shcm:FontIcon Glyph=}"
|
||||
Tag="List"
|
||||
Text="列表"/>
|
||||
<RadioMenuFlyoutItem
|
||||
Tag="Grid"
|
||||
Click="RadioMenuFlyoutItemClick"
|
||||
Icon="{shcm:FontIcon Glyph=}"
|
||||
Tag="Grid"
|
||||
Text="网格"/>
|
||||
</MenuFlyout>
|
||||
</SplitButton.Flyout>
|
||||
|
||||
@@ -34,7 +34,10 @@ public class DescriptionTextBlock : ContentControl
|
||||
public DescriptionTextBlock()
|
||||
{
|
||||
IsTabStop = false;
|
||||
Content = new TextBlock();
|
||||
Content = new TextBlock()
|
||||
{
|
||||
TextWrapping = TextWrapping.Wrap,
|
||||
};
|
||||
|
||||
ActualThemeChanged += OnActualThemeChanged;
|
||||
}
|
||||
|
||||
@@ -64,6 +64,20 @@ public static class DbSetExtension
|
||||
return dbSet.Context().SaveChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加列表并保存
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity">实体类型</typeparam>
|
||||
/// <param name="dbSet">数据库集</param>
|
||||
/// <param name="entities">实体</param>
|
||||
/// <returns>影响条数</returns>
|
||||
public static int AddRangeAndSave<TEntity>(this DbSet<TEntity> dbSet, IEnumerable<TEntity> entities)
|
||||
where TEntity : class
|
||||
{
|
||||
dbSet.AddRange(entities);
|
||||
return dbSet.Context().SaveChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 移除并保存
|
||||
/// </summary>
|
||||
@@ -78,6 +92,20 @@ public static class DbSetExtension
|
||||
return dbSet.Context().SaveChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 移除并保存
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity">实体类型</typeparam>
|
||||
/// <param name="dbSet">数据库集</param>
|
||||
/// <param name="entities">实体列表</param>
|
||||
/// <returns>影响条数</returns>
|
||||
public static int RemoveRangeAndSave<TEntity>(this DbSet<TEntity> dbSet, IEnumerable<TEntity> entities)
|
||||
where TEntity : class
|
||||
{
|
||||
dbSet.RemoveRange(entities);
|
||||
return dbSet.Context().SaveChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新并保存
|
||||
/// </summary>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace Snap.Hutao.Core.Convert;
|
||||
namespace Snap.Hutao.Core.ExpressionService;
|
||||
|
||||
/// <summary>
|
||||
/// Class to cast to type <see cref="TTo"/>
|
||||
@@ -0,0 +1,42 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace Snap.Hutao.Core.ExpressionService;
|
||||
|
||||
/// <summary>
|
||||
/// 枚举帮助类
|
||||
/// </summary>
|
||||
public static class EnumExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// 判断枚举是否有对应的Flag
|
||||
/// </summary>
|
||||
/// <typeparam name="T">枚举类型</typeparam>
|
||||
/// <param name="enum">待检查的枚举</param>
|
||||
/// <param name="value">值</param>
|
||||
/// <returns>是否有对应的Flag</returns>
|
||||
public static bool HasOption<T>(this T @enum, T value)
|
||||
where T : struct, Enum
|
||||
{
|
||||
return ExpressionCache<T>.Entry(@enum, value);
|
||||
}
|
||||
|
||||
private static class ExpressionCache<T>
|
||||
{
|
||||
public static readonly Func<T, T, bool> Entry = Get();
|
||||
|
||||
private static Func<T, T, bool> Get()
|
||||
{
|
||||
ParameterExpression paramSource = Expression.Parameter(typeof(T));
|
||||
ParameterExpression paramValue = Expression.Parameter(typeof(T));
|
||||
|
||||
BinaryExpression logicalAnd = Expression.AndAssign(paramSource, paramValue);
|
||||
BinaryExpression equal = Expression.Equal(logicalAnd, paramValue);
|
||||
|
||||
// 生成一个源类型入,目标类型出的 lamdba
|
||||
return Expression.Lambda<Func<T, T, bool>>(equal, paramSource, paramValue).Compile();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Windows.ApplicationModel.DataTransfer;
|
||||
using Windows.Storage.Streams;
|
||||
|
||||
namespace Snap.Hutao.Core.IO.DataTransfer;
|
||||
|
||||
@@ -31,9 +32,22 @@ internal static class Clipboard
|
||||
/// <param name="text">文本</param>
|
||||
public static void SetText(string text)
|
||||
{
|
||||
DataPackage content = new();
|
||||
DataPackage content = new() { RequestedOperation = DataPackageOperation.Copy };
|
||||
content.SetText(text);
|
||||
Windows.ApplicationModel.DataTransfer.Clipboard.SetContent(content);
|
||||
Windows.ApplicationModel.DataTransfer.Clipboard.Flush();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置位图
|
||||
/// </summary>
|
||||
/// <param name="stream">位图流</param>
|
||||
public static void SetBitmapStream(IRandomAccessStream stream)
|
||||
{
|
||||
RandomAccessStreamReference reference = RandomAccessStreamReference.CreateFromStream(stream);
|
||||
DataPackage content = new() { RequestedOperation = DataPackageOperation.Copy };
|
||||
content.SetBitmap(reference);
|
||||
Windows.ApplicationModel.DataTransfer.Clipboard.SetContent(content);
|
||||
Windows.ApplicationModel.DataTransfer.Clipboard.Flush();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Core.Convert;
|
||||
using Snap.Hutao.Core.ExpressionService;
|
||||
using Snap.Hutao.Core.Json.Annotation;
|
||||
|
||||
namespace Snap.Hutao.Core.Json.Converter;
|
||||
|
||||
@@ -92,7 +92,6 @@ internal static class Activation
|
||||
{
|
||||
if (args.TryGetProtocolActivatedUri(out Uri? uri))
|
||||
{
|
||||
Ioc.Default.GetRequiredService<IInfoBarService>().Information(uri.ToString());
|
||||
await HandleUrlActivationAsync(uri).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
415
src/Snap.Hutao/Snap.Hutao/Migrations/20221202052444_Cultivation.Designer.cs
generated
Normal file
415
src/Snap.Hutao/Snap.Hutao/Migrations/20221202052444_Cultivation.Designer.cs
generated
Normal file
@@ -0,0 +1,415 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Snap.Hutao.Context.Database;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Snap.Hutao.Migrations
|
||||
{
|
||||
[DbContext(typeof(AppDbContext))]
|
||||
[Migration("20221202052444_Cultivation")]
|
||||
partial class Cultivation
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "7.0.0");
|
||||
|
||||
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<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<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.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.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("Achievements")
|
||||
.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("Entries")
|
||||
.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("Items")
|
||||
.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.AchievementArchive", b =>
|
||||
{
|
||||
b.Navigation("Achievements");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.CultivateEntry", b =>
|
||||
{
|
||||
b.Navigation("Items");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.CultivateProject", b =>
|
||||
{
|
||||
b.Navigation("Entries");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.GachaArchive", b =>
|
||||
{
|
||||
b.Navigation("Items");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Snap.Hutao.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Cultivation : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "cultivate_projects",
|
||||
columns: table => new
|
||||
{
|
||||
InnerId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
IsSelected = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
Name = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_cultivate_projects", x => x.InnerId);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "cultivate_entries",
|
||||
columns: table => new
|
||||
{
|
||||
InnerId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
ProjectId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
Type = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_cultivate_entries", x => x.InnerId);
|
||||
table.ForeignKey(
|
||||
name: "FK_cultivate_entries_cultivate_projects_ProjectId",
|
||||
column: x => x.ProjectId,
|
||||
principalTable: "cultivate_projects",
|
||||
principalColumn: "InnerId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "cultivate_items",
|
||||
columns: table => new
|
||||
{
|
||||
InnerId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
EntryId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
ItemId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Count = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_cultivate_items", x => x.InnerId);
|
||||
table.ForeignKey(
|
||||
name: "FK_cultivate_items_cultivate_entries_EntryId",
|
||||
column: x => x.EntryId,
|
||||
principalTable: "cultivate_entries",
|
||||
principalColumn: "InnerId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_cultivate_entries_ProjectId",
|
||||
table: "cultivate_entries",
|
||||
column: "ProjectId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_cultivate_items_EntryId",
|
||||
table: "cultivate_items",
|
||||
column: "EntryId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "cultivate_items");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "cultivate_entries");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "cultivate_projects");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,6 +82,68 @@ namespace Snap.Hutao.Migrations
|
||||
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<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<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")
|
||||
@@ -273,7 +335,7 @@ namespace Snap.Hutao.Migrations
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.Achievement", b =>
|
||||
{
|
||||
b.HasOne("Snap.Hutao.Model.Entity.AchievementArchive", "Archive")
|
||||
.WithMany()
|
||||
.WithMany("Achievements")
|
||||
.HasForeignKey("ArchiveId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
@@ -281,6 +343,28 @@ namespace Snap.Hutao.Migrations
|
||||
b.Navigation("Archive");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.CultivateEntry", b =>
|
||||
{
|
||||
b.HasOne("Snap.Hutao.Model.Entity.CultivateProject", "Project")
|
||||
.WithMany("Entries")
|
||||
.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("Items")
|
||||
.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")
|
||||
@@ -295,13 +379,33 @@ namespace Snap.Hutao.Migrations
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.GachaItem", b =>
|
||||
{
|
||||
b.HasOne("Snap.Hutao.Model.Entity.GachaArchive", "Archive")
|
||||
.WithMany()
|
||||
.WithMany("Items")
|
||||
.HasForeignKey("ArchiveId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Archive");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.AchievementArchive", b =>
|
||||
{
|
||||
b.Navigation("Achievements");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.CultivateEntry", b =>
|
||||
{
|
||||
b.Navigation("Items");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.CultivateProject", b =>
|
||||
{
|
||||
b.Navigation("Entries");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Snap.Hutao.Model.Entity.GachaArchive", b =>
|
||||
{
|
||||
b.Navigation("Items");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,11 +25,21 @@ public class Avatar
|
||||
/// </summary>
|
||||
public Uri SideIcon { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 名片
|
||||
/// </summary>
|
||||
public Uri NameCard { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 星级
|
||||
/// </summary>
|
||||
public ItemQuality Quality { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 元素类型
|
||||
/// </summary>
|
||||
public ElementType Element { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 等级
|
||||
/// </summary>
|
||||
|
||||
@@ -18,6 +18,11 @@ public class Reliquary : EquipBase
|
||||
/// </summary>
|
||||
public List<ReliquarySubProperty> SecondarySubProperties { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 合成的副属性
|
||||
/// </summary>
|
||||
public List<ReliquarySubProperty> ComposedSubProperties { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 评分
|
||||
/// </summary>
|
||||
|
||||
@@ -20,13 +20,13 @@ public class ReliquarySubProperty
|
||||
Value = value;
|
||||
Score = score;
|
||||
|
||||
// only 0.2 | 0.4 | 0.6 | 0.8 | 1.0
|
||||
// only 0.25 | 0.50 | 0.75 | 1.00
|
||||
Opacity = score switch
|
||||
{
|
||||
< 25 => 0.25,
|
||||
< 50 => 0.5,
|
||||
< 75 => 0.75,
|
||||
_ => 1,
|
||||
<= 25 => 0.25,
|
||||
<= 50 => 0.50,
|
||||
<= 75 => 0.75,
|
||||
_ => 1.00,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Model.Binding.Cultivation;
|
||||
|
||||
/// <summary>
|
||||
/// 养成主体的类型
|
||||
/// </summary>
|
||||
public enum CultivateType
|
||||
{
|
||||
/// <summary>
|
||||
/// 无
|
||||
/// </summary>
|
||||
None,
|
||||
|
||||
/// <summary>
|
||||
/// 角色
|
||||
/// </summary>
|
||||
Avatar,
|
||||
|
||||
/// <summary>
|
||||
/// 角色技能
|
||||
/// </summary>
|
||||
Skill,
|
||||
|
||||
/// <summary>
|
||||
/// 武器
|
||||
/// </summary>
|
||||
Weapon,
|
||||
|
||||
/// <summary>
|
||||
/// 家具
|
||||
/// </summary>
|
||||
Furniture,
|
||||
}
|
||||
@@ -30,6 +30,11 @@ public class AchievementArchive : ISelectable
|
||||
/// </summary>
|
||||
public bool IsSelected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 成就
|
||||
/// </summary>
|
||||
public virtual ICollection<Achievement> Achievements { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 创建一个新的存档
|
||||
/// </summary>
|
||||
|
||||
48
src/Snap.Hutao/Snap.Hutao/Model/Entity/CultivateEntry.cs
Normal file
48
src/Snap.Hutao/Snap.Hutao/Model/Entity/CultivateEntry.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Binding.Cultivation;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Snap.Hutao.Model.Entity;
|
||||
|
||||
/// <summary>
|
||||
/// 养成入口
|
||||
/// </summary>
|
||||
[Table("cultivate_entries")]
|
||||
public class CultivateEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// 内部Id
|
||||
/// </summary>
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public Guid InnerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目Id
|
||||
/// </summary>
|
||||
public Guid ProjectId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目
|
||||
/// </summary>
|
||||
[ForeignKey(nameof(ProjectId))]
|
||||
public CultivateProject Project { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 养成类型
|
||||
/// </summary>
|
||||
public CultivateType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 角色/武器/家具 Id
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物品
|
||||
/// </summary>
|
||||
public virtual ICollection<CultivateItem> Items { get; set; } = default!;
|
||||
}
|
||||
42
src/Snap.Hutao/Snap.Hutao/Model/Entity/CultivateItem.cs
Normal file
42
src/Snap.Hutao/Snap.Hutao/Model/Entity/CultivateItem.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Snap.Hutao.Model.Entity;
|
||||
|
||||
/// <summary>
|
||||
/// 消耗物品
|
||||
/// </summary>
|
||||
[Table("cultivate_items")]
|
||||
public class CultivateItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 内部Id
|
||||
/// </summary>
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public Guid InnerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 外键
|
||||
/// </summary>
|
||||
public Guid EntryId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 入口名称
|
||||
/// </summary>
|
||||
[ForeignKey(nameof(EntryId))]
|
||||
public CultivateEntry Entry { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 物品 Id
|
||||
/// </summary>
|
||||
public int ItemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物品个数
|
||||
/// </summary>
|
||||
public int Count { get; set; }
|
||||
}
|
||||
37
src/Snap.Hutao/Snap.Hutao/Model/Entity/CultivateProject.cs
Normal file
37
src/Snap.Hutao/Snap.Hutao/Model/Entity/CultivateProject.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Core.Database;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Snap.Hutao.Model.Entity;
|
||||
|
||||
/// <summary>
|
||||
/// 培养计划
|
||||
/// </summary>
|
||||
[Table("cultivate_projects")]
|
||||
public class CultivateProject : ISelectable
|
||||
{
|
||||
/// <summary>
|
||||
/// 内部Id
|
||||
/// </summary>
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public Guid InnerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否选中
|
||||
/// </summary>
|
||||
public bool IsSelected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 入口集合
|
||||
/// </summary>
|
||||
public virtual ICollection<CultivateEntry> Entries { get; set; } = default!;
|
||||
}
|
||||
@@ -28,12 +28,12 @@ public class DailyNoteEntry : INotifyPropertyChanged
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// </summary>
|
||||
[ForeignKey(nameof(UserId))]
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户
|
||||
/// </summary>
|
||||
[ForeignKey(nameof(UserId))]
|
||||
public User User { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -28,6 +28,11 @@ public class GachaArchive : ISelectable
|
||||
/// <inheritdoc/>
|
||||
public bool IsSelected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 卡池物品
|
||||
/// </summary>
|
||||
public virtual ICollection<GachaItem> Items { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 构造一个新的卡池存档
|
||||
/// </summary>
|
||||
|
||||
@@ -60,7 +60,8 @@ public class User : ISelectable
|
||||
{
|
||||
_ = cookie.TryGetAsStoken(out Cookie? stoken);
|
||||
_ = cookie.TryGetAsLtoken(out Cookie? ltoken);
|
||||
_ = cookie.TryGetAsCookieToken(out Cookie? cookieToken);
|
||||
|
||||
return new() { Stoken = stoken, Ltoken = ltoken };
|
||||
return new() { Stoken = stoken, Ltoken = ltoken, CookieToken = cookieToken };
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@ namespace Snap.Hutao.Model.Intrinsic;
|
||||
|
||||
/// <summary>
|
||||
/// 成就信息状态
|
||||
/// https://github.com/Grasscutters/Grasscutter/blob/development/src/generated/main/java/emu/grasscutter/net/proto/AchievementInfoOuterClass.java#L163
|
||||
/// </summary>
|
||||
public enum AchievementInfoStatus
|
||||
{
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace Snap.Hutao.Model.Intrinsic;
|
||||
|
||||
/// <summary>
|
||||
/// 元素类型
|
||||
/// https://github.com/Grasscutters/Grasscutter/blob/development/src/main/java/emu/grasscutter/game/props/ElementType.java
|
||||
/// </summary>
|
||||
public enum ElementType
|
||||
{
|
||||
@@ -55,7 +54,7 @@ public enum ElementType
|
||||
Rock = 8,
|
||||
|
||||
/// <summary>
|
||||
/// 抗火元素
|
||||
/// 燃元素
|
||||
/// </summary>
|
||||
AntiFire = 9,
|
||||
|
||||
@@ -63,4 +62,4 @@ public enum ElementType
|
||||
/// 默认
|
||||
/// </summary>
|
||||
Default = 255,
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@ namespace Snap.Hutao.Model.Intrinsic;
|
||||
|
||||
/// <summary>
|
||||
/// 装备类型
|
||||
/// https://github.com/Grasscutters/Grasscutter/blob/development/src/main/java/emu/grasscutter/game/inventory/EquipType.java
|
||||
/// </summary>
|
||||
public enum EquipType
|
||||
{
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace Snap.Hutao.Model.Intrinsic;
|
||||
|
||||
/// <summary>
|
||||
/// 物品类型
|
||||
/// https://github.com/Grasscutters/Grasscutter/tree/development/src/main/java/emu/grasscutter/game/inventory/ItemType.java
|
||||
/// </summary>
|
||||
public enum ItemType
|
||||
{
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace Snap.Hutao.Model.Intrinsic;
|
||||
|
||||
/// <summary>
|
||||
/// 玩家属性
|
||||
/// https://github.com/Grasscutters/Grasscutter/tree/development/src/main/java/emu/grasscutter/game/props/PlayerProperty.java
|
||||
/// </summary>
|
||||
public enum PlayerProperty
|
||||
{
|
||||
@@ -217,7 +216,7 @@ public enum PlayerProperty
|
||||
PROP_PLAYER_LEGENDARY_DAILY_TASK_NUM = 10041,
|
||||
|
||||
/// <summary>
|
||||
/// Realm currency [0, +inf
|
||||
/// Realm currency [0, +inf)
|
||||
/// </summary>
|
||||
PROP_PLAYER_HOME_COIN = 10042,
|
||||
|
||||
|
||||
@@ -12,8 +12,12 @@ internal class AvatarNameCardPicConverter : ValueConverterBase<Avatar.Avatar?, U
|
||||
{
|
||||
private const string BaseUrl = "https://static.snapgenshin.com/NameCardPic/UI_NameCardPic_{0}_P.png";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override Uri Convert(Avatar.Avatar? avatar)
|
||||
/// <summary>
|
||||
/// 从角色转换到名片
|
||||
/// </summary>
|
||||
/// <param name="avatar">角色</param>
|
||||
/// <returns>名片</returns>
|
||||
public static Uri AvatarToUri(Avatar.Avatar? avatar)
|
||||
{
|
||||
if (avatar == null)
|
||||
{
|
||||
@@ -24,6 +28,12 @@ internal class AvatarNameCardPicConverter : ValueConverterBase<Avatar.Avatar?, U
|
||||
return new Uri(string.Format(BaseUrl, avatarName));
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override Uri Convert(Avatar.Avatar? avatar)
|
||||
{
|
||||
return AvatarToUri(avatar);
|
||||
}
|
||||
|
||||
private static string ReplaceSpecialCaseNaming(string avatarName)
|
||||
{
|
||||
return avatarName switch
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Control;
|
||||
using Snap.Hutao.Control.Image;
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
|
||||
namespace Snap.Hutao.Model.Metadata.Converter;
|
||||
|
||||
@@ -37,9 +39,49 @@ internal class ElementNameIconConverter : ValueConverterBase<string, Uri>
|
||||
: new Uri(string.Format(BaseUrl, element));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将中文元素名称转换为元素类型
|
||||
/// </summary>
|
||||
/// <param name="elementName">元素名称</param>
|
||||
/// <returns>元素类型</returns>
|
||||
public static ElementType ElementNameToElementType(string elementName)
|
||||
{
|
||||
return elementName switch
|
||||
{
|
||||
"雷" => ElementType.Electric,
|
||||
"火" => ElementType.Fire,
|
||||
"草" => ElementType.Grass,
|
||||
"冰" => ElementType.Ice,
|
||||
"岩" => ElementType.Rock,
|
||||
"水" => ElementType.Water,
|
||||
"风" => ElementType.Wind,
|
||||
_ => ElementType.None,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将元素类型转换为 Bgra8
|
||||
/// </summary>
|
||||
/// <param name="type">元素类型</param>
|
||||
/// <returns>Bgra8</returns>
|
||||
public static Bgra8 ElementTypeToBgra8(ElementType type)
|
||||
{
|
||||
return type switch
|
||||
{
|
||||
ElementType.Electric => Bgra8.FromRgb(0xDF, 0xBB, 0xFF),
|
||||
ElementType.Fire => Bgra8.FromRgb(0xFF, 0xA8, 0x70),
|
||||
ElementType.Grass => Bgra8.FromRgb(0xB1, 0xEB, 0x29),
|
||||
ElementType.Ice => Bgra8.FromRgb(0xCC, 0xFF, 0xFF),
|
||||
ElementType.Rock => Bgra8.FromRgb(0xF4, 0xD6, 0x60),
|
||||
ElementType.Water => Bgra8.FromRgb(0x08, 0xE4, 0xFF),
|
||||
ElementType.Wind => Bgra8.FromRgb(0xA7, 0xF7, 0xD0),
|
||||
_ => Bgra8.FromRgb(0x80, 0x80, 0x80),
|
||||
};
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override Uri Convert(string from)
|
||||
{
|
||||
return ElementNameToIconUri(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,12 +29,12 @@ internal class PropertyInfoDescriptor : ValueConverterBase<PropertyInfo, IList<L
|
||||
/// </summary>
|
||||
/// <param name="name">属性名称</param>
|
||||
/// <param name="method">方法</param>
|
||||
/// <param name="value1">值1</param>
|
||||
/// <param name="value2">值2</param>
|
||||
/// <param name="baseValue">值1</param>
|
||||
/// <param name="addValue">值2</param>
|
||||
/// <returns>对2</returns>
|
||||
public static Pair2<string, string, string?> FormatIntegerPair2(string name, FormatMethod method, double value1, double value2)
|
||||
public static Pair2<string, string, string?> FormatIntegerPair2(string name, FormatMethod method, double baseValue, double addValue)
|
||||
{
|
||||
return new(name, FormatValue(method, value1), $"[+{FormatValue(method, value2)}]");
|
||||
return new(name, FormatValue(method, baseValue + addValue), $"[{FormatValue(method, baseValue)}+{FormatValue(method, addValue)}]");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Core.Convert;
|
||||
using Snap.Hutao.Core.ExpressionService;
|
||||
|
||||
namespace Snap.Hutao.Model.Primitive.Converter;
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
BIN
src/Snap.Hutao/Snap.Hutao/Resource/Icon/UI_Icon_Fetter.png
Normal file
BIN
src/Snap.Hutao/Snap.Hutao/Resource/Icon/UI_Icon_Fetter.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
@@ -6,12 +6,22 @@ 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.Metadata;
|
||||
using Snap.Hutao.Service.AvatarInfo.Composer;
|
||||
using Snap.Hutao.Service.AvatarInfo.Factory;
|
||||
using Snap.Hutao.Service.Metadata;
|
||||
using Snap.Hutao.Web.Enka;
|
||||
using Snap.Hutao.Web.Enka.Model;
|
||||
using Snap.Hutao.Web.Hoyolab;
|
||||
using Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate;
|
||||
using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord;
|
||||
using CalculateAvatar = Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate.Avatar;
|
||||
using EnkaAvatarInfo = Snap.Hutao.Web.Enka.Model.AvatarInfo;
|
||||
using EnkaPlayerInfo = Snap.Hutao.Web.Enka.Model.PlayerInfo;
|
||||
using ModelAvatarInfo = Snap.Hutao.Model.Entity.AvatarInfo;
|
||||
using RecordCharacter = Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.Avatar.Character;
|
||||
using RecordPlayerInfo = Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.PlayerInfo;
|
||||
|
||||
namespace Snap.Hutao.Service.AvatarInfo;
|
||||
|
||||
@@ -25,7 +35,6 @@ internal class AvatarInfoService : IAvatarInfoService
|
||||
private readonly ISummaryFactory summaryFactory;
|
||||
private readonly IMetadataService metadataService;
|
||||
private readonly ILogger<AvatarInfoService> logger;
|
||||
private readonly EnkaClient enkaClient;
|
||||
|
||||
/// <summary>
|
||||
/// 构造一个新的角色信息服务
|
||||
@@ -34,73 +43,89 @@ internal class AvatarInfoService : IAvatarInfoService
|
||||
/// <param name="metadataService">元数据服务</param>
|
||||
/// <param name="summaryFactory">简述工厂</param>
|
||||
/// <param name="logger">日志器</param>
|
||||
/// <param name="enkaClient">Enka客户端</param>
|
||||
public AvatarInfoService(
|
||||
AppDbContext appDbContext,
|
||||
IMetadataService metadataService,
|
||||
ISummaryFactory summaryFactory,
|
||||
ILogger<AvatarInfoService> logger,
|
||||
EnkaClient enkaClient)
|
||||
ILogger<AvatarInfoService> logger)
|
||||
{
|
||||
this.appDbContext = appDbContext;
|
||||
this.metadataService = metadataService;
|
||||
this.summaryFactory = summaryFactory;
|
||||
this.logger = logger;
|
||||
this.enkaClient = enkaClient;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task<ValueResult<RefreshResult, Summary?>> GetSummaryAsync(PlayerUid uid, RefreshOption refreshOption, CancellationToken token = default)
|
||||
public async Task<ValueResult<RefreshResult, Summary?>> GetSummaryAsync(UserAndRole userAndRole, RefreshOption refreshOption, CancellationToken token = default)
|
||||
{
|
||||
if (await metadataService.InitializeAsync().ConfigureAwait(false))
|
||||
{
|
||||
token.ThrowIfCancellationRequested();
|
||||
|
||||
if (HasOption(refreshOption, RefreshOption.RequestFromAPI))
|
||||
switch (refreshOption)
|
||||
{
|
||||
EnkaResponse? resp = await GetEnkaResponseAsync(uid, token).ConfigureAwait(false);
|
||||
token.ThrowIfCancellationRequested();
|
||||
if (resp == null)
|
||||
{
|
||||
return new(RefreshResult.APIUnavailable, null);
|
||||
}
|
||||
case RefreshOption.RequestFromEnkaAPI:
|
||||
{
|
||||
EnkaResponse? resp = await GetEnkaResponseAsync(userAndRole.Role, token).ConfigureAwait(false);
|
||||
token.ThrowIfCancellationRequested();
|
||||
if (resp == null)
|
||||
{
|
||||
return new(RefreshResult.APIUnavailable, null);
|
||||
}
|
||||
|
||||
if (resp.IsValid)
|
||||
{
|
||||
IList<Web.Enka.Model.AvatarInfo> list = HasOption(refreshOption, RefreshOption.StoreInDatabase)
|
||||
? UpdateDbAvatarInfo(uid.Value, resp.AvatarInfoList)
|
||||
: resp.AvatarInfoList;
|
||||
if (resp.IsValid)
|
||||
{
|
||||
IList<EnkaAvatarInfo> list = UpdateDbAvatarInfos(userAndRole.Role.GameUid, resp.AvatarInfoList);
|
||||
Summary summary = await GetSummaryCoreAsync(resp.PlayerInfo, list, token).ConfigureAwait(false);
|
||||
token.ThrowIfCancellationRequested();
|
||||
return new(RefreshResult.Ok, summary);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new(RefreshResult.ShowcaseNotOpen, null);
|
||||
}
|
||||
}
|
||||
|
||||
Summary summary = await GetSummaryCoreAsync(resp.PlayerInfo, list, token).ConfigureAwait(false);
|
||||
token.ThrowIfCancellationRequested();
|
||||
return new(RefreshResult.Ok, summary);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new(RefreshResult.ShowcaseNotOpen, null);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerInfo info = PlayerInfo.CreateEmpty(uid.Value);
|
||||
case RefreshOption.RequestFromHoyolabGameRecord:
|
||||
{
|
||||
EnkaPlayerInfo info = EnkaPlayerInfo.CreateEmpty(userAndRole.Role.GameUid);
|
||||
IList<EnkaAvatarInfo> list = await UpdateDbAvatarInfosByGameRecordCharacterAsync(userAndRole).ConfigureAwait(false);
|
||||
Summary summary = await GetSummaryCoreAsync(info, list, token).ConfigureAwait(false);
|
||||
return new(RefreshResult.Ok, summary);
|
||||
}
|
||||
|
||||
Summary summary = await GetSummaryCoreAsync(info, GetDbAvatarInfos(uid.Value), token).ConfigureAwait(false);
|
||||
token.ThrowIfCancellationRequested();
|
||||
return new(RefreshResult.Ok, summary);
|
||||
case RefreshOption.RequestFromHoyolabCalculate:
|
||||
{
|
||||
EnkaPlayerInfo info = EnkaPlayerInfo.CreateEmpty(userAndRole.Role.GameUid);
|
||||
IList<EnkaAvatarInfo> list = await UpdateDbAvatarInfosByCalculateAvatarDetailAsync(userAndRole).ConfigureAwait(false);
|
||||
Summary summary = await GetSummaryCoreAsync(info, list, token).ConfigureAwait(false);
|
||||
return new(RefreshResult.Ok, summary);
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
EnkaPlayerInfo info = EnkaPlayerInfo.CreateEmpty(userAndRole.Role.GameUid);
|
||||
Summary summary = await GetSummaryCoreAsync(info, GetDbAvatarInfos(userAndRole.Role.GameUid), token).ConfigureAwait(false);
|
||||
token.ThrowIfCancellationRequested();
|
||||
return new(RefreshResult.Ok, summary);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return new(RefreshResult.MetadataUninitialized, null);
|
||||
return new(RefreshResult.MetadataNotInitialized, null);
|
||||
}
|
||||
}
|
||||
|
||||
private static bool HasOption(RefreshOption source, RefreshOption define)
|
||||
private static async Task<EnkaResponse?> GetEnkaResponseAsync(PlayerUid uid, CancellationToken token = default)
|
||||
{
|
||||
return (source & define) == define;
|
||||
EnkaClient enkaClient = Ioc.Default.GetRequiredService<EnkaClient>();
|
||||
|
||||
return await enkaClient.GetForwardDataAsync(uid, token).ConfigureAwait(false)
|
||||
?? await enkaClient.GetDataAsync(uid, token).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private async Task<Summary> GetSummaryCoreAsync(PlayerInfo info, IEnumerable<Web.Enka.Model.AvatarInfo> avatarInfos, CancellationToken token)
|
||||
private async Task<Summary> GetSummaryCoreAsync(EnkaPlayerInfo info, IEnumerable<EnkaAvatarInfo> avatarInfos, CancellationToken token)
|
||||
{
|
||||
ValueStopwatch stopwatch = ValueStopwatch.StartNew();
|
||||
Summary summary = await summaryFactory.CreateAsync(info, avatarInfos, token).ConfigureAwait(false);
|
||||
@@ -109,30 +134,24 @@ internal class AvatarInfoService : IAvatarInfoService
|
||||
return summary;
|
||||
}
|
||||
|
||||
private async Task<EnkaResponse?> GetEnkaResponseAsync(PlayerUid uid, CancellationToken token = default)
|
||||
private List<EnkaAvatarInfo> UpdateDbAvatarInfos(string uid, IEnumerable<EnkaAvatarInfo> webInfos)
|
||||
{
|
||||
return await enkaClient.GetForwardDataAsync(uid, token).ConfigureAwait(false)
|
||||
?? await enkaClient.GetDataAsync(uid, token).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private List<Web.Enka.Model.AvatarInfo> UpdateDbAvatarInfo(string uid, IEnumerable<Web.Enka.Model.AvatarInfo> webInfos)
|
||||
{
|
||||
List<Model.Entity.AvatarInfo> dbInfos = appDbContext.AvatarInfos
|
||||
List<ModelAvatarInfo> dbInfos = appDbContext.AvatarInfos
|
||||
.Where(i => i.Uid == uid)
|
||||
.ToList();
|
||||
|
||||
foreach (Web.Enka.Model.AvatarInfo webInfo in webInfos)
|
||||
foreach (EnkaAvatarInfo webInfo in webInfos)
|
||||
{
|
||||
if (AvatarIds.IsPlayer(webInfo.AvatarId))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Model.Entity.AvatarInfo? entity = dbInfos.SingleOrDefault(i => i.Info.AvatarId == webInfo.AvatarId);
|
||||
ModelAvatarInfo? entity = dbInfos.SingleOrDefault(i => i.Info.AvatarId == webInfo.AvatarId);
|
||||
|
||||
if (entity == null)
|
||||
{
|
||||
entity = Model.Entity.AvatarInfo.Create(uid, webInfo);
|
||||
entity = ModelAvatarInfo.Create(uid, webInfo);
|
||||
appDbContext.AvatarInfos.AddAndSave(entity);
|
||||
}
|
||||
else
|
||||
@@ -145,7 +164,90 @@ internal class AvatarInfoService : IAvatarInfoService
|
||||
return GetDbAvatarInfos(uid);
|
||||
}
|
||||
|
||||
private List<Web.Enka.Model.AvatarInfo> GetDbAvatarInfos(string uid)
|
||||
private async Task<List<EnkaAvatarInfo>> UpdateDbAvatarInfosByGameRecordCharacterAsync(UserAndRole userAndRole)
|
||||
{
|
||||
string uid = userAndRole.Role.GameUid;
|
||||
List<ModelAvatarInfo> dbInfos = appDbContext.AvatarInfos
|
||||
.Where(i => i.Uid == uid)
|
||||
.ToList();
|
||||
|
||||
GameRecordClient gameRecordClient = Ioc.Default.GetRequiredService<GameRecordClient>();
|
||||
RecordPlayerInfo? playerInfo = await gameRecordClient
|
||||
.GetPlayerInfoAsync(userAndRole)
|
||||
.ConfigureAwait(false);
|
||||
List<RecordCharacter> characters = await gameRecordClient
|
||||
.GetCharactersAsync(userAndRole, playerInfo!)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
GameRecordCharacterAvatarInfoComposer composer = Ioc.Default.GetRequiredService<GameRecordCharacterAvatarInfoComposer>();
|
||||
|
||||
foreach (RecordCharacter character in characters)
|
||||
{
|
||||
if (AvatarIds.IsPlayer(character.Id))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
ModelAvatarInfo? entity = dbInfos.SingleOrDefault(i => i.Info.AvatarId == character.Id);
|
||||
|
||||
if (entity == null)
|
||||
{
|
||||
EnkaAvatarInfo avatarInfo = new() { AvatarId = character.Id };
|
||||
avatarInfo = await composer.ComposeAsync(avatarInfo, character).ConfigureAwait(false);
|
||||
entity = ModelAvatarInfo.Create(uid, avatarInfo);
|
||||
appDbContext.AvatarInfos.AddAndSave(entity);
|
||||
}
|
||||
else
|
||||
{
|
||||
entity.Info = await composer.ComposeAsync(entity.Info, character).ConfigureAwait(false);
|
||||
appDbContext.AvatarInfos.UpdateAndSave(entity);
|
||||
}
|
||||
}
|
||||
|
||||
return GetDbAvatarInfos(uid);
|
||||
}
|
||||
|
||||
private async Task<List<EnkaAvatarInfo>> UpdateDbAvatarInfosByCalculateAvatarDetailAsync(UserAndRole userAndRole)
|
||||
{
|
||||
string uid = userAndRole.Role.GameUid;
|
||||
List<ModelAvatarInfo> dbInfos = appDbContext.AvatarInfos
|
||||
.Where(i => i.Uid == uid)
|
||||
.ToList();
|
||||
|
||||
CalculateClient calculateClient = Ioc.Default.GetRequiredService<CalculateClient>();
|
||||
List<CalculateAvatar> avatars = await calculateClient.GetAvatarsAsync(userAndRole.User, userAndRole.Role).ConfigureAwait(false);
|
||||
|
||||
CalculateAvatarDetailAvatarInfoComposer composer = Ioc.Default.GetRequiredService<CalculateAvatarDetailAvatarInfoComposer>();
|
||||
|
||||
foreach (CalculateAvatar avatar in avatars)
|
||||
{
|
||||
if (AvatarIds.IsPlayer(avatar.Id))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
AvatarDetail? detailAvatar = await calculateClient.GetAvatarDetailAsync(userAndRole.User, userAndRole.Role, avatar).ConfigureAwait(false);
|
||||
|
||||
ModelAvatarInfo? entity = dbInfos.SingleOrDefault(i => i.Info.AvatarId == avatar.Id);
|
||||
|
||||
if (entity == null)
|
||||
{
|
||||
EnkaAvatarInfo avatarInfo = new() { AvatarId = avatar.Id };
|
||||
avatarInfo = await composer.ComposeAsync(avatarInfo, detailAvatar).ConfigureAwait(false);
|
||||
entity = ModelAvatarInfo.Create(uid, avatarInfo);
|
||||
appDbContext.AvatarInfos.AddAndSave(entity);
|
||||
}
|
||||
else
|
||||
{
|
||||
entity.Info = await composer.ComposeAsync(entity.Info, detailAvatar).ConfigureAwait(false);
|
||||
appDbContext.AvatarInfos.UpdateAndSave(entity);
|
||||
}
|
||||
}
|
||||
|
||||
return GetDbAvatarInfos(uid);
|
||||
}
|
||||
|
||||
private List<EnkaAvatarInfo> GetDbAvatarInfos(string uid)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate;
|
||||
|
||||
namespace Snap.Hutao.Service.AvatarInfo.Composer;
|
||||
|
||||
/// <summary>
|
||||
/// 计数器角色详情转角色信息
|
||||
/// </summary>
|
||||
[Injection(InjectAs.Transient)]
|
||||
internal class CalculateAvatarDetailAvatarInfoComposer : IAvatarInfoComposer<AvatarDetail>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public ValueTask<Web.Enka.Model.AvatarInfo> ComposeAsync(Web.Enka.Model.AvatarInfo avatarInfo, AvatarDetail source)
|
||||
{
|
||||
// update skills
|
||||
avatarInfo.SkillLevelMap = source.SkillList.ToDictionary(s => s.Id.ToString(), s => s.LevelCurrent);
|
||||
return ValueTask.FromResult(avatarInfo);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
using Snap.Hutao.Service.Metadata;
|
||||
using Snap.Hutao.Web.Enka.Model;
|
||||
using Snap.Hutao.Web.Hoyolab.Takumi.GameRecord.Avatar;
|
||||
|
||||
namespace Snap.Hutao.Service.AvatarInfo.Composer;
|
||||
|
||||
/// <summary>
|
||||
/// 游戏记录角色转角色详情转换器
|
||||
/// </summary>
|
||||
[Injection(InjectAs.Transient)]
|
||||
internal class GameRecordCharacterAvatarInfoComposer : IAvatarInfoComposer<Character>
|
||||
{
|
||||
private readonly IMetadataService metadataService;
|
||||
|
||||
/// <summary>
|
||||
/// 构造一个新的游戏记录角色转角色详情转换器
|
||||
/// </summary>
|
||||
/// <param name="metadataService">元数据服务</param>
|
||||
public GameRecordCharacterAvatarInfoComposer(IMetadataService metadataService)
|
||||
{
|
||||
this.metadataService = metadataService;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async ValueTask<Web.Enka.Model.AvatarInfo> ComposeAsync(Web.Enka.Model.AvatarInfo avatarInfo, Character source)
|
||||
{
|
||||
Dictionary<AvatarId, Model.Metadata.Avatar.Avatar> map = await metadataService.GetIdToAvatarMapAsync().ConfigureAwait(false);
|
||||
Model.Metadata.Avatar.Avatar avatar = map[source.Id];
|
||||
|
||||
// update fetter
|
||||
avatarInfo.FetterInfo ??= new();
|
||||
avatarInfo.FetterInfo.ExpLevel = source.Fetter;
|
||||
|
||||
// update level
|
||||
avatarInfo.PropMap ??= new Dictionary<PlayerProperty, TypeValue>();
|
||||
avatarInfo.PropMap[PlayerProperty.PROP_LEVEL] = new() { Type = PlayerProperty.PROP_LEVEL, Value = source.Level.ToString(), };
|
||||
|
||||
// update constellations
|
||||
avatarInfo.TalentIdList ??= new List<int>();
|
||||
avatarInfo.TalentIdList = source.Constellations.Where(t => t.IsActived).Select(t => t.Id).ToList();
|
||||
|
||||
// update relic
|
||||
avatarInfo.EquipList ??= new();
|
||||
|
||||
if (avatarInfo.EquipList.Count == 0)
|
||||
{
|
||||
List<Equip> relics = source.Reliquaries.Select(r => new Equip()
|
||||
{
|
||||
ItemId = r.Id,
|
||||
Reliquary = new() { Level = r.Level + 1, },
|
||||
Flat = new() { ItemType = ItemType.ITEM_RELIQUARY, EquipType = r.Position, },
|
||||
}).ToList();
|
||||
avatarInfo.EquipList.AddRange(relics);
|
||||
}
|
||||
|
||||
Equip? equip = avatarInfo.EquipList.LastOrDefault();
|
||||
if (equip == null || equip.Weapon == null)
|
||||
{
|
||||
// 不存在武器则添加
|
||||
avatarInfo.EquipList.Add(new());
|
||||
}
|
||||
|
||||
equip = avatarInfo.EquipList.Last();
|
||||
|
||||
if (equip.Weapon == null)
|
||||
{
|
||||
equip.ItemId = source.Weapon.Id;
|
||||
equip.Weapon = new()
|
||||
{
|
||||
Level = source.Weapon.Level,
|
||||
AffixMap = new Dictionary<string, int>
|
||||
{
|
||||
{ $"1{source.Weapon.Id}", source.Weapon.AffixLevel - 1 },
|
||||
},
|
||||
};
|
||||
|
||||
// Special case here, don't set EQUIP_WEAPON
|
||||
equip.Flat = new() { ItemType = ItemType.ITEM_WEAPON, };
|
||||
}
|
||||
|
||||
return avatarInfo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Service.AvatarInfo.Composer;
|
||||
|
||||
/// <summary>
|
||||
/// 角色信息合并器
|
||||
/// </summary>
|
||||
/// <typeparam name="TSource">源类型</typeparam>
|
||||
internal interface IAvatarInfoComposer<TSource>
|
||||
{
|
||||
/// <summary>
|
||||
/// 合并到角色信息
|
||||
/// </summary>
|
||||
/// <param name="avatarInfo">基底,角色Id必定存在</param>
|
||||
/// <param name="source">源</param>
|
||||
/// <returns>任务</returns>
|
||||
ValueTask<Web.Enka.Model.AvatarInfo> ComposeAsync(Web.Enka.Model.AvatarInfo avatarInfo, TSource source);
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
|
||||
namespace Snap.Hutao.Service.AvatarInfo.Factory;
|
||||
|
||||
@@ -41,7 +42,7 @@ internal class AffixWeight : Dictionary<FightProperty, double>
|
||||
/// <summary>
|
||||
/// 角色Id
|
||||
/// </summary>
|
||||
public int AvatarId { get; }
|
||||
public AvatarId AvatarId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
|
||||
@@ -18,7 +18,6 @@ internal static partial class ReliquaryWeightConfiguration
|
||||
|
||||
/// <summary>
|
||||
/// 词条权重
|
||||
/// https://docs.qq.com/sheet/DUG52SFJlTUN3cmNL?tab=BB08J2
|
||||
/// </summary>
|
||||
public static readonly List<AffixWeight> AffixWeights = new()
|
||||
{
|
||||
@@ -78,7 +77,7 @@ internal static partial class ReliquaryWeightConfiguration
|
||||
new(AvatarIds.Ayato, 50, 75, 0, 100, 100, 0, 0, 0) { { FightProperty.FIGHT_PROP_WATER_ADD_HURT, 100 } },
|
||||
new(AvatarIds.Collei, 0, 75, 0, 100, 100, 0, 55, 0) { { FightProperty.FIGHT_PROP_GRASS_ADD_HURT, 100 } },
|
||||
new(AvatarIds.Dori, 100, 75, 0, 100, 100, 0, 55, 0) { { FightProperty.FIGHT_PROP_ELEC_ADD_HURT, 100 } },
|
||||
new(AvatarIds.Tighnari, 0, 75, 0, 100, 100, 0, 55, 0) { { FightProperty.FIGHT_PROP_GRASS_ADD_HURT, 100 } },
|
||||
new(AvatarIds.Tighnari, 0, 75, 0, 100, 100, 75, 55, 0) { { FightProperty.FIGHT_PROP_GRASS_ADD_HURT, 100 } },
|
||||
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 } },
|
||||
|
||||
@@ -74,7 +74,9 @@ internal class SummaryAvatarFactory
|
||||
Name = avatar.Name,
|
||||
Icon = AvatarIconConverter.IconNameToUri(avatar.Icon),
|
||||
SideIcon = AvatarIconConverter.IconNameToUri(avatar.SideIcon),
|
||||
NameCard = AvatarNameCardPicConverter.AvatarToUri(avatar),
|
||||
Quality = avatar.Quality,
|
||||
Element = ElementNameIconConverter.ElementNameToElementType(avatar.FetterInfo.VisionBefore),
|
||||
Level = $"Lv.{avatarInfo.PropMap[PlayerProperty.PROP_LEVEL].Value}",
|
||||
FetterLevel = avatarInfo.FetterInfo.ExpLevel,
|
||||
Weapon = reliquaryAndWeapon.Weapon,
|
||||
@@ -117,7 +119,7 @@ internal class SummaryAvatarFactory
|
||||
KeyValuePair<string, int>? idLevel = equip.Weapon!.AffixMap?.Single();
|
||||
int affixLevel = idLevel.HasValue ? idLevel.Value.Value : 0;
|
||||
|
||||
WeaponStat mainStat = equip.Flat.WeaponStats![0];
|
||||
WeaponStat? mainStat = equip.Flat.WeaponStats?[0];
|
||||
WeaponStat? subStat = equip.Flat.WeaponStats?.Count > 1 ? equip.Flat.WeaponStats![1] : null;
|
||||
|
||||
Pair<string, string> subProperty;
|
||||
@@ -141,7 +143,7 @@ internal class SummaryAvatarFactory
|
||||
// EquipBase
|
||||
Level = $"Lv.{equip.Weapon!.Level}",
|
||||
Quality = weapon.Quality,
|
||||
MainProperty = new(mainStat.AppendPropId.GetDescription(), mainStat.StatValue.ToString()),
|
||||
MainProperty = mainStat == null ? default! : new(mainStat.AppendPropId.GetDescription(), mainStat.StatValue.ToString()),
|
||||
|
||||
// Weapon
|
||||
SubProperty = subProperty,
|
||||
|
||||
@@ -60,6 +60,11 @@ internal static class SummaryHelper
|
||||
/// <returns>技能</returns>
|
||||
public static List<Skill> CreateSkills(IDictionary<string, int> skillLevelMap, IDictionary<string, int>? proudSkillExtraLevelMap, IEnumerable<ProudableSkill> proudSkills)
|
||||
{
|
||||
if (skillLevelMap == null)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
|
||||
Dictionary<string, int> skillLevelMapCopy = new(skillLevelMap);
|
||||
|
||||
if (proudSkillExtraLevelMap != null)
|
||||
@@ -98,28 +103,28 @@ internal static class SummaryHelper
|
||||
/// <returns>列表</returns>
|
||||
public static List<Pair2<string, string, string?>> CreateAvatarProperties(IDictionary<FightProperty, double> fightPropMap)
|
||||
{
|
||||
List<Pair2<string, string, string?>> properties;
|
||||
if (fightPropMap == null)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
|
||||
double baseHp = fightPropMap.GetValueOrDefault2(FightProperty.FIGHT_PROP_BASE_HP); // 1
|
||||
double hp = fightPropMap.GetValueOrDefault2(FightProperty.FIGHT_PROP_HP); // 2
|
||||
double hpPercent = fightPropMap.GetValueOrDefault2(FightProperty.FIGHT_PROP_HP_PERCENT); // 3
|
||||
double hpAdd = hp + (baseHp * hpPercent);
|
||||
double maxHp = baseHp + hpAdd;
|
||||
Pair2<string, string, string?> hpPair2 = PropertyInfoDescriptor.FormatIntegerPair2("生命值", FormatMethod.Integer, maxHp, hpAdd);
|
||||
Pair2<string, string, string?> hpPair2 = PropertyInfoDescriptor.FormatIntegerPair2("生命值", FormatMethod.Integer, baseHp, hpAdd);
|
||||
|
||||
double baseAtk = fightPropMap.GetValueOrDefault2(FightProperty.FIGHT_PROP_BASE_ATTACK); // 4
|
||||
double atk = fightPropMap.GetValueOrDefault2(FightProperty.FIGHT_PROP_ATTACK); // 5
|
||||
double atkPrecent = fightPropMap.GetValueOrDefault2(FightProperty.FIGHT_PROP_ATTACK_PERCENT); // 6
|
||||
double atkAdd = atk + (baseAtk * atkPrecent);
|
||||
double maxAtk = baseAtk + atkAdd;
|
||||
Pair2<string, string, string?> atkPair2 = PropertyInfoDescriptor.FormatIntegerPair2("攻击力", FormatMethod.Integer, maxAtk, atkAdd);
|
||||
Pair2<string, string, string?> atkPair2 = PropertyInfoDescriptor.FormatIntegerPair2("攻击力", FormatMethod.Integer, baseAtk, atkAdd);
|
||||
|
||||
double baseDef = fightPropMap.GetValueOrDefault2(FightProperty.FIGHT_PROP_BASE_DEFENSE); // 7
|
||||
double def = fightPropMap.GetValueOrDefault2(FightProperty.FIGHT_PROP_DEFENSE); // 8
|
||||
double defPercent = fightPropMap.GetValueOrDefault2(FightProperty.FIGHT_PROP_DEFENSE_PERCENT); // 9
|
||||
double defAdd = def + (baseDef * defPercent);
|
||||
double maxDef = baseDef + defAdd;
|
||||
Pair2<string, string, string?> defPair2 = PropertyInfoDescriptor.FormatIntegerPair2("防御力", FormatMethod.Integer, maxDef, defAdd);
|
||||
Pair2<string, string, string?> defPair2 = PropertyInfoDescriptor.FormatIntegerPair2("防御力", FormatMethod.Integer, baseDef, defAdd);
|
||||
|
||||
double em = fightPropMap.GetValueOrDefault2(FightProperty.FIGHT_PROP_ELEMENT_MASTERY); // 28
|
||||
Pair2<string, string, string?> emPair2 = PropertyInfoDescriptor.FormatIntegerPair2("元素精通", FormatMethod.Integer, em);
|
||||
@@ -133,7 +138,7 @@ internal static class SummaryHelper
|
||||
double chargeEff = fightPropMap.GetValueOrDefault2(FightProperty.FIGHT_PROP_CHARGE_EFFICIENCY); // 23
|
||||
Pair2<string, string, string?> chargeEffPair2 = PropertyInfoDescriptor.FormatIntegerPair2("元素充能效率", FormatMethod.Percent, chargeEff);
|
||||
|
||||
properties = new() { hpPair2, atkPair2, defPair2, emPair2, critRatePair2, critDMGPair2, chargeEffPair2 };
|
||||
List<Pair2<string, string, string?>> properties = new() { hpPair2, atkPair2, defPair2, emPair2, critRatePair2, critDMGPair2, chargeEffPair2 };
|
||||
|
||||
FightProperty bonusProperty = GetBonusFightProperty(fightPropMap);
|
||||
if (bonusProperty != FightProperty.FIGHT_PROP_NONE)
|
||||
@@ -220,6 +225,11 @@ internal static class SummaryHelper
|
||||
/// <returns>评分</returns>
|
||||
public static double ScoreCrit(IDictionary<FightProperty, double> fightPropMap)
|
||||
{
|
||||
if (fightPropMap == null)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double cr = fightPropMap[FightProperty.FIGHT_PROP_CRITICAL];
|
||||
double cd = fightPropMap[FightProperty.FIGHT_PROP_CRITICAL_HURT];
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
using Snap.Hutao.Extension;
|
||||
using Snap.Hutao.Model.Binding.AvatarProperty;
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Model.Metadata.Annotation;
|
||||
using Snap.Hutao.Model.Metadata.Converter;
|
||||
using Snap.Hutao.Model.Metadata.Reliquary;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
@@ -65,10 +66,27 @@ internal class SummaryReliquaryFactory
|
||||
List<ReliquarySubProperty> subProperty = equip.Reliquary!.AppendPropIdList.EmptyIfNull().Select(CreateSubProperty).ToList();
|
||||
|
||||
int affixCount = GetAffixCount(reliquary);
|
||||
if (subProperty.Count == 0)
|
||||
{
|
||||
return new()
|
||||
{
|
||||
// NameIconDescription
|
||||
Name = reliquary.Name,
|
||||
Icon = RelicIconConverter.IconNameToUri(reliquary.Icon),
|
||||
Description = reliquary.Description,
|
||||
|
||||
// EquipBase
|
||||
Level = $"+{equip.Reliquary.Level - 1}",
|
||||
Quality = reliquary.RankLevel,
|
||||
};
|
||||
}
|
||||
|
||||
Span<ReliquarySubProperty> span = CollectionsMarshal.AsSpan(subProperty);
|
||||
List<ReliquarySubProperty> primary = new(span[..^affixCount].ToArray());
|
||||
List<ReliquarySubProperty> secondary = new(span[^affixCount..].ToArray());
|
||||
|
||||
List<ReliquarySubProperty> composed = equip.Flat.ReliquarySubstats!.Select(CreateComposedSubProperty).ToList();
|
||||
|
||||
ReliquaryLevel relicLevel = reliqueryLevels.Single(r => r.Level == equip.Reliquary!.Level && r.Quality == reliquary.RankLevel);
|
||||
FightProperty property = idRelicMainPropMap[equip.Reliquary.MainPropId];
|
||||
|
||||
@@ -85,7 +103,7 @@ internal class SummaryReliquaryFactory
|
||||
MainProperty = new(property.GetDescription(), PropertyInfoDescriptor.FormatValue(property, relicLevel.Properties[property])),
|
||||
|
||||
// Reliquary
|
||||
// SubProperties = subProperty,
|
||||
ComposedSubProperties = composed,
|
||||
PrimarySubProperties = primary,
|
||||
SecondarySubProperties = secondary,
|
||||
Score = ScoreReliquary(property, reliquary, relicLevel, subProperty),
|
||||
@@ -150,6 +168,19 @@ internal class SummaryReliquaryFactory
|
||||
return ReliquaryWeightConfiguration.AffixWeights.FirstOrDefault(w => w.AvatarId == avatarInfo.AvatarId, ReliquaryWeightConfiguration.Default);
|
||||
}
|
||||
|
||||
private ReliquarySubProperty CreateComposedSubProperty(ReliquarySubstat substat)
|
||||
{
|
||||
FormatMethod method = substat.AppendPropId.GetFormatMethod();
|
||||
string valueFormatted = method switch
|
||||
{
|
||||
FormatMethod.Integer => Math.Round((double)substat.StatValue, MidpointRounding.AwayFromZero).ToString(),
|
||||
FormatMethod.Percent => $"{substat.StatValue}%",
|
||||
_ => substat.StatValue.ToString(),
|
||||
};
|
||||
|
||||
return new(substat.AppendPropId.GetDescription(), valueFormatted, 0);
|
||||
}
|
||||
|
||||
private ReliquarySubProperty CreateSubProperty(int appendPropId)
|
||||
{
|
||||
MetadataReliquaryAffix affix = idReliquaryAffixMap[appendPropId];
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Binding.AvatarProperty;
|
||||
using Snap.Hutao.Model.Binding.User;
|
||||
using Snap.Hutao.Web.Hoyolab;
|
||||
|
||||
namespace Snap.Hutao.Service.AvatarInfo;
|
||||
@@ -14,9 +15,9 @@ internal interface IAvatarInfoService
|
||||
/// <summary>
|
||||
/// 异步获取总览数据
|
||||
/// </summary>
|
||||
/// <param name="uid">uid</param>
|
||||
/// <param name="userAndRole">uid</param>
|
||||
/// <param name="refreshOption">刷新选项</param>
|
||||
/// <param name="token">取消令牌</param>
|
||||
/// <returns>总览数据</returns>
|
||||
Task<ValueResult<RefreshResult, Summary?>> GetSummaryAsync(PlayerUid uid, RefreshOption refreshOption, CancellationToken token = default);
|
||||
Task<ValueResult<RefreshResult, Summary?>> GetSummaryAsync(UserAndRole userAndRole, RefreshOption refreshOption, CancellationToken token = default);
|
||||
}
|
||||
@@ -6,26 +6,25 @@ namespace Snap.Hutao.Service.AvatarInfo;
|
||||
/// <summary>
|
||||
/// 刷新选项
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum RefreshOption
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否存入本地数据库
|
||||
/// 直接从数据库读取
|
||||
/// </summary>
|
||||
StoreInDatabase = 0b00000001,
|
||||
None,
|
||||
|
||||
/// <summary>
|
||||
/// 从API获取
|
||||
/// 从 Enka API 获取
|
||||
/// </summary>
|
||||
RequestFromAPI = 0b00000010,
|
||||
RequestFromEnkaAPI,
|
||||
|
||||
/// <summary>
|
||||
/// 仅数据库
|
||||
/// 从 米游社 我的角色 获取
|
||||
/// </summary>
|
||||
DatabaseOnly = 0b00000000,
|
||||
RequestFromHoyolabGameRecord,
|
||||
|
||||
/// <summary>
|
||||
/// 标准操作
|
||||
/// 从 米游社 养成计算 获取
|
||||
/// </summary>
|
||||
Standard = StoreInDatabase | RequestFromAPI,
|
||||
RequestFromHoyolabCalculate,
|
||||
}
|
||||
@@ -16,7 +16,7 @@ public enum RefreshResult
|
||||
/// <summary>
|
||||
/// 元数据加载失败
|
||||
/// </summary>
|
||||
MetadataUninitialized,
|
||||
MetadataNotInitialized,
|
||||
|
||||
/// <summary>
|
||||
/// API 不可用
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Snap.Hutao.Context.Database;
|
||||
using Snap.Hutao.Core.Abstraction;
|
||||
using Snap.Hutao.Core.Database;
|
||||
@@ -201,7 +202,7 @@ internal class GachaLogService : IGachaLogService, ISupportAsyncInitialization
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Task RemoveArchiveAsync(GachaArchive archive)
|
||||
public async Task RemoveArchiveAsync(GachaArchive archive)
|
||||
{
|
||||
Must.NotNull(archiveCollection!);
|
||||
|
||||
@@ -209,8 +210,11 @@ internal class GachaLogService : IGachaLogService, ISupportAsyncInitialization
|
||||
archiveCollection.Remove(archive);
|
||||
|
||||
// Sync database
|
||||
await appDbContext.GachaItems
|
||||
.Where(item => item.ArchiveId == archive.InnerId)
|
||||
.ExecuteDeleteAsync()
|
||||
.ConfigureAwait(false);
|
||||
appDbContext.GachaArchives.RemoveAndSave(archive);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private static Task RandomDelayAsync(CancellationToken token)
|
||||
@@ -234,9 +238,7 @@ internal class GachaLogService : IGachaLogService, ISupportAsyncInitialization
|
||||
.Where(i => i.Id < trimId)
|
||||
.Select(i => GachaItem.Create(archiveId, i, GetItemId(i)));
|
||||
|
||||
appDbContext.GachaItems.AddRange(toAdd);
|
||||
appDbContext.SaveChanges();
|
||||
|
||||
appDbContext.GachaItems.AddRangeAndSave(toAdd);
|
||||
CurrentArchive = archive;
|
||||
}
|
||||
|
||||
@@ -335,14 +337,14 @@ internal class GachaLogService : IGachaLogService, ISupportAsyncInitialization
|
||||
|
||||
if (archive != null)
|
||||
{
|
||||
// TODO: replace with MaxBy
|
||||
// https://github.com/dotnet/efcore/issues/25566
|
||||
// .MaxBy(i => i.Id);
|
||||
item = appDbContext.GachaItems
|
||||
.Where(i => i.ArchiveId == archive.InnerId)
|
||||
.Where(i => i.QueryType == configType)
|
||||
.OrderByDescending(i => i.Id)
|
||||
.FirstOrDefault();
|
||||
|
||||
// TODO MaxBy should be supported by .NET 7
|
||||
// .MaxBy(i => i.Id);
|
||||
}
|
||||
|
||||
return item?.Id ?? 0L;
|
||||
@@ -389,18 +391,16 @@ internal class GachaLogService : IGachaLogService, ISupportAsyncInitialization
|
||||
{
|
||||
if (itemsToAdd.Count > 0)
|
||||
{
|
||||
// 全量刷新
|
||||
if ((!isLazy) && archive != null)
|
||||
{
|
||||
IQueryable<GachaItem> toRemove = appDbContext.GachaItems
|
||||
appDbContext.GachaItems
|
||||
.Where(i => i.ArchiveId == archive.InnerId)
|
||||
.Where(i => i.Id >= endId);
|
||||
|
||||
appDbContext.GachaItems.RemoveRange(toRemove);
|
||||
appDbContext.SaveChanges();
|
||||
.Where(i => i.Id >= endId)
|
||||
.ExecuteDelete();
|
||||
}
|
||||
|
||||
appDbContext.GachaItems.AddRange(itemsToAdd);
|
||||
appDbContext.SaveChanges();
|
||||
appDbContext.GachaItems.AddRangeAndSave(itemsToAdd);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@ using Microsoft.Win32.SafeHandles;
|
||||
using Snap.Hutao.Core.Diagnostics;
|
||||
using Snap.Hutao.Win32;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using Windows.Win32.System.Diagnostics.ToolHelp;
|
||||
using static Windows.Win32.PInvoke;
|
||||
@@ -152,7 +151,7 @@ internal class GameFpsUnlocker : IGameFpsUnlocker
|
||||
Must.Range(adr >= 0, "未匹配到FPS字节");
|
||||
|
||||
int rip = adr + 2;
|
||||
int rel = Unsafe.ReadUnaligned<int>(ref image[rip + 2]);
|
||||
int rel = image.Fixed<int>(rip + 2); // Unsafe.ReadUnaligned<int>(ref image[rip + 2]);
|
||||
int ofs = rip + rel + 6;
|
||||
fpsAddress = (nuint)((long)unityPlayer.modBaseAddr + ofs);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ internal class HutaoService : IHutaoService
|
||||
appDbContext.ObjectCache.AddAndSave(new()
|
||||
{
|
||||
Key = key,
|
||||
ExpireTime = DateTimeOffset.Now.AddHours(4),
|
||||
ExpireTime = DateTimeOffset.Now.AddHours(6),
|
||||
Value = JsonSerializer.Serialize(web, options),
|
||||
});
|
||||
|
||||
|
||||
@@ -45,8 +45,10 @@
|
||||
<None Remove="Resource\Icon\UI_ChapterIcon_Hutao.png" />
|
||||
<None Remove="Resource\Icon\UI_GachaShowPanel_Bg_Weapon.png" />
|
||||
<None Remove="Resource\Icon\UI_GuideIcon_PlayMethod.png" />
|
||||
<None Remove="Resource\Icon\UI_HomeWorldTabIcon_2_Team.png" />
|
||||
<None Remove="Resource\Icon\UI_Icon_Achievement.png" />
|
||||
<None Remove="Resource\Icon\UI_Icon_BoostUp.png" />
|
||||
<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_ItemIcon_201.png" />
|
||||
@@ -65,6 +67,7 @@
|
||||
<None Remove="View\Control\StatisticsCard.xaml" />
|
||||
<None Remove="View\Dialog\AchievementArchiveCreateDialog.xaml" />
|
||||
<None Remove="View\Dialog\AchievementImportDialog.xaml" />
|
||||
<None Remove="View\Dialog\AdoptCalculatorDialog.xaml" />
|
||||
<None Remove="View\Dialog\AvatarInfoQueryDialog.xaml" />
|
||||
<None Remove="View\Dialog\DailyNoteNotificationDialog.xaml" />
|
||||
<None Remove="View\Dialog\DailyNoteVerificationDialog.xaml" />
|
||||
@@ -80,11 +83,11 @@
|
||||
<None Remove="View\Page\AnnouncementContentPage.xaml" />
|
||||
<None Remove="View\Page\AnnouncementPage.xaml" />
|
||||
<None Remove="View\Page\AvatarPropertyPage.xaml" />
|
||||
<None Remove="View\Page\CultivationPage.xaml" />
|
||||
<None Remove="View\Page\DailyNotePage.xaml" />
|
||||
<None Remove="View\Page\GachaLogPage.xaml" />
|
||||
<None Remove="View\Page\HutaoDatabasePage.xaml" />
|
||||
<None Remove="View\Page\LaunchGamePage.xaml" />
|
||||
<None Remove="View\Page\LoginMihoyoBBSPage.xaml" />
|
||||
<None Remove="View\Page\LoginMihoyoUserPage.xaml" />
|
||||
<None Remove="View\Page\SettingPage.xaml" />
|
||||
<None Remove="View\Page\WikiAvatarPage.xaml" />
|
||||
@@ -115,8 +118,10 @@
|
||||
<Content Include="Resource\Icon\UI_ChapterIcon_Hutao.png" />
|
||||
<Content Include="Resource\Icon\UI_GachaShowPanel_Bg_Weapon.png" />
|
||||
<Content Include="Resource\Icon\UI_GuideIcon_PlayMethod.png" />
|
||||
<Content Include="Resource\Icon\UI_HomeWorldTabIcon_2_Team.png" />
|
||||
<Content Include="Resource\Icon\UI_Icon_Achievement.png" />
|
||||
<Content Include="Resource\Icon\UI_Icon_BoostUp.png" />
|
||||
<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_ItemIcon_201.png" />
|
||||
@@ -174,6 +179,16 @@
|
||||
<ItemGroup>
|
||||
<None Include="..\.editorconfig" Link=".editorconfig" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="View\Page\CultivationPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="View\Dialog\AdoptCalculatorDialog.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="View\Page\WikiWeaponPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -214,11 +229,6 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="View\Page\LoginMihoyoBBSPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="View\Page\LoginMihoyoUserPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -1,26 +1,25 @@
|
||||
<ContentControl
|
||||
x:Class="Snap.Hutao.View.Control.BottomTextControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Border
|
||||
BorderThickness="1"
|
||||
CornerRadius="{StaticResource CompatCornerRadius}"
|
||||
Background="{StaticResource CardBackgroundFillColorDefault}"
|
||||
BorderBrush="{StaticResource CardStrokeColorDefault}"
|
||||
Background="{StaticResource CardBackgroundFillColorDefault}">
|
||||
BorderThickness="1"
|
||||
CornerRadius="{StaticResource CompatCornerRadius}">
|
||||
<StackPanel Name="BackgroundStack">
|
||||
<ContentPresenter
|
||||
Name="ContentHost"/>
|
||||
<ContentPresenter Name="ContentHost"/>
|
||||
<TextBlock
|
||||
Name="TextHost"
|
||||
Margin="0,0,0,2"
|
||||
TextWrapping="NoWrap"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
MaxWidth="80"
|
||||
HorizontalAlignment="Center"/>
|
||||
Margin="0,0,0,2"
|
||||
HorizontalAlignment="Center"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
TextWrapping="NoWrap"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ContentControl>
|
||||
|
||||
@@ -1,23 +1,21 @@
|
||||
<UserControl
|
||||
x:Class="Snap.Hutao.View.Control.DescParamComboBox"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:sc="using:SettingsUI.Controls"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<Style TargetType="ComboBox" BasedOn="{StaticResource DefaultComboBoxStyle}">
|
||||
<Style BasedOn="{StaticResource DefaultComboBoxStyle}" TargetType="ComboBox">
|
||||
<Setter Property="MinWidth" Value="120"/>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
<StackPanel>
|
||||
<sc:SettingsGroup VerticalAlignment="Top" Margin="0,-64,0,0">
|
||||
<sc:Setting Header="等级" Padding="12,0,6,0">
|
||||
<sc:SettingsGroup Margin="0,-64,0,0" VerticalAlignment="Top">
|
||||
<sc:Setting Padding="12,0,6,0" Header="等级">
|
||||
<sc:Setting.ActionContent>
|
||||
<ComboBox
|
||||
x:Name="ItemHost"
|
||||
SelectionChanged="ItemHostSelectionChanged">
|
||||
<ComboBox x:Name="ItemHost" SelectionChanged="ItemHostSelectionChanged">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Level}"/>
|
||||
@@ -28,15 +26,16 @@
|
||||
</sc:Setting>
|
||||
</sc:SettingsGroup>
|
||||
|
||||
<ItemsControl
|
||||
x:Name="DetailsHost"
|
||||
VerticalAlignment="Top">
|
||||
<ItemsControl x:Name="DetailsHost" VerticalAlignment="Top">
|
||||
<ItemsControl.ItemContainerTransitions>
|
||||
<ContentThemeTransition/>
|
||||
</ItemsControl.ItemContainerTransitions>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<sc:Setting Margin="0,2,0,0" Header="{Binding Description}" Padding="12,0">
|
||||
<sc:Setting
|
||||
Margin="0,2,0,0"
|
||||
Padding="12,0"
|
||||
Header="{Binding Description}">
|
||||
<sc:Setting.ActionContent>
|
||||
<TextBlock Text="{Binding Parameter}"/>
|
||||
</sc:Setting.ActionContent>
|
||||
|
||||
@@ -1,32 +1,29 @@
|
||||
<UserControl
|
||||
x:Class="Snap.Hutao.View.Control.ItemIcon"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:shci="using:Snap.Hutao.Control.Image"
|
||||
xmlns:shmmc="using:Snap.Hutao.Model.Metadata.Converter"
|
||||
mc:Ignorable="d"
|
||||
Width="80"
|
||||
Height="80">
|
||||
Height="80"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<shmmc:QualityConverter x:Key="QualityConverter"/>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Grid CornerRadius="{StaticResource CompatCornerRadius}">
|
||||
<shci:CachedImage Source="{x:Bind Quality, Converter={StaticResource QualityConverter}, Mode=OneWay}"/>
|
||||
<shci:CachedImage Source="https://static.snapgenshin.com/Bg/UI_ImgSign_ItemIcon.png"/>
|
||||
<shci:CachedImage Source="{x:Bind Icon, Mode=OneWay}"/>
|
||||
<shci:CachedImage
|
||||
Source="{x:Bind Quality,Converter={StaticResource QualityConverter},Mode=OneWay}"/>
|
||||
<shci:CachedImage
|
||||
Source="https://static.snapgenshin.com/Bg/UI_ImgSign_ItemIcon.png"/>
|
||||
<shci:CachedImage
|
||||
Source="{x:Bind Icon,Mode=OneWay}"/>
|
||||
<shci:CachedImage
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Margin="2"
|
||||
Width="16"
|
||||
Height="16"
|
||||
Source="{x:Bind Badge,Mode=OneWay}"/>
|
||||
Margin="2"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Source="{x:Bind Badge, Mode=OneWay}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<UserControl
|
||||
x:Class="Snap.Hutao.View.Control.SkillPivot"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:shci="using:Snap.Hutao.Control.Image"
|
||||
xmlns:shmmc="using:Snap.Hutao.Model.Metadata.Converter"
|
||||
@@ -11,34 +11,33 @@
|
||||
<UserControl.Resources>
|
||||
<shmmc:SkillIconConverter x:Key="SkillIconConverter"/>
|
||||
<shmmc:DescParamDescriptor x:Key="DescParamDescriptor"/>
|
||||
|
||||
|
||||
<Thickness x:Key="PivotHeaderItemMargin">0,0,16,0</Thickness>
|
||||
<Thickness x:Key="PivotItemMargin">0</Thickness>
|
||||
|
||||
<Style TargetType="PivotHeaderItem" BasedOn="{StaticResource DefaultPivotHeaderItemStyle}">
|
||||
|
||||
<Style BasedOn="{StaticResource DefaultPivotHeaderItemStyle}" TargetType="PivotHeaderItem">
|
||||
<Setter Property="Height" Value="80"/>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Pivot
|
||||
x:Name="ItemHost"
|
||||
ItemsSource="{x:Bind Skills,Mode=OneWay}"
|
||||
SelectedItem="{x:Bind Selected}"
|
||||
ItemTemplate="{x:Bind ItemTemplate}"
|
||||
Style="{StaticResource DefaultPivotStyle}"
|
||||
>
|
||||
ItemsSource="{x:Bind Skills, Mode=OneWay}"
|
||||
SelectedItem="{x:Bind Selected}"
|
||||
Style="{StaticResource DefaultPivotStyle}">
|
||||
<Pivot.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<shci:MonoChrome
|
||||
Width="36"
|
||||
Height="36"
|
||||
Source="{Binding Icon,Converter={StaticResource SkillIconConverter}}"/>
|
||||
Source="{Binding Icon, Converter={StaticResource SkillIconConverter}}"/>
|
||||
<TextBlock
|
||||
Margin="0,8,0,0"
|
||||
Text="{Binding Name}"
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"/>
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Name}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</Pivot.HeaderTemplate>
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
<UserControl
|
||||
x:Class="Snap.Hutao.View.Control.StatisticsCard"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:cwucont="using:CommunityToolkit.WinUI.UI.Controls"
|
||||
xmlns:cwuconv="using:CommunityToolkit.WinUI.UI.Converters"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:shci="using:Snap.Hutao.Control.Image"
|
||||
xmlns:shcp="using:Snap.Hutao.Control.Panel"
|
||||
xmlns:shmbg="using:Snap.Hutao.Model.Binding.Gacha"
|
||||
xmlns:shvc="using:Snap.Hutao.View.Control"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance shmbg:TypedWishSummary}">
|
||||
d:DataContext="{d:DesignInstance shmbg:TypedWishSummary}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<UserControl.Resources>
|
||||
<SolidColorBrush x:Key="BlueBrush" Color="#FF5180CB"/>
|
||||
@@ -19,46 +18,45 @@
|
||||
<SolidColorBrush x:Key="OrangeBrush" Color="#FFBC6932"/>
|
||||
|
||||
<DataTemplate x:Key="OrangeListTemplate" x:DataType="shmbg:SummaryItem">
|
||||
<Grid Margin="0,4,4,0" Background="Transparent" >
|
||||
<Grid Margin="0,4,4,0" Background="Transparent">
|
||||
<ToolTipService.ToolTip>
|
||||
<TextBlock Text="{Binding TimeFormatted}"/>
|
||||
</ToolTipService.ToolTip>
|
||||
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||
<shci:CachedImage
|
||||
Source="{Binding Icon}"
|
||||
Height="32" Width="32"/>
|
||||
Width="32"
|
||||
Height="32"
|
||||
Source="{Binding Icon}"/>
|
||||
<TextBlock
|
||||
Text="{Binding Name}"
|
||||
Margin="8,0,0,0"
|
||||
VerticalAlignment="Center">
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Name}">
|
||||
<TextBlock.Foreground>
|
||||
<SolidColorBrush Color="{Binding Color}"/>
|
||||
</TextBlock.Foreground>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="0,0,8,0"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="#FF0063FF"
|
||||
Text="保底"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding IsGuarentee,Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||
Visibility="{Binding IsGuarentee, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||
<TextBlock
|
||||
Margin="0,0,8,0"
|
||||
Text="UP"
|
||||
Foreground="#FFFFA400"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding IsUp,Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||
Foreground="#FFFFA400"
|
||||
Text="UP"
|
||||
Visibility="{Binding IsUp, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||
|
||||
<TextBlock
|
||||
Width="20"
|
||||
TextAlignment="Center"
|
||||
Text="{Binding LastPull}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource BodyTextBlockStyle}"/>
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Text="{Binding LastPull}"
|
||||
TextAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
@@ -66,23 +64,24 @@
|
||||
<DataTemplate x:Key="OrangeGridTemplate" x:DataType="shmbg:SummaryItem">
|
||||
<Grid Width="40" Margin="0,4,4,0">
|
||||
<Border
|
||||
Background="{StaticResource CardBackgroundFillColorDefault}"
|
||||
BorderBrush="{StaticResource CardStrokeColorDefault}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="{StaticResource CompatCornerRadius}"
|
||||
BorderBrush="{StaticResource CardStrokeColorDefault}"
|
||||
Background="{StaticResource CardBackgroundFillColorDefault}"
|
||||
ToolTipService.ToolTip="{Binding TimeFormatted}">
|
||||
<StackPanel>
|
||||
<shvc:ItemIcon
|
||||
Width="40"
|
||||
Height="40"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="QUALITY_ORANGE"
|
||||
Height="40" Width="40"/>
|
||||
Quality="QUALITY_ORANGE"/>
|
||||
<!--<shci:CachedImage
|
||||
Source="{Binding Icon}"
|
||||
Height="40" Width="40"/>-->
|
||||
<TextBlock
|
||||
Text="{Binding LastPull}"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding LastPull}"
|
||||
TextWrapping="NoWrap">
|
||||
<TextBlock.Foreground>
|
||||
<SolidColorBrush Color="{Binding Color}"/>
|
||||
@@ -95,9 +94,7 @@
|
||||
|
||||
</UserControl.Resources>
|
||||
|
||||
<Border
|
||||
Background="{StaticResource CardBackgroundFillColorDefaultBrush}"
|
||||
CornerRadius="{StaticResource CompatCornerRadius}">
|
||||
<Border Background="{StaticResource CardBackgroundFillColorDefaultBrush}" CornerRadius="{StaticResource CompatCornerRadius}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
@@ -106,37 +103,42 @@
|
||||
</Grid.RowDefinitions>
|
||||
<Expander
|
||||
x:Name="DetailExpander"
|
||||
Padding="16,0,16,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Background="Transparent"
|
||||
Padding="16,0,16,0"
|
||||
BorderBrush="{x:Null}"
|
||||
IsExpanded="True">
|
||||
<Expander.Header>
|
||||
<Grid Grid.Row="0">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Name}"
|
||||
Style="{StaticResource SubtitleTextBlockStyle}"/>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||
Text="{Binding Name}"/>
|
||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<TextBlock
|
||||
VerticalAlignment="Bottom"
|
||||
Margin="0,4,12,2"
|
||||
VerticalAlignment="Bottom"
|
||||
FontFamily="Consolas"
|
||||
FontSize="24"
|
||||
Text="{Binding TotalCount}"
|
||||
Visibility="{Binding ElementName=DetailExpander,Path=IsExpanded,Converter={StaticResource BoolToVisibilityRevertConverter}}"
|
||||
FontSize="24"/>
|
||||
<shcp:PanelSelector
|
||||
Margin="6,0,6,0"
|
||||
x:Name="ItemsPanelSelector"/>
|
||||
Visibility="{Binding ElementName=DetailExpander, Path=IsExpanded, Converter={StaticResource BoolToVisibilityRevertConverter}}"/>
|
||||
<shcp:PanelSelector x:Name="ItemsPanelSelector" Margin="6,0,6,0"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Expander.Header>
|
||||
<StackPanel>
|
||||
<StackPanel Grid.Row="1" Margin="0,0,0,12">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Margin="0,4,0,4" FontFamily="Consolas" Text="{Binding TotalCount}" FontSize="48"/>
|
||||
<TextBlock Margin="12,0,0,12" Text="抽" VerticalAlignment="Bottom"/>
|
||||
<TextBlock
|
||||
Margin="0,4,0,4"
|
||||
FontFamily="Consolas"
|
||||
FontSize="48"
|
||||
Text="{Binding TotalCount}"/>
|
||||
<TextBlock
|
||||
Margin="12,0,0,12"
|
||||
VerticalAlignment="Bottom"
|
||||
Text="抽"/>
|
||||
</StackPanel>
|
||||
|
||||
<Grid ColumnSpacing="4">
|
||||
@@ -146,102 +148,102 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
BorderThickness="1"
|
||||
CornerRadius="{StaticResource CompatCornerRadius}"
|
||||
Background="{StaticResource CardBackgroundFillColorDefault}"
|
||||
BorderBrush="{StaticResource CardStrokeColorDefault}"
|
||||
Background="{StaticResource CardBackgroundFillColorDefault}">
|
||||
BorderThickness="1"
|
||||
CornerRadius="{StaticResource CompatCornerRadius}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ProgressRing
|
||||
Margin="4"
|
||||
Height="40"
|
||||
Width="40"
|
||||
Grid.Column="0"
|
||||
Width="40"
|
||||
Height="40"
|
||||
Margin="4"
|
||||
Background="{StaticResource CardBackgroundFillColorDefaultBrush}"
|
||||
Foreground="{StaticResource OrangeBrush}"
|
||||
IsIndeterminate="False"
|
||||
Maximum="{Binding GuarenteeOrangeThreshold}"
|
||||
Value="{Binding LastOrangePull}"
|
||||
Foreground="{StaticResource OrangeBrush}"
|
||||
Background="{StaticResource CardBackgroundFillColorDefaultBrush}"/>
|
||||
Value="{Binding LastOrangePull}"/>
|
||||
<TextBlock
|
||||
Margin="0,0,0,2"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Grid.Column="0"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Text="{Binding LastOrangePull}"
|
||||
Foreground="{StaticResource OrangeBrush}"/>
|
||||
<TextBlock
|
||||
Margin="0,0,0,2"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{StaticResource OrangeBrush}"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Text="{Binding LastOrangePull}"/>
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
Margin="0,0,0,2"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{StaticResource OrangeBrush}"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="五星"
|
||||
Foreground="{StaticResource OrangeBrush}"/>
|
||||
Text="五星"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
BorderThickness="1"
|
||||
CornerRadius="{StaticResource CompatCornerRadius}"
|
||||
Background="{StaticResource CardBackgroundFillColorDefault}"
|
||||
BorderBrush="{StaticResource CardStrokeColorDefault}"
|
||||
Background="{StaticResource CardBackgroundFillColorDefault}">
|
||||
BorderThickness="1"
|
||||
CornerRadius="{StaticResource CompatCornerRadius}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ProgressRing
|
||||
Margin="4"
|
||||
Height="40"
|
||||
Width="40"
|
||||
Grid.Column="0"
|
||||
Width="40"
|
||||
Height="40"
|
||||
Margin="4"
|
||||
Background="{StaticResource CardBackgroundFillColorDefaultBrush}"
|
||||
Foreground="{StaticResource PurpleBrush}"
|
||||
IsIndeterminate="False"
|
||||
Maximum="{Binding GuarenteePurpleThreshold}"
|
||||
Value="{Binding LastPurplePull}"
|
||||
Foreground="{StaticResource PurpleBrush}"
|
||||
Background="{StaticResource CardBackgroundFillColorDefaultBrush}"/>
|
||||
Value="{Binding LastPurplePull}"/>
|
||||
<TextBlock
|
||||
Margin="0,0,0,2"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Grid.Column="0"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Text="{Binding LastPurplePull}"
|
||||
Foreground="{StaticResource PurpleBrush}"/>
|
||||
<TextBlock
|
||||
Margin="0,0,0,2"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{StaticResource PurpleBrush}"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Text="{Binding LastPurplePull}"/>
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
Margin="0,0,0,2"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{StaticResource PurpleBrush}"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="四星"
|
||||
Foreground="{StaticResource PurpleBrush}"/>
|
||||
Text="四星"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,8,0,0">
|
||||
<StackPanel Margin="0,8,0,0" Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Opacity="0.6"
|
||||
FontFamily="Consolas"
|
||||
HorizontalAlignment="Left"
|
||||
FontFamily="Consolas"
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding FromFormatted}"/>
|
||||
<TextBlock
|
||||
Opacity="0.6"
|
||||
FontFamily="Consolas"
|
||||
Text="-"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"/>
|
||||
<TextBlock
|
||||
Opacity="0.6"
|
||||
FontFamily="Consolas"
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="-"/>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Left"
|
||||
FontFamily="Consolas"
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding ToFormatted}"/>
|
||||
</StackPanel>
|
||||
@@ -249,73 +251,69 @@
|
||||
<MenuFlyoutSeparator Margin="-12,0"/>
|
||||
<StackPanel Grid.Row="3" Margin="0,12,0,0">
|
||||
<Grid>
|
||||
<TextBlock
|
||||
Text="五星"
|
||||
<TextBlock
|
||||
Foreground="{StaticResource OrangeBrush}"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Foreground="{StaticResource OrangeBrush}"/>
|
||||
<TextBlock
|
||||
Text="五星"/>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
FontFamily="Consolas"
|
||||
Foreground="{StaticResource OrangeBrush}"
|
||||
FontFamily="Consolas"
|
||||
Foreground="{StaticResource OrangeBrush}"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Text="{Binding TotalOrangeFormatted}"/>
|
||||
</Grid>
|
||||
<Grid Margin="0,2,0,0">
|
||||
<TextBlock
|
||||
Text="四星"
|
||||
<TextBlock
|
||||
Foreground="{StaticResource PurpleBrush}"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Foreground="{StaticResource PurpleBrush}"/>
|
||||
<TextBlock
|
||||
Text="四星"/>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
FontFamily="Consolas"
|
||||
Foreground="{StaticResource PurpleBrush}"
|
||||
FontFamily="Consolas"
|
||||
Foreground="{StaticResource PurpleBrush}"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Text="{Binding TotalPurpleFormatted}"/>
|
||||
</Grid>
|
||||
<Grid Margin="0,2,0,0">
|
||||
<TextBlock
|
||||
Text="三星"
|
||||
<TextBlock
|
||||
Foreground="{StaticResource BlueBrush}"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Foreground="{StaticResource BlueBrush}"/>
|
||||
<TextBlock
|
||||
Text="三星"/>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
FontFamily="Consolas"
|
||||
Foreground="{StaticResource BlueBrush}"
|
||||
FontFamily="Consolas"
|
||||
Foreground="{StaticResource BlueBrush}"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Text="{Binding TotalBlueFormatted}"/>
|
||||
</Grid>
|
||||
|
||||
|
||||
<Grid Margin="0,2,0,0">
|
||||
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Text="五星平均抽数"/>
|
||||
<TextBlock
|
||||
Text="五星平均抽数"
|
||||
Style="{StaticResource BodyTextBlockStyle}"/>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
FontFamily="Consolas,MicroSoft YaHei UI"
|
||||
Text="{Binding AverageOrangePullFormatted}"
|
||||
Style="{StaticResource BodyTextBlockStyle}"/>
|
||||
</Grid>
|
||||
<Grid Margin="0,2,0,0">
|
||||
<TextBlock
|
||||
Text="UP 平均抽数"
|
||||
Style="{StaticResource BodyTextBlockStyle}"/>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
FontFamily="Consolas,MicroSoft YaHei UI"
|
||||
Text="{Binding AverageUpOrangePullFormatted}"
|
||||
Style="{StaticResource BodyTextBlockStyle}"/>
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Text="{Binding AverageOrangePullFormatted}"/>
|
||||
</Grid>
|
||||
<Grid Margin="0,2,0,0">
|
||||
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Text="UP 平均抽数"/>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
FontFamily="Consolas,MicroSoft YaHei UI"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Text="{Binding AverageUpOrangePullFormatted}"/>
|
||||
</Grid>
|
||||
<Grid Margin="0,2,0,0">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Left"
|
||||
FontFamily="Consolas,MicroSoft YaHei UI"
|
||||
Text="{Binding MaxOrangePullFormatted}"
|
||||
Style="{StaticResource BodyTextBlockStyle}"/>
|
||||
FontFamily="Consolas,MicroSoft YaHei UI"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Text="{Binding MaxOrangePullFormatted}"/>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
FontFamily="Consolas,MicroSoft YaHei UI"
|
||||
Text="{Binding MinOrangePullFormatted}"
|
||||
Style="{StaticResource BodyTextBlockStyle}"/>
|
||||
FontFamily="Consolas,MicroSoft YaHei UI"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Text="{Binding MinOrangePullFormatted}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<MenuFlyoutSeparator Margin="-12,12,-12,0"/>
|
||||
@@ -325,20 +323,18 @@
|
||||
Grid.Row="2"
|
||||
Margin="12,6,12,12"
|
||||
VerticalScrollBarVisibility="Hidden">
|
||||
<cwucont:SwitchPresenter Value="{Binding ElementName=ItemsPanelSelector,Path=Current}">
|
||||
<cwucont:SwitchPresenter Value="{Binding ElementName=ItemsPanelSelector, Path=Current}">
|
||||
<cwucont:SwitchPresenter.ContentTransitions>
|
||||
<ContentThemeTransition/>
|
||||
</cwucont:SwitchPresenter.ContentTransitions>
|
||||
<cwucont:Case Value="List">
|
||||
<ItemsControl
|
||||
ItemsSource="{Binding OrangeList}"
|
||||
ItemTemplate="{StaticResource OrangeListTemplate}"/>
|
||||
<ItemsControl ItemTemplate="{StaticResource OrangeListTemplate}" ItemsSource="{Binding OrangeList}"/>
|
||||
</cwucont:Case>
|
||||
<cwucont:Case Value="Grid">
|
||||
<ItemsControl
|
||||
Margin="0,0,-4,0"
|
||||
ItemsSource="{Binding OrangeList}"
|
||||
ItemTemplate="{StaticResource OrangeGridTemplate}">
|
||||
ItemTemplate="{StaticResource OrangeGridTemplate}"
|
||||
ItemsSource="{Binding OrangeList}">
|
||||
<ItemsControl.Transitions>
|
||||
<ReorderThemeTransition/>
|
||||
</ItemsControl.Transitions>
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<ContentDialog
|
||||
x:Class="Snap.Hutao.View.Dialog.AchievementArchiveCreateDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
Title="设置成就存档的名称"
|
||||
CloseButtonText="取消"
|
||||
DefaultButton="Primary"
|
||||
PrimaryButtonText="确认"
|
||||
CloseButtonText="取消"
|
||||
Style="{StaticResource DefaultContentDialogStyle}">
|
||||
Style="{StaticResource DefaultContentDialogStyle}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
<TextBox
|
||||
Margin="0,0,0,8"
|
||||
x:Name="InputText"
|
||||
PlaceholderText="在此处输入"
|
||||
VerticalAlignment="Top"/>
|
||||
Margin="0,0,0,8"
|
||||
VerticalAlignment="Top"
|
||||
PlaceholderText="在此处输入"/>
|
||||
</Grid>
|
||||
</ContentDialog>
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<ContentDialog
|
||||
x:Class="Snap.Hutao.View.Dialog.AchievementImportDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:cwuc="using:CommunityToolkit.WinUI.UI.Controls"
|
||||
mc:Ignorable="d"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="为当前存档导入成就"
|
||||
CloseButtonText="取消"
|
||||
DefaultButton="Primary"
|
||||
PrimaryButtonText="确认"
|
||||
CloseButtonText="取消"
|
||||
Style="{StaticResource DefaultContentDialogStyle}">
|
||||
Style="{StaticResource DefaultContentDialogStyle}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
@@ -19,50 +19,50 @@
|
||||
</Grid.RowDefinitions>
|
||||
<cwuc:UniformGrid
|
||||
Grid.Row="0"
|
||||
Columns="3"
|
||||
ColumnSpacing="16"
|
||||
Columns="3"
|
||||
RowSpacing="16">
|
||||
<cwuc:HeaderedContentControl Header="导出App">
|
||||
<TextBlock
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Opacity="0.6"
|
||||
Margin="0,4,0,0"
|
||||
Text="{x:Bind UIAF.Info.ExportApp,Mode=OneWay,TargetNullValue=未知}"/>
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{x:Bind UIAF.Info.ExportApp, Mode=OneWay, TargetNullValue=未知}"/>
|
||||
</cwuc:HeaderedContentControl>
|
||||
<cwuc:HeaderedContentControl Header="导出时间">
|
||||
<TextBlock
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Opacity="0.6"
|
||||
Margin="0,4,0,0"
|
||||
Text="{x:Bind UIAF.Info.ExportDateTime.LocalDateTime,Mode=OneWay,TargetNullValue=未知}"/>
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{x:Bind UIAF.Info.ExportDateTime.LocalDateTime, Mode=OneWay, TargetNullValue=未知}"/>
|
||||
</cwuc:HeaderedContentControl>
|
||||
<cwuc:HeaderedContentControl Header="导出App版本">
|
||||
<TextBlock
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Opacity="0.6"
|
||||
Margin="0,4,0,0"
|
||||
Text="{x:Bind UIAF.Info.ExportAppVersion,Mode=OneWay,TargetNullValue=未知}"/>
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{x:Bind UIAF.Info.ExportAppVersion, Mode=OneWay, TargetNullValue=未知}"/>
|
||||
</cwuc:HeaderedContentControl>
|
||||
<cwuc:HeaderedContentControl Header="UIAF 版本">
|
||||
<TextBlock
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Opacity="0.6"
|
||||
Margin="0,4,0,0"
|
||||
Text="{x:Bind UIAF.Info.UIAFVersion,Mode=OneWay,TargetNullValue=未知}"/>
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{x:Bind UIAF.Info.UIAFVersion, Mode=OneWay, TargetNullValue=未知}"/>
|
||||
</cwuc:HeaderedContentControl>
|
||||
<cwuc:HeaderedContentControl Header="成就个数">
|
||||
<TextBlock
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Opacity="0.6"
|
||||
Margin="0,4,0,0"
|
||||
Text="{x:Bind UIAF.List.Count,Mode=OneWay,TargetNullValue=未知}"/>
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{x:Bind UIAF.List.Count, Mode=OneWay, TargetNullValue=未知}"/>
|
||||
</cwuc:HeaderedContentControl>
|
||||
</cwuc:UniformGrid>
|
||||
<RadioButtons
|
||||
Name="ImportModeSelector"
|
||||
Header="导入模式"
|
||||
Grid.Row="1"
|
||||
Margin="0,16,0,0"
|
||||
Header="导入模式"
|
||||
SelectedIndex="0">
|
||||
<RadioButton Content="贪婪(添加新数据,更新已完成项)"/>
|
||||
<RadioButton Content="懒惰(添加新数据,跳过已完成项)"/>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<ContentDialog
|
||||
x:Class="Snap.Hutao.View.Dialog.AdoptCalculatorDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="米游社养成计算"
|
||||
Closed="OnContentDialogClosed"
|
||||
DefaultButton="Primary"
|
||||
PrimaryButtonText="完成"
|
||||
Style="{StaticResource DefaultContentDialogStyle}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Loaded="OnGridLoaded">
|
||||
<WebView2
|
||||
Name="WebView"
|
||||
Width="380"
|
||||
Height="500"/>
|
||||
</Grid>
|
||||
</ContentDialog>
|
||||
@@ -0,0 +1,78 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using Microsoft.Web.WebView2.Core;
|
||||
using Snap.Hutao.Model.Binding.User;
|
||||
using Snap.Hutao.Service.User;
|
||||
using Snap.Hutao.Web.Bridge;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
|
||||
namespace Snap.Hutao.View.Dialog;
|
||||
|
||||
/// <summary>
|
||||
/// 养成计算器对话框
|
||||
/// </summary>
|
||||
public sealed partial class AdoptCalculatorDialog : ContentDialog
|
||||
{
|
||||
private readonly IServiceScope scope;
|
||||
[SuppressMessage("", "IDE0052")]
|
||||
private CalculatorJsInterface? dailyNoteJsInterface;
|
||||
|
||||
/// <summary>
|
||||
/// 构造一个新的养成计算器对话框
|
||||
/// </summary>
|
||||
/// <param name="window">窗体</param>
|
||||
public AdoptCalculatorDialog(Window window)
|
||||
{
|
||||
InitializeComponent();
|
||||
XamlRoot = window.Content.XamlRoot;
|
||||
scope = Ioc.Default.CreateScope();
|
||||
}
|
||||
|
||||
private void OnGridLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
InitializeAsync().SafeForget();
|
||||
}
|
||||
|
||||
private async Task InitializeAsync()
|
||||
{
|
||||
await WebView.EnsureCoreWebView2Async();
|
||||
CoreWebView2 coreWebView2 = WebView.CoreWebView2;
|
||||
|
||||
IUserService userService = scope.ServiceProvider.GetRequiredService<IUserService>();
|
||||
User? user = userService.Current;
|
||||
|
||||
if (user == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
coreWebView2.SetCookie(user.CookieToken, user.Ltoken, null).SetMobileUserAgent();
|
||||
dailyNoteJsInterface = new(coreWebView2, scope.ServiceProvider);
|
||||
|
||||
#if DEBUG
|
||||
coreWebView2.OpenDevToolsWindow();
|
||||
#endif
|
||||
coreWebView2.Navigate($"http://webstatic.mihoyo.com/ys/event/e20200923adopt_calculator/index.html?bbs_presentation_style=fullscreen&bbs_auth_required=true&&utm_source=bbs&utm_medium=mys&utm_campaign=GameRecord");
|
||||
}
|
||||
|
||||
private void OnContentDialogClosed(ContentDialog sender, ContentDialogClosedEventArgs args)
|
||||
{
|
||||
dailyNoteJsInterface = null;
|
||||
scope.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -2,21 +2,20 @@
|
||||
x:Class="Snap.Hutao.View.Dialog.AvatarInfoQueryDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Snap.Hutao.View.Dialog"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
IsPrimaryButtonEnabled="False"
|
||||
Title="查询UID对应的橱窗"
|
||||
DefaultButton="Primary"
|
||||
PrimaryButtonText="请输入UID"
|
||||
CloseButtonText="取消"
|
||||
Style="{StaticResource DefaultContentDialogStyle}">
|
||||
DefaultButton="Primary"
|
||||
IsPrimaryButtonEnabled="False"
|
||||
PrimaryButtonText="请输入UID"
|
||||
Style="{StaticResource DefaultContentDialogStyle}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
<TextBox
|
||||
x:Name="InputText"
|
||||
TextChanged="InputTextChanged"
|
||||
PlaceholderText="请输入UID"/>
|
||||
PlaceholderText="请输入UID"
|
||||
TextChanged="InputTextChanged"/>
|
||||
</Grid>
|
||||
</ContentDialog>
|
||||
|
||||
@@ -1,44 +1,45 @@
|
||||
<ContentDialog
|
||||
x:Class="Snap.Hutao.View.Dialog.DailyNoteNotificationDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:sc="using:SettingsUI.Controls"
|
||||
xmlns:shme="using:Snap.Hutao.Model.Entity"
|
||||
mc:Ignorable="d"
|
||||
Title="设置实时便笺通知"
|
||||
d:DataContext="{d:DesignInstance shme:DailyNoteEntry}"
|
||||
DefaultButton="Primary"
|
||||
PrimaryButtonText="保存"
|
||||
Style="{StaticResource DefaultContentDialogStyle}"
|
||||
d:DataContext="{d:DesignInstance shme:DailyNoteEntry}">
|
||||
mc:Ignorable="d">
|
||||
<ScrollViewer>
|
||||
<sc:SettingsGroup Margin="0,-24,0,0" Header="{Binding UserGameRole}">
|
||||
<sc:Setting Header="原粹树脂提醒阈值" Padding="16,8">
|
||||
<Slider Margin="32,0,0,0" MinWidth="160" Minimum="0" Maximum="160" Value="{Binding ResinNotifyThreshold,Mode=TwoWay}"/>
|
||||
<sc:Setting Padding="16,8" Header="原粹树脂提醒阈值">
|
||||
<Slider
|
||||
MinWidth="160"
|
||||
Margin="32,0,0,0"
|
||||
Maximum="160"
|
||||
Minimum="0"
|
||||
Value="{Binding ResinNotifyThreshold, Mode=TwoWay}"/>
|
||||
</sc:Setting>
|
||||
<sc:Setting Header="洞天宝钱提醒阈值" Padding="16,8">
|
||||
<Slider MinWidth="160" Minimum="0" Maximum="2400" Value="{Binding HomeCoinNotifyThreshold,Mode=TwoWay}"/>
|
||||
<sc:Setting Padding="16,8" Header="洞天宝钱提醒阈值">
|
||||
<Slider
|
||||
MinWidth="160"
|
||||
Maximum="2400"
|
||||
Minimum="0"
|
||||
Value="{Binding HomeCoinNotifyThreshold, Mode=TwoWay}"/>
|
||||
</sc:Setting>
|
||||
<sc:Setting Header="参量质变仪提醒" Padding="16,8">
|
||||
<ToggleSwitch
|
||||
Style="{StaticResource ToggleSwitchSettingStyle}"
|
||||
IsOn="{Binding TransformerNotify,Mode=TwoWay}"/>
|
||||
<sc:Setting Padding="16,8" Header="参量质变仪提醒">
|
||||
<ToggleSwitch IsOn="{Binding TransformerNotify, Mode=TwoWay}" Style="{StaticResource ToggleSwitchSettingStyle}"/>
|
||||
</sc:Setting>
|
||||
<sc:Setting Header="每日委托上线提醒" Padding="16,8">
|
||||
<ToggleSwitch
|
||||
Style="{StaticResource ToggleSwitchSettingStyle}"
|
||||
IsOn="{Binding DailyTaskNotify,Mode=TwoWay}"/>
|
||||
<sc:Setting Padding="16,8" Header="每日委托上线提醒">
|
||||
<ToggleSwitch IsOn="{Binding DailyTaskNotify, Mode=TwoWay}" Style="{StaticResource ToggleSwitchSettingStyle}"/>
|
||||
</sc:Setting>
|
||||
<sc:Setting Header="探索派遣完成提醒" Padding="16,8">
|
||||
<ToggleSwitch
|
||||
Style="{StaticResource ToggleSwitchSettingStyle}"
|
||||
IsOn="{Binding ExpeditionNotify,Mode=TwoWay}"/>
|
||||
<sc:Setting Padding="16,8" Header="探索派遣完成提醒">
|
||||
<ToggleSwitch IsOn="{Binding ExpeditionNotify, Mode=TwoWay}" Style="{StaticResource ToggleSwitchSettingStyle}"/>
|
||||
</sc:Setting>
|
||||
<sc:Setting Header="在主页显示卡片" Padding="16,8">
|
||||
<ToggleSwitch
|
||||
Style="{StaticResource ToggleSwitchSettingStyle}"
|
||||
IsOn="{Binding ShowInHomeWidget,Mode=TwoWay}"/>
|
||||
<sc:Setting Padding="16,8" Header="在主页显示卡片">
|
||||
<ToggleSwitch IsOn="{Binding ShowInHomeWidget, Mode=TwoWay}" Style="{StaticResource ToggleSwitchSettingStyle}"/>
|
||||
</sc:Setting>
|
||||
</sc:SettingsGroup>
|
||||
</ScrollViewer>
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
<ContentDialog
|
||||
x:Class="Snap.Hutao.View.Dialog.DailyNoteVerificationDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
Closed="OnContentDialogClosed"
|
||||
Style="{StaticResource DefaultContentDialogStyle}"
|
||||
Title="米游社实时便笺"
|
||||
Closed="OnContentDialogClosed"
|
||||
DefaultButton="Primary"
|
||||
PrimaryButtonText="完成"
|
||||
DefaultButton="Primary">
|
||||
Style="{StaticResource DefaultContentDialogStyle}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Loaded="OnGridLoaded">
|
||||
<WebView2 Name="WebView" Height="448" Width="380"/>
|
||||
<WebView2
|
||||
Name="WebView"
|
||||
Width="380"
|
||||
Height="448"/>
|
||||
</Grid>
|
||||
</ContentDialog>
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<ContentDialog
|
||||
x:Class="Snap.Hutao.View.Dialog.GachaLogImportDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:cwuc="using:CommunityToolkit.WinUI.UI.Controls"
|
||||
mc:Ignorable="d"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="导入祈愿记录"
|
||||
CloseButtonText="取消"
|
||||
DefaultButton="Primary"
|
||||
PrimaryButtonText="确认"
|
||||
CloseButtonText="取消"
|
||||
Style="{StaticResource DefaultContentDialogStyle}">
|
||||
Style="{StaticResource DefaultContentDialogStyle}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
@@ -19,50 +19,50 @@
|
||||
</Grid.RowDefinitions>
|
||||
<cwuc:UniformGrid
|
||||
Grid.Row="0"
|
||||
Columns="3"
|
||||
ColumnSpacing="16"
|
||||
Columns="3"
|
||||
RowSpacing="16">
|
||||
<cwuc:HeaderedContentControl Header="导出App">
|
||||
<TextBlock
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Opacity="0.6"
|
||||
Margin="0,4,0,0"
|
||||
Text="{x:Bind UIGF.Info.ExportApp,Mode=OneWay,TargetNullValue=未知}"/>
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{x:Bind UIGF.Info.ExportApp, Mode=OneWay, TargetNullValue=未知}"/>
|
||||
</cwuc:HeaderedContentControl>
|
||||
<cwuc:HeaderedContentControl Header="导出时间">
|
||||
<TextBlock
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Opacity="0.6"
|
||||
Margin="0,4,0,0"
|
||||
Text="{x:Bind UIGF.Info.ExportDateTime.LocalDateTime,Mode=OneWay,TargetNullValue=未知}"/>
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{x:Bind UIGF.Info.ExportDateTime.LocalDateTime, Mode=OneWay, TargetNullValue=未知}"/>
|
||||
</cwuc:HeaderedContentControl>
|
||||
<cwuc:HeaderedContentControl Header="导出App版本">
|
||||
<TextBlock
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Opacity="0.6"
|
||||
Margin="0,4,0,0"
|
||||
Text="{x:Bind UIGF.Info.ExportAppVersion,Mode=OneWay,TargetNullValue=未知}"/>
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{x:Bind UIGF.Info.ExportAppVersion, Mode=OneWay, TargetNullValue=未知}"/>
|
||||
</cwuc:HeaderedContentControl>
|
||||
<cwuc:HeaderedContentControl Header="UIGF 版本">
|
||||
<TextBlock
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Opacity="0.6"
|
||||
Margin="0,4,0,0"
|
||||
Text="{x:Bind UIGF.Info.UIGFVersion,Mode=OneWay,TargetNullValue=未知}"/>
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{x:Bind UIGF.Info.UIGFVersion, Mode=OneWay, TargetNullValue=未知}"/>
|
||||
</cwuc:HeaderedContentControl>
|
||||
<cwuc:HeaderedContentControl Header="记录条数">
|
||||
<TextBlock
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Opacity="0.6"
|
||||
Margin="0,4,0,0"
|
||||
Text="{x:Bind UIGF.List.Count,Mode=OneWay,TargetNullValue=未知}"/>
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{x:Bind UIGF.List.Count, Mode=OneWay, TargetNullValue=未知}"/>
|
||||
</cwuc:HeaderedContentControl>
|
||||
<cwuc:HeaderedContentControl Header="UID">
|
||||
<TextBlock
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Opacity="0.6"
|
||||
Margin="0,4,0,0"
|
||||
Text="{x:Bind UIGF.Info.Uid,Mode=OneWay,TargetNullValue=未知}"/>
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{x:Bind UIGF.Info.Uid, Mode=OneWay, TargetNullValue=未知}"/>
|
||||
</cwuc:HeaderedContentControl>
|
||||
</cwuc:UniformGrid>
|
||||
</Grid>
|
||||
|
||||
@@ -1,34 +1,30 @@
|
||||
<ContentDialog
|
||||
x:Class="Snap.Hutao.View.Dialog.GachaLogRefreshProgressDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:cwucont="using:CommunityToolkit.WinUI.UI.Controls"
|
||||
xmlns:cwuconv="using:CommunityToolkit.WinUI.UI.Converters"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:shvc="using:Snap.Hutao.View.Control"
|
||||
mc:Ignorable="d"
|
||||
Title="获取祈愿物品中"
|
||||
Style="{StaticResource DefaultContentDialogStyle}"
|
||||
Title="获取祈愿物品中">
|
||||
mc:Ignorable="d">
|
||||
|
||||
<ContentDialog.Resources>
|
||||
<cwuconv:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
|
||||
<DataTemplate x:Key="GachaItemDataTemplate">
|
||||
<Grid
|
||||
Width="40"
|
||||
Height="40">
|
||||
<Grid Width="40" Height="40">
|
||||
<shvc:ItemIcon
|
||||
Icon="{Binding Icon}"
|
||||
Badge="{Binding Badge}"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ContentDialog.Resources>
|
||||
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
Text="祈愿记录Url已失效,请重新获取"
|
||||
Visibility="{x:Bind State.AuthKeyTimeout,Converter={StaticResource BoolToVisibilityConverter},Mode=OneWay}"/>
|
||||
<TextBlock Text="祈愿记录Url已失效,请重新获取" Visibility="{x:Bind State.AuthKeyTimeout, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}"/>
|
||||
<cwucont:HeaderedItemsControl
|
||||
x:Name="GachaItemsPresenter"
|
||||
Padding="0,8,0,0"
|
||||
@@ -36,7 +32,10 @@
|
||||
ItemTemplate="{StaticResource GachaItemDataTemplate}">
|
||||
<cwucont:HeaderedItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<cwucont:UniformGrid Columns="5" ColumnSpacing="4" RowSpacing="4"/>
|
||||
<cwucont:UniformGrid
|
||||
ColumnSpacing="4"
|
||||
Columns="5"
|
||||
RowSpacing="4"/>
|
||||
</ItemsPanelTemplate>
|
||||
</cwucont:HeaderedItemsControl.ItemsPanel>
|
||||
</cwucont:HeaderedItemsControl>
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
<ContentDialog
|
||||
x:Class="Snap.Hutao.View.Dialog.GachaLogUrlDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
Title="手动输入祈愿记录Url"
|
||||
CloseButtonText="取消"
|
||||
DefaultButton="Primary"
|
||||
PrimaryButtonText="确认"
|
||||
CloseButtonText="取消"
|
||||
Style="{StaticResource DefaultContentDialogStyle}">
|
||||
Style="{StaticResource DefaultContentDialogStyle}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
<TextBox
|
||||
x:Name="InputText"
|
||||
PlaceholderText="请输入Url"/>
|
||||
<TextBox x:Name="InputText" PlaceholderText="请输入Url"/>
|
||||
</Grid>
|
||||
</ContentDialog>
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<ContentDialog
|
||||
x:Class="Snap.Hutao.View.Dialog.GameAccountNameDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
Title="为账号命名"
|
||||
CloseButtonText="取消"
|
||||
DefaultButton="Primary"
|
||||
PrimaryButtonText="确认"
|
||||
CloseButtonText="取消"
|
||||
Style="{StaticResource DefaultContentDialogStyle}">
|
||||
Style="{StaticResource DefaultContentDialogStyle}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
<TextBox
|
||||
Margin="0,0,0,0"
|
||||
x:Name="InputText"
|
||||
PlaceholderText="在此处输入"
|
||||
VerticalAlignment="Top"/>
|
||||
Margin="0,0,0,0"
|
||||
VerticalAlignment="Top"
|
||||
PlaceholderText="在此处输入"/>
|
||||
</Grid>
|
||||
</ContentDialog>
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
<ContentDialog
|
||||
x:Class="Snap.Hutao.View.Dialog.LoginMihoyoBBSDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
Title="登录到米游社"
|
||||
CloseButtonText="取消"
|
||||
DefaultButton="Primary"
|
||||
PrimaryButtonText="确认"
|
||||
CloseButtonText="取消"
|
||||
Style="{StaticResource DefaultContentDialogStyle}">
|
||||
Style="{StaticResource DefaultContentDialogStyle}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<TextBox
|
||||
Name="AccountTextBox"
|
||||
Margin="0,16,0,0"
|
||||
PlaceholderText="请输入账号"
|
||||
Name="AccountTextBox"/>
|
||||
PlaceholderText="请输入账号"/>
|
||||
<PasswordBox
|
||||
Name="PasswordTextBox"
|
||||
Margin="0,16,0,0"
|
||||
PlaceholderText="请输入密码"
|
||||
Name="PasswordTextBox"/>
|
||||
PlaceholderText="请输入密码"/>
|
||||
|
||||
<TextBlock
|
||||
Margin="0,16,0,0"
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
<ContentDialog
|
||||
x:Class="Snap.Hutao.View.Dialog.SignInWebViewDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
Closed="OnContentDialogClosed"
|
||||
Style="{StaticResource DefaultContentDialogStyle}"
|
||||
Title="米游社每日签到"
|
||||
Closed="OnContentDialogClosed"
|
||||
DefaultButton="Primary"
|
||||
PrimaryButtonText="完成"
|
||||
DefaultButton="Primary">
|
||||
Style="{StaticResource DefaultContentDialogStyle}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Loaded="OnGridLoaded">
|
||||
<WebView2 Name="WebView" Height="456" Width="380"/>
|
||||
<WebView2
|
||||
Name="WebView"
|
||||
Width="380"
|
||||
Height="456"/>
|
||||
</Grid>
|
||||
</ContentDialog>
|
||||
|
||||
@@ -40,7 +40,6 @@ public sealed partial class SignInWebViewDialog : ContentDialog
|
||||
await WebView.EnsureCoreWebView2Async();
|
||||
CoreWebView2 coreWebView2 = WebView.CoreWebView2;
|
||||
IUserService userService = scope.ServiceProvider.GetRequiredService<IUserService>();
|
||||
|
||||
User? user = userService.Current;
|
||||
|
||||
if (user == null)
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
<ContentDialog
|
||||
x:Class="Snap.Hutao.View.Dialog.UserDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:settings="using:SettingsUI.Controls"
|
||||
mc:Ignorable="d"
|
||||
IsPrimaryButtonEnabled="False"
|
||||
Title="设置 Cookie"
|
||||
DefaultButton="Primary"
|
||||
PrimaryButtonText="请输入Cookie"
|
||||
CloseButtonText="取消"
|
||||
Style="{StaticResource DefaultContentDialogStyle}">
|
||||
DefaultButton="Primary"
|
||||
IsPrimaryButtonEnabled="False"
|
||||
PrimaryButtonText="请输入Cookie"
|
||||
Style="{StaticResource DefaultContentDialogStyle}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<StackPanel>
|
||||
<TextBox
|
||||
Margin="0,0,0,8"
|
||||
x:Name="InputText"
|
||||
TextChanged="InputTextChanged"
|
||||
Margin="0,0,0,8"
|
||||
VerticalAlignment="Top"
|
||||
PlaceholderText="在此处输入包含 Stoken 的字符串"
|
||||
VerticalAlignment="Top"/>
|
||||
TextChanged="InputTextChanged"/>
|
||||
<settings:SettingsGroup Margin="0,-48,0,0">
|
||||
<settings:Setting
|
||||
Icon=""
|
||||
Header="Github 上的第三方工具"
|
||||
HorizontalAlignment="Stretch"
|
||||
Description="HolographicHat/GetToken"
|
||||
HorizontalAlignment="Stretch">
|
||||
Header="Github 上的第三方工具"
|
||||
Icon="">
|
||||
<HyperlinkButton
|
||||
Margin="12,0,0,0"
|
||||
Padding="6"
|
||||
@@ -33,10 +33,10 @@
|
||||
NavigateUri="https://github.com/HolographicHat/GetToken/releases/latest"/>
|
||||
</settings:Setting>
|
||||
<settings:Setting
|
||||
Icon=""
|
||||
Header="操作文档"
|
||||
HorizontalAlignment="Stretch"
|
||||
Description="进入文档页面并按指示操作"
|
||||
HorizontalAlignment="Stretch">
|
||||
Header="操作文档"
|
||||
Icon="">
|
||||
<HyperlinkButton
|
||||
Margin="12,0,0,0"
|
||||
Padding="6"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<UserControl
|
||||
x:Class="Snap.Hutao.View.MainView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:shcm="using:Snap.Hutao.Control.Markup"
|
||||
xmlns:shv="using:Snap.Hutao.View"
|
||||
@@ -16,65 +16,70 @@
|
||||
<NavigationView
|
||||
x:Name="NavView"
|
||||
CompactPaneLength="48"
|
||||
OpenPaneLength="188"
|
||||
PaneDisplayMode="Left"
|
||||
IsBackEnabled="{Binding ElementName=ContentFrame, Path=CanGoBack}"
|
||||
IsPaneOpen="True"
|
||||
IsBackEnabled="{Binding ElementName=ContentFrame,Path=CanGoBack}">
|
||||
OpenPaneLength="188"
|
||||
PaneDisplayMode="Left">
|
||||
<NavigationView.MenuItems>
|
||||
<NavigationViewItem
|
||||
Content="活动公告"
|
||||
shvh:NavHelper.NavigateTo="shvp:AnnouncementPage"
|
||||
Content="活动公告"
|
||||
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_BtnIcon_ActivityEntry.png}"/>
|
||||
|
||||
<NavigationViewItemHeader Content="工具"/>
|
||||
|
||||
<NavigationViewItem
|
||||
Content="启动游戏"
|
||||
shvh:NavHelper.NavigateTo="shvp:LaunchGamePage"
|
||||
Content="启动游戏"
|
||||
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_GuideIcon_PlayMethod.png}"/>
|
||||
|
||||
<NavigationViewItem
|
||||
Content="祈愿记录"
|
||||
shvh:NavHelper.NavigateTo="shvp:GachaLogPage"
|
||||
Content="祈愿记录"
|
||||
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_BtnIcon_Gacha.png}"/>
|
||||
|
||||
<NavigationViewItem
|
||||
Content="实时便笺"
|
||||
shvh:NavHelper.NavigateTo="shvp:DailyNotePage"
|
||||
Content="实时便笺"
|
||||
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_ItemIcon_210.png}"/>
|
||||
|
||||
<NavigationViewItem
|
||||
Content="成就管理"
|
||||
shvh:NavHelper.NavigateTo="shvp:AchievementPage"
|
||||
Content="成就管理"
|
||||
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_Icon_Achievement.png}"/>
|
||||
|
||||
<NavigationViewItem
|
||||
Content="属性统计"
|
||||
shvh:NavHelper.NavigateTo="shvp:AvatarPropertyPage"
|
||||
Content="我的角色"
|
||||
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_Icon_BoostUp.png}"/>
|
||||
|
||||
|
||||
<NavigationViewItem
|
||||
shvh:NavHelper.NavigateTo="shvp:CultivationPage"
|
||||
Content="养成计划"
|
||||
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_HomeWorldTabIcon_2_Team.png}"/>
|
||||
|
||||
<NavigationViewItem
|
||||
Content="深渊统计"
|
||||
shvh:NavHelper.NavigateTo="shvp:HutaoDatabasePage"
|
||||
Content="深渊统计"
|
||||
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_ChapterIcon_Hutao.png}"/>
|
||||
|
||||
|
||||
<NavigationViewItemHeader Content="WIKI"/>
|
||||
|
||||
<NavigationViewItem
|
||||
Content="角色资料"
|
||||
shvh:NavHelper.NavigateTo="shvp:WikiAvatarPage"
|
||||
Content="角色资料"
|
||||
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_BagTabIcon_Avatar.png}"/>
|
||||
|
||||
|
||||
<NavigationViewItem
|
||||
Content="武器资料"
|
||||
shvh:NavHelper.NavigateTo="shvp:WikiWeaponPage"
|
||||
Content="武器资料"
|
||||
Icon="{shcm:BitmapIcon Source=ms-appx:///Resource/Icon/UI_BagTabIcon_Weapon.png}"/>
|
||||
</NavigationView.MenuItems>
|
||||
|
||||
<NavigationView.PaneFooter>
|
||||
<shv:UserView/>
|
||||
</NavigationView.PaneFooter>
|
||||
|
||||
|
||||
<Frame x:Name="ContentFrame">
|
||||
<Frame.ContentTransitions>
|
||||
<NavigationThemeTransition/>
|
||||
@@ -84,8 +89,8 @@
|
||||
|
||||
<StackPanel
|
||||
x:Name="InfoBarStack"
|
||||
Margin="32,48,32,32"
|
||||
MaxWidth="640"
|
||||
Margin="32,48,32,32"
|
||||
VerticalAlignment="Bottom">
|
||||
<StackPanel.Resources>
|
||||
<ResourceDictionary>
|
||||
@@ -93,46 +98,46 @@
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<AcrylicBrush
|
||||
x:Key="InfoBarErrorSeverityBackgroundBrush"
|
||||
TintOpacity="0.6"
|
||||
FallbackColor="#FDE7E9"
|
||||
TintColor="#FDE7E9"
|
||||
FallbackColor="#FDE7E9"/>
|
||||
TintOpacity="0.6"/>
|
||||
<AcrylicBrush
|
||||
x:Key="InfoBarWarningSeverityBackgroundBrush"
|
||||
TintOpacity="0.6"
|
||||
FallbackColor="#FFF4CE"
|
||||
TintColor="#FFF4CE"
|
||||
FallbackColor="#FFF4CE"/>
|
||||
TintOpacity="0.6"/>
|
||||
<AcrylicBrush
|
||||
x:Key="InfoBarSuccessSeverityBackgroundBrush"
|
||||
TintOpacity="0.6"
|
||||
FallbackColor="#DFF6DD"
|
||||
TintColor="#DFF6DD"
|
||||
FallbackColor="#DFF6DD"/>
|
||||
TintOpacity="0.6"/>
|
||||
<AcrylicBrush
|
||||
x:Key="InfoBarInformationalSeverityBackgroundBrush"
|
||||
TintOpacity="0.6"
|
||||
FallbackColor="#80F6F6F6"
|
||||
TintColor="#80F6F6F6"
|
||||
FallbackColor="#80F6F6F6"/>
|
||||
TintOpacity="0.6"/>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<AcrylicBrush
|
||||
x:Key="InfoBarErrorSeverityBackgroundBrush"
|
||||
TintOpacity="0.6"
|
||||
FallbackColor="#442726"
|
||||
TintColor="#442726"
|
||||
FallbackColor="#442726"/>
|
||||
TintOpacity="0.6"/>
|
||||
<AcrylicBrush
|
||||
x:Key="InfoBarWarningSeverityBackgroundBrush"
|
||||
TintOpacity="0.6"
|
||||
FallbackColor="#433519"
|
||||
TintColor="#433519"
|
||||
FallbackColor="#433519"/>
|
||||
TintOpacity="0.6"/>
|
||||
<AcrylicBrush
|
||||
x:Key="InfoBarSuccessSeverityBackgroundBrush"
|
||||
TintOpacity="0.6"
|
||||
FallbackColor="#393D1B"
|
||||
TintColor="#393D1B"
|
||||
FallbackColor="#393D1B"/>
|
||||
TintOpacity="0.6"/>
|
||||
<AcrylicBrush
|
||||
x:Key="InfoBarInformationalSeverityBackgroundBrush"
|
||||
TintOpacity="0.6"
|
||||
FallbackColor="#34424d"
|
||||
TintColor="#34424d"
|
||||
FallbackColor="#34424d"/>
|
||||
TintOpacity="0.6"/>
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
</ResourceDictionary>
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<shc:ScopedPage
|
||||
x:Class="Snap.Hutao.View.Page.AchievementPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:mxic="using:Microsoft.Xaml.Interactions.Core"
|
||||
xmlns:mxi="using:Microsoft.Xaml.Interactivity"
|
||||
xmlns:mxic="using:Microsoft.Xaml.Interactions.Core"
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance shv:AchievementViewModel}"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
d:DataContext="{d:DesignInstance shv:AchievementViewModel}">
|
||||
mc:Ignorable="d">
|
||||
|
||||
<mxi:Interaction.Behaviors>
|
||||
<shcb:InvokeCommandOnLoadedBehavior Command="{Binding OpenUICommand}"/>
|
||||
</mxi:Interaction.Behaviors>
|
||||
|
||||
<Grid Visibility="{Binding IsInitialized,Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
<Grid Visibility="{Binding IsInitialized, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
@@ -29,27 +29,23 @@
|
||||
<ColumnDefinition Width="252"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<CommandBar
|
||||
Grid.Column="1"
|
||||
DefaultLabelPosition="Right">
|
||||
|
||||
|
||||
<CommandBar Grid.Column="1" DefaultLabelPosition="Right">
|
||||
|
||||
<CommandBar.Content>
|
||||
<AutoSuggestBox
|
||||
Text="{Binding SearchText,Mode=TwoWay}"
|
||||
Height="36"
|
||||
PlaceholderText="搜索成就名称,描述或编号"
|
||||
HorizontalAlignment="Stretch"
|
||||
Margin="12,6,12,0"
|
||||
Width="240"
|
||||
Height="36"
|
||||
Margin="12,6,12,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalContentAlignment="Center"
|
||||
PlaceholderText="搜索成就名称,描述或编号"
|
||||
QueryIcon="{shcm:FontIcon Glyph=}"
|
||||
Style="{StaticResource DefaultAutoSuggestBoxStyle}"
|
||||
QueryIcon="{shcm:FontIcon Glyph=}">
|
||||
Text="{Binding SearchText, Mode=TwoWay}">
|
||||
<mxi:Interaction.Behaviors>
|
||||
<mxic:EventTriggerBehavior EventName="QuerySubmitted">
|
||||
<mxic:InvokeCommandAction
|
||||
Command="{Binding SearchAchievementCommand}"
|
||||
CommandParameter="{Binding SearchText}"/>
|
||||
<mxic:InvokeCommandAction Command="{Binding SearchAchievementCommand}" CommandParameter="{Binding SearchText}"/>
|
||||
</mxic:EventTriggerBehavior>
|
||||
</mxi:Interaction.Behaviors>
|
||||
</AutoSuggestBox>
|
||||
@@ -57,64 +53,62 @@
|
||||
|
||||
<AppBarElementContainer>
|
||||
<ComboBox
|
||||
MinWidth="120"
|
||||
Height="36"
|
||||
MinWidth="120"
|
||||
Margin="2,6,3,6"
|
||||
DisplayMemberPath="Name"
|
||||
ItemsSource="{Binding Archives,Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedArchive,Mode=TwoWay}"/>
|
||||
ItemsSource="{Binding Archives, Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedArchive, Mode=TwoWay}"/>
|
||||
</AppBarElementContainer>
|
||||
<AppBarButton
|
||||
Label="创建新存档"
|
||||
Command="{Binding AddArchiveCommand}"
|
||||
Icon="{shcm:FontIcon Glyph=}"
|
||||
Command="{Binding AddArchiveCommand}"/>
|
||||
Label="创建新存档"/>
|
||||
<AppBarButton
|
||||
Label="删除当前存档"
|
||||
Command="{Binding RemoveArchiveCommand}"
|
||||
Icon="{shcm:FontIcon Glyph=}"
|
||||
Command="{Binding RemoveArchiveCommand}"/>
|
||||
|
||||
Label="删除当前存档"/>
|
||||
|
||||
<AppBarSeparator/>
|
||||
|
||||
<AppBarButton
|
||||
Label="导入"
|
||||
Icon="{shcm:FontIcon Glyph=}">
|
||||
|
||||
<AppBarButton Icon="{shcm:FontIcon Glyph=}" Label="导入">
|
||||
<AppBarButton.Flyout>
|
||||
<MenuFlyout Placement="BottomEdgeAlignedRight">
|
||||
<MenuFlyoutItem
|
||||
Text="从剪贴板导入"
|
||||
Command="{Binding ImportUIAFFromClipboardCommand}"
|
||||
Icon="{shcm:FontIcon Glyph=}"
|
||||
Command="{Binding ImportUIAFFromClipboardCommand}"/>
|
||||
Text="从剪贴板导入"/>
|
||||
<MenuFlyoutItem
|
||||
Text="从 UIAF 文件导入"
|
||||
Command="{Binding ImportUIAFFromFileCommand}"
|
||||
Icon="{shcm:FontIcon Glyph=}"
|
||||
Command="{Binding ImportUIAFFromFileCommand}"/>
|
||||
Text="从 UIAF 文件导入"/>
|
||||
</MenuFlyout>
|
||||
</AppBarButton.Flyout>
|
||||
</AppBarButton>
|
||||
<AppBarButton
|
||||
Label="导出"
|
||||
Command="{Binding ExportAsUIAFToFileCommand}"
|
||||
Icon="{shcm:FontIcon Glyph=}"
|
||||
Command="{Binding ExportAsUIAFToFileCommand}"/>
|
||||
Label="导出"/>
|
||||
<AppBarSeparator/>
|
||||
<AppBarToggleButton
|
||||
Label="优先未完成"
|
||||
Command="{Binding SortIncompletedSwitchCommand}"
|
||||
Icon="{shcm:FontIcon Glyph=}"
|
||||
IsChecked="{Binding IsIncompletedItemsFirst}"
|
||||
Command="{Binding SortIncompletedSwitchCommand}"/>
|
||||
Label="优先未完成"/>
|
||||
</CommandBar>
|
||||
</Grid>
|
||||
|
||||
|
||||
<SplitView
|
||||
Grid.Row="1"
|
||||
IsPaneOpen="True"
|
||||
DisplayMode="Inline"
|
||||
IsPaneOpen="True"
|
||||
OpenPaneLength="252"
|
||||
PaneBackground="Transparent">
|
||||
<SplitView.Pane>
|
||||
<ListView
|
||||
SelectionMode="Single"
|
||||
SelectedItem="{Binding SelectedAchievementGoal,Mode=TwoWay}"
|
||||
ItemsSource="{Binding AchievementGoals}">
|
||||
ItemsSource="{Binding AchievementGoals}"
|
||||
SelectedItem="{Binding SelectedAchievementGoal, Mode=TwoWay}"
|
||||
SelectionMode="Single">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
@@ -123,14 +117,14 @@
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<shci:CachedImage
|
||||
Grid.Column="0"
|
||||
Width="24"
|
||||
Height="24"
|
||||
Grid.Column="0"
|
||||
Source="{Binding Icon,Converter={StaticResource AchievementIconConverter}}"/>
|
||||
Source="{Binding Icon, Converter={StaticResource AchievementIconConverter}}"/>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Grid.Column="1"
|
||||
Margin="12,0,0,2"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Name}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
@@ -142,20 +136,20 @@
|
||||
<ScrollViewer Padding="0,0,16,0">
|
||||
<ItemsControl
|
||||
Margin="16,0,0,16"
|
||||
ItemsSource="{Binding Achievements}"
|
||||
ItemsPanel="{StaticResource ItemsStackPanelTemplate}">
|
||||
ItemsPanel="{StaticResource ItemsStackPanelTemplate}"
|
||||
ItemsSource="{Binding Achievements}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid
|
||||
CornerRadius="{ThemeResource ControlCornerRadius}"
|
||||
Background="{ThemeResource CardBackgroundBrush}"
|
||||
BorderThickness="{ThemeResource CardBorderThickness}"
|
||||
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
|
||||
Padding="8"
|
||||
MinHeight="48"
|
||||
Margin="0,8,0,0"
|
||||
Padding="8"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
MinHeight="48">
|
||||
Background="{ThemeResource CardBackgroundBrush}"
|
||||
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
|
||||
BorderThickness="{ThemeResource CardBorderThickness}"
|
||||
CornerRadius="{ThemeResource ControlCornerRadius}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
@@ -163,19 +157,19 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<CheckBox
|
||||
IsChecked="{Binding IsChecked,Mode=TwoWay}"
|
||||
Grid.Column="1"
|
||||
Margin="6,0,12,0"
|
||||
Style="{StaticResource DefaultCheckBoxStyle}"
|
||||
Padding="16,0,0,0"
|
||||
Grid.Column="1">
|
||||
IsChecked="{Binding IsChecked, Mode=TwoWay}"
|
||||
Style="{StaticResource DefaultCheckBoxStyle}">
|
||||
<CheckBox.Content>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Inner.Title}"/>
|
||||
<TextBlock
|
||||
Margin="0,2,0,0"
|
||||
Style="{StaticResource SecondaryTextStyle}"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
Text="{Binding Inner.Description}"/>
|
||||
Text="{Binding Inner.Description}"
|
||||
TextTrimming="CharacterEllipsis"/>
|
||||
</StackPanel>
|
||||
</CheckBox.Content>
|
||||
</CheckBox>
|
||||
@@ -186,19 +180,19 @@
|
||||
<ColumnDefinition Width="32"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Margin="12,0,12,0"
|
||||
VerticalAlignment="Center"
|
||||
Grid.Column="0"
|
||||
Text="{Binding Time}"
|
||||
Visibility="{Binding IsChecked,Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||
Visibility="{Binding IsChecked, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||
<Image
|
||||
Grid.Column="1"
|
||||
Height="32"
|
||||
Source="ms-appx:///Resource/Icon/UI_ItemIcon_201.png"/>
|
||||
<TextBlock
|
||||
Grid.Column="2"
|
||||
Margin="12,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Grid.Column="2"
|
||||
Text="{Binding Inner.FinishReward.Count}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<Page
|
||||
x:Class="Snap.Hutao.View.Page.AnnouncementContentPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
ActualThemeChanged="PageActualThemeChanged"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
ActualThemeChanged="PageActualThemeChanged">
|
||||
mc:Ignorable="d">
|
||||
<Page.Transitions>
|
||||
<TransitionCollection>
|
||||
<NavigationThemeTransition>
|
||||
@@ -16,6 +16,6 @@
|
||||
</Page.Transitions>
|
||||
<WebView2
|
||||
x:Name="WebView"
|
||||
IsRightTapEnabled="False"
|
||||
DefaultBackgroundColor="Transparent"/>
|
||||
DefaultBackgroundColor="Transparent"
|
||||
IsRightTapEnabled="False"/>
|
||||
</Page>
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
<shc:ScopedPage
|
||||
x:Class="Snap.Hutao.View.Page.AnnouncementPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:cwu="using:CommunityToolkit.WinUI.UI"
|
||||
xmlns:cwua="using:CommunityToolkit.WinUI.UI.Animations"
|
||||
xmlns:cwub="using:CommunityToolkit.WinUI.UI.Behaviors"
|
||||
xmlns:cwucont="using:CommunityToolkit.WinUI.UI.Controls"
|
||||
xmlns:mxic="using:Microsoft.Xaml.Interactions.Core"
|
||||
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:mxic="using:Microsoft.Xaml.Interactions.Core"
|
||||
xmlns:shc="using:Snap.Hutao.Control"
|
||||
xmlns:shca="using:Snap.Hutao.Control.Animation"
|
||||
xmlns:shcb="using:Snap.Hutao.Control.Behavior"
|
||||
xmlns:shci="using:Snap.Hutao.Control.Image"
|
||||
xmlns:shv="using:Snap.Hutao.ViewModel"
|
||||
d:DataContext="{d:DesignInstance shv:AnnouncementViewModel}"
|
||||
mc:Ignorable="d"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
mc:Ignorable="d">
|
||||
<mxi:Interaction.Behaviors>
|
||||
<shcb:InvokeCommandOnLoadedBehavior Command="{Binding OpenUICommand}"/>
|
||||
</mxi:Interaction.Behaviors>
|
||||
@@ -26,35 +26,31 @@
|
||||
|
||||
<DataTemplate x:Key="AnnouncementTemplate">
|
||||
<cwucont:AdaptiveGridView
|
||||
cwua:ItemsReorderAnimation.Duration="0:0:0.1"
|
||||
SelectionMode="None"
|
||||
DesiredWidth="300"
|
||||
HorizontalAlignment="Stretch"
|
||||
ItemContainerStyle="{StaticResource LargeGridViewItemStyle}"
|
||||
ItemsSource="{Binding List}"
|
||||
Margin="16,16,0,-4">
|
||||
Margin="16,16,0,-4"
|
||||
HorizontalAlignment="Stretch"
|
||||
cwua:ItemsReorderAnimation.Duration="0:0:0.1"
|
||||
DesiredWidth="300"
|
||||
ItemContainerStyle="{StaticResource LargeGridViewItemStyle}"
|
||||
ItemsSource="{Binding List}"
|
||||
SelectionMode="None">
|
||||
<cwucont:AdaptiveGridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border
|
||||
CornerRadius="{StaticResource CompatCornerRadius}"
|
||||
cwu:UIElementExtensions.ClipToBounds="True"
|
||||
Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}"
|
||||
cwu:UIElementExtensions.ClipToBounds="True">
|
||||
CornerRadius="{StaticResource CompatCornerRadius}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<!--Image Layer-->
|
||||
<!-- Image Layer -->
|
||||
<Border cwu:UIElementExtensions.ClipToBounds="True">
|
||||
<Border
|
||||
VerticalAlignment="Top"
|
||||
cwu:VisualExtensions.NormalizedCenterPoint="0.5">
|
||||
<Border VerticalAlignment="Top" cwu:VisualExtensions.NormalizedCenterPoint="0.5">
|
||||
<mxi:Interaction.Behaviors>
|
||||
<shcb:AutoHeightBehavior TargetWidth="1080" TargetHeight="390"/>
|
||||
<shcb:AutoHeightBehavior TargetHeight="390" TargetWidth="1080"/>
|
||||
</mxi:Interaction.Behaviors>
|
||||
<shci:CachedImage
|
||||
Stretch="UniformToFill"
|
||||
Source="{Binding Banner}"/>
|
||||
<shci:CachedImage Source="{Binding Banner}" Stretch="UniformToFill"/>
|
||||
<cwua:Explicit.Animations>
|
||||
<cwua:AnimationSet x:Name="ImageZoomInAnimation">
|
||||
<shca:ImageZoomInAnimation/>
|
||||
@@ -65,42 +61,40 @@
|
||||
</cwua:Explicit.Animations>
|
||||
</Border>
|
||||
</Border>
|
||||
<!--Time Description-->
|
||||
<!-- Time Description -->
|
||||
<Grid Grid.Row="0">
|
||||
<Border
|
||||
Height="24"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Bottom"
|
||||
Visibility="{Binding ShouldShowTimeDescription,Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
Visibility="{Binding ShouldShowTimeDescription, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
<ProgressBar
|
||||
MinHeight="2"
|
||||
Value="{Binding TimePercent,Mode=OneWay}"
|
||||
VerticalAlignment="Bottom"
|
||||
Background="Transparent"
|
||||
CornerRadius="0"
|
||||
Maximum="1"
|
||||
VerticalAlignment="Bottom"
|
||||
Background="Transparent"/>
|
||||
Value="{Binding TimePercent, Mode=OneWay}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<!--General Description-->
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
CornerRadius="{StaticResource CompatCornerRadiusBottom}">
|
||||
<!-- General Description -->
|
||||
<Border Grid.Row="1" CornerRadius="{StaticResource CompatCornerRadiusBottom}">
|
||||
<StackPanel Margin="4" VerticalAlignment="Bottom">
|
||||
<TextBlock
|
||||
Margin="4,6,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
Text="{Binding Subtitle}"
|
||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||
TextWrapping="NoWrap"
|
||||
TextTrimming="WordEllipsis"/>
|
||||
Text="{Binding Subtitle}"
|
||||
TextTrimming="WordEllipsis"
|
||||
TextWrapping="NoWrap"/>
|
||||
|
||||
<TextBlock
|
||||
Text="{Binding Title}"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
TextWrapping="NoWrap"
|
||||
TextTrimming="WordEllipsis"
|
||||
Margin="4,6,0,0"
|
||||
Opacity="0.6"/>
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Text="{Binding Title}"
|
||||
TextTrimming="WordEllipsis"
|
||||
TextWrapping="NoWrap"/>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -108,37 +102,35 @@
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Margin="4,4,0,4"
|
||||
FontSize="10"
|
||||
Opacity="0.4"
|
||||
Margin="4,4,0,4"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding TimeFormatted}"
|
||||
TextWrapping="NoWrap"/>
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
Margin="4,4,4,4"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Bottom"
|
||||
FontSize="10"
|
||||
Opacity="0.8"
|
||||
Margin="4,4,4,4"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Visibility="{Binding ShouldShowTimeDescription,Converter={StaticResource BoolToVisibilityConverter}}"
|
||||
Text="{Binding TimeDescription}" />
|
||||
Text="{Binding TimeDescription}"
|
||||
Visibility="{Binding ShouldShowTimeDescription, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
<mxi:Interaction.Behaviors>
|
||||
<mxic:EventTriggerBehavior EventName="Tapped">
|
||||
<mxic:InvokeCommandAction
|
||||
Command="{Binding DataContext.OpenAnnouncementUICommand,Source={StaticResource BindingProxy}}"
|
||||
CommandParameter="{Binding Content}"/>
|
||||
<mxic:InvokeCommandAction Command="{Binding DataContext.OpenAnnouncementUICommand, Source={StaticResource BindingProxy}}" CommandParameter="{Binding Content}"/>
|
||||
</mxic:EventTriggerBehavior>
|
||||
<mxic:EventTriggerBehavior EventName="PointerEntered">
|
||||
<cwub:StartAnimationAction Animation="{Binding ElementName=ImageZoomInAnimation}" />
|
||||
<cwub:StartAnimationAction Animation="{Binding ElementName=ImageZoomInAnimation}"/>
|
||||
</mxic:EventTriggerBehavior>
|
||||
<mxic:EventTriggerBehavior EventName="PointerExited">
|
||||
<cwub:StartAnimationAction Animation="{Binding ElementName=ImageZoomOutAnimation}" />
|
||||
<cwub:StartAnimationAction Animation="{Binding ElementName=ImageZoomOutAnimation}"/>
|
||||
</mxic:EventTriggerBehavior>
|
||||
</mxi:Interaction.Behaviors>
|
||||
</Border>
|
||||
@@ -152,13 +144,13 @@
|
||||
<StackPanel>
|
||||
<Pivot>
|
||||
<PivotItem
|
||||
Header="活动公告"
|
||||
Content="{Binding Announcement.List[0]}"
|
||||
ContentTemplate="{StaticResource AnnouncementTemplate}"/>
|
||||
ContentTemplate="{StaticResource AnnouncementTemplate}"
|
||||
Header="活动公告"/>
|
||||
<PivotItem
|
||||
Header="游戏公告"
|
||||
Content="{Binding Announcement.List[1]}"
|
||||
ContentTemplate="{StaticResource AnnouncementTemplate}"/>
|
||||
ContentTemplate="{StaticResource AnnouncementTemplate}"
|
||||
Header="游戏公告"/>
|
||||
</Pivot>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
12
src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml
Normal file
12
src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml
Normal file
@@ -0,0 +1,12 @@
|
||||
<shc:ScopedPage
|
||||
x:Class="Snap.Hutao.View.Page.CultivationPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:shc="using:Snap.Hutao.Control"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid/>
|
||||
</shc:ScopedPage>
|
||||
22
src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml.cs
Normal file
22
src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml.cs
Normal file
@@ -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 CultivationPage : ScopedPage
|
||||
{
|
||||
/// <summary>
|
||||
/// 够造一个新的养成页面
|
||||
/// </summary>
|
||||
public CultivationPage()
|
||||
{
|
||||
InitializeWith<CultivationViewModel>();
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -1,59 +1,56 @@
|
||||
<shc:ScopedPage
|
||||
x:Class="Snap.Hutao.View.Page.DailyNotePage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
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:mxic="using:Microsoft.Xaml.Interactions.Core"
|
||||
xmlns:mxim="using:Microsoft.Xaml.Interactions.Media"
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance shv:DailyNoteViewModel}"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<mxi:Interaction.Behaviors>
|
||||
<shcb:InvokeCommandOnLoadedBehavior Command="{Binding OpenUICommand}"/>
|
||||
</mxi:Interaction.Behaviors>
|
||||
|
||||
<Page.Resources>
|
||||
<shc:BindingProxy
|
||||
x:Key="ViewModelBindingProxy"
|
||||
DataContext="{Binding}"/>
|
||||
<shc:BindingProxy x:Key="ViewModelBindingProxy" DataContext="{Binding}"/>
|
||||
</Page.Resources>
|
||||
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<CommandBar
|
||||
Background="{StaticResource CardBackgroundFillColorDefaultBrush}"
|
||||
DefaultLabelPosition="Right">
|
||||
<AppBarButton Label="立即刷新" Icon="{shcm:FontIcon Glyph=}" Command="{Binding RefreshCommand}"/>
|
||||
<AppBarButton Label="添加角色" Icon="{shcm:FontIcon Glyph=}">
|
||||
<CommandBar Background="{StaticResource CardBackgroundFillColorDefaultBrush}" DefaultLabelPosition="Right">
|
||||
<AppBarButton
|
||||
Command="{Binding RefreshCommand}"
|
||||
Icon="{shcm:FontIcon Glyph=}"
|
||||
Label="立即刷新"/>
|
||||
<AppBarButton Icon="{shcm:FontIcon Glyph=}" Label="添加角色">
|
||||
<AppBarButton.Flyout>
|
||||
<Flyout Placement="Bottom" LightDismissOverlayMode="On">
|
||||
<Flyout LightDismissOverlayMode="On" Placement="Bottom">
|
||||
<Flyout.FlyoutPresenterStyle>
|
||||
<Style
|
||||
TargetType="FlyoutPresenter"
|
||||
BasedOn="{StaticResource DefaultFlyoutPresenterStyle}">
|
||||
<Style BasedOn="{StaticResource DefaultFlyoutPresenterStyle}" TargetType="FlyoutPresenter">
|
||||
<Setter Property="Padding" Value="0,2,0,2"/>
|
||||
<Setter Property="Background" Value="{ThemeResource FlyoutPresenterBackground}" />
|
||||
<Setter Property="Background" Value="{ThemeResource FlyoutPresenterBackground}"/>
|
||||
</Style>
|
||||
</Flyout.FlyoutPresenterStyle>
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
Margin="16,12,16,16"
|
||||
Text="添加角色以定时刷新"
|
||||
Style="{StaticResource BaseTextBlockStyle}"/>
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="添加角色以定时刷新"/>
|
||||
<ScrollViewer MaxHeight="320" Padding="16,0">
|
||||
<ItemsControl ItemsSource="{Binding UserAndRoles}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
@@ -64,39 +61,39 @@
|
||||
<TextBlock
|
||||
Margin="0,2,0,0"
|
||||
Opacity="0.6"
|
||||
Text="{Binding Role.Description}"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"/>
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Role.Description}"/>
|
||||
</StackPanel>
|
||||
<Button
|
||||
HorizontalAlignment="Right"
|
||||
Content=""
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
BorderBrush="{x:Null}"
|
||||
Margin="16,0,0,0"
|
||||
Padding="12"
|
||||
Command="{Binding DataContext.TrackRoleCommand,Source={StaticResource ViewModelBindingProxy}}"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderBrush="{x:Null}"
|
||||
BorderThickness="0"
|
||||
Command="{Binding DataContext.TrackRoleCommand, Source={StaticResource ViewModelBindingProxy}}"
|
||||
CommandParameter="{Binding}"
|
||||
Content=""
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
ToolTipService.ToolTip="添加"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
|
||||
|
||||
</StackPanel>
|
||||
</Flyout>
|
||||
</AppBarButton.Flyout>
|
||||
</AppBarButton>
|
||||
<AppBarButton Label="通知设置" Icon="{shcm:FontIcon Glyph=}">
|
||||
<AppBarButton Icon="{shcm:FontIcon Glyph=}" Label="通知设置">
|
||||
<AppBarButton.Flyout>
|
||||
<Flyout Placement="BottomEdgeAlignedRight">
|
||||
<StackPanel>
|
||||
<RadioButtons ItemsSource="{Binding RefreshTimes}" SelectedItem="{Binding SelectedRefreshTime,Mode=TwoWay}">
|
||||
<RadioButtons ItemsSource="{Binding RefreshTimes}" SelectedItem="{Binding SelectedRefreshTime, Mode=TwoWay}">
|
||||
<RadioButtons.Header>
|
||||
<TextBlock Text="刷新间隔时间" Style="{StaticResource BaseTextBlockStyle}"/>
|
||||
<TextBlock Style="{StaticResource BaseTextBlockStyle}" Text="刷新间隔时间"/>
|
||||
</RadioButtons.Header>
|
||||
<RadioButtons.ItemTemplate>
|
||||
<DataTemplate>
|
||||
@@ -104,14 +101,14 @@
|
||||
</DataTemplate>
|
||||
</RadioButtons.ItemTemplate>
|
||||
</RadioButtons>
|
||||
<sc:SettingsGroup Header="通知" Margin="0,-16,0,0">
|
||||
<sc:SettingsGroup Margin="0,-16,0,0" Header="通知">
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Description="防止通知自动收入操作中心"
|
||||
Header="提醒通知"
|
||||
Description="防止通知自动收入操作中心">
|
||||
Icon="">
|
||||
<ToggleSwitch
|
||||
Margin="24,0,0,0"
|
||||
IsOn="{Binding IsReminderNotification,Mode=TwoWay}"
|
||||
IsOn="{Binding IsReminderNotification, Mode=TwoWay}"
|
||||
Style="{StaticResource ToggleSwitchSettingStyle}"/>
|
||||
</sc:Setting>
|
||||
</sc:SettingsGroup>
|
||||
@@ -122,30 +119,28 @@
|
||||
</CommandBar>
|
||||
|
||||
<ScrollViewer Grid.Row="1">
|
||||
<ItemsControl
|
||||
Margin="0,0,0,16"
|
||||
ItemsSource="{Binding DailyNoteEntries}">
|
||||
<ItemsControl Margin="0,0,0,16" ItemsSource="{Binding DailyNoteEntries}">
|
||||
<ItemsControl.ItemContainerTransitions>
|
||||
<AddDeleteThemeTransition />
|
||||
<ContentThemeTransition />
|
||||
<AddDeleteThemeTransition/>
|
||||
<ContentThemeTransition/>
|
||||
<EntranceThemeTransition IsStaggeringEnabled="False"/>
|
||||
</ItemsControl.ItemContainerTransitions>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border
|
||||
Margin="16,16,16,0"
|
||||
BorderThickness="1"
|
||||
Padding="8"
|
||||
CornerRadius="{StaticResource CompatCornerRadius}"
|
||||
Background="{StaticResource CardBackgroundFillColorSecondary}"
|
||||
BorderBrush="{StaticResource CardStrokeColorDefaultBrush}"
|
||||
Background="{StaticResource CardBackgroundFillColorSecondary}">
|
||||
BorderThickness="1"
|
||||
CornerRadius="{StaticResource CompatCornerRadius}">
|
||||
<Grid Background="Transparent">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid HorizontalAlignment="Stretch" MinHeight="40">
|
||||
<Grid MinHeight="40" HorizontalAlignment="Stretch">
|
||||
<TextBlock
|
||||
Margin="4,0,0,4"
|
||||
VerticalAlignment="Center"
|
||||
@@ -153,38 +148,42 @@
|
||||
Text="{Binding UserGameRole}"/>
|
||||
<StackPanel
|
||||
x:Name="ButtonPanel"
|
||||
Visibility="Collapsed"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
Orientation="Horizontal"
|
||||
Visibility="Collapsed">
|
||||
<Button
|
||||
MinHeight="36.8"
|
||||
Content=""
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
Margin="6,0,0,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
BorderBrush="{x:Null}"
|
||||
Margin="6,0,0,0"
|
||||
Command="{Binding DataContext.RemoveDailyNoteCommand,Source={StaticResource ViewModelBindingProxy}}"
|
||||
BorderThickness="0"
|
||||
Command="{Binding DataContext.RemoveDailyNoteCommand, Source={StaticResource ViewModelBindingProxy}}"
|
||||
CommandParameter="{Binding}"
|
||||
Content=""
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
ToolTipService.ToolTip="移除用户"/>
|
||||
<Button
|
||||
MinHeight="36.8"
|
||||
Content=""
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
Margin="8,0,0,0"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
BorderBrush="{x:Null}"
|
||||
Margin="8,0,0,0"
|
||||
Command="{Binding DataContext.ModifyNotificationCommand,Source={StaticResource ViewModelBindingProxy}}"
|
||||
BorderThickness="0"
|
||||
Command="{Binding DataContext.ModifyNotificationCommand, Source={StaticResource ViewModelBindingProxy}}"
|
||||
CommandParameter="{Binding}"
|
||||
Content=""
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
ToolTipService.ToolTip="通知设置"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<cwuc:UniformGrid Grid.Row="1" Columns="5" Margin="0,8,0,0" ColumnSpacing="8">
|
||||
<cwuc:UniformGrid
|
||||
Grid.Row="1"
|
||||
Margin="0,8,0,0"
|
||||
ColumnSpacing="8"
|
||||
Columns="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
@@ -197,33 +196,31 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid
|
||||
Grid.Column="0"
|
||||
Height="40"
|
||||
Width="40">
|
||||
<Image
|
||||
Width="32"
|
||||
Source="ms-appx:///Resource/Icon/UI_ItemIcon_210_256.png" />
|
||||
Width="40"
|
||||
Height="40">
|
||||
<Image Width="32" Source="ms-appx:///Resource/Icon/UI_ItemIcon_210_256.png"/>
|
||||
<ProgressRing
|
||||
Height="40"
|
||||
Width="40"
|
||||
Height="40"
|
||||
Background="{StaticResource CardBackgroundFillColorDefaultBrush}"
|
||||
Maximum="{Binding DailyNote.MaxResin,Mode=OneWay}"
|
||||
Value="{Binding DailyNote.CurrentResin,Mode=OneWay}"
|
||||
IsIndeterminate="False"/>
|
||||
IsIndeterminate="False"
|
||||
Maximum="{Binding DailyNote.MaxResin, Mode=OneWay}"
|
||||
Value="{Binding DailyNote.CurrentResin, Mode=OneWay}"/>
|
||||
</Grid>
|
||||
<TextBlock
|
||||
Margin="12,0,0,4"
|
||||
Grid.Column="1"
|
||||
Margin="12,0,0,4"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||
Text="{Binding DailyNote.ResinFormatted,Mode=OneWay}"/>
|
||||
Text="{Binding DailyNote.ResinFormatted, Mode=OneWay}"/>
|
||||
</Grid>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Opacity="0.6"
|
||||
Margin="4,4,0,0"
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding DailyNote.ResinRecoveryTargetTime,Mode=OneWay}"/>
|
||||
Text="{Binding DailyNote.ResinRecoveryTargetTime, Mode=OneWay}"/>
|
||||
</Grid>
|
||||
|
||||
<Grid>
|
||||
@@ -238,33 +235,31 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid
|
||||
Grid.Column="0"
|
||||
Height="40"
|
||||
Width="40">
|
||||
<Image
|
||||
Width="32"
|
||||
Source="ms-appx:///Resource/Icon/UI_ItemIcon_204.png" />
|
||||
Width="40"
|
||||
Height="40">
|
||||
<Image Width="32" Source="ms-appx:///Resource/Icon/UI_ItemIcon_204.png"/>
|
||||
<ProgressRing
|
||||
Height="40"
|
||||
Width="40"
|
||||
Height="40"
|
||||
Background="{StaticResource CardBackgroundFillColorDefaultBrush}"
|
||||
Maximum="{Binding DailyNote.MaxHomeCoin,Mode=OneWay}"
|
||||
Value="{Binding DailyNote.CurrentHomeCoin,Mode=OneWay}"
|
||||
IsIndeterminate="False"/>
|
||||
IsIndeterminate="False"
|
||||
Maximum="{Binding DailyNote.MaxHomeCoin, Mode=OneWay}"
|
||||
Value="{Binding DailyNote.CurrentHomeCoin, Mode=OneWay}"/>
|
||||
</Grid>
|
||||
<TextBlock
|
||||
Margin="12,0,0,4"
|
||||
Grid.Column="1"
|
||||
Margin="12,0,0,4"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||
Text="{Binding DailyNote.HomeCoinFormatted,Mode=OneWay}"/>
|
||||
Text="{Binding DailyNote.HomeCoinFormatted, Mode=OneWay}"/>
|
||||
</Grid>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Opacity="0.6"
|
||||
Margin="4,4,0,0"
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding DailyNote.HomeCoinRecoveryTargetTimeFormatted,Mode=OneWay}"/>
|
||||
Text="{Binding DailyNote.HomeCoinRecoveryTargetTimeFormatted, Mode=OneWay}"/>
|
||||
</Grid>
|
||||
|
||||
<Grid>
|
||||
@@ -279,33 +274,31 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid
|
||||
Grid.Column="0"
|
||||
Height="40"
|
||||
Width="40">
|
||||
<Image
|
||||
Width="32"
|
||||
Source="ms-appx:///Resource/Icon/UI_MarkQuest_Events_Proce.png" />
|
||||
Width="40"
|
||||
Height="40">
|
||||
<Image Width="32" Source="ms-appx:///Resource/Icon/UI_MarkQuest_Events_Proce.png"/>
|
||||
<ProgressRing
|
||||
Height="40"
|
||||
Width="40"
|
||||
Height="40"
|
||||
Background="{StaticResource CardBackgroundFillColorDefaultBrush}"
|
||||
Maximum="{Binding DailyNote.TotalTaskNum,Mode=OneWay}"
|
||||
Value="{Binding DailyNote.FinishedTaskNum,Mode=OneWay}"
|
||||
IsIndeterminate="False"/>
|
||||
IsIndeterminate="False"
|
||||
Maximum="{Binding DailyNote.TotalTaskNum, Mode=OneWay}"
|
||||
Value="{Binding DailyNote.FinishedTaskNum, Mode=OneWay}"/>
|
||||
</Grid>
|
||||
<TextBlock
|
||||
Margin="12,0,0,4"
|
||||
Grid.Column="1"
|
||||
Margin="12,0,0,4"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||
Text="{Binding DailyNote.TaskFormatted,Mode=OneWay}"/>
|
||||
Text="{Binding DailyNote.TaskFormatted, Mode=OneWay}"/>
|
||||
</Grid>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Opacity="0.6"
|
||||
Margin="4,4,0,0"
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding DailyNote.ExtraTaskRewardDescription,Mode=OneWay}"/>
|
||||
Text="{Binding DailyNote.ExtraTaskRewardDescription, Mode=OneWay}"/>
|
||||
</Grid>
|
||||
|
||||
<Grid>
|
||||
@@ -320,31 +313,29 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid
|
||||
Grid.Column="0"
|
||||
Height="40"
|
||||
Width="40">
|
||||
<Image
|
||||
Width="32"
|
||||
Source="ms-appx:///Resource/Icon/UI_MarkTower.png" />
|
||||
Width="40"
|
||||
Height="40">
|
||||
<Image Width="32" Source="ms-appx:///Resource/Icon/UI_MarkTower.png"/>
|
||||
<ProgressRing
|
||||
Height="40"
|
||||
Width="40"
|
||||
Height="40"
|
||||
Background="{StaticResource CardBackgroundFillColorDefaultBrush}"
|
||||
Maximum="{Binding DailyNote.ResinDiscountNumLimit,Mode=OneWay}"
|
||||
Value="{Binding DailyNote.ResinDiscountUsedNum,Mode=OneWay}"
|
||||
IsIndeterminate="False"/>
|
||||
IsIndeterminate="False"
|
||||
Maximum="{Binding DailyNote.ResinDiscountNumLimit, Mode=OneWay}"
|
||||
Value="{Binding DailyNote.ResinDiscountUsedNum, Mode=OneWay}"/>
|
||||
</Grid>
|
||||
<TextBlock
|
||||
Margin="12,0,0,4"
|
||||
Grid.Column="1"
|
||||
Margin="12,0,0,4"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||
Text="{Binding DailyNote.ResinDiscountFormatted,Mode=OneWay}"/>
|
||||
Text="{Binding DailyNote.ResinDiscountFormatted, Mode=OneWay}"/>
|
||||
</Grid>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Opacity="0.6"
|
||||
Margin="4,4,0,0"
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="本周已消耗减半次数"/>
|
||||
</Grid>
|
||||
@@ -361,40 +352,41 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid
|
||||
Grid.Column="0"
|
||||
Height="40"
|
||||
Width="40">
|
||||
<Image
|
||||
Width="32"
|
||||
Source="ms-appx:///Resource/Icon/UI_ItemIcon_220021.png" />
|
||||
Width="40"
|
||||
Height="40">
|
||||
<Image Width="32" Source="ms-appx:///Resource/Icon/UI_ItemIcon_220021.png"/>
|
||||
<ProgressRing
|
||||
Height="40"
|
||||
Width="40"
|
||||
Height="40"
|
||||
Background="{StaticResource CardBackgroundFillColorDefaultBrush}"
|
||||
IsIndeterminate="False"
|
||||
Maximum="604800"
|
||||
Value="{Binding DailyNote.Transformer.RecoveryTime.TotalSeconds,Mode=OneWay}"
|
||||
IsIndeterminate="False"/>
|
||||
Value="{Binding DailyNote.Transformer.RecoveryTime.TotalSeconds, Mode=OneWay}"/>
|
||||
</Grid>
|
||||
<TextBlock
|
||||
Margin="12,0,0,4"
|
||||
Grid.Column="1"
|
||||
Margin="12,0,0,4"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||
Text="{Binding DailyNote.Transformer.RecoveryTime.ReachedFormatted,Mode=OneWay}"/>
|
||||
Text="{Binding DailyNote.Transformer.RecoveryTime.ReachedFormatted, Mode=OneWay}"/>
|
||||
</Grid>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Opacity="0.6"
|
||||
Margin="4,4,0,0"
|
||||
Opacity="0.6"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding DailyNote.Transformer.RecoveryTime.TimeFormatted,Mode=OneWay}"/>
|
||||
Text="{Binding DailyNote.Transformer.RecoveryTime.TimeFormatted, Mode=OneWay}"/>
|
||||
</Grid>
|
||||
</cwuc:UniformGrid>
|
||||
|
||||
<ItemsControl Margin="0,16,0,0" Grid.Row="2" ItemsSource="{Binding DailyNote.Expeditions,Mode=OneWay}">
|
||||
<ItemsControl
|
||||
Grid.Row="2"
|
||||
Margin="0,16,0,0"
|
||||
ItemsSource="{Binding DailyNote.Expeditions, Mode=OneWay}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<cwuc:UniformGrid Columns="5" ColumnSpacing="8"/>
|
||||
<cwuc:UniformGrid ColumnSpacing="8" Columns="5"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
@@ -411,26 +403,26 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid
|
||||
Grid.Column="0"
|
||||
Height="40"
|
||||
Width="40">
|
||||
Width="40"
|
||||
Height="40">
|
||||
<shci:CachedImage
|
||||
Width="32"
|
||||
Margin="0,0,0,8"
|
||||
Source="{Binding AvatarSideIcon,Mode=OneWay}" />
|
||||
Source="{Binding AvatarSideIcon, Mode=OneWay}"/>
|
||||
<ProgressRing
|
||||
Height="40"
|
||||
Width="40"
|
||||
Height="40"
|
||||
Background="{StaticResource CardBackgroundFillColorDefaultBrush}"
|
||||
Maximum="{Binding TotalTime,Mode=OneWay}"
|
||||
Value="{Binding PassedTime,Mode=OneWay}"
|
||||
IsIndeterminate="False"/>
|
||||
IsIndeterminate="False"
|
||||
Maximum="{Binding TotalTime, Mode=OneWay}"
|
||||
Value="{Binding PassedTime, Mode=OneWay}"/>
|
||||
</Grid>
|
||||
<TextBlock
|
||||
Margin="12,0,0,4"
|
||||
Grid.Column="1"
|
||||
Margin="12,0,0,4"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{Binding RemainedTimeFormatted,Mode=OneWay}"/>
|
||||
Text="{Binding RemainedTimeFormatted, Mode=OneWay}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
@@ -439,9 +431,7 @@
|
||||
|
||||
<Grid.Resources>
|
||||
<Storyboard x:Name="ButtonPanelVisibleStoryboard">
|
||||
<ObjectAnimationUsingKeyFrames
|
||||
Storyboard.TargetName="ButtonPanel"
|
||||
Storyboard.TargetProperty="Visibility">
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPanel" Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<Visibility>Visible</Visibility>
|
||||
@@ -451,9 +441,7 @@
|
||||
</Storyboard>
|
||||
|
||||
<Storyboard x:Name="ButtonPanelCollapsedStoryboard">
|
||||
<ObjectAnimationUsingKeyFrames
|
||||
Storyboard.TargetName="ButtonPanel"
|
||||
Storyboard.TargetProperty="Visibility">
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPanel" Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<Visibility>Collapsed</Visibility>
|
||||
@@ -477,6 +465,6 @@
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
|
||||
|
||||
</Grid>
|
||||
</shc:ScopedPage>
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<shc:ScopedPage
|
||||
x:Class="Snap.Hutao.View.Page.GachaLogPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:mxi="using:Microsoft.Xaml.Interactivity"
|
||||
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"
|
||||
xmlns:shci="using:Snap.Hutao.Control.Image"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance shv:GachaLogViewModel}"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<mxi:Interaction.Behaviors>
|
||||
<shcb:InvokeCommandOnLoadedBehavior Command="{Binding OpenUICommand}"/>
|
||||
</mxi:Interaction.Behaviors>
|
||||
|
||||
<Grid Visibility="{Binding IsInitialized,Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
<Grid Visibility="{Binding IsInitialized, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
<Rectangle
|
||||
Height="48"
|
||||
VerticalAlignment="Top"
|
||||
@@ -27,71 +27,67 @@
|
||||
<Pivot Grid.RowSpan="2">
|
||||
<Pivot.LeftHeader>
|
||||
<ComboBox
|
||||
MinWidth="120"
|
||||
Height="36"
|
||||
MinWidth="120"
|
||||
Margin="16,6,0,6"
|
||||
DisplayMemberPath="Uid"
|
||||
SelectedItem="{Binding SelectedArchive,Mode=TwoWay}"
|
||||
ItemsSource="{Binding Archives}"/>
|
||||
ItemsSource="{Binding Archives}"
|
||||
SelectedItem="{Binding SelectedArchive, Mode=TwoWay}"/>
|
||||
</Pivot.LeftHeader>
|
||||
<Pivot.RightHeader>
|
||||
<CommandBar DefaultLabelPosition="Right">
|
||||
<AppBarButton Label="刷新" Icon="{shcm:FontIcon Glyph=}">
|
||||
<AppBarButton Icon="{shcm:FontIcon Glyph=}" Label="刷新">
|
||||
<AppBarButton.Flyout>
|
||||
<MenuFlyout Placement="Bottom">
|
||||
<MenuFlyoutItem
|
||||
Text="Stoken刷新"
|
||||
Command="{Binding RefreshByStokenCommand}"
|
||||
Icon="{shcm:FontIcon Glyph=}"
|
||||
Command="{Binding RefreshByStokenCommand}"/>
|
||||
Text="Stoken刷新"/>
|
||||
<MenuFlyoutItem
|
||||
Text="从缓存刷新"
|
||||
Command="{Binding RefreshByWebCacheCommand}"
|
||||
Icon="{shcm:FontIcon Glyph=}"
|
||||
Command="{Binding RefreshByWebCacheCommand}"/>
|
||||
Text="从缓存刷新"/>
|
||||
<MenuFlyoutItem
|
||||
Text="手动输入Url"
|
||||
Command="{Binding RefreshByManualInputCommand}"
|
||||
Icon="{shcm:FontIcon Glyph=}"
|
||||
Command="{Binding RefreshByManualInputCommand}"/>
|
||||
Text="手动输入Url"/>
|
||||
<ToggleMenuFlyoutItem
|
||||
Text="全量刷新"
|
||||
Icon="{shcm:FontIcon Glyph=}"
|
||||
IsChecked="{Binding IsAggressiveRefresh}"/>
|
||||
IsChecked="{Binding IsAggressiveRefresh}"
|
||||
Text="全量刷新"/>
|
||||
</MenuFlyout>
|
||||
</AppBarButton.Flyout>
|
||||
</AppBarButton>
|
||||
<AppBarSeparator/>
|
||||
<AppBarButton Label="导入" Icon="{shcm:FontIcon Glyph=}">
|
||||
<AppBarButton Icon="{shcm:FontIcon Glyph=}" Label="导入">
|
||||
<AppBarButton.Flyout>
|
||||
<MenuFlyout Placement="Bottom">
|
||||
<MenuFlyoutItem Command="{Binding ImportFromUIGFJsonCommand}" Text="从 UIGF Json 文件导入"/>
|
||||
<MenuFlyoutItem
|
||||
Text="从 UIGF Json 文件导入"
|
||||
Command="{Binding ImportFromUIGFJsonCommand}"/>
|
||||
<MenuFlyoutItem
|
||||
Text="从 UIGF Excel 文件导入"
|
||||
Command="{Binding ImportFromUIGFExcelCommand}"
|
||||
IsEnabled="False"
|
||||
Visibility="Collapsed"
|
||||
Command="{Binding ImportFromUIGFExcelCommand}"/>
|
||||
Text="从 UIGF Excel 文件导入"
|
||||
Visibility="Collapsed"/>
|
||||
</MenuFlyout>
|
||||
</AppBarButton.Flyout>
|
||||
</AppBarButton>
|
||||
<AppBarButton Label="导出" Icon="{shcm:FontIcon Glyph=}">
|
||||
<AppBarButton Icon="{shcm:FontIcon Glyph=}" Label="导出">
|
||||
<AppBarButton.Flyout>
|
||||
<MenuFlyout Placement="Bottom">
|
||||
<MenuFlyoutItem Command="{Binding ExportToUIGFJsonCommand}" Text="导出到 UIGF Json 文件"/>
|
||||
<MenuFlyoutItem
|
||||
Text="导出到 UIGF Json 文件"
|
||||
Command="{Binding ExportToUIGFJsonCommand}"/>
|
||||
<MenuFlyoutItem
|
||||
Text="导出到 UIGF Excel 文件"
|
||||
Command="{Binding ExportToUIGFExcelCommand}"
|
||||
IsEnabled="False"
|
||||
Visibility="Collapsed"
|
||||
Command="{Binding ExportToUIGFExcelCommand}"/>
|
||||
Text="导出到 UIGF Excel 文件"
|
||||
Visibility="Collapsed"/>
|
||||
</MenuFlyout>
|
||||
</AppBarButton.Flyout>
|
||||
</AppBarButton>
|
||||
<CommandBar.SecondaryCommands>
|
||||
<AppBarButton
|
||||
Label="删除当前存档"
|
||||
Command="{Binding RemoveArchiveCommand}"
|
||||
Icon="{shcm:FontIcon Glyph=}"
|
||||
Command="{Binding RemoveArchiveCommand}"/>
|
||||
Label="删除当前存档"/>
|
||||
</CommandBar.SecondaryCommands>
|
||||
</CommandBar>
|
||||
</Pivot.RightHeader>
|
||||
@@ -104,16 +100,16 @@
|
||||
<ColumnDefinition Width="auto" MinWidth="16"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<shvc:StatisticsCard
|
||||
Margin="16,16,0,16"
|
||||
Grid.Column="0"
|
||||
Margin="16,16,0,16"
|
||||
DataContext="{Binding Statistics.AvatarWish}"/>
|
||||
<shvc:StatisticsCard
|
||||
Margin="16,16,0,16"
|
||||
Grid.Column="1"
|
||||
Margin="16,16,0,16"
|
||||
DataContext="{Binding Statistics.WeaponWish}"/>
|
||||
<shvc:StatisticsCard
|
||||
Margin="16,16,0,16"
|
||||
Grid.Column="2"
|
||||
Margin="16,16,0,16"
|
||||
DataContext="{Binding Statistics.PermanentWish}"/>
|
||||
</Grid>
|
||||
</PivotItem>
|
||||
@@ -124,9 +120,7 @@
|
||||
OpenPaneLength="296"
|
||||
PaneBackground="Transparent">
|
||||
<SplitView.Pane>
|
||||
<ListView
|
||||
ItemsSource="{Binding Statistics.HistoryWishes}"
|
||||
SelectedItem="{Binding SelectedHistoryWish,Mode=TwoWay}">
|
||||
<ListView ItemsSource="{Binding Statistics.HistoryWishes}" SelectedItem="{Binding SelectedHistoryWish, Mode=TwoWay}">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
@@ -135,31 +129,30 @@
|
||||
<RowDefinition/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,8,0,0">
|
||||
<StackPanel Margin="0,8,0,0" Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Width="32"
|
||||
Text="{Binding Version}"
|
||||
Style="{StaticResource BaseTextBlockStyle}"/>
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{Binding Version}"/>
|
||||
<TextBlock
|
||||
Margin="0,0,0,0"
|
||||
Text="{Binding Name}"
|
||||
Style="{StaticResource BaseTextBlockStyle}"/>
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{Binding Name}"/>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<TextBlock
|
||||
Margin="0,8,0,0"
|
||||
Text="{Binding TotalCountFormatted}"
|
||||
HorizontalAlignment="Right"
|
||||
Style="{StaticResource BaseTextBlockStyle}"/>
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{Binding TotalCountFormatted}"/>
|
||||
<Border
|
||||
CornerRadius="{StaticResource CompatCornerRadiusSmall}"
|
||||
Grid.Row="1"
|
||||
Margin="0,6,0,0"
|
||||
Padding="2"
|
||||
Grid.Row="1"
|
||||
HorizontalAlignment="Left"
|
||||
Background="{StaticResource CardBackgroundFillColorDefault}">
|
||||
<ItemsControl
|
||||
ItemsSource="{Binding OrangeUpList}">
|
||||
Background="{StaticResource CardBackgroundFillColorDefault}"
|
||||
CornerRadius="{StaticResource CompatCornerRadiusSmall}">
|
||||
<ItemsControl ItemsSource="{Binding OrangeUpList}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal"/>
|
||||
@@ -182,14 +175,13 @@
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
<Border
|
||||
CornerRadius="{StaticResource CompatCornerRadiusSmall}"
|
||||
Grid.Row="1"
|
||||
Margin="0,6,0,0"
|
||||
Padding="2"
|
||||
Grid.Row="1"
|
||||
HorizontalAlignment="Right"
|
||||
Background="{StaticResource CardBackgroundFillColorDefault}">
|
||||
<ItemsControl
|
||||
ItemsSource="{Binding PurpleUpList}">
|
||||
Background="{StaticResource CardBackgroundFillColorDefault}"
|
||||
CornerRadius="{StaticResource CompatCornerRadiusSmall}">
|
||||
<ItemsControl ItemsSource="{Binding PurpleUpList}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal"/>
|
||||
@@ -213,18 +205,18 @@
|
||||
</Border>
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
Orientation="Horizontal"
|
||||
Margin="0,6,0,8"
|
||||
Opacity="0.6"
|
||||
Margin="0,6,0,8">
|
||||
Orientation="Horizontal">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Left"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Text="{Binding FromFormatted}"/>
|
||||
<TextBlock
|
||||
Text=" - "
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left"
|
||||
Style="{StaticResource BodyTextBlockStyle}"/>
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Text=" - "/>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Left"
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
@@ -236,37 +228,38 @@
|
||||
</ListView>
|
||||
</SplitView.Pane>
|
||||
<SplitView.Content>
|
||||
|
||||
|
||||
<ScrollViewer>
|
||||
<StackPanel Margin="16,0,16,0">
|
||||
<Border
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0,16,0,0"
|
||||
BorderThickness="1"
|
||||
HorizontalAlignment="Left"
|
||||
BorderBrush="{StaticResource CardStrokeColorDefault}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="{StaticResource CompatCornerRadius}">
|
||||
<shci:CachedImage
|
||||
MaxHeight="320"
|
||||
Source="{Binding SelectedHistoryWish.BannerImage}"/>
|
||||
<shci:CachedImage MaxHeight="320" Source="{Binding SelectedHistoryWish.BannerImage}"/>
|
||||
</Border>
|
||||
|
||||
<TextBlock Text="五星" Style="{StaticResource BaseTextBlockStyle}" Margin="0,16,0,8"/>
|
||||
|
||||
<TextBlock
|
||||
Margin="0,16,0,8"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="五星"/>
|
||||
<GridView ItemsSource="{Binding SelectedHistoryWish.OrangeList}">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<shvc:ItemIcon
|
||||
Badge="{Binding Badge}"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"
|
||||
Badge="{Binding Badge}"/>
|
||||
Quality="{Binding Quality}"/>
|
||||
<Border
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Background="#80000000"
|
||||
CornerRadius="0,6,0,6">
|
||||
<TextBlock
|
||||
Foreground="#FFFFFFFF"
|
||||
Margin="6,0,6,2"
|
||||
Foreground="#FFFFFFFF"
|
||||
Text="{Binding Count}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
@@ -274,23 +267,26 @@
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
|
||||
<TextBlock Text="四星" Style="{StaticResource BaseTextBlockStyle}" Margin="0,0,0,8"/>
|
||||
<TextBlock
|
||||
Margin="0,0,0,8"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="四星"/>
|
||||
<GridView ItemsSource="{Binding SelectedHistoryWish.PurpleList}">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<shvc:ItemIcon
|
||||
Badge="{Binding Badge}"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"
|
||||
Badge="{Binding Badge}"/>
|
||||
Quality="{Binding Quality}"/>
|
||||
<Border
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Background="#80000000"
|
||||
CornerRadius="0,6,0,6">
|
||||
<TextBlock
|
||||
Foreground="#FFFFFFFF"
|
||||
Margin="6,0,6,2"
|
||||
Foreground="#FFFFFFFF"
|
||||
Text="{Binding Count}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
@@ -298,23 +294,26 @@
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
|
||||
<TextBlock Text="三星" Style="{StaticResource BaseTextBlockStyle}" Margin="0,0,0,8"/>
|
||||
<TextBlock
|
||||
Margin="0,0,0,8"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="三星"/>
|
||||
<GridView ItemsSource="{Binding SelectedHistoryWish.BlueList}">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<shvc:ItemIcon
|
||||
Badge="{Binding Badge}"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"
|
||||
Badge="{Binding Badge}"/>
|
||||
Quality="{Binding Quality}"/>
|
||||
<Border
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Background="#80000000"
|
||||
CornerRadius="0,6,0,6">
|
||||
<TextBlock
|
||||
Foreground="#FFFFFFFF"
|
||||
Margin="6,0,6,2"
|
||||
Foreground="#FFFFFFFF"
|
||||
Text="{Binding Count}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
@@ -329,23 +328,26 @@
|
||||
<PivotItem Header="角色">
|
||||
<ScrollViewer>
|
||||
<StackPanel Margin="16,0,16,0">
|
||||
<TextBlock Text="五星" Style="{StaticResource BaseTextBlockStyle}" Margin="0,16,0,8"/>
|
||||
<TextBlock
|
||||
Margin="0,16,0,8"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="五星"/>
|
||||
<GridView ItemsSource="{Binding Statistics.OrangeAvatars}" SelectionMode="None">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<shvc:ItemIcon
|
||||
Badge="{Binding Badge}"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"
|
||||
Badge="{Binding Badge}"/>
|
||||
Quality="{Binding Quality}"/>
|
||||
<Border
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Background="#80000000"
|
||||
CornerRadius="0,6,0,6">
|
||||
<TextBlock
|
||||
Foreground="#FFFFFFFF"
|
||||
Margin="6,0,6,2"
|
||||
Foreground="#FFFFFFFF"
|
||||
Text="{Binding Count}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
@@ -353,23 +355,26 @@
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
|
||||
<TextBlock Text="四星" Style="{StaticResource BaseTextBlockStyle}" Margin="0,0,0,8"/>
|
||||
<TextBlock
|
||||
Margin="0,0,0,8"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="四星"/>
|
||||
<GridView ItemsSource="{Binding Statistics.PurpleAvatars}" SelectionMode="None">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<shvc:ItemIcon
|
||||
Badge="{Binding Badge}"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"
|
||||
Badge="{Binding Badge}"/>
|
||||
Quality="{Binding Quality}"/>
|
||||
<Border
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Background="#80000000"
|
||||
CornerRadius="0,6,0,6">
|
||||
<TextBlock
|
||||
Foreground="#FFFFFFFF"
|
||||
Margin="6,0,6,2"
|
||||
Foreground="#FFFFFFFF"
|
||||
Text="{Binding Count}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
@@ -382,23 +387,26 @@
|
||||
<PivotItem Header="武器">
|
||||
<ScrollViewer>
|
||||
<StackPanel Margin="16,0,16,0">
|
||||
<TextBlock Text="五星" Style="{StaticResource BaseTextBlockStyle}" Margin="0,16,0,8"/>
|
||||
<TextBlock
|
||||
Margin="0,16,0,8"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="五星"/>
|
||||
<GridView ItemsSource="{Binding Statistics.OrangeWeapons}" SelectionMode="None">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<shvc:ItemIcon
|
||||
Badge="{Binding Badge}"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"
|
||||
Badge="{Binding Badge}"/>
|
||||
Quality="{Binding Quality}"/>
|
||||
<Border
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Background="#80000000"
|
||||
CornerRadius="0,6,0,6">
|
||||
<TextBlock
|
||||
Foreground="#FFFFFFFF"
|
||||
Margin="6,0,6,2"
|
||||
Foreground="#FFFFFFFF"
|
||||
Text="{Binding Count}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
@@ -406,23 +414,26 @@
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
|
||||
<TextBlock Text="四星" Style="{StaticResource BaseTextBlockStyle}" Margin="0,0,0,8"/>
|
||||
<TextBlock
|
||||
Margin="0,0,0,8"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="四星"/>
|
||||
<GridView ItemsSource="{Binding Statistics.PurpleWeapons}" SelectionMode="None">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<shvc:ItemIcon
|
||||
Badge="{Binding Badge}"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"
|
||||
Badge="{Binding Badge}"/>
|
||||
Quality="{Binding Quality}"/>
|
||||
<Border
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Background="#80000000"
|
||||
CornerRadius="0,6,0,6">
|
||||
<TextBlock
|
||||
Foreground="#FFFFFFFF"
|
||||
Margin="6,0,6,2"
|
||||
Foreground="#FFFFFFFF"
|
||||
Text="{Binding Count}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
@@ -430,23 +441,26 @@
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
|
||||
<TextBlock Text="三星" Style="{StaticResource BaseTextBlockStyle}" Margin="0,0,0,8"/>
|
||||
<TextBlock
|
||||
Margin="0,0,0,8"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="三星"/>
|
||||
<GridView ItemsSource="{Binding Statistics.BlueWeapons}" SelectionMode="None">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<shvc:ItemIcon
|
||||
Badge="{Binding Badge}"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"
|
||||
Badge="{Binding Badge}"/>
|
||||
Quality="{Binding Quality}"/>
|
||||
<Border
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Background="#80000000"
|
||||
CornerRadius="0,6,0,6">
|
||||
<TextBlock
|
||||
Foreground="#FFFFFFFF"
|
||||
Margin="6,0,6,2"
|
||||
Foreground="#FFFFFFFF"
|
||||
Text="{Binding Count}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
<shc:ScopedPage
|
||||
x:Class="Snap.Hutao.View.Page.HutaoDatabasePage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
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:shvc="using:Snap.Hutao.View.Control"
|
||||
xmlns:shv="using:Snap.Hutao.ViewModel"
|
||||
xmlns:shcm="using:Snap.Hutao.Control.Markup"
|
||||
xmlns:sc="using:SettingsUI.Controls"
|
||||
mc:Ignorable="d"
|
||||
xmlns:shv="using:Snap.Hutao.ViewModel"
|
||||
xmlns:shvc="using:Snap.Hutao.View.Control"
|
||||
d:DataContext="{d:DesignInstance shv:HutaoDatabaseViewModel}"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<mxi:Interaction.Behaviors>
|
||||
<shcb:InvokeCommandOnLoadedBehavior Command="{Binding OpenUICommand}"/>
|
||||
@@ -24,13 +24,16 @@
|
||||
<Pivot>
|
||||
<Pivot.RightHeader>
|
||||
<CommandBar DefaultLabelPosition="Right">
|
||||
<AppBarButton Label="详情" Icon="{shcm:FontIcon Glyph=}">
|
||||
<AppBarButton Icon="{shcm:FontIcon Glyph=}" Label="详情">
|
||||
<AppBarButton.Flyout>
|
||||
<Flyout Placement="BottomEdgeAlignedRight">
|
||||
<sc:SettingsGroup Header="数据来自「胡桃数据库」" Margin="0,-32,0,0" MinWidth="240">
|
||||
<sc:Setting Header="上传记录总数" Content="{Binding Overview.RecordTotal}"/>
|
||||
<sc:Setting Header="深渊记录总数" Content="{Binding Overview.SpiralAbyssTotal}"/>
|
||||
<sc:Setting Header="深渊记录满星数" Content="{Binding Overview.SpiralAbyssFullStar}"/>
|
||||
<sc:SettingsGroup
|
||||
MinWidth="240"
|
||||
Margin="0,-32,0,0"
|
||||
Header="数据来自「胡桃数据库」">
|
||||
<sc:Setting Content="{Binding Overview.RecordTotal}" Header="上传记录总数"/>
|
||||
<sc:Setting Content="{Binding Overview.SpiralAbyssTotal}" Header="深渊记录总数"/>
|
||||
<sc:Setting Content="{Binding Overview.SpiralAbyssFullStar}" Header="深渊记录满星数"/>
|
||||
</sc:SettingsGroup>
|
||||
</Flyout>
|
||||
</AppBarButton.Flyout>
|
||||
@@ -48,16 +51,14 @@
|
||||
<DataTemplate>
|
||||
<ScrollViewer>
|
||||
<GridView
|
||||
SelectionMode="None"
|
||||
ItemsSource="{Binding Avatars}"
|
||||
Margin="16,16,6,-6"
|
||||
ItemContainerStyle="{StaticResource LargeGridViewItemStyle}">
|
||||
ItemContainerStyle="{StaticResource LargeGridViewItemStyle}"
|
||||
ItemsSource="{Binding Avatars}"
|
||||
SelectionMode="None">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shvc:BottomTextControl Text="{Binding Rate}">
|
||||
<shvc:ItemIcon
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"/>
|
||||
<shvc:ItemIcon Icon="{Binding Icon}" Quality="{Binding Quality}"/>
|
||||
</shvc:BottomTextControl>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
@@ -78,16 +79,14 @@
|
||||
<DataTemplate>
|
||||
<ScrollViewer>
|
||||
<GridView
|
||||
SelectionMode="None"
|
||||
ItemsSource="{Binding Avatars}"
|
||||
Margin="16,16,6,-6"
|
||||
ItemContainerStyle="{StaticResource LargeGridViewItemStyle}">
|
||||
ItemContainerStyle="{StaticResource LargeGridViewItemStyle}"
|
||||
ItemsSource="{Binding Avatars}"
|
||||
SelectionMode="None">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shvc:BottomTextControl Text="{Binding Rate}">
|
||||
<shvc:ItemIcon
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"/>
|
||||
<shvc:ItemIcon Icon="{Binding Icon}" Quality="{Binding Quality}"/>
|
||||
</shvc:BottomTextControl>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
@@ -106,24 +105,69 @@
|
||||
<Grid Margin="16,0,16,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="48"/>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0" Text="角色" Margin="6" HorizontalAlignment="Center" Style="{StaticResource CaptionTextBlockStyle}"/>
|
||||
<TextBlock Grid.Column="1" Text="持有" Margin="6" HorizontalAlignment="Center" Style="{StaticResource CaptionTextBlockStyle}"/>
|
||||
<TextBlock Grid.Column="2" Text="0 命" Margin="6" HorizontalAlignment="Center" Style="{StaticResource CaptionTextBlockStyle}"/>
|
||||
<TextBlock Grid.Column="3" Text="1 命" Margin="6" HorizontalAlignment="Center" Style="{StaticResource CaptionTextBlockStyle}"/>
|
||||
<TextBlock Grid.Column="4" Text="2 命" Margin="6" HorizontalAlignment="Center" Style="{StaticResource CaptionTextBlockStyle}"/>
|
||||
<TextBlock Grid.Column="5" Text="3 命" Margin="6" HorizontalAlignment="Center" Style="{StaticResource CaptionTextBlockStyle}"/>
|
||||
<TextBlock Grid.Column="6" Text="4 命" Margin="6" HorizontalAlignment="Center" Style="{StaticResource CaptionTextBlockStyle}"/>
|
||||
<TextBlock Grid.Column="7" Text="5 命" Margin="6" HorizontalAlignment="Center" Style="{StaticResource CaptionTextBlockStyle}"/>
|
||||
<TextBlock Grid.Column="8" Text="6 命" Margin="6" HorizontalAlignment="Center" Style="{StaticResource CaptionTextBlockStyle}"/>
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Margin="6"
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="角色"/>
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
Margin="6"
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="持有"/>
|
||||
<TextBlock
|
||||
Grid.Column="2"
|
||||
Margin="6"
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="0 命"/>
|
||||
<TextBlock
|
||||
Grid.Column="3"
|
||||
Margin="6"
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="1 命"/>
|
||||
<TextBlock
|
||||
Grid.Column="4"
|
||||
Margin="6"
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="2 命"/>
|
||||
<TextBlock
|
||||
Grid.Column="5"
|
||||
Margin="6"
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="3 命"/>
|
||||
<TextBlock
|
||||
Grid.Column="6"
|
||||
Margin="6"
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="4 命"/>
|
||||
<TextBlock
|
||||
Grid.Column="7"
|
||||
Margin="6"
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="5 命"/>
|
||||
<TextBlock
|
||||
Grid.Column="8"
|
||||
Margin="6"
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="6 命"/>
|
||||
</Grid>
|
||||
<ScrollViewer Grid.Row="1">
|
||||
<ItemsControl
|
||||
@@ -138,9 +182,9 @@
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border
|
||||
Margin="16,0,16,8"
|
||||
Background="{StaticResource CardBackgroundFillColorDefault}"
|
||||
CornerRadius="{StaticResource CompatCornerRadius}"
|
||||
Margin="16,0,16,8">
|
||||
CornerRadius="{StaticResource CompatCornerRadius}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
@@ -148,8 +192,8 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<shvc:ItemIcon
|
||||
Height="48"
|
||||
Width="48"
|
||||
Height="48"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"/>
|
||||
|
||||
@@ -211,27 +255,27 @@
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border
|
||||
CornerRadius="{StaticResource CompatCornerRadius}"
|
||||
Margin="12,0,12,12"
|
||||
Background="{StaticResource CardBackgroundFillColorDefault}">
|
||||
Background="{StaticResource CardBackgroundFillColorDefault}"
|
||||
CornerRadius="{StaticResource CompatCornerRadius}">
|
||||
<Grid Margin="6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="120"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ItemsControl ItemsSource="{Binding}" HorizontalAlignment="Left">
|
||||
<ItemsControl HorizontalAlignment="Left" ItemsSource="{Binding}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<cwuc:UniformGrid Columns="4" ColumnSpacing="6"/>
|
||||
<cwuc:UniformGrid ColumnSpacing="6" Columns="4"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shvc:ItemIcon
|
||||
Width="48"
|
||||
Height="48"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"/>
|
||||
Width="48"
|
||||
Height="48"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
@@ -257,27 +301,27 @@
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border
|
||||
CornerRadius="{StaticResource CompatCornerRadius}"
|
||||
Margin="12,0,12,12"
|
||||
Background="{StaticResource CardBackgroundFillColorDefault}">
|
||||
Background="{StaticResource CardBackgroundFillColorDefault}"
|
||||
CornerRadius="{StaticResource CompatCornerRadius}">
|
||||
<Grid Margin="6">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="120"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ItemsControl ItemsSource="{Binding}" HorizontalAlignment="Left">
|
||||
<ItemsControl HorizontalAlignment="Left" ItemsSource="{Binding}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<cwuc:UniformGrid Columns="4" ColumnSpacing="6"/>
|
||||
<cwuc:UniformGrid ColumnSpacing="6" Columns="4"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shvc:ItemIcon
|
||||
Width="48"
|
||||
Height="48"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"/>
|
||||
Width="48"
|
||||
Height="48"
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
<shc:ScopedPage
|
||||
x:Class="Snap.Hutao.View.Page.LaunchGamePage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:mxi="using:Microsoft.Xaml.Interactivity"
|
||||
xmlns:mxic="using:Microsoft.Xaml.Interactions.Core"
|
||||
xmlns:mxim="using:Microsoft.Xaml.Interactions.Media"
|
||||
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:shv="using:Snap.Hutao.ViewModel"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance shv:LaunchGameViewModel}"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<mxi:Interaction.Behaviors>
|
||||
<shcb:InvokeCommandOnLoadedBehavior Command="{Binding OpenUICommand}"/>
|
||||
</mxi:Interaction.Behaviors>
|
||||
|
||||
|
||||
<Page.Resources>
|
||||
<shc:BindingProxy x:Key="BindingProxy" DataContext="{Binding}"/>
|
||||
|
||||
<Style TargetType="Button" BasedOn="{StaticResource SettingButtonStyle}">
|
||||
<Style BasedOn="{StaticResource SettingButtonStyle}" TargetType="Button">
|
||||
<Setter Property="MinWidth" Value="156"/>
|
||||
</Style>
|
||||
<Style TargetType="HyperlinkButton" BasedOn="{StaticResource HyperlinkButtonStyle}">
|
||||
<Style BasedOn="{StaticResource HyperlinkButtonStyle}" TargetType="HyperlinkButton">
|
||||
<Setter Property="MinWidth" Value="156"/>
|
||||
</Style>
|
||||
<Style TargetType="ComboBox" BasedOn="{StaticResource DefaultComboBoxStyle}">
|
||||
<Style BasedOn="{StaticResource DefaultComboBoxStyle}" TargetType="ComboBox">
|
||||
<Setter Property="MinWidth" Value="156"/>
|
||||
</Style>
|
||||
<Style TargetType="NumberBox">
|
||||
@@ -47,38 +47,36 @@
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Margin="16,-16,16,16">
|
||||
<sc:SettingsGroup Header="常规" Margin="0,0,0,0">
|
||||
<sc:SettingsGroup Margin="0,0,0,0" Header="常规">
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Description="切换游戏服务器,B服用户需要自备额外的 PCGameSDK.dll 文件"
|
||||
Header="服务器"
|
||||
Description="切换游戏服务器,B服用户需要自备额外的 PCGameSDK.dll 文件">
|
||||
Icon="">
|
||||
<sc:Setting.ActionContent>
|
||||
<ComboBox
|
||||
DisplayMemberPath="Name"
|
||||
ItemsSource="{Binding KnownSchemes}"
|
||||
SelectedItem="{Binding SelectedScheme,Mode=TwoWay}"
|
||||
DisplayMemberPath="Name"/>
|
||||
SelectedItem="{Binding SelectedScheme, Mode=TwoWay}"/>
|
||||
</sc:Setting.ActionContent>
|
||||
</sc:Setting>
|
||||
<sc:SettingExpander IsExpanded="True">
|
||||
<sc:SettingExpander.Header>
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Description="在游戏内切换账号,网络环境发生变化后需要重新手动检测"
|
||||
Header="账号"
|
||||
Description="在游戏内切换账号,网络环境发生变化后需要重新手动检测">
|
||||
Icon="">
|
||||
<sc:Setting.ActionContent>
|
||||
<Button
|
||||
Grid.Column="1"
|
||||
MinWidth="124"
|
||||
Margin="0,0,8,0"
|
||||
HorizontalAlignment="Right"
|
||||
Command="{Binding DetectGameAccountCommand}"
|
||||
Grid.Column="1"
|
||||
Margin="0,0,8,0"
|
||||
MinWidth="124"
|
||||
Content="检测"/>
|
||||
</sc:Setting.ActionContent>
|
||||
</sc:Setting>
|
||||
</sc:SettingExpander.Header>
|
||||
<ListView
|
||||
ItemsSource="{Binding GameAccounts}"
|
||||
SelectedItem="{Binding SelectedGameAccount,Mode=TwoWay}">
|
||||
<ListView ItemsSource="{Binding GameAccounts}" SelectedItem="{Binding SelectedGameAccount, Mode=TwoWay}">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
@@ -87,47 +85,45 @@
|
||||
<TextBlock
|
||||
Opacity="0.8"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding AttachUid,TargetNullValue=该账号尚未绑定 UID}"/>
|
||||
Text="{Binding AttachUid, TargetNullValue=该账号尚未绑定 UID}"/>
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
x:Name="ButtonPanel"
|
||||
Visibility="Collapsed"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
Orientation="Horizontal"
|
||||
Visibility="Collapsed">
|
||||
<Button
|
||||
Margin="4,8"
|
||||
MinWidth="48"
|
||||
Margin="4,8"
|
||||
VerticalAlignment="Stretch"
|
||||
ToolTipService.ToolTip="绑定当前用户角色"
|
||||
Content=""
|
||||
Command="{Binding DataContext.AttachGameAccountCommand,Source={StaticResource BindingProxy}}"
|
||||
Command="{Binding DataContext.AttachGameAccountCommand, Source={StaticResource BindingProxy}}"
|
||||
CommandParameter="{Binding}"
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"/>
|
||||
Content=""
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
ToolTipService.ToolTip="绑定当前用户角色"/>
|
||||
<Button
|
||||
Margin="4,8"
|
||||
MinWidth="48"
|
||||
Margin="4,8"
|
||||
VerticalAlignment="Stretch"
|
||||
ToolTipService.ToolTip="重命名"
|
||||
Command="{Binding DataContext.ModifyGameAccountCommand, Source={StaticResource BindingProxy}}"
|
||||
CommandParameter="{Binding}"
|
||||
Content=""
|
||||
Command="{Binding DataContext.ModifyGameAccountCommand,Source={StaticResource BindingProxy}}"
|
||||
CommandParameter="{Binding}"
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"/>
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
ToolTipService.ToolTip="重命名"/>
|
||||
<Button
|
||||
Margin="4,8,0,8"
|
||||
MinWidth="48"
|
||||
Margin="4,8,0,8"
|
||||
VerticalAlignment="Stretch"
|
||||
ToolTipService.ToolTip="删除"
|
||||
Content=""
|
||||
Command="{Binding DataContext.RemoveGameAccountCommand,Source={StaticResource BindingProxy}}"
|
||||
Command="{Binding DataContext.RemoveGameAccountCommand, Source={StaticResource BindingProxy}}"
|
||||
CommandParameter="{Binding}"
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"/>
|
||||
Content=""
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
ToolTipService.ToolTip="删除"/>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<Grid.Resources>
|
||||
<Storyboard x:Name="ButtonPanelVisibleStoryboard">
|
||||
<ObjectAnimationUsingKeyFrames
|
||||
Storyboard.TargetName="ButtonPanel"
|
||||
Storyboard.TargetProperty="Visibility">
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPanel" Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<Visibility>Visible</Visibility>
|
||||
@@ -137,9 +133,7 @@
|
||||
</Storyboard>
|
||||
|
||||
<Storyboard x:Name="ButtonPanelCollapsedStoryboard">
|
||||
<ObjectAnimationUsingKeyFrames
|
||||
Storyboard.TargetName="ButtonPanel"
|
||||
Storyboard.TargetProperty="Visibility">
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPanel" Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<Visibility>Collapsed</Visibility>
|
||||
@@ -148,7 +142,7 @@
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</Grid.Resources>
|
||||
|
||||
|
||||
<mxi:Interaction.Behaviors>
|
||||
<mxic:EventTriggerBehavior EventName="PointerEntered">
|
||||
<mxim:ControlStoryboardAction Storyboard="{StaticResource ButtonPanelVisibleStoryboard}"/>
|
||||
@@ -165,94 +159,86 @@
|
||||
</sc:SettingsGroup>
|
||||
<sc:SettingsGroup Header="外观">
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Description="覆盖默认的全屏状态"
|
||||
Header="全屏"
|
||||
Description="覆盖默认的全屏状态">
|
||||
Icon="">
|
||||
<sc:Setting.ActionContent>
|
||||
<ToggleSwitch
|
||||
IsOn="{Binding IsFullScreen,Mode=TwoWay}"
|
||||
Style="{StaticResource ToggleSwitchSettingStyle}"
|
||||
Width="120"/>
|
||||
Width="120"
|
||||
IsOn="{Binding IsFullScreen, Mode=TwoWay}"
|
||||
Style="{StaticResource ToggleSwitchSettingStyle}"/>
|
||||
</sc:Setting.ActionContent>
|
||||
</sc:Setting>
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Description="将窗口创建为弹出窗口,不带框架"
|
||||
Header="无边框"
|
||||
Description="将窗口创建为弹出窗口,不带框架">
|
||||
Icon="">
|
||||
<sc:Setting.ActionContent>
|
||||
<ToggleSwitch
|
||||
IsOn="{Binding IsBorderless,Mode=TwoWay}"
|
||||
Style="{StaticResource ToggleSwitchSettingStyle}"
|
||||
Width="120"/>
|
||||
Width="120"
|
||||
IsOn="{Binding IsBorderless, Mode=TwoWay}"
|
||||
Style="{StaticResource ToggleSwitchSettingStyle}"/>
|
||||
</sc:Setting.ActionContent>
|
||||
</sc:Setting>
|
||||
|
||||
<sc:Setting
|
||||
Margin="0,6,0,0"
|
||||
Icon=""
|
||||
Description="覆盖默认屏幕宽度"
|
||||
Header="宽度"
|
||||
Description="覆盖默认屏幕宽度">
|
||||
Icon="">
|
||||
<sc:Setting.ActionContent>
|
||||
<NumberBox
|
||||
Value="{Binding ScreenWidth,Mode=TwoWay}"
|
||||
Width="160"/>
|
||||
<NumberBox Width="160" Value="{Binding ScreenWidth, Mode=TwoWay}"/>
|
||||
</sc:Setting.ActionContent>
|
||||
</sc:Setting>
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Description="覆盖默认屏幕高度"
|
||||
Header="高度"
|
||||
Description="覆盖默认屏幕高度">
|
||||
Icon="">
|
||||
<sc:Setting.ActionContent>
|
||||
<NumberBox
|
||||
Value="{Binding ScreenHeight,Mode=TwoWay}"
|
||||
Width="160"/>
|
||||
<NumberBox Width="160" Value="{Binding ScreenHeight, Mode=TwoWay}"/>
|
||||
</sc:Setting.ActionContent>
|
||||
</sc:Setting>
|
||||
</sc:SettingsGroup>
|
||||
|
||||
<sc:SettingsGroup Header="Dangerous Feature" IsEnabled="{Binding IsElevated}">
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Description="Requires administrator privilege. Otherwise the option will be disabled."
|
||||
Header="Unlock frame rate limit"
|
||||
Description="Requires administrator privilege. Otherwise the option will be disabled.">
|
||||
Icon="">
|
||||
<sc:Setting.ActionContent>
|
||||
<ToggleSwitch
|
||||
IsOn="{Binding UnlockFps,Mode=TwoWay}"
|
||||
OnContent="Enable"
|
||||
Width="120"
|
||||
IsOn="{Binding UnlockFps, Mode=TwoWay}"
|
||||
OffContent="Disable"
|
||||
Style="{StaticResource ToggleSwitchSettingStyle}"
|
||||
Width="120"/>
|
||||
OnContent="Enable"
|
||||
Style="{StaticResource ToggleSwitchSettingStyle}"/>
|
||||
</sc:Setting.ActionContent>
|
||||
</sc:Setting>
|
||||
<sc:Setting
|
||||
Header="Set frame rate"
|
||||
Description="{Binding TargetFps}">
|
||||
<sc:Setting Description="{Binding TargetFps}" Header="Set frame rate">
|
||||
<sc:Setting.ActionContent>
|
||||
<Slider
|
||||
Value="{Binding TargetFps,Mode=TwoWay}"
|
||||
Minimum="60"
|
||||
Width="400"
|
||||
Maximum="360"
|
||||
Width="400"/>
|
||||
Minimum="60"
|
||||
Value="{Binding TargetFps, Mode=TwoWay}"/>
|
||||
</sc:Setting.ActionContent>
|
||||
</sc:Setting>
|
||||
</sc:SettingsGroup>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
<Grid
|
||||
Grid.Row="1"
|
||||
VerticalAlignment="Bottom">
|
||||
<Grid Grid.Row="1" VerticalAlignment="Bottom">
|
||||
<Button
|
||||
Style="{StaticResource AccentButtonStyle}"
|
||||
Command="{Binding LaunchCommand}"
|
||||
HorizontalAlignment="Right"
|
||||
Grid.Column="3"
|
||||
Margin="24"
|
||||
MinWidth="80"
|
||||
Width="100"
|
||||
Height="80">
|
||||
Height="80"
|
||||
MinWidth="80"
|
||||
Margin="24"
|
||||
HorizontalAlignment="Right"
|
||||
Command="{Binding LaunchCommand}"
|
||||
Style="{StaticResource AccentButtonStyle}">
|
||||
<StackPanel>
|
||||
<FontIcon Glyph="" FontSize="36"/>
|
||||
<FontIcon FontSize="36" Glyph=""/>
|
||||
<TextBlock Margin="0,4,0,0" Text="启动游戏"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<Page
|
||||
x:Class="Snap.Hutao.View.Page.LoginMihoyoBBSPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
|
||||
<Grid Loaded="OnRootLoaded">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock
|
||||
Margin="12,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="在下方登录米游社"
|
||||
Grid.Row="0"/>
|
||||
<Button
|
||||
HorizontalAlignment="Right"
|
||||
Margin="16"
|
||||
Content="我已登录"
|
||||
Click="CookieButtonClick"/>
|
||||
<WebView2
|
||||
Grid.Row="1"
|
||||
Margin="0,0,0,0"
|
||||
|
||||
x:Name="WebView"/>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -1,83 +0,0 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.Web.WebView2.Core;
|
||||
using Snap.Hutao.Service.Abstraction;
|
||||
using Snap.Hutao.Service.Navigation;
|
||||
using Snap.Hutao.Service.User;
|
||||
using Snap.Hutao.Web.Hoyolab;
|
||||
|
||||
namespace Snap.Hutao.View.Page;
|
||||
|
||||
/// <summary>
|
||||
/// 登录米游社页面
|
||||
/// </summary>
|
||||
public sealed partial class LoginMihoyoBBSPage : Microsoft.UI.Xaml.Controls.Page
|
||||
{
|
||||
private const string CookieSite = "https://bbs.mihoyo.com";
|
||||
private const string Website = "https://bbs.mihoyo.com/ys/";
|
||||
|
||||
/// <summary>
|
||||
/// 构造一个新的登录米游社页面
|
||||
/// </summary>
|
||||
public LoginMihoyoBBSPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
[SuppressMessage("", "VSTHRD100")]
|
||||
private async void OnRootLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
await WebView.EnsureCoreWebView2Async();
|
||||
|
||||
CoreWebView2CookieManager manager = WebView.CoreWebView2.CookieManager;
|
||||
IReadOnlyList<CoreWebView2Cookie>? cookies = await manager.GetCookiesAsync(CookieSite);
|
||||
|
||||
if (cookies != null)
|
||||
{
|
||||
foreach (CoreWebView2Cookie item in cookies)
|
||||
{
|
||||
manager.DeleteCookie(item);
|
||||
}
|
||||
}
|
||||
|
||||
WebView.CoreWebView2.Navigate(Website);
|
||||
}
|
||||
|
||||
private async Task HandleCurrentCookieAsync()
|
||||
{
|
||||
CoreWebView2CookieManager manager = WebView.CoreWebView2.CookieManager;
|
||||
IReadOnlyList<CoreWebView2Cookie> cookies = await manager.GetCookiesAsync(CookieSite);
|
||||
|
||||
Cookie cookie = Cookie.FromCoreWebView2Cookies(cookies);
|
||||
IUserService userService = Ioc.Default.GetRequiredService<IUserService>();
|
||||
(UserOptionResult result, string nickname) = await userService.ProcessInputCookieAsync(cookie).ConfigureAwait(false);
|
||||
|
||||
Ioc.Default.GetRequiredService<INavigationService>().GoBack();
|
||||
IInfoBarService infoBarService = Ioc.Default.GetRequiredService<IInfoBarService>();
|
||||
|
||||
switch (result)
|
||||
{
|
||||
case UserOptionResult.Added:
|
||||
infoBarService.Success($"用户 [{nickname}] 添加成功");
|
||||
break;
|
||||
case UserOptionResult.Incomplete:
|
||||
infoBarService.Information($"此 Cookie 不完整,操作失败");
|
||||
break;
|
||||
case UserOptionResult.Invalid:
|
||||
infoBarService.Information($"此 Cookie 无效,操作失败");
|
||||
break;
|
||||
case UserOptionResult.Updated:
|
||||
infoBarService.Success($"用户 [{nickname}] 更新成功");
|
||||
break;
|
||||
default:
|
||||
throw Must.NeverHappen();
|
||||
}
|
||||
}
|
||||
|
||||
private void CookieButtonClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
HandleCurrentCookieAsync().SafeForget();
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
<Page
|
||||
x:Class="Snap.Hutao.View.Page.LoginMihoyoUserPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Loaded="OnRootLoaded">
|
||||
<Grid.RowDefinitions>
|
||||
@@ -13,18 +13,18 @@
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
Margin="12,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="在下方米哈游通行证"
|
||||
Grid.Row="0"/>
|
||||
Text="在下方米哈游通行证"/>
|
||||
<Button
|
||||
HorizontalAlignment="Right"
|
||||
Margin="16"
|
||||
Content="我已登录"
|
||||
Click="CookieButtonClick"/>
|
||||
HorizontalAlignment="Right"
|
||||
Click="CookieButtonClick"
|
||||
Content="我已登录"/>
|
||||
<WebView2
|
||||
x:Name="WebView"
|
||||
Grid.Row="2"
|
||||
Margin="0,0,0,0"
|
||||
x:Name="WebView"/>
|
||||
Margin="0,0,0,0"/>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
<Page
|
||||
x:Class="Snap.Hutao.View.Page.SettingPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:sc="using:SettingsUI.Controls"
|
||||
xmlns:shv="using:Snap.Hutao.ViewModel"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance shv:SettingViewModel}"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
d:DataContext="{d:DesignInstance shv:SettingViewModel}">
|
||||
mc:Ignorable="d">
|
||||
<Page.Resources>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource SettingButtonStyle}">
|
||||
<Style BasedOn="{StaticResource SettingButtonStyle}" TargetType="Button">
|
||||
<Setter Property="MinWidth" Value="160"/>
|
||||
</Style>
|
||||
<Style TargetType="HyperlinkButton" BasedOn="{StaticResource HyperlinkButtonStyle}">
|
||||
<Style BasedOn="{StaticResource HyperlinkButtonStyle}" TargetType="HyperlinkButton">
|
||||
<Setter Property="MinWidth" Value="160"/>
|
||||
</Style>
|
||||
<Style TargetType="ComboBox" BasedOn="{StaticResource DefaultComboBoxStyle}">
|
||||
<Style BasedOn="{StaticResource DefaultComboBoxStyle}" TargetType="ComboBox">
|
||||
<Setter Property="MinWidth" Value="160"/>
|
||||
</Style>
|
||||
</Page.Resources>
|
||||
@@ -35,67 +35,59 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border
|
||||
Width="80"
|
||||
BorderThickness="1"
|
||||
CornerRadius="{StaticResource CompatCornerRadius}"
|
||||
Background="{StaticResource CardBackgroundFillColorDefault}"
|
||||
BorderBrush="{StaticResource CardStrokeColorDefault}"
|
||||
Background="{StaticResource CardBackgroundFillColorDefault}">
|
||||
BorderThickness="1"
|
||||
CornerRadius="{StaticResource CompatCornerRadius}">
|
||||
<Image Source="ms-appx:///Assets/Square150x150Logo.scale-200.png"/>
|
||||
</Border>
|
||||
|
||||
<Grid
|
||||
Margin="16,0,0,0"
|
||||
Grid.Column="1">
|
||||
<Grid Grid.Column="1" Margin="16,0,0,0">
|
||||
<TextBlock TextWrapping="Wrap">
|
||||
<Run>胡桃 图标由 </Run>
|
||||
<Run>胡桃 图标由</Run>
|
||||
<Hyperlink NavigateUri="https://dieqi32894.lofter.com/post/4b58ce16_2b6b2d365">LOFTER@夙夜</Hyperlink>
|
||||
<Run>纸绘,并由 </Run>
|
||||
<Run>纸绘,并由</Run>
|
||||
<Hyperlink NavigateUri="https://github.com/DGP-Studio">DGP Studio</Hyperlink>
|
||||
<Run> 后期处理后,授权使用。</Run>
|
||||
<Run>后期处理后,授权使用。</Run>
|
||||
</TextBlock>
|
||||
<TextBlock
|
||||
VerticalAlignment="Bottom"
|
||||
Text="Copyright © 2022 DGP Studio. All Rights Reserved."/>
|
||||
<TextBlock VerticalAlignment="Bottom" Text="Copyright © 2022 DGP Studio. All Rights Reserved."/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Description="{Binding AppVersion}"
|
||||
Header="胡桃"
|
||||
Description="{Binding AppVersion}"/>
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Header="设备ID">
|
||||
Icon=""/>
|
||||
<sc:Setting Header="设备ID" Icon="">
|
||||
<sc:Setting.Description>
|
||||
<TextBlock
|
||||
IsTextSelectionEnabled="True"
|
||||
Text="{Binding DeviceId}"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"/>
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding DeviceId}"/>
|
||||
</sc:Setting.Description>
|
||||
</sc:Setting>
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Description="Github 上反馈的问题会优先处理"
|
||||
Header="反馈"
|
||||
Description="Github 上反馈的问题会优先处理">
|
||||
<HyperlinkButton
|
||||
Content="前往反馈"
|
||||
NavigateUri="https://hut.ao/statements/bug-report.html"/>
|
||||
Icon="">
|
||||
<HyperlinkButton Content="前往反馈" NavigateUri="https://hut.ao/statements/bug-report.html"/>
|
||||
</sc:Setting>
|
||||
<sc:SettingExpander>
|
||||
<sc:SettingExpander.Header>
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Description="根本没有检查更新选项"
|
||||
Header="检查更新"
|
||||
Description="根本没有检查更新选项"/>
|
||||
Icon=""/>
|
||||
</sc:SettingExpander.Header>
|
||||
<InfoBar
|
||||
CornerRadius="0,0,4,4"
|
||||
IsClosable="False"
|
||||
Severity="Informational"
|
||||
Message="都说了没有了"
|
||||
IsOpen="True"
|
||||
CornerRadius="0,0,4,4">
|
||||
Message="都说了没有了"
|
||||
Severity="Informational">
|
||||
<InfoBar.ActionButton>
|
||||
<Button
|
||||
HorizontalAlignment="Right"
|
||||
Width="1"
|
||||
HorizontalAlignment="Right"
|
||||
Command="{Binding DebugExceptionCommand}"
|
||||
Content="没用的按钮"/>
|
||||
</InfoBar.ActionButton>
|
||||
@@ -105,110 +97,102 @@
|
||||
|
||||
<sc:SettingsGroup Header="外观">
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Description="更改窗体的背景材质"
|
||||
Header="背景材质"
|
||||
Description="更改窗体的背景材质">
|
||||
Icon="">
|
||||
<ComboBox
|
||||
SelectedItem="{Binding SelectedBackdropType,Mode=TwoWay}"
|
||||
DisplayMemberPath="Name"
|
||||
ItemsSource="{Binding BackdropTypes}"
|
||||
DisplayMemberPath="Name"/>
|
||||
SelectedItem="{Binding SelectedBackdropType, Mode=TwoWay}"/>
|
||||
</sc:Setting>
|
||||
|
||||
</sc:SettingsGroup>
|
||||
|
||||
<sc:SettingsGroup Header="祈愿记录">
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Description="在祈愿记录页面显示或隐藏无记录的历史祈愿活动"
|
||||
Header="无记录的历史祈愿活动"
|
||||
Description="在祈愿记录页面显示或隐藏无记录的历史祈愿活动">
|
||||
Icon="">
|
||||
<ToggleSwitch
|
||||
Style="{StaticResource ToggleSwitchSettingStyle}"
|
||||
OnContent="显示"
|
||||
IsOn="{Binding IsEmptyHistoryWishVisible, Mode=TwoWay}"
|
||||
OffContent="隐藏"
|
||||
IsOn="{Binding IsEmptyHistoryWishVisible,Mode=TwoWay}"/>
|
||||
OnContent="显示"
|
||||
Style="{StaticResource ToggleSwitchSettingStyle}"/>
|
||||
</sc:Setting>
|
||||
|
||||
</sc:SettingsGroup>
|
||||
|
||||
<sc:SettingsGroup Header="游戏">
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Header="游戏路径"
|
||||
Description="{Binding GamePath}">
|
||||
<sc:Setting Header="游戏路径" Icon="">
|
||||
<sc:Setting.Description>
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
Foreground="{StaticResource SystemFillColorCautionBrush}"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="请选择游戏本体而不是启动器!"/>
|
||||
<TextBlock Style="{StaticResource CaptionTextBlockStyle}" Text="{Binding GamePath}"/>
|
||||
</StackPanel>
|
||||
</sc:Setting.Description>
|
||||
<sc:Setting.ActionContent>
|
||||
<Button Content="设置路径" Command="{Binding SetGamePathCommand}"/>
|
||||
<Button Command="{Binding SetGamePathCommand}" Content="设置路径"/>
|
||||
</sc:Setting.ActionContent>
|
||||
</sc:Setting>
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Description="若祈愿记录缓存刷新频繁提示验证密钥过期,可以尝试此操作"
|
||||
Header="删除游戏内网页缓存"
|
||||
Description="若祈愿记录缓存刷新频繁提示验证密钥过期,可以尝试此操作">
|
||||
Icon="">
|
||||
<sc:Setting.ActionContent>
|
||||
<Button Content="删除" Command="{Binding DeleteGameWebCacheCommand}"/>
|
||||
<Button Command="{Binding DeleteGameWebCacheCommand}" Content="删除"/>
|
||||
</sc:Setting.ActionContent>
|
||||
</sc:Setting>
|
||||
</sc:SettingsGroup>
|
||||
|
||||
<sc:SettingsGroup Header="测试功能">
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Description="用户数据/日志/元数据在此处存放"
|
||||
Header="打开 数据 文件夹"
|
||||
Description="用户数据/日志/元数据在此处存放">
|
||||
Icon="">
|
||||
<sc:Setting.ActionContent>
|
||||
<Button Content="打开" Command="{Binding Experimental.OpenDataFolderCommand}"/>
|
||||
<Button Command="{Binding Experimental.OpenDataFolderCommand}" Content="打开"/>
|
||||
</sc:Setting.ActionContent>
|
||||
</sc:Setting>
|
||||
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Description="图片缓存在此处存放"
|
||||
Header="打开 缓存 文件夹"
|
||||
Description="图片缓存在此处存放">
|
||||
Icon="">
|
||||
<sc:Setting.ActionContent>
|
||||
<Button Content="打开" Command="{Binding Experimental.OpenCacheFolderCommand}"/>
|
||||
<Button Command="{Binding Experimental.OpenCacheFolderCommand}" Content="打开"/>
|
||||
</sc:Setting.ActionContent>
|
||||
</sc:Setting>
|
||||
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Header="米游社每日签到">
|
||||
<sc:Setting.Description>
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="对当前选中的账号进行签到"/>
|
||||
<TextBlock
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Foreground="{StaticResource SystemFillColorCautionBrush}"
|
||||
Text="可能需要重启应用以对其他账号签到"/>
|
||||
</StackPanel>
|
||||
</sc:Setting.Description>
|
||||
Description="对当前选中的账号进行签到"
|
||||
Header="米游社每日签到"
|
||||
Icon="">
|
||||
<sc:Setting.ActionContent>
|
||||
<Button
|
||||
Content="打开签到对话框"
|
||||
Command="{Binding ShowSignInWebViewDialogCommand}"/>
|
||||
<Button Command="{Binding ShowSignInWebViewDialogCommand}" Content="打开签到对话框"/>
|
||||
</sc:Setting.ActionContent>
|
||||
</sc:Setting>
|
||||
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Description="将当前账号的深渊数据上传到胡桃数据库"
|
||||
Header="上传深渊数据"
|
||||
Description="将当前账号的深渊数据上传到胡桃数据库">
|
||||
Icon="">
|
||||
<sc:Setting.ActionContent>
|
||||
<Button Content="上传" Command="{Binding Experimental.UploadSpiralAbyssRecordCommand}"/>
|
||||
<Button Command="{Binding Experimental.UploadSpiralAbyssRecordCommand}" Content="上传"/>
|
||||
</sc:Setting.ActionContent>
|
||||
</sc:Setting>
|
||||
</sc:SettingsGroup>
|
||||
|
||||
<sc:SettingsGroup Header="危险功能" Foreground="{StaticResource SystemFillColorCriticalBrush}">
|
||||
<sc:SettingsGroup Foreground="{StaticResource SystemFillColorCriticalBrush}" Header="危险功能">
|
||||
<sc:Setting
|
||||
Icon=""
|
||||
Header="删除所有用户"
|
||||
Background="{StaticResource SystemFillColorCriticalBackgroundBrush}"
|
||||
Description="直接删除用户表的所有记录,用于修复特定的账号冲突问题"
|
||||
Background="{StaticResource SystemFillColorCriticalBackgroundBrush}">
|
||||
Header="删除所有用户"
|
||||
Icon="">
|
||||
<sc:Setting.ActionContent>
|
||||
<Button
|
||||
Content="执行"
|
||||
Command="{Binding Experimental.DeleteUsersCommand}"/>
|
||||
<Button Command="{Binding Experimental.DeleteUsersCommand}" Content="执行"/>
|
||||
</sc:Setting.ActionContent>
|
||||
</sc:Setting>
|
||||
</sc:SettingsGroup>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,119 +1,62 @@
|
||||
<shc:ScopedPage
|
||||
x:Class="Snap.Hutao.View.Page.WikiWeaponPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
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: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:shcp="using:Snap.Hutao.Control.Panel"
|
||||
xmlns:shct="using:Snap.Hutao.Control.Text"
|
||||
xmlns:shv="using:Snap.Hutao.ViewModel"
|
||||
xmlns:shvc="using:Snap.Hutao.View.Control"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance Type=shv:WikiWeaponViewModel}"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
mc:Ignorable="d">
|
||||
<mxi:Interaction.Behaviors>
|
||||
<shcb:InvokeCommandOnLoadedBehavior Command="{Binding OpenUICommand}"/>
|
||||
</mxi:Interaction.Behaviors>
|
||||
|
||||
<Page.Resources>
|
||||
<DataTemplate x:Key="PropertyDataTemplate">
|
||||
<shvc:DescParamComboBox
|
||||
HorizontalAlignment="Stretch"
|
||||
Source="{Binding Converter={StaticResource PropertyDescriptor}}"/>
|
||||
<shvc:DescParamComboBox HorizontalAlignment="Stretch" Source="{Binding Converter={StaticResource PropertyDescriptor}}"/>
|
||||
</DataTemplate>
|
||||
</Page.Resources>
|
||||
|
||||
<SplitView
|
||||
IsPaneOpen="True"
|
||||
DisplayMode="Inline"
|
||||
OpenPaneLength="200"
|
||||
PaneBackground="{StaticResource CardBackgroundFillColorSecondary}">
|
||||
<SplitView.Pane>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<CommandBar DefaultLabelPosition="Right">
|
||||
<CommandBar.Content>
|
||||
<shcp:PanelSelector Margin="6,8,0,0" x:Name="ItemsPanelSelector"/>
|
||||
</CommandBar.Content>
|
||||
|
||||
<!--<AppBarButton Label="筛选" Icon="{shcm:FontIcon Glyph=}">
|
||||
<AppBarButton.Flyout>
|
||||
<Flyout Placement="RightEdgeAlignedTop" LightDismissOverlayMode="On">
|
||||
<cwuc:UniformGrid Columns="3" RowSpacing="16">
|
||||
<cwuc:HeaderedItemsControl
|
||||
Header="元素"
|
||||
Padding="0,12,0,0"
|
||||
ItemsSource="{Binding FilterElementInfos}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}" Content="{Binding Value}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</cwuc:HeaderedItemsControl>
|
||||
|
||||
<cwuc:HeaderedItemsControl
|
||||
Header="所属"
|
||||
Padding="0,12,0,0"
|
||||
ItemsSource="{Binding FilterAssociationInfos}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}" Content="{Binding Value.Key}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</cwuc:HeaderedItemsControl>
|
||||
|
||||
<cwuc:HeaderedItemsControl
|
||||
Header="武器"
|
||||
Padding="0,12,0,0"
|
||||
ItemsSource="{Binding FilterWeaponTypeInfos}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}" Content="{Binding Value.Key}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</cwuc:HeaderedItemsControl>
|
||||
|
||||
<cwuc:HeaderedItemsControl
|
||||
Header="星级"
|
||||
Padding="0,12,0,0"
|
||||
ItemsSource="{Binding FilterQualityInfos}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}" Content="{Binding Value.Key}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</cwuc:HeaderedItemsControl>
|
||||
|
||||
<cwuc:HeaderedItemsControl
|
||||
Header="体型"
|
||||
Padding="0,12,0,0"
|
||||
ItemsSource="{Binding FilterBodyInfos}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}" Content="{Binding Value.Key}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</cwuc:HeaderedItemsControl>
|
||||
</cwuc:UniformGrid>
|
||||
</Flyout>
|
||||
</AppBarButton.Flyout>
|
||||
</AppBarButton>-->
|
||||
</CommandBar>
|
||||
<cwuc:SwitchPresenter Grid.Row="1" Value="{Binding ElementName=ItemsPanelSelector,Path=Current}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<CommandBar
|
||||
Grid.Row="0"
|
||||
Background="{StaticResource CardBackgroundFillColorDefaultBrush}"
|
||||
BorderBrush="{x:Null}"
|
||||
BorderThickness="0"
|
||||
DefaultLabelPosition="Right">
|
||||
<CommandBar.Content>
|
||||
<shcp:PanelSelector x:Name="ItemsPanelSelector" Margin="6,8,0,0"/>
|
||||
</CommandBar.Content>
|
||||
<AppBarButton Icon="{shcm:FontIcon Glyph=}" Label="养成计算"/>
|
||||
</CommandBar>
|
||||
<SplitView
|
||||
Grid.Row="1"
|
||||
DisplayMode="Inline"
|
||||
IsPaneOpen="True"
|
||||
OpenPaneLength="200"
|
||||
PaneBackground="{StaticResource CardBackgroundFillColorSecondary}">
|
||||
<SplitView.Pane>
|
||||
<cwuc:SwitchPresenter Grid.Row="1" Value="{Binding ElementName=ItemsPanelSelector, Path=Current}">
|
||||
<cwuc:Case Value="List">
|
||||
<ListView
|
||||
Grid.Row="1"
|
||||
SelectionMode="Single"
|
||||
ItemsSource="{Binding Weapons}"
|
||||
SelectedItem="{Binding Selected,Mode=TwoWay}">
|
||||
SelectedItem="{Binding Selected, Mode=TwoWay}"
|
||||
SelectionMode="Single">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
@@ -126,11 +69,11 @@
|
||||
Width="48"
|
||||
Height="48"
|
||||
Margin="0,0,12,6"
|
||||
Source="{Binding Icon,Converter={StaticResource EquipIconConverter},Mode=OneWay}"/>
|
||||
Source="{Binding Icon, Converter={StaticResource EquipIconConverter}, Mode=OneWay}"/>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Grid.Column="1"
|
||||
Margin="12,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Name}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
@@ -139,12 +82,12 @@
|
||||
</cwuc:Case>
|
||||
<cwuc:Case Value="Grid">
|
||||
<GridView
|
||||
Margin="6,6,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
HorizontalContentAlignment="Left"
|
||||
Margin="6,6,0,0"
|
||||
SelectionMode="Single"
|
||||
ItemsSource="{Binding Weapons}"
|
||||
SelectedItem="{Binding Selected,Mode=TwoWay}">
|
||||
SelectedItem="{Binding Selected, Mode=TwoWay}"
|
||||
SelectionMode="Single">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shci:CachedImage
|
||||
@@ -152,134 +95,127 @@
|
||||
Width="40"
|
||||
Height="40"
|
||||
Margin="0"
|
||||
Source="{Binding Icon,Converter={StaticResource EquipIconConverter},Mode=OneWay}"/>
|
||||
Source="{Binding Icon, Converter={StaticResource EquipIconConverter}, Mode=OneWay}"/>
|
||||
</DataTemplate>
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
</cwuc:Case>
|
||||
</cwuc:SwitchPresenter>
|
||||
</Grid>
|
||||
</SplitView.Pane>
|
||||
<SplitView.Content>
|
||||
<ScrollViewer>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition MaxWidth="800"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Margin="0,0,20,0">
|
||||
<Border
|
||||
Margin="16,16,0,0"
|
||||
BorderThickness="1"
|
||||
BorderBrush="{StaticResource CardStrokeColorDefault}"
|
||||
CornerRadius="{StaticResource CompatCornerRadius}">
|
||||
<Border.Background>
|
||||
<ImageBrush ImageSource="ms-appx:///Resource/Icon/UI_GachaShowPanel_Bg_Weapon.png"/>
|
||||
</Border.Background>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<mxi:Interaction.Behaviors>
|
||||
<shcb:AutoHeightBehavior TargetWidth="2048" TargetHeight="1024"/>
|
||||
</mxi:Interaction.Behaviors>
|
||||
<ScrollViewer
|
||||
Margin="16"
|
||||
Grid.Column="0">
|
||||
<StackPanel>
|
||||
<shvc:BottomTextControl
|
||||
RequestedTheme="Light"
|
||||
Text="突破前">
|
||||
<shvc:ItemIcon
|
||||
Icon="{Binding Selected.Icon,Converter={StaticResource EquipIconConverter}}"
|
||||
Quality="{Binding Selected.RankLevel}"/>
|
||||
</shvc:BottomTextControl>
|
||||
|
||||
<shvc:BottomTextControl
|
||||
RequestedTheme="Light"
|
||||
Text="突破后"
|
||||
Margin="0,16,0,0">
|
||||
<shvc:ItemIcon
|
||||
Icon="{Binding Selected.AwakenIcon,Converter={StaticResource EquipIconConverter}}"
|
||||
Quality="{Binding Selected.RankLevel}"/>
|
||||
</shvc:BottomTextControl>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<Grid Grid.ColumnSpan="2">
|
||||
</SplitView.Pane>
|
||||
<SplitView.Content>
|
||||
<ScrollViewer>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition MaxWidth="800"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Margin="0,0,20,0">
|
||||
<Border
|
||||
Margin="16,16,0,0"
|
||||
BorderBrush="{StaticResource CardStrokeColorDefault}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="{StaticResource CompatCornerRadius}">
|
||||
<Border.Background>
|
||||
<ImageBrush ImageSource="ms-appx:///Resource/Icon/UI_GachaShowPanel_Bg_Weapon.png"/>
|
||||
</Border.Background>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="176*"/>
|
||||
<ColumnDefinition Width="848*"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<shci:CachedImage
|
||||
<mxi:Interaction.Behaviors>
|
||||
<shcb:AutoHeightBehavior TargetHeight="1024" TargetWidth="2048"/>
|
||||
</mxi:Interaction.Behaviors>
|
||||
<ScrollViewer Grid.Column="0" Margin="16">
|
||||
<StackPanel>
|
||||
<shvc:BottomTextControl RequestedTheme="Light" Text="突破前">
|
||||
<shvc:ItemIcon Icon="{Binding Selected.Icon, Converter={StaticResource EquipIconConverter}}" Quality="{Binding Selected.RankLevel}"/>
|
||||
</shvc:BottomTextControl>
|
||||
|
||||
<shvc:BottomTextControl
|
||||
Margin="0,16,0,0"
|
||||
RequestedTheme="Light"
|
||||
Text="突破后">
|
||||
<shvc:ItemIcon Icon="{Binding Selected.AwakenIcon, Converter={StaticResource EquipIconConverter}}" Quality="{Binding Selected.RankLevel}"/>
|
||||
</shvc:BottomTextControl>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<Grid Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="176*"/>
|
||||
<ColumnDefinition Width="848*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<shci:CachedImage
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Stretch"
|
||||
Source="{Binding Selected.Icon, Converter={StaticResource GachaEquipIconConverter}}"/>
|
||||
</Grid>
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Stretch"
|
||||
Source="{Binding Selected.Icon,Converter={StaticResource GachaEquipIconConverter}}"/>
|
||||
Margin="16"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Bottom"
|
||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||
Text="{Binding Selected.Name}"/>
|
||||
</Grid>
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Bottom"
|
||||
Margin="16"
|
||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||
Text="{Binding Selected.Name}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<TextBlock
|
||||
Margin="16,16,0,0"
|
||||
TextWrapping="Wrap"
|
||||
Text="{Binding Selected.Description}"/>
|
||||
<ContentControl
|
||||
Margin="16,16,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Content="{Binding Selected.Property,Mode=OneWay}"
|
||||
ContentTemplate="{StaticResource PropertyDataTemplate}"/>
|
||||
<TextBlock Text="{Binding Selected.Affix.Name}" Style="{StaticResource BaseTextBlockStyle}" Margin="16,32,0,0"/>
|
||||
<Pivot ItemsSource="{Binding Selected.Affix.Descriptions}">
|
||||
<Pivot.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding LevelFormatted}" Style="{StaticResource CaptionTextBlockStyle}"/>
|
||||
</DataTemplate>
|
||||
</Pivot.HeaderTemplate>
|
||||
<Pivot.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shct:DescriptionTextBlock
|
||||
Margin="16,16,0,0"
|
||||
Description="{Binding Description}">
|
||||
<shct:DescriptionTextBlock.Resources>
|
||||
<Style TargetType="TextBlock" BasedOn="{StaticResource BodyTextBlockStyle}">
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
</Style>
|
||||
</shct:DescriptionTextBlock.Resources>
|
||||
</shct:DescriptionTextBlock>
|
||||
</DataTemplate>
|
||||
</Pivot.ItemTemplate>
|
||||
</Pivot>
|
||||
<TextBlock Text="搭配角色" Style="{StaticResource BaseTextBlockStyle}" Margin="16,32,0,0"/>
|
||||
<GridView
|
||||
Margin="16,16,0,0"
|
||||
SelectionMode="None"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
ItemsSource="{Binding Selected.Collocation.Avatars}">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shvc:BottomTextControl
|
||||
ToolTipService.ToolTip="{Binding Name}"
|
||||
Text="{Binding Rate}">
|
||||
<shvc:ItemIcon
|
||||
Icon="{Binding Icon}"
|
||||
Quality="{Binding Quality}"/>
|
||||
</shvc:BottomTextControl>
|
||||
</DataTemplate>
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</SplitView.Content>
|
||||
</SplitView>
|
||||
</Border>
|
||||
<TextBlock
|
||||
Margin="16,16,0,0"
|
||||
Text="{Binding Selected.Description}"
|
||||
TextWrapping="Wrap"/>
|
||||
<ContentControl
|
||||
Margin="16,16,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Content="{Binding Selected.Property, Mode=OneWay}"
|
||||
ContentTemplate="{StaticResource PropertyDataTemplate}"/>
|
||||
<TextBlock
|
||||
Margin="16,32,0,0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="{Binding Selected.Affix.Name}"/>
|
||||
<Pivot ItemsSource="{Binding Selected.Affix.Descriptions}">
|
||||
<Pivot.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Style="{StaticResource CaptionTextBlockStyle}" Text="{Binding LevelFormatted}"/>
|
||||
</DataTemplate>
|
||||
</Pivot.HeaderTemplate>
|
||||
<Pivot.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shct:DescriptionTextBlock Margin="16,16,0,0" Description="{Binding Description}">
|
||||
<shct:DescriptionTextBlock.Resources>
|
||||
<Style BasedOn="{StaticResource BodyTextBlockStyle}" TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
</Style>
|
||||
</shct:DescriptionTextBlock.Resources>
|
||||
</shct:DescriptionTextBlock>
|
||||
</DataTemplate>
|
||||
</Pivot.ItemTemplate>
|
||||
</Pivot>
|
||||
<TextBlock
|
||||
Margin="16,32,0,0"
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="搭配角色"/>
|
||||
<GridView
|
||||
Margin="16,16,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
ItemsSource="{Binding Selected.Collocation.Avatars}"
|
||||
SelectionMode="None">
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<shvc:BottomTextControl Text="{Binding Rate}" ToolTipService.ToolTip="{Binding Name}">
|
||||
<shvc:ItemIcon Icon="{Binding Icon}" Quality="{Binding Quality}"/>
|
||||
</shvc:BottomTextControl>
|
||||
</DataTemplate>
|
||||
</GridView.ItemTemplate>
|
||||
</GridView>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</SplitView.Content>
|
||||
</SplitView>
|
||||
</Grid>
|
||||
|
||||
</shc:ScopedPage>
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<UserControl
|
||||
x:Class="Snap.Hutao.View.TitleView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
Height="44"
|
||||
VerticalAlignment="Top"
|
||||
Height="44">
|
||||
mc:Ignorable="d">
|
||||
<Grid x:Name="DragableGrid">
|
||||
<TextBlock
|
||||
Text="{x:Bind Title}"
|
||||
TextWrapping="NoWrap"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Margin="4,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Margin="4,0,0,0"/>
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{x:Bind Title}"
|
||||
TextWrapping="NoWrap"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<UserControl
|
||||
x:Class="Snap.Hutao.View.UserView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:mxi="using:Microsoft.Xaml.Interactivity"
|
||||
xmlns:mxic="using:Microsoft.Xaml.Interactions.Core"
|
||||
xmlns:mxim="using:Microsoft.Xaml.Interactions.Media"
|
||||
xmlns:mxi="using:Microsoft.Xaml.Interactivity"
|
||||
xmlns:shc="using:Snap.Hutao.Control"
|
||||
xmlns:shcm="using:Snap.Hutao.Control.Markup"
|
||||
xmlns:shvm="using:Snap.Hutao.ViewModel"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance shvm:UserViewModel}">
|
||||
d:DataContext="{d:DesignInstance shvm:UserViewModel}"
|
||||
mc:Ignorable="d">
|
||||
<mxi:Interaction.Behaviors>
|
||||
<mxic:EventTriggerBehavior EventName="Loaded">
|
||||
<mxic:InvokeCommandAction Command="{Binding OpenUICommand}"/>
|
||||
@@ -19,14 +19,12 @@
|
||||
</mxi:Interaction.Behaviors>
|
||||
<StackPanel>
|
||||
<Button
|
||||
Background="Transparent"
|
||||
BorderBrush="{x:Null}"
|
||||
Grid.Column="2"
|
||||
Margin="4,4,4,6">
|
||||
Margin="4,4,4,6"
|
||||
Background="Transparent"
|
||||
BorderBrush="{x:Null}">
|
||||
<Button.Resources>
|
||||
<shc:BindingProxy
|
||||
x:Key="ViewModelBindingProxy"
|
||||
DataContext="{Binding}"/>
|
||||
<shc:BindingProxy x:Key="ViewModelBindingProxy" DataContext="{Binding}"/>
|
||||
</Button.Resources>
|
||||
<Button.Content>
|
||||
<Grid>
|
||||
@@ -36,35 +34,31 @@
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<PersonPicture
|
||||
ProfilePicture="{Binding SelectedUser.UserInfo.AvatarUrl,Mode=OneWay}"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="1,1,6,1"
|
||||
Width="36"
|
||||
Height="36"
|
||||
Width="36"/>
|
||||
Margin="1,1,6,1"
|
||||
HorizontalAlignment="Left"
|
||||
ProfilePicture="{Binding SelectedUser.UserInfo.AvatarUrl, Mode=OneWay}"/>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,0,2"
|
||||
Grid.Column="1"
|
||||
Text="{Binding SelectedUser.UserInfo.Nickname,Mode=OneWay}"
|
||||
Margin="0,0,0,2"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding SelectedUser.UserInfo.Nickname, Mode=OneWay}"
|
||||
TextTrimming="CharacterEllipsis"/>
|
||||
<FontIcon
|
||||
Grid.Column="2"
|
||||
Glyph=""
|
||||
FontSize="12"
|
||||
Margin="0,0,8,0"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,8,0"/>
|
||||
FontSize="12"
|
||||
Glyph=""/>
|
||||
</Grid>
|
||||
</Button.Content>
|
||||
<Button.Flyout>
|
||||
<Flyout
|
||||
Placement="LeftEdgeAlignedBottom"
|
||||
LightDismissOverlayMode="On">
|
||||
<Flyout LightDismissOverlayMode="On" Placement="LeftEdgeAlignedBottom">
|
||||
<Flyout.FlyoutPresenterStyle>
|
||||
<Style
|
||||
TargetType="FlyoutPresenter"
|
||||
BasedOn="{StaticResource DefaultFlyoutPresenterStyle}">
|
||||
<Style BasedOn="{StaticResource DefaultFlyoutPresenterStyle}" TargetType="FlyoutPresenter">
|
||||
<Setter Property="Padding" Value="0,2,0,2"/>
|
||||
<Setter Property="Background" Value="{ThemeResource FlyoutPresenterBackground}" />
|
||||
<Setter Property="Background" Value="{ThemeResource FlyoutPresenterBackground}"/>
|
||||
</Style>
|
||||
</Flyout.FlyoutPresenterStyle>
|
||||
<StackPanel>
|
||||
@@ -75,10 +69,10 @@
|
||||
<ListView
|
||||
Grid.Row="1"
|
||||
Margin="4"
|
||||
SelectionMode="Single"
|
||||
CanReorderItems="True"
|
||||
ItemsSource="{Binding SelectedUser.UserGameRoles}"
|
||||
SelectedItem="{Binding SelectedUser.SelectedUserGameRole,Mode=TwoWay}">
|
||||
SelectedItem="{Binding SelectedUser.SelectedUserGameRole, Mode=TwoWay}"
|
||||
SelectionMode="Single">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Padding="0,6">
|
||||
@@ -86,8 +80,8 @@
|
||||
<TextBlock
|
||||
Margin="0,2,0,0"
|
||||
Opacity="0.6"
|
||||
Text="{Binding Description}"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"/>
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{Binding Description}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
@@ -98,12 +92,12 @@
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="账号"/>
|
||||
<ListView
|
||||
MaxHeight="224"
|
||||
Grid.Row="1"
|
||||
MaxHeight="224"
|
||||
Margin="4"
|
||||
SelectionMode="Single"
|
||||
ItemsSource="{Binding Users}"
|
||||
SelectedItem="{Binding SelectedUser,Mode=TwoWay}">
|
||||
SelectedItem="{Binding SelectedUser, Mode=TwoWay}"
|
||||
SelectionMode="Single">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid
|
||||
@@ -116,10 +110,10 @@
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<PersonPicture
|
||||
ProfilePicture="{Binding UserInfo.AvatarUrl,Mode=OneWay}"
|
||||
HorizontalAlignment="Left"
|
||||
Height="32"
|
||||
Margin="0,0"
|
||||
Height="32"/>
|
||||
HorizontalAlignment="Left"
|
||||
ProfilePicture="{Binding UserInfo.AvatarUrl, Mode=OneWay}"/>
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
Margin="12,0,0,0"
|
||||
@@ -128,39 +122,37 @@
|
||||
|
||||
<StackPanel
|
||||
x:Name="ButtonPanel"
|
||||
Orientation="Horizontal"
|
||||
Grid.Column="2"
|
||||
Orientation="Horizontal"
|
||||
Visibility="Collapsed">
|
||||
<Button
|
||||
Content=""
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
Margin="12,0,0,0"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
BorderBrush="{x:Null}"
|
||||
Margin="12,0,0,0"
|
||||
Command="{Binding DataContext.CopyCookieCommand,Source={StaticResource ViewModelBindingProxy}}"
|
||||
BorderThickness="0"
|
||||
Command="{Binding DataContext.CopyCookieCommand, Source={StaticResource ViewModelBindingProxy}}"
|
||||
CommandParameter="{Binding}"
|
||||
Content=""
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
ToolTipService.ToolTip="复制 Cookie"/>
|
||||
<Button
|
||||
Content=""
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
Margin="6,0,0,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
BorderBrush="{x:Null}"
|
||||
Margin="6,0,0,0"
|
||||
Command="{Binding DataContext.RemoveUserCommand,Source={StaticResource ViewModelBindingProxy}}"
|
||||
BorderThickness="0"
|
||||
Command="{Binding DataContext.RemoveUserCommand, Source={StaticResource ViewModelBindingProxy}}"
|
||||
CommandParameter="{Binding}"
|
||||
Content=""
|
||||
FontFamily="{StaticResource SymbolThemeFontFamily}"
|
||||
ToolTipService.ToolTip="移除用户"/>
|
||||
</StackPanel>
|
||||
|
||||
<Grid.Resources>
|
||||
<Storyboard x:Name="ButtonPanelVisibleStoryboard">
|
||||
<ObjectAnimationUsingKeyFrames
|
||||
Storyboard.TargetName="ButtonPanel"
|
||||
Storyboard.TargetProperty="Visibility">
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPanel" Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<Visibility>Visible</Visibility>
|
||||
@@ -170,9 +162,7 @@
|
||||
</Storyboard>
|
||||
|
||||
<Storyboard x:Name="ButtonPanelCollapsedStoryboard">
|
||||
<ObjectAnimationUsingKeyFrames
|
||||
Storyboard.TargetName="ButtonPanel"
|
||||
Storyboard.TargetProperty="Visibility">
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonPanel" Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0">
|
||||
<DiscreteObjectKeyFrame.Value>
|
||||
<Visibility>Collapsed</Visibility>
|
||||
@@ -199,17 +189,20 @@
|
||||
Style="{StaticResource BaseTextBlockStyle}"
|
||||
Text="Cookie 操作"/>
|
||||
<CommandBar DefaultLabelPosition="Right">
|
||||
<AppBarButton Label="登录米哈游通行证" Icon="{shcm:FontIcon Glyph=}" Command="{Binding LoginMihoyoUserCommand}"/>
|
||||
<AppBarButton
|
||||
Command="{Binding LoginMihoyoUserCommand}"
|
||||
Icon="{shcm:FontIcon Glyph=}"
|
||||
Label="登录米哈游通行证"/>
|
||||
<AppBarButton
|
||||
Command="{Binding AddUserCommand}"
|
||||
Icon="{shcm:FontIcon Glyph=}"
|
||||
Label="手动输入"
|
||||
Command="{Binding AddUserCommand}"/>
|
||||
Label="手动输入"/>
|
||||
</CommandBar>
|
||||
</StackPanel>
|
||||
</Flyout>
|
||||
</Button.Flyout>
|
||||
<Button.Style>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource DefaultButtonStyle}">
|
||||
<Style BasedOn="{StaticResource DefaultButtonStyle}" TargetType="Button">
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
|
||||
@@ -2,17 +2,25 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media.Imaging;
|
||||
using Snap.Hutao.Control;
|
||||
using Snap.Hutao.Control.Image;
|
||||
using Snap.Hutao.Core.IO.DataTransfer;
|
||||
using Snap.Hutao.Factory.Abstraction;
|
||||
using Snap.Hutao.Model.Binding.AvatarProperty;
|
||||
using Snap.Hutao.Model.Binding.User;
|
||||
using Snap.Hutao.Service.Abstraction;
|
||||
using Snap.Hutao.Service.AvatarInfo;
|
||||
using Snap.Hutao.Service.User;
|
||||
using Snap.Hutao.View.Dialog;
|
||||
using Snap.Hutao.Web.Hoyolab;
|
||||
using Snap.Hutao.Web.Hoyolab.Takumi.Binding;
|
||||
using Snap.Hutao.Win32;
|
||||
using Snap.Hutao.WinRT;
|
||||
using Windows.Foundation;
|
||||
using Windows.Graphics.Imaging;
|
||||
using Windows.Storage.Streams;
|
||||
using Windows.UI;
|
||||
using WinRT;
|
||||
|
||||
namespace Snap.Hutao.ViewModel;
|
||||
|
||||
@@ -46,8 +54,10 @@ internal class AvatarPropertyViewModel : ObservableObject, ISupportCancellation
|
||||
this.infoBarService = infoBarService;
|
||||
|
||||
OpenUICommand = asyncRelayCommandFactory.Create(OpenUIAsync);
|
||||
RefreshByUserGameRoleCommand = asyncRelayCommandFactory.Create(RefreshByUserGameRoleAsync);
|
||||
RefreshByInputUidCommand = asyncRelayCommandFactory.Create(RefreshByInputUidAsync);
|
||||
RefreshFromEnkaApiCommand = asyncRelayCommandFactory.Create(RefreshByEnkaApiAsync);
|
||||
RefreshFromHoyolabGameRecordCommand = asyncRelayCommandFactory.Create(RefreshByHoyolabGameRecordAsync);
|
||||
RefreshFromHoyolabCalculateCommand = asyncRelayCommandFactory.Create(RefreshByHoyolabCalculateAsync);
|
||||
ExportAsImageCommand = asyncRelayCommandFactory.Create<UIElement>(ExportAsImageAsync);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
@@ -66,17 +76,48 @@ internal class AvatarPropertyViewModel : ObservableObject, ISupportCancellation
|
||||
/// <summary>
|
||||
/// 加载界面命令
|
||||
/// </summary>
|
||||
public ICommand OpenUICommand { get; set; }
|
||||
public ICommand OpenUICommand { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 按当前角色刷新命令
|
||||
/// 从 Enka Api 同步命令
|
||||
/// </summary>
|
||||
public ICommand RefreshByUserGameRoleCommand { get; set; }
|
||||
public ICommand RefreshFromEnkaApiCommand { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 按UID刷新命令
|
||||
/// 从游戏记录同步命令
|
||||
/// </summary>
|
||||
public ICommand RefreshByInputUidCommand { get; set; }
|
||||
public ICommand RefreshFromHoyolabGameRecordCommand { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 从养成计算同步命令
|
||||
/// </summary>
|
||||
public ICommand RefreshFromHoyolabCalculateCommand { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出图片命令
|
||||
/// </summary>
|
||||
public ICommand ExportAsImageCommand { get; }
|
||||
|
||||
private static unsafe void ProcessSoftwareBitmap(SoftwareBitmap softwareBitmap, Bgra8 tint)
|
||||
{
|
||||
using (BitmapBuffer buffer = softwareBitmap.LockBuffer(BitmapBufferAccessMode.ReadWrite))
|
||||
{
|
||||
using (IMemoryBufferReference reference = buffer.CreateReference())
|
||||
{
|
||||
reference.As<IMemoryBufferByteAccess>().GetBuffer(out byte* data, out uint length);
|
||||
|
||||
for (int i = 0; i < length; i += 4)
|
||||
{
|
||||
Bgra8* pixel = (Bgra8*)(data + i);
|
||||
|
||||
pixel->B = (byte)(((pixel->B * pixel->A) + (tint.B * (0xFF - pixel->A))) / 0xFF);
|
||||
pixel->G = (byte)(((pixel->G * pixel->A) + (tint.G * (0xFF - pixel->A))) / 0xFF);
|
||||
pixel->R = (byte)(((pixel->R * pixel->A) + (tint.R * (0xFF - pixel->A))) / 0xFF);
|
||||
pixel->A = 0xFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Task OpenUIAsync()
|
||||
{
|
||||
@@ -84,49 +125,61 @@ internal class AvatarPropertyViewModel : ObservableObject, ISupportCancellation
|
||||
{
|
||||
if (user.SelectedUserGameRole is UserGameRole role)
|
||||
{
|
||||
return RefreshCoreAsync((PlayerUid)role, RefreshOption.DatabaseOnly, CancellationToken);
|
||||
UserAndRole userAndRole = new(user.Entity, role);
|
||||
return RefreshCoreAsync(userAndRole, RefreshOption.None, CancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private Task RefreshByUserGameRoleAsync()
|
||||
private Task RefreshByEnkaApiAsync()
|
||||
{
|
||||
if (userService.Current is User user)
|
||||
{
|
||||
if (user.SelectedUserGameRole is UserGameRole role)
|
||||
{
|
||||
return RefreshCoreAsync((PlayerUid)role, RefreshOption.Standard, CancellationToken);
|
||||
UserAndRole userAndRole = new(user.Entity, role);
|
||||
return RefreshCoreAsync(userAndRole, RefreshOption.RequestFromEnkaAPI, CancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task RefreshByInputUidAsync()
|
||||
private Task RefreshByHoyolabGameRecordAsync()
|
||||
{
|
||||
MainWindow mainWindow = Ioc.Default.GetRequiredService<MainWindow>();
|
||||
(bool isOk, PlayerUid uid) = await new AvatarInfoQueryDialog(mainWindow).GetPlayerUidAsync().ConfigureAwait(false);
|
||||
|
||||
if (isOk)
|
||||
if (userService.Current is User user)
|
||||
{
|
||||
if (StructMarshal.IsDefault(uid))
|
||||
if (user.SelectedUserGameRole is UserGameRole role)
|
||||
{
|
||||
infoBarService.Information("请输入正确的UID");
|
||||
}
|
||||
else
|
||||
{
|
||||
await RefreshCoreAsync(uid, RefreshOption.RequestFromAPI, CancellationToken).ConfigureAwait(false);
|
||||
UserAndRole userAndRole = new(user.Entity, role);
|
||||
return RefreshCoreAsync(userAndRole, RefreshOption.RequestFromHoyolabGameRecord, CancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task RefreshCoreAsync(PlayerUid uid, RefreshOption option, CancellationToken token)
|
||||
private Task RefreshByHoyolabCalculateAsync()
|
||||
{
|
||||
if (userService.Current is User user)
|
||||
{
|
||||
if (user.SelectedUserGameRole is UserGameRole role)
|
||||
{
|
||||
UserAndRole userAndRole = new(user.Entity, role);
|
||||
return RefreshCoreAsync(userAndRole, RefreshOption.RequestFromHoyolabCalculate, CancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task RefreshCoreAsync(UserAndRole userAndRole, RefreshOption option, CancellationToken token)
|
||||
{
|
||||
try
|
||||
{
|
||||
(RefreshResult result, Summary? summary) = await avatarInfoService.GetSummaryAsync(uid, option, token).ConfigureAwait(false);
|
||||
(RefreshResult result, Summary? summary) = await avatarInfoService.GetSummaryAsync(userAndRole, option, token).ConfigureAwait(false);
|
||||
|
||||
if (result == RefreshResult.Ok)
|
||||
{
|
||||
@@ -151,4 +204,29 @@ internal class AvatarPropertyViewModel : ObservableObject, ISupportCancellation
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ExportAsImageAsync(UIElement? element)
|
||||
{
|
||||
if (element == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RenderTargetBitmap bitmap = new();
|
||||
await bitmap.RenderAsync(element);
|
||||
|
||||
IBuffer buffer = await bitmap.GetPixelsAsync();
|
||||
SoftwareBitmap softwareBitmap = SoftwareBitmap.CreateCopyFromBuffer(buffer, BitmapPixelFormat.Bgra8, bitmap.PixelWidth, bitmap.PixelHeight, BitmapAlphaMode.Ignore);
|
||||
Color systemAltHighColor = (Color)Ioc.Default.GetRequiredService<App>().Resources["CompatBackgroundColor"];
|
||||
Bgra8 tint = Bgra8.FromColor(systemAltHighColor);
|
||||
ProcessSoftwareBitmap(softwareBitmap, tint);
|
||||
|
||||
using (InMemoryRandomAccessStream memory = new())
|
||||
{
|
||||
BitmapEncoder encoder = await BitmapEncoder.CreateAsync(BitmapEncoder.JpegEncoderId, memory);
|
||||
encoder.SetSoftwareBitmap(softwareBitmap);
|
||||
await encoder.FlushAsync();
|
||||
Clipboard.SetBitmapStream(memory);
|
||||
}
|
||||
}
|
||||
}
|
||||
17
src/Snap.Hutao/Snap.Hutao/ViewModel/CultivationViewModel.cs
Normal file
17
src/Snap.Hutao/Snap.Hutao/ViewModel/CultivationViewModel.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Snap.Hutao.Control;
|
||||
|
||||
namespace Snap.Hutao.ViewModel;
|
||||
|
||||
/// <summary>
|
||||
/// 养成视图模型
|
||||
/// </summary>
|
||||
[Injection(InjectAs.Scoped)]
|
||||
internal class CultivationViewModel : ObservableObject, ISupportCancellation
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public CancellationToken CancellationToken { get; set; }
|
||||
}
|
||||
@@ -194,4 +194,4 @@ internal class DailyNoteViewModel : ObservableObject, ISupportCancellation
|
||||
appDbContext.DailyNotes.UpdateAndSave(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ using Snap.Hutao.Context.FileSystem.Location;
|
||||
using Snap.Hutao.Factory.Abstraction;
|
||||
using Snap.Hutao.Service.Abstraction;
|
||||
using Snap.Hutao.Service.User;
|
||||
using Snap.Hutao.View.Dialog;
|
||||
using Snap.Hutao.Web.Hutao;
|
||||
using Snap.Hutao.Web.Hutao.Model.Post;
|
||||
using Windows.Storage;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user