Example #1
0
            public ParameterSelector(AnimNodeItem item, AnimationTreeParameterType type, int parameterCount)
            {
                this.Height = 20;
                this.Item   = item;
                this.ColumnDefinitions.Add(1, GridUnitType.Star);
                for (int i = 0; i < parameterCount; i++)
                {
                    this.ColumnDefinitions.Add(1, GridUnitType.Star);
                }

                this._Label = new Label()
                {
                    Column = 0, VerticalAlignment = Framework.UI.VerticalAlignment.Center
                };
                this._Label.Text = (parameterCount > 1) ? "Parameters" : "Parameter";
                this.Controls.Add(this._Label);

                this._ParamType = type;
                this._Params    = new UI.IntPopup[parameterCount];
                for (int i = 0; i < parameterCount; i++)
                {
                    this._Params[i] = new UI.IntPopup()
                    {
                        Column = i + 1, UserData = i, VerticalAlignment = Framework.UI.VerticalAlignment.Center
                    };
                    this._Params[i].OptionChanged += ParameterSelector_OptionChanged;
                    this.Controls.Add(this._Params[i]);
                }
            }
Example #2
0
            protected override void RefreshData()
            {
                base.RefreshData();
                AnimNodeItem item = base.Object as AnimNodeItem;

                Skill.Editor.Animation.AnimationTreeEditorWindow window = (Skill.Editor.Animation.AnimationTreeEditorWindow)((Skill.Editor.UI.EditorFrame)item.OwnerFrame).Owner;
                _ParameterSelector.Rebuild(window.Tree.Parameters);
            }
Example #3
0
            void _DeleteItem_Click(object sender, System.EventArgs e)
            {
                AnimNodeItem item   = (AnimNodeItem)Owner;
                GraphEditor  editor = item.FindInParents <GraphEditor>();

                if (editor != null)
                {
                    editor.Remove(item);
                }
            }
Example #4
0
            public InputConnectorManager(AnimNodeItem item)
            {
                this._Item = item;
                this.RowDefinitions.Add(18, GridUnitType.Pixel); // header
                this.RowDefinitions.Add(1, GridUnitType.Star);   // items
                this.RowDefinitions.Add(20, GridUnitType.Pixel); // buttons
                this.Controls.Add(CreateHeader());

                _LbItems = new Framework.UI.ListBox()
                {
                    Row = 1
                };
                _LbItems.DisableFocusable();
                _LbItems.BackgroundVisible = true;
                _LbItems.Background.Style  = (GUIStyle)"RL Background";
                this.Controls.Add(_LbItems);

                _PnlButtons = new Grid()
                {
                    Row = 2
                };
                _PnlButtons.ColumnDefinitions.Add(1, GridUnitType.Star);
                _PnlButtons.ColumnDefinitions.Add(20, GridUnitType.Pixel); // btn add
                _PnlButtons.ColumnDefinitions.Add(20, GridUnitType.Pixel); // btn remove
                this.Controls.Add(_PnlButtons);

                _BtnAdd = new Button()
                {
                    Column = 1
                };
                _PnlButtons.Controls.Add(_BtnAdd);
                _BtnRemove = new Button()
                {
                    Column = 2, IsEnabled = false
                };
                _PnlButtons.Controls.Add(_BtnRemove);

                _LbItems.SelectionChanged += _LbItems_SelectionChanged;
                _BtnAdd.Click             += _BtnAdd_Click;
                _BtnRemove.Click          += _BtnRemove_Click;

                for (int i = 0; i < _Item.ConnectorCount; i++)
                {
                    var listItem = CreateItem();
                    listItem.Index = i;
                    _LbItems.Items.Add(listItem);
                }
            }
Example #5
0
            public InputConnectorItem(AnimNodeItem node)
            {
                this.Node   = node;
                this.Height = 20;
                _LblHeader  = new Label();
                this.Controls.Add(_LblHeader);

                _Connector = new UI.Connector(UI.ConnectorType.Input)
                {
                    VerticalAlignment   = Framework.UI.VerticalAlignment.Center,
                    HorizontalAlignment = Framework.UI.HorizontalAlignment.Right,
                    Width            = 20,
                    Height           = 12,
                    Margin           = new Thickness(0, 0, -20, 0),
                    UserData         = this.Node,
                    SingleConnection = true
                };
                this.Controls.Add(_Connector);

                _RefreshSyles = true;
            }
Example #6
0
 public InputItem(AnimNodeItem item)
 {
     this._Item = item;
 }
Example #7
0
 public AnimNodeItemDragThumb(AnimNodeItem item)
 {
     this._Item = item;
 }
Example #8
0
 public ItemProperties(AnimNodeItem item)
     : base(item)
 {
     _Item = item;
 }