Files
sbox-public/game/addons/base/code/UI/Components/LoaderFullScreen.razor
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

42 lines
741 B
Plaintext

@using System
@using Sandbox;
@using Sandbox.UI;
@namespace Sandbox.UI
@inherits Panel
<root>
<div class="indicator">
<Panel class="progress" @ref=ProgressPanel></Panel>
</div>
</root>
@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);
}
}