mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-04-18 05:17:53 -04:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
42 lines
741 B
Plaintext
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);
|
|
}
|
|
|
|
}
|