Example #1
0
            public CurveTrackTreeViewItem(CurveTrack track, CurveEditor.EditCurveInfo info)
            {
                this.Track = track;
                this.Info  = info;

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

                _TbVisible = new Skill.Editor.UI.ToggleButton()
                {
                    Column = 0, IsChecked = track.Visibility == Skill.Framework.UI.Visibility.Visible
                };
                _LblName = new Label()
                {
                    Column = 1, Text = info.Attribute.Name
                };
                _CFColor = new Skill.Editor.UI.ColorField()
                {
                    Column = 2, Color = track.Color
                };

                this.Controls.Add(_TbVisible);
                this.Controls.Add(_LblName);
                this.Controls.Add(_CFColor);

                _TbVisible.Changed    += _TbVisible_Changed;
                _CFColor.ColorChanged += _CFColor_ColorChanged;
            }
Example #2
0
        protected override void CreateCustomFileds()
        {
            _TxtName = new Skill.Editor.UI.TextField()
            {
                Margin = ControlMargin
            };
            _TxtName.Label.text = "Name";
            _CFColor            = new Skill.Editor.UI.ColorField()
            {
                Margin = ControlMargin
            };
            _CFColor.Label.text = "Color";

            Controls.Add(_TxtName);
            Controls.Add(_CFColor);

            _TxtName.TextChanged  += _TxtName_TextChanged;
            _CFColor.ColorChanged += _CFColor_ColorChanged;
        }
Example #3
0
                public SubtitleEventProperties(SubtitleEvent se)
                    : base(se)
                {
                    _Event = se;


                    _BtnPickTitle = new Skill.Framework.UI.Button()
                    {
                        Margin = ControlMargin
                    };
                    _BtnPickTitle.Content.text = "Select Subtitle";
                    this.Controls.Add(_BtnPickTitle);

                    _TimeField = new Skill.Editor.UI.FloatField()
                    {
                        Margin = ControlMargin
                    };
                    _TimeField.Label.text = "Time";
                    this.Controls.Add(_TimeField);

                    _DurationField = new Skill.Editor.UI.FloatField()
                    {
                        Margin = ControlMargin
                    };
                    _DurationField.Label.text = "Duration";
                    this.Controls.Add(_DurationField);


                    _TbOverrideStyle = new Skill.Editor.UI.ToggleButton()
                    {
                        Margin = ControlMargin
                    };
                    _TbOverrideStyle.Label.text = "Override Style";
                    this.Controls.Add(_TbOverrideStyle);

                    _ColorField = new Skill.Editor.UI.ColorField()
                    {
                        Margin = ControlMargin
                    };
                    _ColorField.Label.text = "Font Color";
                    this.Controls.Add(_ColorField);

                    _FontStyleField = new Skill.Editor.UI.EnumPopup()
                    {
                        Margin = ControlMargin
                    };
                    _FontStyleField.Label.text = "Font Style";
                    this.Controls.Add(_FontStyleField);

                    _AlignmentField = new Skill.Editor.UI.EnumPopup()
                    {
                        Margin = ControlMargin
                    };
                    _AlignmentField.Label.text = "Alignment";
                    this.Controls.Add(_AlignmentField);

                    _BtnPickTitle.Click          += _BtnPickTitle_Click;
                    _TimeField.ValueChanged      += _TimeField_ValueChanged;
                    _DurationField.ValueChanged  += _DurationField_ValueChanged;
                    _TbOverrideStyle.Changed     += _TbOverrideStyle_Changed;
                    _ColorField.ColorChanged     += _ColorField_ColorChanged;
                    _FontStyleField.ValueChanged += _FontStyleField_ValueChanged;
                    _AlignmentField.ValueChanged += _AlignmentField_ValueChanged;
                }
