mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
Add compatibility with GI 4.0
This commit is contained in:
@@ -69,7 +69,7 @@ internal sealed class DescriptionTextBlock : ContentControl
|
||||
for (int i = 0; i < description.Length;)
|
||||
{
|
||||
// newline
|
||||
if (description.Slice(i, 2) is @"\n")
|
||||
if (description[i..].IndexOf(@"\n") is 0)
|
||||
{
|
||||
AppendText(text, description[last..i]);
|
||||
AppendLineBreak(text);
|
||||
@@ -78,7 +78,7 @@ internal sealed class DescriptionTextBlock : ContentControl
|
||||
}
|
||||
|
||||
// color tag
|
||||
else if (description.Slice(i, 2) is "<c")
|
||||
else if (description[i..].IndexOf("<c") is 0)
|
||||
{
|
||||
AppendText(text, description[last..i]);
|
||||
Rgba32 color = new(description.Slice(i + 8, 8).ToString());
|
||||
@@ -90,7 +90,7 @@ internal sealed class DescriptionTextBlock : ContentControl
|
||||
}
|
||||
|
||||
// italic
|
||||
else if (description.Slice(i, 2) is "<i")
|
||||
else if (description[i..].IndexOf("<i") is 0)
|
||||
{
|
||||
AppendText(text, description[last..i]);
|
||||
|
||||
|
||||
@@ -15,8 +15,13 @@ internal sealed class FeatureOptions : IReadOnlyCollection<Feature>
|
||||
/// </summary>
|
||||
public Feature IsDailyNoteSilentVerificationEnabled { get; } = new("IsDailyNoteSilentVerificationEnabled", "启用实时便笺无感验证", "IsDailyNoteSilentVerificationEnabled", true);
|
||||
|
||||
/// <summary>
|
||||
/// 元数据检查是否忽略
|
||||
/// </summary>
|
||||
public Feature IsMetadataUpdateCheckSuppressed { get; } = new("IsMetadataUpdateCheckSuppressed", "禁用元数据更新检查", "IsMetadataUpdateCheckSuppressed", false);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public int Count { get => 1; }
|
||||
public int Count { get => 2; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IEnumerator<Feature> GetEnumerator()
|
||||
|
||||
@@ -18,6 +18,11 @@ internal sealed class ItemIconConverter : ValueConverter<string, Uri>
|
||||
/// <returns>链接</returns>
|
||||
public static Uri IconNameToUri(string name)
|
||||
{
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{
|
||||
return default!;
|
||||
}
|
||||
|
||||
return name.StartsWith("UI_RelicIcon_")
|
||||
? RelicIconConverter.IconNameToUri(name)
|
||||
: Web.HutaoEndpoints.StaticFile("ItemIcon", $"{name}.png").ToUri();
|
||||
|
||||
@@ -13,6 +13,11 @@ namespace Snap.Hutao.Model.Metadata.Item;
|
||||
/// </summary>
|
||||
internal sealed class Material : DisplayItem
|
||||
{
|
||||
public static readonly Material Default = new()
|
||||
{
|
||||
Name = "???",
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 材料类型
|
||||
/// </summary>
|
||||
|
||||
@@ -111,7 +111,7 @@ internal sealed partial class WikiAvatarViewModel : Abstraction.ViewModel
|
||||
{
|
||||
avatar.Collocation = idCollocations.GetValueOrDefault(avatar.Id);
|
||||
avatar.CookBonusView ??= CookBonusView.Create(avatar.FetterInfo.CookBonus, idMaterialMap);
|
||||
avatar.CultivationItemsView ??= avatar.CultivationItems.SelectList(i => idMaterialMap[i]);
|
||||
avatar.CultivationItemsView ??= avatar.CultivationItems.SelectList(i => idMaterialMap.GetValueOrDefault(i, Material.Default)!);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user