A UI Razor component for a reload progress bar. It renders a label and a bar whose inner fill width is driven by the Progress property and contributes Progress to the component rebuild hash.
@using Sandbox;
@using Sandbox.UI;
@inherits PanelComponent
@namespace Sandbox
<root>
<div class="label">Reloading</div>
<div class="reloadbar">
<div class="fill" style="width: @(Progress * 100)%"></div>
</div>
</root>
@code
{
[Property, Range(0, 1)] public float Progress { get; set; } = 0.5f;
/// <summary>
/// the hash determines if the system should be rebuilt. If it changes, it will be rebuilt
/// </summary>
protected override int BuildHash() => System.HashCode.Combine( Progress );
}