Esempio n. 1
0
        private void Rebuild()
        {
            _SourceComponents.Controls.Clear();
            _DestinationComponents.Controls.Clear();

            if (_Source.Object != null && _Destination.Object != null)
            {
                EnableControls(true);

                Component[] sourceComponents = _Source.Object.GetComponents <Component>();
                Component[] destComponents   = _Destination.Object.GetComponents <Component>();

                _MatchedComponents.Clear();
                for (int i = 0; i < sourceComponents.Length; i++)
                {
                    MatchComponent match = new MatchComponent();
                    match.Source      = sourceComponents[i];
                    match.Destination = FindMatch(destComponents, match.Source.GetType());
                    match.Copy        = true;
                    if (match.Source is Transform)
                    {
                        match.Copy = false;
                    }
                    _MatchedComponents.Add(match);
                }

                Skill.Framework.UI.Thickness margin = new Skill.Framework.UI.Thickness(2, 2, 2, 6);
                foreach (var item in _MatchedComponents)
                {
                    Skill.Editor.UI.ToggleButton tb = new Skill.Editor.UI.ToggleButton()
                    {
                        Margin = margin, Left = true
                    };
                    tb.IsChecked  = item.Copy;
                    tb.UserData   = item;
                    tb.Label.text = item.Source.GetType().Name;
                    _SourceComponents.Controls.Add(tb);

                    Skill.Framework.UI.Label lbl = new Skill.Framework.UI.Label()
                    {
                        Margin = margin
                    };
                    if (item.Destination != null)
                    {
                        lbl.Text = item.Destination.GetType().Name;
                    }
                    _DestinationComponents.Controls.Add(lbl);

                    tb.Changed += ToggleButton_Changed;
                }
            }
            else
            {
                EnableControls(false);
            }
        }
Esempio n. 2
0
            public SoundKeyView(SoundTrackBar trackBar, SoundKey key)
                : base(trackBar, key)
            {
                this._SoundKey = key;
                _PreviewImage  = new AudioPreviewCurve()
                {
                    Margin = new Skill.Framework.UI.Thickness(2), BackgroundColor = Color.clear
                };
                _LblClipName = new Skill.Framework.UI.Label()
                {
                    Style = Resources.Styles.EventLabel
                };

                Controls.Add(_PreviewImage);
                Controls.Add(_LblClipName);
            }
Esempio n. 3
0
        internal TrackTreeView(MatineeEditorWindow editor)
        {
            this._Editor = editor;
            RowDefinitions.Add(25, Skill.Framework.UI.GridUnitType.Pixel);
            RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);

            _Toolbar = new Framework.UI.Grid();
            _Toolbar.ColumnDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);
            _Toolbar.ColumnDefinitions.Add(30, Skill.Framework.UI.GridUnitType.Pixel);

            // create header
            _Title = new Skill.Framework.UI.Label()
            {
                Row = 0, Column = 0
            };
            _Title.Text = "Tracks";
            _Toolbar.Controls.Add(_Title);

            Controls.Add(_Toolbar);

            _BtnAddKey = new Framework.UI.Button()
            {
                Row = 0, Column = 1, IsEnabled = false
            };
            _BtnAddKey.Content.tooltip = "Add key to Selected";
            _Toolbar.Controls.Add(_BtnAddKey);

            _TreeView = new TreeView()
            {
                Row = 1, UserData = this, HandleScrollWheel = true, AlwayShowVertical = true, Padding = new Framework.UI.Thickness(0, 0, 0, 16), AutoHeight = true
            };
            _TreeView.DisableFocusable();
            Controls.Add(_TreeView);

            // create context menu
            this._TreeView.ContextMenu  = new TrackTreeViewContextMenu(this);
            this._TrackGroupContextMenu = new TrackGroupContextMenu(this);
            this._TrackItemContextMenu  = new TrackItemContextMenu(this);

            _TreeView.SelectedItemChanged += _TreeView_SelectedItemChanged;
            _BtnAddKey.Click += _BtnAddKey_Click;
        }
