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]
29 lines
605 B
C#
29 lines
605 B
C#
namespace Editor;
|
|
|
|
[CustomEditor( typeof( string ), NamedEditor = "folder" )]
|
|
public class FolderControlWidget : ControlWidget
|
|
{
|
|
private readonly FolderEdit _folder;
|
|
|
|
public string Value
|
|
{
|
|
get => SerializedProperty.As.String;
|
|
set
|
|
{
|
|
SerializedProperty.As.String = value;
|
|
|
|
if ( _folder.IsValid() )
|
|
_folder.Value = value;
|
|
}
|
|
}
|
|
|
|
public FolderControlWidget( SerializedProperty property ) : base( property )
|
|
{
|
|
Layout = Layout.Row();
|
|
|
|
_folder = Layout.Add( new FolderEdit( this ) );
|
|
_folder.Value = property.GetValue<string>();
|
|
_folder.FolderSelected = ( v ) => Value = v;
|
|
}
|
|
}
|