Example #4
0
        private void CreateUI()
        {
            _Panel = new StackPanel()
            {
                Padding = new Skill.Framework.UI.Thickness(2, 4, 2, 0)
            };
            _TextureField = new Skill.Editor.UI.ObjectField <Texture2D>()
            {
                Object = _PaintColor.Texture, HorizontalAlignment = Skill.Framework.UI.HorizontalAlignment.Center, Width = 80, Height = 80, Margin = new Skill.Framework.UI.Thickness(2)
            };


            #region _TbChannels
            _TbChannels = new UI.TabHeader(4, true)
            {
                Margin = new Thickness(0, 2, 0, 10), HorizontalAlignment = HorizontalAlignment.Center, Width = 200, Height = 20
            };
            _TbChannels[0].text = "R";
            _TbChannels[1].text = "G";
            _TbChannels[2].text = "B";
            _TbChannels[3].text = "A";

            _TbChannels.SetTabSelected(0, _PaintColor.ChannelR);
            _TbChannels.SetTabSelected(1, _PaintColor.ChannelG);
            _TbChannels.SetTabSelected(2, _PaintColor.ChannelB);
            _TbChannels.SetTabSelected(3, _PaintColor.ChannelA);
            #endregion

            #region _LayersField and _PUV and _TbBrush

            Grid layersPanel = new Grid()
            {
                Height = 32, Padding = new Thickness(2, 6)
            };
            layersPanel.ColumnDefinitions.Add(90, GridUnitType.Pixel);
            layersPanel.ColumnDefinitions.Add(50, GridUnitType.Pixel);
            layersPanel.ColumnDefinitions.Add(10, GridUnitType.Pixel);
            layersPanel.ColumnDefinitions.Add(45, GridUnitType.Pixel);
            layersPanel.ColumnDefinitions.Add(1, GridUnitType.Star);


            _TbBrush = new UI.ToggleButton()
            {
                Column = 0, IsChecked = _PaintColor.Brush, Left = true
            };
            _TbBrush.Label.text = "Brush View";
            layersPanel.Controls.Add(_TbBrush);

            _PUV = new Popup()
            {
                Row = 0, Column = 1
            };
            PopupOption uv1 = new PopupOption(0)
            {
                Name = "UV1"
            }; uv1.Content.text = "UV 1";
            PopupOption uv2 = new PopupOption(1)
            {
                Name = "UV2"
            }; uv2.Content.text = "UV 2";
            _PUV.Options.Add(uv1);
            _PUV.Options.Add(uv2);
            _PUV.SelectedIndex = _PaintColor.UV2 ? 1 : 0;
            layersPanel.Controls.Add(_PUV);

            Label lbl = new Label()
            {
                Text = "Layers", Column = 3
            };
            layersPanel.Controls.Add(lbl);


            _LayersField = new LayerMaskField()
            {
                Row = 0, Column = 4
            };
            _LayersField.Layers     = _PaintColor.LayerMask;
            _LayersField.Label.text = string.Empty;
            layersPanel.Controls.Add(_LayersField);


            #endregion

            _PnlFavoriteColors = new Grid()
            {
                Height = 22, Margin = new Thickness(0, 2)
            };
            _FavoriteColors = new Color[] { new Color(1.0f, 0.0f, 0.0f, 0.0f),   // red
                                            new Color(0.0f, 1.0f, 0.0f, 0.0f),   // green
                                            new Color(0.0f, 0.0f, 1.0f, 0.0f),   // blue
                                            new Color(0.0f, 0.0f, 0.0f, 1.0f),   // Alpha
                                            new Color(1.0f, 1.0f, 1.0f, 1.0f),   // white
                                            new Color(0.0f, 0.0f, 0.0f, 0.0f) }; // black
            _PnlFavoriteColors.Controls.Add(new Box()
            {
                Row = 0, Column = 0, ColumnSpan = _FavoriteColors.Length
            });
            for (int i = 0; i < _FavoriteColors.Length; i++)
            {
                _PnlFavoriteColors.ColumnDefinitions.Add(1, GridUnitType.Star);
                Skill.Framework.UI.Button btn = new Skill.Framework.UI.Button()
                {
                    Tag = i.ToString(), Margin = new Thickness(4), Style = new GUIStyle(), Column = i
                };
                string    toolTip    = string.Empty;
                Texture2D background = null;
                if (i == 0)
                {
                    background = Skill.Editor.Resources.UITextures.Colors.Red; toolTip = "Red";
                }
                else if (i == 1)
                {
                    background = Skill.Editor.Resources.UITextures.Colors.Green; toolTip = "Green";
                }
                else if (i == 2)
                {
                    background = Skill.Editor.Resources.UITextures.Colors.Blue; toolTip = "Blue";
                }
                else if (i == 3)
                {
                    background = Skill.Editor.Resources.UITextures.Colors.Transparent; toolTip = "Alpha";
                }
                else if (i == 4)
                {
                    background = Skill.Editor.Resources.UITextures.Colors.White; toolTip = "White";
                }
                else if (i == 5)
                {
                    background = Skill.Editor.Resources.UITextures.Colors.Black; toolTip = "Black";
                }
                btn.Style.normal.background = btn.Style.focused.background = btn.Style.hover.background = btn.Style.active.background = background;
                btn.Content.tooltip         = toolTip;
                btn.Click += btn_Click;
                _PnlFavoriteColors.Controls.Add(btn);
            }


            _ColorField = new ColorField()
            {
                Color = _PaintColor.Color, Margin = new Thickness(2)
            };
            _SliRadius = new Skill.Editor.UI.Slider()
            {
                Value = _PaintColor.Radius, MinValue = 1, MaxValue = 40, Margin = new Thickness(2), Height = 16
            }; _SliRadius.Label.text = "Radius"; _SliRadius.Label.tooltip = "Shift + (A/D)";
            _SliStrength             = new Skill.Editor.UI.Slider()
            {
                Value = _PaintColor.Strength, MinValue = 1f, MaxValue = 100f, Margin = new Thickness(2), Height = 16
            }; _SliStrength.Label.text = "Strength";
            _SliFalloff = new Skill.Editor.UI.Slider()
            {
                Value = _PaintColor.Falloff, MinValue = 0.0f, MaxValue = 1.0f, Margin = new Thickness(2), Height = 16
            }; _SliFalloff.Label.text = "Falloff";
            _HelpBox = new HelpBox()
            {
                Height = 60, Message = "Hold CTRL and drag with Right Click to paint.\nTexture must be read/write enable\nValid texture format:\n    ARGB32, RGBA32, RGB24 and Alpha8"
            };

            _BtnSaveTexture = new Skill.Framework.UI.Button()
            {
                Margin = new Thickness(2), Height = 40
            }; _BtnSaveTexture.Content.text = "Save Texture";
            _TbShadowMode = new UI.ToggleButton()
            {
                Left = false, Margin = new Thickness(2), Height = 20
            }; _TbShadowMode.Label.text = "Shadow Mode";


            _Panel.Controls.Add(_TextureField);
            _Panel.Controls.Add(_TbChannels);
            _Panel.Controls.Add(_PnlFavoriteColors);
            _Panel.Controls.Add(_ColorField);
            _Panel.Controls.Add(layersPanel);
            _Panel.Controls.Add(_SliRadius);
            _Panel.Controls.Add(_SliStrength);
            _Panel.Controls.Add(_SliFalloff);
            _Panel.Controls.Add(_TbShadowMode);
            _Panel.Controls.Add(_HelpBox);
            _Panel.Controls.Add(_BtnSaveTexture);

            _Frame = new Frame("Frame");
            _Frame.Grid.Controls.Add(_Panel);

            _TextureField.ObjectChanged += _TextureField_ObjectChanged;
            _TbBrush.Changed            += _TbBrush_Changed;
            _TbShadowMode.Changed       += _TbShadowMode_Changed;

            _TbChannels.TabChanged += Channel_Changed;

            _LayersField.LayersChanged += _LayersField_LayersChanged;
            _PUV.OptionChanged         += _PUV_OptionChanged;
            _ColorField.ColorChanged   += _ColorField_ColorChanged;

            _SliRadius.ValueChanged   += _SliRadius_ValueChanged;
            _SliStrength.ValueChanged += _SliStrength_ValueChanged;
            _SliFalloff.ValueChanged  += _SliFalloff_ValueChanged;
            _BtnSaveTexture.Click     += _BtnSaveTexture_Click;
        }