Esempio n. 1
0
        public AudioStateGraphEditor(AudioControllerEditorWindow editor)
        {
            this._Editor = editor;

            this.Selection = new Skill.Editor.UI.SelectableCollection <Skill.Editor.UI.ISelectable>();
            this.Selection.SelectionChanged += Selection_SelectionChanged;

            _Background = new Box()
            {
                Row = 0
            };
            this.Controls.Add(_Background);

            _ConnectionHost = new AudioConnectionHost(this)
            {
                Row = 0
            };
            this.Controls.Add(_ConnectionHost);

            _Panel = new Skill.Editor.UI.ZoomPanel()
            {
                Row = 0, MinZoomFactor = 0.6f, MaxZoomFactor = 1.0f
            };
            this.Controls.Add(_Panel);

            this._MultiSelector = new Skill.Editor.UI.MultiSelector <Skill.Editor.UI.ISelectable>(this, Selection)
            {
                Row = 1
            };
            this.Controls.Add(_MultiSelector);

            this.WantsMouseEvents = true;
            this.ContextMenu      = new GraphContextMenu(this);
        }
Esempio n. 2
0
        public AudioTriggerEditor(AudioControllerEditorWindow editor)
        {
            this._Editor = editor;

            this.RowDefinitions.Add(20, GridUnitType.Pixel);
            this.RowDefinitions.Add(1, GridUnitType.Star);
            this.ColumnDefinitions.Add(1, GridUnitType.Star);
            this.ColumnDefinitions.Add(60, GridUnitType.Pixel);

            _TriggerLabel = new Label()
            {
                Row = 0, Column = 0, Text = "Triggers"
            };
            this.Controls.Add(_TriggerLabel);

            _TriggerList = new ListBox()
            {
                Row = 1, Column = 0, ColumnSpan = 2
            };
            _TriggerList.DisableFocusable();
            this.Controls.Add(_TriggerList);

            _TriggerToolbar = new UniformGrid()
            {
                Row = 0, Column = 1, Rows = 1, Columns = 2
            };
            this.Controls.Add(_TriggerToolbar);

            _BtnAddTrigger = new Button()
            {
                Column = 0
            };
            _BtnAddTrigger.Content.tooltip = "add new trigger";
            _TriggerToolbar.Controls.Add(_BtnAddTrigger);

            _BtnRemoveTrigger = new Button()
            {
                Column = 1
            };
            _BtnRemoveTrigger.Content.tooltip = "remove selected trigger";
            _TriggerToolbar.Controls.Add(_BtnRemoveTrigger);

            SetButtonsEnable();

            _TriggerList.SelectionChanged += _TriggerList_SelectionChanged;
            _BtnAddTrigger.Click          += _BtnAddTrigger_Click;
            _BtnRemoveTrigger.Click       += _BtnRemoveTrigger_Click;
        }
Esempio n. 3
0
        void OnDestroy()
        {
            if (_GraphEditor != null)
            {
                _GraphEditor.DeselectInspector();
                _GraphEditor.DestroyPreviewObject();
            }
            if (_TriggerEditor != null)
            {
                _TriggerEditor.DeselectInspector();
            }

            if (_Instance == this)
            {
                _Instance = null;
            }
        }