1
0
mirror of https://github.com/wangdage12/Snap.Hutao.git synced 2026-07-31 04:10:25 +08:00

调整合并增量颜色

This commit is contained in:
mfkvfhpdx
2026-05-03 18:24:19 +08:00
parent 1e600db869
commit 8bb177d08f
2 changed files with 53 additions and 3 deletions
@@ -256,11 +256,40 @@
VerticalAlignment="Center"
Text="{Binding Inner.Name}"
TextTrimming="CharacterEllipsis"/>
<TextBlock
<StackPanel
Grid.Column="1"
Margin="0,0,0,0"
VerticalAlignment="Center"
Text="{Binding FormattedCount}"/>
Orientation="Horizontal"
Spacing="0">
<TextBlock
VerticalAlignment="Center"
Text="{Binding FormattedCount}"
Visibility="{Binding ShowNonMergeCompactCount, Converter={StaticResource BoolToVisibilityConverter}}"/>
<StackPanel
Orientation="Horizontal"
Spacing="0"
Visibility="{Binding ShowMergeSpacedWithoutParen, Converter={StaticResource BoolToVisibilityConverter}}">
<TextBlock VerticalAlignment="Center" Text="{Binding DisplayCurrent, Mode=OneWay}"/>
<TextBlock VerticalAlignment="Center" Text="{Binding SlashCountSuffix, Mode=OneWay}"/>
</StackPanel>
<StackPanel
Orientation="Horizontal"
Spacing="0"
Visibility="{Binding ShowMergeInventoryParen, Converter={StaticResource BoolToVisibilityConverter}}">
<TextBlock VerticalAlignment="Center" Text="{Binding DisplayCurrent, Mode=OneWay}"/>
<TextBlock
VerticalAlignment="Center"
Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}"
Text="{Binding RawInventoryParenthetical, Mode=OneWay}"
Visibility="{Binding MergeInventoryParenUseBlue, Converter={StaticResource BoolToVisibilityConverter}}"/>
<TextBlock
VerticalAlignment="Center"
Foreground="{ThemeResource SystemFillColorCriticalBrush}"
Text="{Binding RawInventoryParenthetical, Mode=OneWay}"
Visibility="{Binding MergeInventoryParenUseRed, Converter={StaticResource BoolToVisibilityConverter}}"/>
<TextBlock VerticalAlignment="Center" Text="{Binding SlashCountSuffix, Mode=OneWay}"/>
</StackPanel>
</StackPanel>
</Grid>
</shuxcc:HorizontalCard.Right>
</shuxcc:HorizontalCard>
@@ -40,6 +40,27 @@ internal sealed class StatisticsCultivateItem
public string FormattedCount { get => $"{DisplayCurrent}/{Count}"; }
/// <summary>未启用合并展示链时,使用紧凑 <see cref="FormattedCount"/>。</summary>
public bool ShowNonMergeCompactCount { get => !MergeAdjustedCurrent.HasValue; }
/// <summary>已合并但合成前后有效持有量与背包数一致,不显示括号,仅「合并后 / 需求」加空格。</summary>
public bool ShowMergeSpacedWithoutParen { get => MergeAdjustedCurrent.HasValue && DisplayCurrent == Current; }
/// <summary>合并后有效持有与背包原数不同,显示「(背包原数)」并着色。</summary>
public bool ShowMergeInventoryParen { get => MergeAdjustedCurrent.HasValue && DisplayCurrent != Current; }
/// <summary>合并后 &gt; 背包原数:括号用强调色(蓝系)。</summary>
public bool MergeInventoryParenUseBlue { get => MergeAdjustedCurrent.HasValue && DisplayCurrent > Current; }
/// <summary>合并后 &lt; 背包原数:括号用警告色(红系,低级被向上消耗)。</summary>
public bool MergeInventoryParenUseRed { get => MergeAdjustedCurrent.HasValue && DisplayCurrent < Current; }
/// <summary>背包同步原数,带前导空格与括号。</summary>
public string RawInventoryParenthetical { get => $" ({Current})"; }
/// <summary>「 / 需求数」段,含前导空格。</summary>
public string SlashCountSuffix { get => $" / {Count}"; }
public bool IsToday { get => Inner.IsItemOfToday(offset, true); }
internal bool ExcludedFromPresentation { get; set; }