A RichText panel component for UI that matches text like "Bullet Crit Chance" and replaces it with an icon, colored label "crit chance" and a stat entry showing the player's crit chance as a percentage.
[RichTextPanel( @"\b([Bb]ullet )?[Cc]rit [Cc]hance\b" )]
public class RichTextBulletCritChance : RichTextBase
{
public override string ImagePath => "textures/ui/bullet-icon.png";
public override bool PrependIcon => true;
public override string TextOverride => "crit chance";
public override Color Color => new Color( 0.5f, 1f, 0.9f );
public override RichTextStatEntry[] Stats => [
new(PlayerStat.CritChance, StatFormat.Percentage)
];
}