Esempio n. 4
0
        private void CreateUI()
        {
            _Frame = new Skill.Framework.UI.Frame("Frame");
            _Frame.Grid.RowDefinitions.Add(30, Skill.Framework.UI.GridUnitType.Pixel);
            _Frame.Grid.RowDefinitions.Add(30, Skill.Framework.UI.GridUnitType.Pixel);
            _Frame.Grid.RowDefinitions.Add(20, Skill.Framework.UI.GridUnitType.Pixel);

            _Frame.Grid.ColumnDefinitions.Add(70, Skill.Framework.UI.GridUnitType.Pixel);
            _Frame.Grid.ColumnDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);

            _BtnEdit = new Skill.Framework.UI.Button()
            {
                Row = 0, Column = 0, ColumnSpan = 2, Margin = new Skill.Framework.UI.Thickness(2)
            };
            _BtnEdit.Content.text = "Edit";
            _Frame.Controls.Add(_BtnEdit);

            _BtnBuild = new Skill.Framework.UI.Button()
            {
                Row = 1, Column = 0, ColumnSpan = 2, Margin = new Skill.Framework.UI.Thickness(2)
            };
            _BtnBuild.Content.text = "Build";
            _Frame.Controls.Add(_BtnBuild);

            _BuildPathLabel = new Skill.Framework.UI.Label()
            {
                Row = 2, Column = 0, Margin = new Skill.Framework.UI.Thickness(2), Text = "Build Path"
            };
            _Frame.Controls.Add(_BuildPathLabel);

            _TFBuildPath = new TextField()
            {
                Row = 2, Column = 1, Margin = new Skill.Framework.UI.Thickness(2), Text = _Data.BuildPath
            };
            _Frame.Controls.Add(_TFBuildPath);

            _BtnBuild.Click          += _BtnBuild_Click;
            _BtnEdit.Click           += _BtnEdit_Click;
            _TFBuildPath.TextChanged += _TFBuildPath_TextChanged;
        }
                public InputItemIndex(AnimNodeBlendByIndexItem item)
                    : base(item)
                {
                    this.Height = 22;
                    this.Margin = new Framework.UI.Thickness(0, 0, 17, 0);
                    this.ColumnDefinitions.Add(8, Framework.UI.GridUnitType.Pixel);
                    this.ColumnDefinitions.Add(2, Framework.UI.GridUnitType.Star);
                    this.ColumnDefinitions.Add(8, Framework.UI.GridUnitType.Pixel);
                    this.ColumnDefinitions.Add(1, Framework.UI.GridUnitType.Star);
                    this.ColumnDefinitions.Add(8, Framework.UI.GridUnitType.Pixel);

                    this._TxtName = new UI.TextField()
                    {
                        Column = 1, VerticalAlignment = Framework.UI.VerticalAlignment.Center
                    };
                    this.Controls.Add(this._TxtName);
                    this._TxtName.TextChanged += _TxtName_TextChanged;

                    this._LblIndex = new Framework.UI.Label()
                    {
                        Column = 3, VerticalAlignment = Framework.UI.VerticalAlignment.Center
                    };
                    this.Controls.Add(this._LblIndex);
                }
Esempio n. 6
0
        public ParameterEditor(IBehaviorItem item, ParameterDataCollection dataDifinition, ParameterDataCollection data)
        {
            _Item           = item;
            _DataDifinition = dataDifinition;
            _Data           = data;

            this._RefreshStyle = true;

            this.RowDefinitions.Add(16, Skill.Framework.UI.GridUnitType.Pixel); // title
            this.RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);   // list
            this.RowDefinitions.Add(16, Skill.Framework.UI.GridUnitType.Pixel); // buttons

            _Title = new Framework.UI.Label {
                Row = 0, Text = "Parameters"
            };
            this.Controls.Add(_Title);

            _FieldsList = new Skill.Framework.UI.ListBox()
            {
                Row = 1
            };
            _FieldsList.DisableFocusable();
            _FieldsList.BackgroundVisible = true;
            this.Controls.Add(_FieldsList);

            _ButtonsPanel = new Framework.UI.Grid()
            {
                Row = 2
            };
            _ButtonsPanel.ColumnDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);
            _ButtonsPanel.ColumnDefinitions.Add(20, Skill.Framework.UI.GridUnitType.Pixel);
            _ButtonsPanel.ColumnDefinitions.Add(20, Skill.Framework.UI.GridUnitType.Pixel);
            this.Controls.Add(_ButtonsPanel);

            _BtnAddImage = new Framework.UI.Image()
            {
                Column = 1
            };
            _ButtonsPanel.Controls.Add(_BtnAddImage);


            _BtnAdd = new UI.IntPopup()
            {
                Column = 1
            };
            _BtnAdd.Options.Add(new UI.PopupOption(1, "float"));
            _BtnAdd.Options.Add(new UI.PopupOption(2, "int"));
            _BtnAdd.Options.Add(new UI.PopupOption(3, "bool"));
            _BtnAdd.Options.Add(new UI.PopupOption(4, "string"));
            _ButtonsPanel.Controls.Add(_BtnAdd);

            _BtnRemove = new Framework.UI.Button()
            {
                Column = 2, IsEnabled = false
            };
            _ButtonsPanel.Controls.Add(_BtnRemove);


            _BtnAdd.OptionChanged        += _BtnAdd_OptionChanged;
            _BtnRemove.Click             += _BtnRemove_Click;
            _FieldsList.SelectionChanged += _FieldsList_SelectionChanged;

            Rebuild();
        }
