@using System @using Sandbox; @using Sandbox.UI; @namespace Sandbox.UI @inherits Panel
@code { public RealTimeSince timeSinceShown; Panel ProgressPanel; public LoaderFullScreen() { timeSinceShown = 0; ProgressPanel = default; } public override void Tick() { var t = timeSinceShown.Relative; t -= 1.0f; if (t < 0) return; ProgressPanel.Style.Width = Length.Fraction( MathF.Pow( t / 30.0f, 0.33f ).Clamp( 0.0f, 1.0f ) ); } protected override int BuildHash() { return HashCode.Combine((int)timeSinceShown.Relative); } }