mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
fix #904
This commit is contained in:
11
src/Snap.Hutao/Snap.Hutao/Model/NameValueDefaults.cs
Normal file
11
src/Snap.Hutao/Snap.Hutao/Model/NameValueDefaults.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Model;
|
||||
|
||||
internal sealed class NameValueDefaults
|
||||
{
|
||||
private static readonly NameValue<string> StringValue = new(SH.ModelNameValueDefaultName, SH.ModelNameValueDefaultDescription);
|
||||
|
||||
public static NameValue<string> String => StringValue;
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"profiles": {
|
||||
"Snap.Hutao": {
|
||||
"commandName": "MsixPackage",
|
||||
"nativeDebugging": false,
|
||||
"nativeDebugging": true,
|
||||
"doNotLaunchApp": false,
|
||||
"allowLocalNetworkLoopbackProperty": true
|
||||
},
|
||||
|
||||
@@ -861,6 +861,24 @@ namespace Snap.Hutao.Resource.Localization {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 请更新角色橱窗数据 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string ModelNameValueDefaultDescription {
|
||||
get {
|
||||
return ResourceManager.GetString("ModelNameValueDefaultDescription", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 暂无数据 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string ModelNameValueDefaultName {
|
||||
get {
|
||||
return ResourceManager.GetString("ModelNameValueDefaultName", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 精炼 {0} 阶 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -413,6 +413,12 @@
|
||||
<value>武器强化素材</value>
|
||||
<comment>Need EXACT same string in game</comment>
|
||||
</data>
|
||||
<data name="ModelNameValueDefaultName" xml:space="preserve">
|
||||
<value>暂无数据</value>
|
||||
</data>
|
||||
<data name="ModelNameValueDefaultDescription" xml:space="preserve">
|
||||
<value>请更新角色橱窗数据</value>
|
||||
</data>
|
||||
<data name="ModelWeaponAffixFormat" xml:space="preserve">
|
||||
<value>精炼 {0} 阶</value>
|
||||
</data>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model;
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Model.Metadata.Converter;
|
||||
using Snap.Hutao.Model.Primitive;
|
||||
@@ -145,7 +146,7 @@ internal sealed class SummaryAvatarFactory
|
||||
NameDescription subProperty;
|
||||
if (subStat is null)
|
||||
{
|
||||
subProperty = new(string.Empty, string.Empty);
|
||||
subProperty = NameDescription.Default;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -168,7 +169,7 @@ internal sealed class SummaryAvatarFactory
|
||||
// EquipBase
|
||||
Level = $"Lv.{equip.Weapon.Level.Value}",
|
||||
Quality = weapon.Quality,
|
||||
MainProperty = mainStat is not null ? FightPropertyFormat.ToNameValue(mainStat.AppendPropId, mainStat.StatValue) : default!,
|
||||
MainProperty = mainStat is not null ? FightPropertyFormat.ToNameValue(mainStat.AppendPropId, mainStat.StatValue) : NameValueDefaults.String,
|
||||
|
||||
// Weapon
|
||||
Id = weapon.Id,
|
||||
|
||||
@@ -113,24 +113,15 @@ internal static class SummaryHelper
|
||||
|
||||
return (maxId / 100000, delta) switch
|
||||
{
|
||||
(5, 0) => 100F,
|
||||
(5, 1) => 90F,
|
||||
(5, 2) => 80F,
|
||||
(5, 3) => 70F,
|
||||
|
||||
(4, 0) => 100F,
|
||||
(4, 1) => 90F,
|
||||
(4, 2) => 80F,
|
||||
(4, 3) => 70F,
|
||||
|
||||
(3, 0) => 100F,
|
||||
(3, 1) => 85F,
|
||||
(3, 2) => 70F,
|
||||
(5 or 4 or 3, 0) => 100F,
|
||||
(5 or 4 or 3, 1) => 90F,
|
||||
(5 or 4 or 3, 2) => 80F,
|
||||
(5 or 4 or 3, 3) => 70F,
|
||||
|
||||
(2, 0) => 100F,
|
||||
(2, 1) => 80F,
|
||||
|
||||
_ => throw Must.NeverHappen($"Unexpected AppendId: {appendId} Delta: {delta}"),
|
||||
_ => throw Must.NeverHappen($"Unexpected AppendId: {appendId.Value} Delta: {delta}"),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -410,15 +410,21 @@
|
||||
<Button.Flyout>
|
||||
<Flyout Placement="BottomEdgeAlignedLeft">
|
||||
<StackPanel>
|
||||
<StackPanel.Resources>
|
||||
<x:Double x:Key="SettingsCardSpacing">3</x:Double>
|
||||
<x:Double x:Key="SettingsCardMinHeight">0</x:Double>
|
||||
<x:Double x:Key="SettingsCardWrapThreshold">0</x:Double>
|
||||
<x:Double x:Key="SettingsCardWrapNoIconThreshold">0</x:Double>
|
||||
</StackPanel.Resources>
|
||||
<cwc:SettingsCard
|
||||
Margin="0,2,0,0"
|
||||
Padding="12,0"
|
||||
Padding="12"
|
||||
Header="{Binding MainProperty.Name}">
|
||||
<TextBlock Text="{Binding MainProperty.Value}"/>
|
||||
</cwc:SettingsCard>
|
||||
<cwc:SettingsCard
|
||||
Margin="0,2,0,0"
|
||||
Padding="12,0"
|
||||
Padding="12"
|
||||
Header="{Binding SubProperty.Name}">
|
||||
<TextBlock Text="{Binding SubProperty.Description}"/>
|
||||
</cwc:SettingsCard>
|
||||
|
||||
@@ -59,7 +59,8 @@
|
||||
Margin="0,0,0,2"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding SelectedUser.UserInfo.Nickname, Mode=OneWay}"
|
||||
TextTrimming="CharacterEllipsis"/>
|
||||
TextTrimming="CharacterEllipsis"
|
||||
TextWrapping="NoWrap"/>
|
||||
<FontIcon
|
||||
Grid.Column="2"
|
||||
Margin="0,0,8,0"
|
||||
|
||||
@@ -8,6 +8,8 @@ namespace Snap.Hutao.ViewModel.AvatarProperty;
|
||||
/// </summary>
|
||||
internal class NameDescription
|
||||
{
|
||||
private static readonly NameDescription DefaultValue = new(SH.ModelNameValueDefaultName, SH.ModelNameValueDefaultDescription);
|
||||
|
||||
/// <summary>
|
||||
/// 构造一个空的名称与描述
|
||||
/// </summary>
|
||||
@@ -26,6 +28,8 @@ internal class NameDescription
|
||||
Description = description;
|
||||
}
|
||||
|
||||
public static NameDescription Default => DefaultValue;
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user