ui/RelicTooltip.razor

Tooltip panel for a relic. Shows the relic name, level out of max, icon background image and the level-specific description, pulling all text from Relic.GetName, Relic.GetIconFilename and Relic.GetRelicDescription.

Rough Code
@using Sandbox;
@using Sandbox.UI;
@inherits Panel
@attribute [StyleSheet("RelicTooltip.razor.scss")]

<root>
	<div class="name">@Relic.GetName(RelicType)</div>
	<div class="level">@($"LVL {Level}/{MaxLevel}")</div>
	<div class="icon" style="background-image:url(@Relic.GetIconFilename(RelicType));"></div>

	<div class="description">
		@Relic.GetRelicDescription(RelicType, Level)
	</div>
</root>

@code
{
	public RelicType RelicType { get; set; }
	public int Level { get; set; }
	public int MaxLevel { get; set; }

	protected override int BuildHash()
	{
		return HashCode.Combine(
			Time.Now
		);
	}
}