28 lines
823 B
C#
28 lines
823 B
C#
using Editor;
|
|
using Sandbox;
|
|
|
|
namespace VeloX;
|
|
|
|
[CustomEditor( typeof( TirePreset ) )]
|
|
public class TirePresetWidget : ControlObjectWidget
|
|
{
|
|
public override bool SupportsMultiEdit => false;
|
|
public override bool IncludeLabel => false;
|
|
|
|
public TirePresetWidget( SerializedProperty property ) : base( property, true )
|
|
{
|
|
|
|
var obj = SerializedObject;
|
|
var tirePreset = obj.ParentProperty.GetValue<TirePreset>();
|
|
|
|
Layout = Layout.Column();
|
|
Layout.Margin = 8f;
|
|
Layout.Add( new Label.Body( $" {ToolTip}" ) { Color = Color.White } );
|
|
Layout.Add( Create( obj.GetProperty( nameof( TirePreset.B ) ) ) );
|
|
Layout.Add( Create( obj.GetProperty( nameof( TirePreset.C ) ) ) );
|
|
Layout.Add( Create( obj.GetProperty( nameof( TirePreset.D ) ) ) );
|
|
Layout.Add( Create( obj.GetProperty( nameof( TirePreset.E ) ) ) );
|
|
|
|
}
|
|
}
|