mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
Compare commits
1 Commits
fix/minor
...
syntax-wit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8b06b8008 |
@@ -15,7 +15,7 @@
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.2.1" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.2.1" />
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.1">
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
||||
@@ -5,12 +5,6 @@ namespace Snap.Hutao.Control.Text.Syntax.MiHoYo;
|
||||
|
||||
internal sealed class MiHoYoColorTextSyntax : MiHoYoXmlElementSyntax
|
||||
{
|
||||
public MiHoYoColorTextSyntax(MiHoYoColorKind colorKind, string text, int start, int end)
|
||||
: base(MiHoYoSyntaxKind.ColorText, text, start, end)
|
||||
{
|
||||
ColorKind = colorKind;
|
||||
}
|
||||
|
||||
public MiHoYoColorTextSyntax(MiHoYoColorKind colorKind, string text, in TextPosition position)
|
||||
: base(MiHoYoSyntaxKind.ColorText, text, position)
|
||||
{
|
||||
@@ -45,5 +39,5 @@ internal sealed class MiHoYoColorTextSyntax : MiHoYoXmlElementSyntax
|
||||
}
|
||||
}
|
||||
|
||||
public ReadOnlySpan<char> ColorSpan { get => Text.AsSpan()[ColorPosition.Start..ColorPosition.End]; }
|
||||
public ReadOnlySpan<char> ColorSpan { get => Text.AsSpan(ColorPosition); }
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Control.Text.Syntax.MiHoYo;
|
||||
|
||||
internal sealed class MiHoYoInterpolatedContentTextSyntax : MiHoYoInterpolatedTextSyntax
|
||||
{
|
||||
public MiHoYoInterpolatedContentTextSyntax(MiHoYoInterpolationKind interpolationKind, string text, in TextPosition position)
|
||||
: base(interpolationKind, text, position)
|
||||
{
|
||||
}
|
||||
|
||||
public TextPosition ContentPosition { get; }
|
||||
|
||||
public ReadOnlySpan<char> ContentSpan => Text.AsSpan(ContentPosition);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Control.Text.Syntax.MiHoYo;
|
||||
|
||||
internal class MiHoYoInterpolatedTextSyntax : MiHoYoSyntaxNode
|
||||
{
|
||||
public MiHoYoInterpolatedTextSyntax(MiHoYoInterpolationKind interpolationKind, string text, in TextPosition position)
|
||||
: base(MiHoYoSyntaxKind.InterpolatedText, text, position)
|
||||
{
|
||||
InterpolationKind = interpolationKind;
|
||||
}
|
||||
|
||||
public MiHoYoInterpolationKind InterpolationKind { get; }
|
||||
}
|
||||
|
||||
internal enum MiHoYoInterpolationKind
|
||||
{
|
||||
None,
|
||||
Female,
|
||||
LayoutMobile,
|
||||
LayoutPC,
|
||||
LayoutPS,
|
||||
Male,
|
||||
MateAvatarSexProInfoMaleFemalePronounBoyGirlD,
|
||||
MateAvatarSexProInfoMaleFemalePronounBoyGirlFirst,
|
||||
Nickname,
|
||||
NonBreakSpace,
|
||||
PlayerAvatarSexProInfoMaleFemalePronounHeShe,
|
||||
RealNameId1,
|
||||
RealNameId1HostOnlyTrue,
|
||||
}
|
||||
@@ -5,11 +5,6 @@ namespace Snap.Hutao.Control.Text.Syntax.MiHoYo;
|
||||
|
||||
internal sealed class MiHoYoItalicTextSyntax : MiHoYoXmlElementSyntax
|
||||
{
|
||||
public MiHoYoItalicTextSyntax(string text, int start, int end)
|
||||
: base(MiHoYoSyntaxKind.ItalicText, text, start, end)
|
||||
{
|
||||
}
|
||||
|
||||
public MiHoYoItalicTextSyntax(string text, in TextPosition position)
|
||||
: base(MiHoYoSyntaxKind.ItalicText, text, position)
|
||||
{
|
||||
|
||||
@@ -5,11 +5,6 @@ namespace Snap.Hutao.Control.Text.Syntax.MiHoYo;
|
||||
|
||||
internal sealed class MiHoYoPlainTextSyntax : MiHoYoSyntaxNode
|
||||
{
|
||||
public MiHoYoPlainTextSyntax(string text, int start, int end)
|
||||
: base(MiHoYoSyntaxKind.PlainText, text, start, end)
|
||||
{
|
||||
}
|
||||
|
||||
public MiHoYoPlainTextSyntax(string text, in TextPosition position)
|
||||
: base(MiHoYoSyntaxKind.PlainText, text, position)
|
||||
{
|
||||
|
||||
@@ -9,4 +9,8 @@ internal sealed class MiHoYoRootSyntax : MiHoYoSyntaxNode
|
||||
: base(MiHoYoSyntaxKind.Root, text, start, end)
|
||||
{
|
||||
}
|
||||
|
||||
public bool IsInterpolated { get => Text.AsSpan()[0] is '#'; }
|
||||
|
||||
public TextPosition ContentPosition { get => IsInterpolated ? new(Position.Start + 1, Position.End) : Position; }
|
||||
}
|
||||
@@ -8,6 +8,7 @@ internal enum MiHoYoSyntaxKind
|
||||
None,
|
||||
Root,
|
||||
PlainText,
|
||||
InterpolatedText,
|
||||
ColorText,
|
||||
ItalicText,
|
||||
}
|
||||
@@ -7,8 +7,6 @@ internal sealed class MiHoYoSyntaxTree
|
||||
{
|
||||
public MiHoYoSyntaxNode Root { get; set; } = default!;
|
||||
|
||||
public string Text { get; set; } = default!;
|
||||
|
||||
public static MiHoYoSyntaxTree Parse(string text)
|
||||
{
|
||||
MiHoYoRootSyntax root = new(text, 0, text.Length);
|
||||
@@ -16,7 +14,6 @@ internal sealed class MiHoYoSyntaxTree
|
||||
|
||||
MiHoYoSyntaxTree tree = new()
|
||||
{
|
||||
Text = text,
|
||||
Root = root,
|
||||
};
|
||||
|
||||
@@ -27,43 +24,50 @@ internal sealed class MiHoYoSyntaxTree
|
||||
{
|
||||
TextPosition contentPosition = syntax switch
|
||||
{
|
||||
MiHoYoRootSyntax rootSyntax => rootSyntax.ContentPosition,
|
||||
MiHoYoXmlElementSyntax xmlSyntax => xmlSyntax.ContentPosition,
|
||||
_ => syntax.Position,
|
||||
};
|
||||
ReadOnlySpan<char> contentSpan = text.AsSpan().Slice(contentPosition.Start, contentPosition.Length);
|
||||
|
||||
ReadOnlySpan<char> contentSpan = text.AsSpan(contentPosition);
|
||||
|
||||
int endOfProcessedAtContent = 0;
|
||||
while (true)
|
||||
{
|
||||
if (endOfProcessedAtContent >= contentSpan.Length)
|
||||
{
|
||||
break;
|
||||
return;
|
||||
}
|
||||
|
||||
// <tag>some text</tag>
|
||||
// ↑ ↑ ↑ ↑
|
||||
// | | | right closing
|
||||
// | | right opening
|
||||
// | left closing
|
||||
// left opening
|
||||
int indexOfXmlLeftOpeningAtUnprocessedContent = contentSpan[endOfProcessedAtContent..].IndexOf('<');
|
||||
|
||||
// End of content
|
||||
if (indexOfXmlLeftOpeningAtUnprocessedContent < 0)
|
||||
{
|
||||
TextPosition position = new(contentPosition.Start + endOfProcessedAtContent, contentPosition.End);
|
||||
MiHoYoPlainTextSyntax plainText = new(text, position);
|
||||
syntax.Children.Add(plainText);
|
||||
break;
|
||||
TextPosition positionAtText = new(contentPosition.Start + endOfProcessedAtContent, contentPosition.End);
|
||||
ParseInterpolatedOrPlainText(text, syntax, positionAtText);
|
||||
return;
|
||||
}
|
||||
|
||||
// We have plain text between xml elements
|
||||
// Text between xml elements
|
||||
if (indexOfXmlLeftOpeningAtUnprocessedContent > 0)
|
||||
{
|
||||
TextPosition position = new(0, indexOfXmlLeftOpeningAtUnprocessedContent);
|
||||
TextPosition positionAtContent = position.RightShift(endOfProcessedAtContent);
|
||||
TextPosition positionAtText = positionAtContent.RightShift(contentPosition.Start);
|
||||
MiHoYoPlainTextSyntax plainText = new(text, positionAtText);
|
||||
syntax.Children.Add(plainText);
|
||||
TextPosition positionAtContent = position >> endOfProcessedAtContent;
|
||||
TextPosition positionAtText = positionAtContent >> contentPosition.Start;
|
||||
|
||||
ParseInterpolatedOrPlainText(text, syntax, positionAtText);
|
||||
endOfProcessedAtContent = positionAtContent.End;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Peek the next character after '<'
|
||||
// Peek the next character after left opening
|
||||
int indexOfXmlLeftOpeningAtContent = endOfProcessedAtContent + indexOfXmlLeftOpeningAtUnprocessedContent;
|
||||
switch (contentSpan[indexOfXmlLeftOpeningAtContent + 1])
|
||||
{
|
||||
@@ -79,8 +83,8 @@ internal sealed class MiHoYoSyntaxTree
|
||||
};
|
||||
|
||||
TextPosition position = new(0, endOfXmlColorRightClosingAtUnprocessedContent);
|
||||
TextPosition positionAtContent = position.RightShift(endOfProcessedAtContent);
|
||||
TextPosition positionAtText = positionAtContent.RightShift(contentPosition.Start);
|
||||
TextPosition positionAtContent = position >> endOfProcessedAtContent;
|
||||
TextPosition positionAtText = positionAtContent >> contentPosition.Start;
|
||||
|
||||
MiHoYoColorTextSyntax colorText = new(colorKind, text, positionAtText);
|
||||
ParseComponents(text, colorText);
|
||||
@@ -94,8 +98,8 @@ internal sealed class MiHoYoSyntaxTree
|
||||
int endOfXmlItalicRightClosingAtUnprocessedContent = EndOfXmlClosing(contentSpan[indexOfXmlLeftOpeningAtContent..], out _);
|
||||
|
||||
TextPosition position = new(0, endOfXmlItalicRightClosingAtUnprocessedContent);
|
||||
TextPosition positionAtContent = position.RightShift(endOfProcessedAtContent);
|
||||
TextPosition positionAtText = positionAtContent.RightShift(contentPosition.Start);
|
||||
TextPosition positionAtContent = position >> endOfProcessedAtContent;
|
||||
TextPosition positionAtText = positionAtContent >> contentPosition.Start;
|
||||
|
||||
MiHoYoItalicTextSyntax italicText = new(text, positionAtText);
|
||||
ParseComponents(text, italicText);
|
||||
@@ -107,6 +111,174 @@ internal sealed class MiHoYoSyntaxTree
|
||||
}
|
||||
}
|
||||
|
||||
private static void ParseInterpolatedOrPlainText(string text, MiHoYoSyntaxNode syntax, in TextPosition spanPosition)
|
||||
{
|
||||
if (text.AsSpan()[0] is not '#')
|
||||
{
|
||||
MiHoYoPlainTextSyntax plainText = new(text, spanPosition);
|
||||
syntax.Children.Add(plainText);
|
||||
return;
|
||||
}
|
||||
|
||||
ReadOnlySpan<char> span = text.AsSpan(spanPosition);
|
||||
|
||||
int endOfProcessedAtSpan = 0;
|
||||
while (true)
|
||||
{
|
||||
if (endOfProcessedAtSpan >= span.Length)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int indexOfOpeningAtUnprocessedSpan = span[endOfProcessedAtSpan..].IndexOf('{');
|
||||
|
||||
// End of content
|
||||
if (indexOfOpeningAtUnprocessedSpan < 0)
|
||||
{
|
||||
TextPosition positionAtText = new(spanPosition.Start + endOfProcessedAtSpan, spanPosition.End);
|
||||
|
||||
MiHoYoPlainTextSyntax plainText = new(text, positionAtText);
|
||||
syntax.Children.Add(plainText);
|
||||
break;
|
||||
}
|
||||
|
||||
// Text between interpolation
|
||||
if (indexOfOpeningAtUnprocessedSpan > 0)
|
||||
{
|
||||
TextPosition position = new(0, indexOfOpeningAtUnprocessedSpan);
|
||||
TextPosition positionAtSpan = position >> endOfProcessedAtSpan;
|
||||
TextPosition positionAtText = positionAtSpan >> spanPosition.Start;
|
||||
|
||||
MiHoYoPlainTextSyntax plainText = new(text, positionAtText);
|
||||
syntax.Children.Add(plainText);
|
||||
endOfProcessedAtSpan = positionAtSpan.End;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Peek the next character after left opening
|
||||
int indexOfOpeningAtSpan = endOfProcessedAtSpan + indexOfOpeningAtUnprocessedSpan;
|
||||
int endOfClosingAtUnprocessedSpan = span[indexOfOpeningAtSpan..].IndexOf('}') + 1;
|
||||
|
||||
TextPosition position2 = new(0, endOfClosingAtUnprocessedSpan);
|
||||
TextPosition positionAtSpan2 = position2 >> endOfProcessedAtSpan;
|
||||
TextPosition positionAtText2 = positionAtSpan2 >> spanPosition.Start;
|
||||
|
||||
switch (span[indexOfOpeningAtSpan + 1])
|
||||
{
|
||||
// {F#(.*?)}
|
||||
case 'F':
|
||||
{
|
||||
MiHoYoInterpolatedContentTextSyntax contentTextSyntax = new(MiHoYoInterpolationKind.Female, text, positionAtText2);
|
||||
syntax.Children.Add(contentTextSyntax);
|
||||
endOfProcessedAtSpan += endOfClosingAtUnprocessedSpan;
|
||||
break;
|
||||
}
|
||||
|
||||
// {LAYOUT_MOBILE#(.+?)}
|
||||
// {LAYOUT_PC#(.+?)}
|
||||
// {LAYOUT_PS#(.+?)}
|
||||
case 'L':
|
||||
{
|
||||
MiHoYoInterpolationKind kind = span[indexOfOpeningAtSpan + 9] switch
|
||||
{
|
||||
'O' => MiHoYoInterpolationKind.LayoutMobile,
|
||||
'P' => MiHoYoInterpolationKind.LayoutPC,
|
||||
'S' => MiHoYoInterpolationKind.LayoutPS,
|
||||
_ => throw Must.NeverHappen($"Unexpected span content {span}"),
|
||||
};
|
||||
|
||||
MiHoYoInterpolatedContentTextSyntax contentTextSyntax = new(kind, text, positionAtText2);
|
||||
syntax.Children.Add(contentTextSyntax);
|
||||
endOfProcessedAtSpan += endOfClosingAtUnprocessedSpan;
|
||||
break;
|
||||
}
|
||||
|
||||
// {MATEAVATAR#SEXPRO[INFO_MALE_PRONOUN_BOYD|INFO_FEMALE_PRONOUN_GIRLD]}
|
||||
// {MATEAVATAR#SEXPRO[INFO_MALE_PRONOUN_BOYFIRST|INFO_FEMALE_PRONOUN_GIRLFIRST]}
|
||||
// {M#(.*?)}
|
||||
case 'M':
|
||||
{
|
||||
switch (span[indexOfOpeningAtSpan + 2])
|
||||
{
|
||||
case 'A':
|
||||
{
|
||||
MiHoYoInterpolationKind kind = endOfClosingAtUnprocessedSpan switch
|
||||
{
|
||||
69 => MiHoYoInterpolationKind.MateAvatarSexProInfoMaleFemalePronounBoyGirlD,
|
||||
77 => MiHoYoInterpolationKind.MateAvatarSexProInfoMaleFemalePronounBoyGirlFirst,
|
||||
_ => throw Must.NeverHappen($"Unexpected span content {span}"),
|
||||
};
|
||||
|
||||
MiHoYoInterpolatedTextSyntax textSyntax = new(kind, text, positionAtText2);
|
||||
syntax.Children.Add(textSyntax);
|
||||
endOfProcessedAtSpan += endOfClosingAtUnprocessedSpan;
|
||||
break;
|
||||
}
|
||||
|
||||
case '#':
|
||||
{
|
||||
MiHoYoInterpolatedContentTextSyntax contentTextSyntax = new(MiHoYoInterpolationKind.Male, text, positionAtText2);
|
||||
syntax.Children.Add(contentTextSyntax);
|
||||
endOfProcessedAtSpan += endOfClosingAtUnprocessedSpan;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
throw Must.NeverHappen($"Unexpected span content {span}");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// {NICKNAME}
|
||||
// {NON_BREAK_SPACE}
|
||||
case 'N':
|
||||
{
|
||||
MiHoYoInterpolationKind kind = span[indexOfOpeningAtSpan + 2] switch
|
||||
{
|
||||
'I' => MiHoYoInterpolationKind.Nickname,
|
||||
'O' => MiHoYoInterpolationKind.NonBreakSpace,
|
||||
_ => throw Must.NeverHappen($"Unexpected span content {span}"),
|
||||
};
|
||||
|
||||
MiHoYoInterpolatedTextSyntax textSyntax = new(kind, text, positionAtText2);
|
||||
syntax.Children.Add(textSyntax);
|
||||
endOfProcessedAtSpan += endOfClosingAtUnprocessedSpan;
|
||||
break;
|
||||
}
|
||||
|
||||
// {PLAYERAVATAR#SEXPRO[INFO_MALE_PRONOUN_HE|INFO_FEMALE_PRONOUN_SHE]}
|
||||
case 'P':
|
||||
{
|
||||
MiHoYoInterpolatedContentTextSyntax contentTextSyntax = new(MiHoYoInterpolationKind.PlayerAvatarSexProInfoMaleFemalePronounHeShe, text, positionAtText2);
|
||||
syntax.Children.Add(contentTextSyntax);
|
||||
endOfProcessedAtSpan += endOfClosingAtUnprocessedSpan;
|
||||
break;
|
||||
}
|
||||
|
||||
// {REALNAME[ID(1)|HOSTONLY(true)]}
|
||||
// {REALNAME[ID(1)]}
|
||||
case 'R':
|
||||
{
|
||||
MiHoYoInterpolationKind kind = endOfClosingAtUnprocessedSpan switch
|
||||
{
|
||||
32 => MiHoYoInterpolationKind.RealNameId1HostOnlyTrue,
|
||||
17 => MiHoYoInterpolationKind.RealNameId1,
|
||||
_ => throw Must.NeverHappen($"Unexpected span content {span}"),
|
||||
};
|
||||
|
||||
MiHoYoInterpolatedTextSyntax textSyntax = new(kind, text, positionAtText2);
|
||||
syntax.Children.Add(textSyntax);
|
||||
endOfProcessedAtSpan += endOfClosingAtUnprocessedSpan;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
throw Must.NeverHappen($"Unexpected span content {span}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int EndOfXmlClosing(in ReadOnlySpan<char> span, out int endOfLeftClosing)
|
||||
{
|
||||
endOfLeftClosing = 0;
|
||||
|
||||
@@ -5,11 +5,6 @@ namespace Snap.Hutao.Control.Text.Syntax.MiHoYo;
|
||||
|
||||
internal abstract class MiHoYoXmlElementSyntax : MiHoYoSyntaxNode
|
||||
{
|
||||
public MiHoYoXmlElementSyntax(MiHoYoSyntaxKind kind, string text, int start, int end)
|
||||
: base(kind, text, start, end)
|
||||
{
|
||||
}
|
||||
|
||||
public MiHoYoXmlElementSyntax(MiHoYoSyntaxKind kind, string text, in TextPosition position)
|
||||
: base(kind, text, position)
|
||||
{
|
||||
|
||||
@@ -22,13 +22,13 @@ internal readonly struct TextPosition
|
||||
get => End - Start;
|
||||
}
|
||||
|
||||
public TextPosition LeftShift(int offset)
|
||||
public static TextPosition operator <<(TextPosition position, int offset)
|
||||
{
|
||||
return new(Start - offset, End - offset);
|
||||
return new(position.Start - offset, position.End - offset);
|
||||
}
|
||||
|
||||
public TextPosition RightShift(int offset)
|
||||
public static TextPosition operator >>(TextPosition position, int offset)
|
||||
{
|
||||
return new(Start + offset, End + offset);
|
||||
return new(position.Start + offset, position.End + offset);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Control.Text.Syntax;
|
||||
|
||||
internal static class TextPositionExtension
|
||||
{
|
||||
public static ReadOnlySpan<char> AsSpan(this string? text, TextPosition position)
|
||||
{
|
||||
return text.AsSpan(position.Start, position.Length);
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,6 @@ internal static partial class IocHttpClientConfiguration
|
||||
.ConfigurePrimaryHttpMessageHandler((handler, provider) =>
|
||||
{
|
||||
HttpClientHandler clientHandler = (HttpClientHandler)handler;
|
||||
clientHandler.AllowAutoRedirect = true;
|
||||
clientHandler.UseProxy = true;
|
||||
clientHandler.Proxy = provider.GetRequiredService<DynamicHttpProxy>();
|
||||
});
|
||||
|
||||
@@ -41,30 +41,6 @@
|
||||
"Equatable": true,
|
||||
"EqualityOperators": true
|
||||
},
|
||||
{
|
||||
"Name": "FurnitureId",
|
||||
"Documentation": "家具 Id",
|
||||
"Equatable": true,
|
||||
"EqualityOperators": true
|
||||
},
|
||||
{
|
||||
"Name": "FurnitureMakeId",
|
||||
"Documentation": "家具配方 Id",
|
||||
"Equatable": true,
|
||||
"EqualityOperators": true
|
||||
},
|
||||
{
|
||||
"Name": "FurnitureSuiteId",
|
||||
"Documentation": "家具套装 Id",
|
||||
"Equatable": true,
|
||||
"EqualityOperators": true
|
||||
},
|
||||
{
|
||||
"Name": "FurnitureTypeId",
|
||||
"Documentation": "家具分类 Id",
|
||||
"Equatable": true,
|
||||
"EqualityOperators": true
|
||||
},
|
||||
{
|
||||
"Name": "Level",
|
||||
"Documentation": "等级 1 - 90",
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Model.Intrinsic;
|
||||
|
||||
internal enum FurnitureDeploySurfaceType
|
||||
{
|
||||
Ground = 0,
|
||||
Wall = 1,
|
||||
Ceil = 2,
|
||||
StackObjPlane = 3,
|
||||
Door = 4,
|
||||
Chandelier = 5,
|
||||
Floor = 6,
|
||||
WallBody = 7,
|
||||
Carpet = 8,
|
||||
LegoRockery = 9,
|
||||
Stair = 10,
|
||||
NPC = 11,
|
||||
Animal = 12,
|
||||
Apartment = 13,
|
||||
FurnitureSuite = 14,
|
||||
Road = 15,
|
||||
Terrain = 16,
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Model.Intrinsic;
|
||||
|
||||
internal enum FurnitureDeployType
|
||||
{
|
||||
Interior,
|
||||
Exterior,
|
||||
InteriorRoom,
|
||||
InteriorHall,
|
||||
Skybox,
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Model.Intrinsic;
|
||||
|
||||
internal enum GroupRecordType
|
||||
{
|
||||
None,
|
||||
Racing,
|
||||
Balloon,
|
||||
Stake,
|
||||
Seek,
|
||||
Explosion,
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Model.Intrinsic;
|
||||
|
||||
internal enum SpecialFurnitureType
|
||||
{
|
||||
NormalFurniture,
|
||||
BlockDependent,
|
||||
FarmField,
|
||||
TeleportPoint,
|
||||
Fishpond,
|
||||
Npc,
|
||||
Apartment,
|
||||
FurnitureSuite,
|
||||
Paimon,
|
||||
Fish,
|
||||
CustomBaseFurniture,
|
||||
CustomNodeFurniture,
|
||||
VirtualFurniture,
|
||||
GroupFurniture,
|
||||
CoopPictureFrame,
|
||||
ChangeBgmFurniture,
|
||||
ServerGadget,
|
||||
Fishtank,
|
||||
}
|
||||
@@ -8,4 +8,15 @@ namespace Snap.Hutao.Model.Metadata.Achievement;
|
||||
/// <summary>
|
||||
/// 奖励
|
||||
/// </summary>
|
||||
internal sealed class Reward : IdCount;
|
||||
internal sealed class Reward
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
public MaterialId Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数量
|
||||
/// </summary>
|
||||
public uint Count { get; set; }
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
|
||||
namespace Snap.Hutao.Model.Metadata.Furniture;
|
||||
|
||||
internal sealed class Furniture
|
||||
{
|
||||
public List<FurnitureTypeId> Types { get; set; } = default!;
|
||||
|
||||
public FurnitureDeploySurfaceType SurfaceType { get; set; }
|
||||
|
||||
public bool IsSpecial { get; set; }
|
||||
|
||||
public SpecialFurnitureType SpecialType { get; set; }
|
||||
|
||||
public uint Comfort { get; set; }
|
||||
|
||||
public uint Cost { get; set; }
|
||||
|
||||
public uint DiscountCost { get; set; }
|
||||
|
||||
public bool CanFloat { get; set; }
|
||||
|
||||
public bool IsUnique { get; set; }
|
||||
|
||||
public string? ItemIcon { get; set; }
|
||||
|
||||
public string? EffectIcon { get; set; }
|
||||
|
||||
public QualityType RankLevel { get; set; }
|
||||
|
||||
public List<FurnitureId> GruopUnits { get; set; } = default!;
|
||||
|
||||
public GroupRecordType GroupRecordType { get; set; }
|
||||
|
||||
public List<string> SourceTexts { get; set; } = default!;
|
||||
|
||||
public FurnitureId Id { get; set; }
|
||||
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
public string Description { get; set; } = default!;
|
||||
|
||||
public string? Icon { get; set; }
|
||||
|
||||
public uint Rank { get; set; }
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
|
||||
namespace Snap.Hutao.Model.Metadata.Furniture;
|
||||
|
||||
internal sealed class FurnitureMake
|
||||
{
|
||||
public FurnitureMakeId Id { get; set; }
|
||||
|
||||
public FurnitureId ItemId { get; set; }
|
||||
|
||||
public uint Experience { get; set; }
|
||||
|
||||
public List<IdCount> Materials { get; set; } = default!;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
|
||||
namespace Snap.Hutao.Model.Metadata.Furniture;
|
||||
|
||||
internal sealed class FurnitureSuite
|
||||
{
|
||||
public FurnitureSuiteId Id { get; set; }
|
||||
|
||||
public List<FurnitureTypeId> Types { get; set; } = default!;
|
||||
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
public string Description { get; set; } = default!;
|
||||
|
||||
public string ItemIcon { get; set; } = default!;
|
||||
|
||||
public string? MapIcon { get; set; }
|
||||
|
||||
public List<AvatarId>? FavoriteNpcs { get; set; }
|
||||
|
||||
public List<FurnitureId> Units { get; set; } = default!;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
|
||||
namespace Snap.Hutao.Model.Metadata.Furniture;
|
||||
|
||||
internal sealed class FurnitureType
|
||||
{
|
||||
public FurnitureTypeId Id { get; set; }
|
||||
|
||||
public uint Category { get; set; }
|
||||
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
public string Name2 { get; set; } = default!;
|
||||
|
||||
public string TabIcon { get; set; } = default!;
|
||||
|
||||
public FurnitureDeployType SceneType { get; set; }
|
||||
|
||||
public bool BagPageOnly { get; set; }
|
||||
|
||||
public bool IsShowInBag { get; set; }
|
||||
|
||||
public uint Sort { get; set; }
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
|
||||
namespace Snap.Hutao.Model.Metadata;
|
||||
|
||||
internal class IdCount
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
public MaterialId Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数量
|
||||
/// </summary>
|
||||
public uint Count { get; set; }
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.UI.Xaml;
|
||||
using Snap.Hutao.Win32.Foundation;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using WinRT;
|
||||
@@ -33,7 +34,7 @@ public static partial class Program
|
||||
}
|
||||
|
||||
[LibraryImport("Microsoft.WindowsAppRuntime.dll", EntryPoint = "WindowsAppRuntime_EnsureIsLoaded")]
|
||||
private static partial int WindowsAppRuntimeEnsureIsLoaded();
|
||||
private static partial HRESULT WindowsAppRuntimeEnsureIsLoaded();
|
||||
|
||||
[LibraryImport("Microsoft.ui.xaml.dll")]
|
||||
private static partial void XamlCheckProcessRequirements();
|
||||
|
||||
@@ -60,45 +60,45 @@
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string"/>
|
||||
<xsd:attribute name="type" type="xsd:string"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string"/>
|
||||
<xsd:attribute name="name" type="xsd:string"/>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
@@ -198,10 +198,10 @@
|
||||
<data name="LaunchGameTitle" xml:space="preserve">
|
||||
<value>Select Account to Launch</value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameMetaAvatarSexProInfoPronounBoyGirlD" xml:space="preserve">
|
||||
<data name="MetadataSpecialNameMateAvatarSexProInfoPronounBoyGirlD" xml:space="preserve">
|
||||
<value><color=#1E90FF>Prince</color>/<color=#FFB6C1>Princess</color></value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameMetaAvatarSexProInfoPronounBoyGirlFirst" xml:space="preserve">
|
||||
<data name="MetadataSpecialNameMateAvatarSexProInfoPronounBoyGirlFirst" xml:space="preserve">
|
||||
<value><color=#1E90FF>I</color>/<color=#FFB6C1>I</color></value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameNickname" xml:space="preserve">
|
||||
|
||||
@@ -60,45 +60,45 @@
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string"/>
|
||||
<xsd:attribute name="type" type="xsd:string"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string"/>
|
||||
<xsd:attribute name="name" type="xsd:string"/>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
@@ -198,10 +198,10 @@
|
||||
<data name="LaunchGameTitle" xml:space="preserve">
|
||||
<value>Pilih akun untuk memulai</value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameMetaAvatarSexProInfoPronounBoyGirlD" xml:space="preserve">
|
||||
<data name="MetadataSpecialNameMateAvatarSexProInfoPronounBoyGirlD" xml:space="preserve">
|
||||
<value><color=#1E90FF>王子</color>/<color=#FFB6C1>公主</color></value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameMetaAvatarSexProInfoPronounBoyGirlFirst" xml:space="preserve">
|
||||
<data name="MetadataSpecialNameMateAvatarSexProInfoPronounBoyGirlFirst" xml:space="preserve">
|
||||
<value><color=#1E90FF>我</color>/<color=#FFB6C1>我</color></value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameNickname" xml:space="preserve">
|
||||
|
||||
@@ -60,45 +60,45 @@
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string"/>
|
||||
<xsd:attribute name="type" type="xsd:string"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string"/>
|
||||
<xsd:attribute name="name" type="xsd:string"/>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
@@ -198,10 +198,10 @@
|
||||
<data name="LaunchGameTitle" xml:space="preserve">
|
||||
<value>アカウントを選択して開始します</value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameMetaAvatarSexProInfoPronounBoyGirlD" xml:space="preserve">
|
||||
<data name="MetadataSpecialNameMateAvatarSexProInfoPronounBoyGirlD" xml:space="preserve">
|
||||
<value><color=#1E90FF>王子</color>/<color=#FFB6C1>公主</color></value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameMetaAvatarSexProInfoPronounBoyGirlFirst" xml:space="preserve">
|
||||
<data name="MetadataSpecialNameMateAvatarSexProInfoPronounBoyGirlFirst" xml:space="preserve">
|
||||
<value><color=#1E90FF>我</color>/<color=#FFB6C1>我</color></value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameNickname" xml:space="preserve">
|
||||
|
||||
@@ -60,45 +60,45 @@
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string"/>
|
||||
<xsd:attribute name="type" type="xsd:string"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string"/>
|
||||
<xsd:attribute name="name" type="xsd:string"/>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
@@ -198,10 +198,10 @@
|
||||
<data name="LaunchGameTitle" xml:space="preserve">
|
||||
<value>계정 선택 및 시작</value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameMetaAvatarSexProInfoPronounBoyGirlD" xml:space="preserve">
|
||||
<data name="MetadataSpecialNameMateAvatarSexProInfoPronounBoyGirlD" xml:space="preserve">
|
||||
<value><color=#1E90FF>王子</color>/<color=#FFB6C1>公主</color></value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameMetaAvatarSexProInfoPronounBoyGirlFirst" xml:space="preserve">
|
||||
<data name="MetadataSpecialNameMateAvatarSexProInfoPronounBoyGirlFirst" xml:space="preserve">
|
||||
<value><color=#1E90FF>我</color>/<color=#FFB6C1>我</color></value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameNickname" xml:space="preserve">
|
||||
|
||||
@@ -60,45 +60,45 @@
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string"/>
|
||||
<xsd:attribute name="type" type="xsd:string"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string"/>
|
||||
<xsd:attribute name="name" type="xsd:string"/>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
@@ -198,10 +198,10 @@
|
||||
<data name="LaunchGameTitle" xml:space="preserve">
|
||||
<value>Selecionar conta para iniciar</value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameMetaAvatarSexProInfoPronounBoyGirlD" xml:space="preserve">
|
||||
<data name="MetadataSpecialNameMateAvatarSexProInfoPronounBoyGirlD" xml:space="preserve">
|
||||
<value><color=#1E90FF>王子</color>/<color=#FFB6C1>公主</color></value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameMetaAvatarSexProInfoPronounBoyGirlFirst" xml:space="preserve">
|
||||
<data name="MetadataSpecialNameMateAvatarSexProInfoPronounBoyGirlFirst" xml:space="preserve">
|
||||
<value><color=#1E90FF>我</color>/<color=#FFB6C1>我</color></value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameNickname" xml:space="preserve">
|
||||
|
||||
@@ -201,10 +201,10 @@
|
||||
<data name="LaunchGameTitle" xml:space="preserve">
|
||||
<value>选择账号并启动</value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameMetaAvatarSexProInfoPronounBoyGirlD" xml:space="preserve">
|
||||
<data name="MetadataSpecialNameMateAvatarSexProInfoPronounBoyGirlD" xml:space="preserve">
|
||||
<value><color=#1E90FF>王子</color>/<color=#FFB6C1>公主</color></value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameMetaAvatarSexProInfoPronounBoyGirlFirst" xml:space="preserve">
|
||||
<data name="MetadataSpecialNameMateAvatarSexProInfoPronounBoyGirlFirst" xml:space="preserve">
|
||||
<value><color=#1E90FF>我</color>/<color=#FFB6C1>我</color></value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameNickname" xml:space="preserve">
|
||||
@@ -2895,7 +2895,7 @@
|
||||
<value>〓活动时间〓.*?\d\.\d版本期间持续开放</value>
|
||||
</data>
|
||||
<data name="WebAnnouncementMatchTransientActivityTime" xml:space="preserve">
|
||||
<value>(?:〓活动时间〓|祈愿时间|【上架时间】|〓折扣时间〓).*?(\d\.\d版本更新后).*?~.*?&lt;t class="t_(?:gl|lc)".*?&gt;(.*?)&lt;/t&gt;</value>
|
||||
<value>(?:〓活动时间〓|祈愿时间|【上架时间】).*?(\d\.\d版本更新后).*?~.*?&lt;t class="t_(?:gl|lc)".*?&gt;(.*?)&lt;/t&gt;</value>
|
||||
</data>
|
||||
<data name="WebAnnouncementMatchVersionUpdateTime" xml:space="preserve">
|
||||
<value>〓更新时间〓.+?&lt;t class=\"t_(?:gl|lc)\".*?&gt;(.*?)&lt;/t&gt;</value>
|
||||
|
||||
@@ -60,45 +60,45 @@
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string"/>
|
||||
<xsd:attribute name="type" type="xsd:string"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string"/>
|
||||
<xsd:attribute name="name" type="xsd:string"/>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
@@ -198,10 +198,10 @@
|
||||
<data name="LaunchGameTitle" xml:space="preserve">
|
||||
<value>Выберите учетную запись для запуска</value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameMetaAvatarSexProInfoPronounBoyGirlD" xml:space="preserve">
|
||||
<data name="MetadataSpecialNameMateAvatarSexProInfoPronounBoyGirlD" xml:space="preserve">
|
||||
<value><color=#1E90FF>Принц</color>/<color=#FFB6C1>Принцесса</color></value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameMetaAvatarSexProInfoPronounBoyGirlFirst" xml:space="preserve">
|
||||
<data name="MetadataSpecialNameMateAvatarSexProInfoPronounBoyGirlFirst" xml:space="preserve">
|
||||
<value><color=#1E90FF>I</color>/<color=#FFB6C1>I</color></value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameNickname" xml:space="preserve">
|
||||
|
||||
@@ -60,45 +60,45 @@
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string"/>
|
||||
<xsd:attribute name="type" type="xsd:string"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string"/>
|
||||
<xsd:attribute name="name" type="xsd:string"/>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
|
||||
<xsd:attribute ref="xml:space"/>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
@@ -198,10 +198,10 @@
|
||||
<data name="LaunchGameTitle" xml:space="preserve">
|
||||
<value>選擇帳號並啟動</value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameMetaAvatarSexProInfoPronounBoyGirlD" xml:space="preserve">
|
||||
<data name="MetadataSpecialNameMateAvatarSexProInfoPronounBoyGirlD" xml:space="preserve">
|
||||
<value><color=#1E90FF>王子</color>/<color=#FFB6C1>公主</color></value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameMetaAvatarSexProInfoPronounBoyGirlFirst" xml:space="preserve">
|
||||
<data name="MetadataSpecialNameMateAvatarSexProInfoPronounBoyGirlFirst" xml:space="preserve">
|
||||
<value><color=#1E90FF>我</color>/<color=#FFB6C1>我</color></value>
|
||||
</data>
|
||||
<data name="MetadataSpecialNameNickname" xml:space="preserve">
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 5.5 KiB |
@@ -85,13 +85,8 @@ internal sealed partial class AnnouncementService : IAnnouncementService
|
||||
{
|
||||
foreach (ref readonly Announcement item in CollectionsMarshal.AsSpan(listWrapper.List))
|
||||
{
|
||||
item.Subtitle = new StringBuilder(item.Subtitle)
|
||||
.Replace("\r<br>", string.Empty)
|
||||
.Replace("<br />", string.Empty)
|
||||
.ToString();
|
||||
item.Content = AnnouncementRegex
|
||||
.XmlTimeTagRegex()
|
||||
.Replace(item.Content, x => x.Groups[1].Value);
|
||||
item.Subtitle = new StringBuilder(item.Subtitle).Replace("\r<br>", string.Empty).ToString();
|
||||
item.Content = AnnouncementRegex.XmlTimeTagRegex().Replace(item.Content, x => x.Groups[1].Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,13 +28,13 @@ internal sealed partial class BackgroundImageService : IBackgroundImageService
|
||||
|
||||
private HashSet<string> currentBackgroundPathSet;
|
||||
|
||||
public async ValueTask<ValueResult<bool, BackgroundImage?>> GetNextBackgroundImageAsync(BackgroundImage? previous)
|
||||
public async ValueTask<ValueResult<bool, BackgroundImage>> GetNextBackgroundImageAsync(BackgroundImage? previous)
|
||||
{
|
||||
HashSet<string> backgroundSet = await SkipOrInitBackgroundAsync().ConfigureAwait(false);
|
||||
|
||||
if (backgroundSet.Count <= 0)
|
||||
{
|
||||
return new(true, default!);
|
||||
return new(false, default!);
|
||||
}
|
||||
|
||||
string path = System.Random.Shared.GetItems([..backgroundSet], 1)[0];
|
||||
@@ -109,9 +109,6 @@ internal sealed partial class BackgroundImageService : IBackgroundImageService
|
||||
case BackgroundImageType.HutaoOfficialLauncher:
|
||||
await SetCurrentBackgroundPathSetAsync(client => client.GetLauncherWallpaperAsync()).ConfigureAwait(false);
|
||||
break;
|
||||
default:
|
||||
currentBackgroundPathSet = [];
|
||||
break;
|
||||
}
|
||||
|
||||
currentBackgroundPathSet ??= [];
|
||||
|
||||
@@ -5,5 +5,5 @@ namespace Snap.Hutao.Service.BackgroundImage;
|
||||
|
||||
internal interface IBackgroundImageService
|
||||
{
|
||||
ValueTask<ValueResult<bool, BackgroundImage?>> GetNextBackgroundImageAsync(BackgroundImage? previous);
|
||||
ValueTask<ValueResult<bool, BackgroundImage>> GetNextBackgroundImageAsync(BackgroundImage? previous);
|
||||
}
|
||||
@@ -41,33 +41,39 @@ internal sealed partial class DiscordService : IDiscordService, IDisposable
|
||||
|
||||
private bool IsSupported()
|
||||
{
|
||||
// Actually requires a discord client to be running on Windows platform.
|
||||
// If not, discord core creation code will throw.
|
||||
Process[] discordProcesses = Process.GetProcessesByName("Discord");
|
||||
|
||||
if (discordProcesses.Length <= 0)
|
||||
try
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// Actually requires a discord client to be running on Windows platform.
|
||||
// If not, discord core creation code will throw.
|
||||
Process[] discordProcesses = Process.GetProcessesByName("Discord");
|
||||
|
||||
foreach (Process process in discordProcesses)
|
||||
{
|
||||
try
|
||||
if (discordProcesses.Length <= 0)
|
||||
{
|
||||
_ = process.Handle;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
if (!isInitialized)
|
||||
{
|
||||
isInitialized = true;
|
||||
infoBarService.Warning(SH.ServiceDiscordActivityElevationRequiredHint);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
foreach (Process process in discordProcesses)
|
||||
{
|
||||
try
|
||||
{
|
||||
_ = process.Handle;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
if (!isInitialized)
|
||||
{
|
||||
infoBarService.Warning(SH.ServiceDiscordActivityElevationRequiredHint);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
isInitialized = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,15 +23,8 @@ internal sealed class LaunchExecutionBetterGenshinImpactAutomationHandlder : ILa
|
||||
Uri betterGenshinImpactUri = "bettergi://start".ToUri();
|
||||
if (await Launcher.QueryUriSupportAsync(betterGenshinImpactUri, LaunchQuerySupportType.Uri) is LaunchQuerySupportStatus.Available)
|
||||
{
|
||||
try
|
||||
{
|
||||
context.Logger.LogInformation("Waiting game window to be ready");
|
||||
context.Process.WaitForInputIdle();
|
||||
}
|
||||
catch (InvalidOperationException)
|
||||
{
|
||||
return;
|
||||
}
|
||||
context.Logger.LogInformation("Waiting game window to be ready");
|
||||
context.Process.WaitForInputIdle();
|
||||
|
||||
context.Logger.LogInformation("Launching BetterGI");
|
||||
await Launcher.LaunchUriAsync(betterGenshinImpactUri);
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Control;
|
||||
using Snap.Hutao.Core.Windowing;
|
||||
|
||||
namespace Snap.Hutao.View.Converter.Specialized;
|
||||
|
||||
internal sealed class BackdropTypeToOpacityConverter : ValueConverter<BackdropType, double>
|
||||
{
|
||||
public override double Convert(BackdropType from)
|
||||
{
|
||||
return from is BackdropType.None ? 1 : 0;
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@
|
||||
xmlns:shch="using:Snap.Hutao.Control.Helper"
|
||||
xmlns:shcm="using:Snap.Hutao.Control.Markup"
|
||||
xmlns:shv="using:Snap.Hutao.View"
|
||||
xmlns:shvcs="using:Snap.Hutao.View.Converter.Specialized"
|
||||
xmlns:shvh="using:Snap.Hutao.View.Helper"
|
||||
xmlns:shvm="using:Snap.Hutao.ViewModel"
|
||||
xmlns:shvp="using:Snap.Hutao.View.Page"
|
||||
@@ -28,16 +27,9 @@
|
||||
<Thickness x:Key="NavigationViewContentGridBorderThickness">0,1,0,0</Thickness>
|
||||
<x:Double x:Key="NavigationViewItemOnLeftIconBoxHeight">24</x:Double>
|
||||
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="Transparent"/>
|
||||
<shvcs:BackdropTypeToOpacityConverter x:Key="BackdropTypeToOpacityConverter"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<!-- Background="{ThemeResource SolidBackgroundFillColorBaseBrush}" -->
|
||||
<Grid Transitions="{ThemeResource EntranceThemeTransitions}">
|
||||
<Border Background="{ThemeResource SolidBackgroundFillColorBaseBrush}" Opacity="{Binding AppOptions.BackdropType, Converter={StaticResource BackdropTypeToOpacityConverter}, Mode=OneWay}">
|
||||
<Border.OpacityTransition>
|
||||
<ScalarTransition Duration="0:0:1"/>
|
||||
</Border.OpacityTransition>
|
||||
</Border>
|
||||
|
||||
<Image
|
||||
x:Name="BackgroundImagePresenter"
|
||||
HorizontalAlignment="Center"
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using CommunityToolkit.WinUI.Animations;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media.Animation;
|
||||
using Snap.Hutao.Control.Animation;
|
||||
using Snap.Hutao.Control.Theme;
|
||||
using Snap.Hutao.Service.BackgroundImage;
|
||||
using Snap.Hutao.Service.Navigation;
|
||||
using Snap.Hutao.View.Page;
|
||||
using Snap.Hutao.ViewModel;
|
||||
|
||||
@@ -377,31 +377,36 @@ internal sealed partial class AchievementViewModel : Abstraction.ViewModel, INav
|
||||
[Command("SearchAchievementCommand")]
|
||||
private void UpdateAchievementsFilterBySearch(string? search)
|
||||
{
|
||||
if (Achievements is not null)
|
||||
if (Achievements is null)
|
||||
{
|
||||
SetProperty(ref selectedAchievementGoal, null);
|
||||
|
||||
if (!string.IsNullOrEmpty(search))
|
||||
{
|
||||
if (uint.TryParse(search, out uint achievementId))
|
||||
{
|
||||
Achievements.Filter = view => view.Inner.Id == achievementId;
|
||||
return;
|
||||
}
|
||||
|
||||
if (VersionRegex().IsMatch(search))
|
||||
{
|
||||
Achievements.Filter = view => view.Inner.Version == search;
|
||||
return;
|
||||
}
|
||||
|
||||
Achievements.Filter = view =>
|
||||
{
|
||||
return view.Inner.Title.Contains(search, StringComparison.CurrentCultureIgnoreCase)
|
||||
|| view.Inner.Description.Contains(search, StringComparison.CurrentCultureIgnoreCase);
|
||||
};
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
SetProperty(ref selectedAchievementGoal, null, nameof(SelectedAchievementGoal));
|
||||
|
||||
if (string.IsNullOrEmpty(search))
|
||||
{
|
||||
Achievements.Filter = default;
|
||||
return;
|
||||
}
|
||||
|
||||
if (uint.TryParse(search, out uint achievementId))
|
||||
{
|
||||
Achievements.Filter = view => view.Inner.Id == achievementId;
|
||||
return;
|
||||
}
|
||||
|
||||
if (VersionRegex().IsMatch(search))
|
||||
{
|
||||
Achievements.Filter = view => view.Inner.Version == search;
|
||||
return;
|
||||
}
|
||||
|
||||
Achievements.Filter = view =>
|
||||
{
|
||||
return view.Inner.Title.Contains(search, StringComparison.CurrentCultureIgnoreCase)
|
||||
|| view.Inner.Description.Contains(search, StringComparison.CurrentCultureIgnoreCase);
|
||||
};
|
||||
}
|
||||
|
||||
private void UpdateAchievementsFinishPercent()
|
||||
|
||||
@@ -76,10 +76,9 @@ internal sealed class DownloadSummary : ObservableObject
|
||||
{
|
||||
HttpResponseMessage response = await httpClient.GetAsync(fileUrl, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false);
|
||||
|
||||
if (response.Content.Headers.ContentType?.MediaType is not ("application/octet-stream" or "application/zip"))
|
||||
if (response.Content.Headers.ContentType?.MediaType is not "application/octet-stream")
|
||||
{
|
||||
logger.LogWarning("Download Static Zip failed, Content-Type is {Type}", response.Content.Headers.ContentType);
|
||||
await taskContext.SwitchToMainThreadAsync();
|
||||
Description = SH.ViewModelWelcomeDownloadSummaryContentTypeNotMatch;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -8,9 +8,7 @@ using Microsoft.UI.Xaml.Media.Animation;
|
||||
using Snap.Hutao.Control.Animation;
|
||||
using Snap.Hutao.Control.Theme;
|
||||
using Snap.Hutao.Message;
|
||||
using Snap.Hutao.Service;
|
||||
using Snap.Hutao.Service.BackgroundImage;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Snap.Hutao.ViewModel;
|
||||
|
||||
@@ -19,15 +17,11 @@ namespace Snap.Hutao.ViewModel;
|
||||
internal sealed partial class MainViewModel : Abstraction.ViewModel, IMainViewModelInitialization, IRecipient<BackgroundImageTypeChangedMessage>
|
||||
{
|
||||
private readonly IBackgroundImageService backgroundImageService;
|
||||
private readonly ILogger<MainViewModel> logger;
|
||||
private readonly ITaskContext taskContext;
|
||||
private readonly AppOptions appOptions;
|
||||
|
||||
private BackgroundImage? previousBackgroundImage;
|
||||
private Image? backgroundImagePresenter;
|
||||
|
||||
public AppOptions AppOptions { get => appOptions; }
|
||||
|
||||
public void Initialize(IBackgroundImagePresenterAccessor accessor)
|
||||
{
|
||||
backgroundImagePresenter = accessor.BackgroundImagePresenter;
|
||||
@@ -46,9 +40,9 @@ internal sealed partial class MainViewModel : Abstraction.ViewModel, IMainViewMo
|
||||
return;
|
||||
}
|
||||
|
||||
(bool shouldRefresh, BackgroundImage? backgroundImage) = await backgroundImageService.GetNextBackgroundImageAsync(previousBackgroundImage).ConfigureAwait(false);
|
||||
(bool isOk, BackgroundImage backgroundImage) = await backgroundImageService.GetNextBackgroundImageAsync(previousBackgroundImage).ConfigureAwait(false);
|
||||
|
||||
if (shouldRefresh)
|
||||
if (isOk)
|
||||
{
|
||||
previousBackgroundImage = backgroundImage;
|
||||
await taskContext.SwitchToMainThreadAsync();
|
||||
@@ -63,18 +57,8 @@ internal sealed partial class MainViewModel : Abstraction.ViewModel, IMainViewMo
|
||||
.StartAsync(backgroundImagePresenter)
|
||||
.ConfigureAwait(true);
|
||||
|
||||
backgroundImagePresenter.Source = backgroundImage?.ImageSource;
|
||||
double targetOpacity = backgroundImage is not null
|
||||
? ThemeHelper.IsDarkMode(backgroundImagePresenter.ActualTheme)
|
||||
? 1 - backgroundImage.Luminance
|
||||
: backgroundImage.Luminance
|
||||
: 0;
|
||||
|
||||
logger.LogInformation(
|
||||
"Background image: [Accent color: {AccentColor}] [Luminance: {Luminance}] [Opacity: {TargetOpacity}]",
|
||||
backgroundImage?.AccentColor.ToString(CultureInfo.CurrentCulture),
|
||||
backgroundImage?.Luminance,
|
||||
targetOpacity);
|
||||
backgroundImagePresenter.Source = backgroundImage.ImageSource;
|
||||
double targetOpacity = ThemeHelper.IsDarkMode(backgroundImagePresenter.ActualTheme) ? 1 - backgroundImage.Luminance : backgroundImage.Luminance;
|
||||
|
||||
await AnimationBuilder
|
||||
.Create()
|
||||
|
||||
Reference in New Issue
Block a user