mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-04-19 13:59:22 -04:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
33 lines
734 B
C#
33 lines
734 B
C#
namespace Editor
|
|
{
|
|
/// <summary>
|
|
/// A wrapper to more easily create dialog windows.
|
|
/// </summary>
|
|
public partial class Dialog : Widget
|
|
{
|
|
/// <summary>
|
|
/// The created parent window for this dialog.
|
|
/// </summary>
|
|
public Window Window { get; init; }
|
|
|
|
public Dialog( Widget parent = null, bool initAsDialog = true ) : base( null )
|
|
{
|
|
Window = new Window( parent );
|
|
Window.Size = new Vector2( 500, 500 );
|
|
|
|
if ( initAsDialog )
|
|
{
|
|
Window.IsDialog = true;
|
|
Window.StatusBar = null;
|
|
}
|
|
|
|
Window.Canvas = this;
|
|
Window.DeleteOnClose = true;
|
|
}
|
|
|
|
public override void Close() => Window.Close();
|
|
public override void Show() => Window.Show();
|
|
public override void Hide() => Window.Hide();
|
|
}
|
|
}
|