mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-04-19 05:48:07 -04:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
25 lines
610 B
C#
25 lines
610 B
C#
|
|
namespace Editor;
|
|
|
|
[CustomEditor( typeof( MissingComponent ) )]
|
|
public class MissingComponentSheet : ComponentEditorWidget
|
|
{
|
|
TextEdit jsonBox;
|
|
|
|
public MissingComponentSheet( SerializedObject obj ) : base( obj )
|
|
{
|
|
var c = obj.Targets.OfType<MissingComponent>().FirstOrDefault();
|
|
|
|
jsonBox = new TextEdit( this );
|
|
jsonBox.ReadOnly = true;
|
|
jsonBox.PlainText = c.GetJson().ToJsonString( new JsonSerializerOptions() { WriteIndented = true } );
|
|
|
|
SetSizeMode( SizeMode.Default, SizeMode.Default );
|
|
|
|
Layout = Layout.Column();
|
|
Layout.Margin = 16;
|
|
Layout.Spacing = 2;
|
|
Layout.Add( jsonBox );
|
|
}
|
|
}
|