mirror of
https://github.com/Facepunch/sbox-public.git
synced 2025-12-23 22:48:07 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
81 lines
1.3 KiB
C#
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 );
|
|
}
|
|
}
|