using Editor; using Sandbox; using System.Linq; namespace SFXR.Editor; [CustomEditor( typeof( SFXRSequencerControls ) )] public class SFXRSequencerControlWidget : ControlWidget { SerializedObject Target; public SFXRSequencerControlWidget( SerializedProperty property ) : base( property ) { if ( !property.TryGetAsObject( out Target ) ) return; var component = property.Parent.Targets.First() as SFXRSequencer; Layout = Layout.Column(); Layout.Spacing = 2; Layout.Margin = new Sandbox.UI.Margin( 0, 4 ); MinimumHeight = 70; Layout.Add( new Button( "Play Sequence", "play_arrow" ) { Width = 200, Clicked = () => { component.PlaySequence(); } } ); Layout.Add( new Button( "Stop Sequence", "stop" ) { Width = 200, Clicked = () => { component.StopSequence(); } } ); } protected override void OnPaint() { } }