Files
sbox-public/engine/Sandbox.Tools/CompileStatus.cs
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

81 lines
1.3 KiB
C#

namespace Editor;
internal static class CompileStatus
{
static CompileProgressWindow progress;
static int compileCount;
internal static void CompileProgress( string statusText )
{
if ( progress is not null )
{
//progress.Label.Text = statusText;
//progress.WindowTitle = statusText;
//progress.Update();
//progress.Repaint();
}
}
internal static void StartCompile( int id, string text )
{
if ( progress is null )
{
//progress = new CompileProgressWindow();
}
//progress.WindowTitle = text;
//progress.Update();
//progress.Repaint();
compileCount++;
}
internal static void EndCompile( int id )
{
//progress.Label.Text = "Hello! Done";
//progress.WindowTitle = "Done!";
//progress.Update();
//progress.Repaint();
compileCount--;
}
internal static void CloseProgress()
{
if ( compileCount > 0 )
return;
if ( progress is not null )
{
progress.Destroy();
progress = null;
}
}
}
class CompileProgressWindow : Widget
{
public Label Label { get; }
public CompileProgressWindow()
{
WindowFlags = WindowFlags.Tool;
Size = new Vector2( 500, 100 );
Show();
AlignToParent( TextFlag.Center );
Label = new Label( "Hello", this );
Label.Size = 100;
}
protected override void OnPaint()
{
Paint.SetBrush( Color.Random );
Paint.DrawRect( LocalRect );
}
}