Skip to content

Commit

Permalink
show finished icon if we have enough items
Browse files Browse the repository at this point in the history
  • Loading branch information
qhy040404 committed Mar 27, 2024
1 parent ab1b3c0 commit 13108b6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
20 changes: 14 additions & 6 deletions src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,20 @@
</ItemContainer.Resources>
<shvcp:HorizontalCard>
<shvcp:HorizontalCard.Left>
<shvco:ItemIcon
Grid.Column="0"
Width="40"
Height="40"
Icon="{Binding Inner.Icon, Converter={StaticResource ItemIconConverter}}"
Quality="{Binding Inner.RankLevel}"/>
<Grid Grid.Column="0">
<shvco:ItemIcon
Width="40"
Height="40"
Icon="{Binding Inner.Icon, Converter={StaticResource ItemIconConverter}}"
Opacity="{Binding IsFinished, Converter={StaticResource BoolToOpacityConverter}}"
Quality="{Binding Inner.RankLevel}"/>
<FontIcon
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="24"
Glyph="&#xE73E;"
Visibility="{Binding IsFinished, Converter={StaticResource BoolToVisibilityConverter}}"/>
</Grid>
</shvcp:HorizontalCard.Left>
<shvcp:HorizontalCard.Right>
<Grid Margin="16,0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public StatisticsCultivateItem(Material inner, Model.Entity.CultivateItem entity
public Material Inner { get; }

/// <summary>
/// 对应背包物品的个数
/// 对应需求物品的个数
/// </summary>
public uint Count { get; set; }

Expand All @@ -40,10 +40,10 @@ public StatisticsCultivateItem(Material inner, Model.Entity.CultivateItem entity
/// <summary>
/// 是否完成
/// </summary>
public bool IsFinished { get => Count >= TotalCount; }
public bool IsFinished { get => TotalCount >= Count; }

/// <summary>
/// 格式化总数
/// </summary>
public string CountFormatted { get => $"{Count}/{TotalCount}"; }
public string CountFormatted { get => $"{TotalCount}/{Count}"; }
}

0 comments on commit 13108b6

Please sign in to comment.