A Razor UI PanelComponent that shows an Easter-egg step banner on screen when EggProgress signals a step is done. It renders a centered card with kicker text, a decorative strip, and the step name, and computes a rounded opacity string and BuildHash so it rebuilds while fading.
@using Sandbox;
@using Sandbox.UI;
@using NZombies;
@inherits PanelComponent
@*
EASTER EGG STEP BANNER — a step of basalt's Easter egg is done: its number, a light strip, its name, in the upper middle of
every screen. Asked for as *"when we complete a step I want it to appear on screen that it was completed"* (2026-09-29).
⚠️ THE HOST'S WORD, NOT THIS MACHINE'S GUESS. It rises from `NZNet.EggStepDone`, the broadcast each step's fanfare already
rides (`EggProgress.OnStepDone`), so it shows on every screen at the same moment, never for a joiner catching up, and never
while testing (`HexPlatforms.Fanfare` sends nothing then). `nz_egg_banner <step>` raises it by hand, to look at it.
⚠️ ITS OWN PanelComponent, mounted beside the round bar (`SurvivalHud.OnUpdate`): no scene edit, and its fade is not held back
by the HUD's coarse BuildHash. The powerup banner has the bottom centre; this takes the upper middle, between the boss bar
and the round's carved numeral.
*@
<root class="egg-banner-hud @HudTheme.Class">
@if ( EggProgress.BannerShowing )
{
<div class="card" style="opacity: @Opacity">
<label class="kicker">@EggProgress.BannerKicker</label>
<div class="strip"></div>
<label class="name">@EggProgress.BannerName</label>
</div>
}
</root>
@code
{
/// <summary>
/// The fade, as it goes into the style: twenty steps, with a point for the decimal whatever the machine's language.
///
/// ⚠️ THE DISPLAYED VALUE IS WHAT THE HASH TAKES (INSTRUCTIONS: a hash that quantises one way and a template that formats
/// another freezes the display).
/// </summary>
static string Opacity => (System.MathF.Round( EggProgress.BannerOpacity * 20f ) / 20f)
.ToString( "0.##", System.Globalization.CultureInfo.InvariantCulture );
/// <summary>⚠️ REBUILDS AS IT FADES, then never again until the next step.</summary>
protected override int BuildHash() => System.HashCode.Combine( EggProgress.BannerShowing, EggProgress.BannerKicker,
EggProgress.BannerName, Opacity, HudTheme.Class );
}