ui/MessagePanel.razor

A Razor UI panel that shows a single log or notification entry: an icon drawn from a background-image URL and a message line, with background color changed when a card or status effect is attached. BuildHash controls when the panel re-renders.

🐞 BuildHash omits StatusEffect while the root style reads it, so toggling StatusEffect on an existing panel leaves the old background color until some other hashed field changes.
@using Sandbox;
@using Sandbox.UI;
@inherits Panel
@attribute [StyleSheet("MessagePanel.razor.scss")]

@*<root style="background-color:@(CardType != CardType.None || StatusEffect != null ? "#00000088" : "#00005588"); transform: scale(@(1f - DepthNum * 0.2f)); bottom:@(10f + DepthNum * 40f)px; z-index: @(-DepthNum * 3); opacity:@(1f - DepthNum * 0.15f);">*@
<root style="background-color:@(CardType != CardType.None || StatusEffect != null ? "#00000088" : "#00005588");">
	<div class="icon" style="background-image:url(@IconFilename);"></div>

	<div class="message">@Message</div>
</root>

@code
{
	public string Message { get; set; }
	public string IconFilename { get; set; }
	public CardType CardType { get; set; }
	public RelicType RelicType { get; set; }
	public int DepthNum { get; set; }

	public StatusEffect StatusEffect { get; set; }

	protected override int BuildHash()
	{
		return HashCode.Combine(
			Message,
			IconFilename,
			CardType,
			RelicType,
			DepthNum
			// Time.Now
		);
	}
}