Esempio n. 7
0
        private void CreateUI()
        {
            _Frame = new Skill.Editor.UI.EditorFrame("Frame", this);

            _Frame.Grid.ColumnDefinitions.Add(58, Skill.Framework.UI.GridUnitType.Pixel); // SourceLabel
            _Frame.Grid.ColumnDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);   // Source
            _Frame.Grid.ColumnDefinitions.Add(2, Skill.Framework.UI.GridUnitType.Pixel);  // Splitter
            _Frame.Grid.ColumnDefinitions.Add(80, Skill.Framework.UI.GridUnitType.Pixel); // DestinationLabel
            _Frame.Grid.ColumnDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);   // Destination

            _Frame.Grid.RowDefinitions.Add(16, Skill.Framework.UI.GridUnitType.Pixel);    // ObjectFields
            _Frame.Grid.RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);      // Components
            _Frame.Grid.RowDefinitions.Add(36, Skill.Framework.UI.GridUnitType.Pixel);    // _BtnCopy

            _Splitter = new Framework.UI.Label()
            {
                Row = 0, Column = 2, RowSpan = 2
            };
            _Frame.Controls.Add(_Splitter);

            _SourceLabel = new Framework.UI.Label()
            {
                Row = 0, Column = 0, Text = "Source", Margin = new Framework.UI.Thickness(2, 0)
            };
            _Frame.Controls.Add(_SourceLabel);

            _Source = new Skill.Editor.UI.ObjectField <GameObject>()
            {
                Row = 0, Column = 1, AllowSceneObjects = true
            };
            _Frame.Controls.Add(_Source);

            _DestinationLabel = new Framework.UI.Label()
            {
                Row = 0, Column = 3, Text = "Destination", Margin = new Framework.UI.Thickness(2, 0)
            };
            _Frame.Controls.Add(_DestinationLabel);

            _Destination = new Skill.Editor.UI.ObjectField <GameObject>()
            {
                Row = 0, Column = 4, AllowSceneObjects = true
            };
            _Frame.Controls.Add(_Destination);

            _ComponentsBackground = new Skill.Framework.UI.Label()
            {
                Row = 1, Column = 0, ColumnSpan = 5
            };
            _Frame.Controls.Add(_ComponentsBackground);

            _SourceComponents = new Skill.Framework.UI.StackPanel()
            {
                Row = 1, Column = 0, ColumnSpan = 2
            };
            _Frame.Controls.Add(_SourceComponents);

            _DestinationComponents = new Skill.Framework.UI.StackPanel()
            {
                Row = 1, Column = 3, ColumnSpan = 2
            };
            _Frame.Controls.Add(_DestinationComponents);

            _BtnCopy = new Skill.Framework.UI.Button()
            {
                Row = 2, Column = 0, ColumnSpan = 5
            };
            _BtnCopy.Content.text = "Copy and Paste";
            _Frame.Controls.Add(_BtnCopy);

            _BtnCopy.Click             += _BtnCopy_Click;
            _Source.ObjectChanged      += _Source_ObjectChanged;
            _Destination.ObjectChanged += _Destination_ObjectChanged;

            EnableControls(false);

            _Splitter.BringToFront();
        }
Esempio n. 8
0
 public AnimNodeSequenceItem(AnimNodeSequenceData data)
     : base(data)
 {
     _LblAnimName      = AddLabel();
     _LblAnimName.Text = data.AnimationName;
 }