This is a UI component for displaying rarity information on a punchboard. It renders a visual marker and optional text label based on an input rarity value.
@namespace CitySim.Punchboard
@using Sandbox.UI
@inherits Panel
<root class="pb-rarity @Rarity.Css()">
<span class="pb-rarity-shape">@Pb.Glyph( Rarity )</span>
@if ( ShowLabel )
{
<span class="pb-rarity-name">@Pb.Label( Rarity )</span>
}
</root>
@code
{
[Parameter] public PbRarity Rarity { get; set; }
[Parameter] public bool ShowLabel { get; set; } = true;
protected override int BuildHash() => HashCode.Combine(GameText.LanguageCode, HashCode.Combine( Rarity, ShowLabel ));
}