Exemplo n.º 1
0
        private void whiteColorPB_Click(object sender, EventArgs e)
        {
            if (dialogActive)
            {
                colorDlg.Focus();
                return;
            }

            dialogActive         = true;
            colorDlg             = new STColorDialog(whiteColorPB.Color);
            colorDlg.FormClosed += delegate
            {
                dialogActive = false;
            };
            colorDlg.ColorChanged += delegate
            {
                whiteColorPB.Color = colorDlg.NewColor;
                ActiveMaterial.WhiteColor.Color = colorDlg.NewColor;

                //Apply to all selected panes
                foreach (BasePane pane in ParentEditor.SelectedPanes)
                {
                    var mat = pane.TryGetActiveMaterial();
                    if (mat != null)
                    {
                        mat.WhiteColor.Color = colorDlg.NewColor;
                    }
                }

                ParentEditor.PropertyChanged?.Invoke(sender, e);
            };
            colorDlg.Show();
        }
        private void whiteColorPB_Click(object sender, EventArgs e)
        {
            if (dialogActive)
            {
                colorDlg.Focus();
                return;
            }

            dialogActive         = true;
            colorDlg             = new STColorDialog(whiteColorPB.Color);
            colorDlg.FormClosed += delegate
            {
                dialogActive = false;
            };
            colorDlg.ColorChanged += delegate
            {
                whiteColorPB.Color = colorDlg.NewColor;
                ActiveMaterial.WhiteColor.Color = colorDlg.NewColor;
                ParentEditor.PropertyChanged?.Invoke(sender, e);
            };
            colorDlg.Show();
        }
Exemplo n.º 3
0
        private void backgroundPB_Click(object sender, EventArgs e)
        {
            if (dialogActive)
            {
                colorDlg.Focus();
                return;
            }

            dialogActive = true;
            colorDlg     = new STColorDialog(((PictureBox)sender).BackColor);
            colorDlg.AllowTransparency = false;
            colorDlg.FormClosed       += delegate
            {
                dialogActive = false;
            };
            colorDlg.ColorChanged += delegate
            {
                ((PictureBox)sender).BackColor      = colorDlg.ColorRGB;
                Runtime.ImageEditor.BackgroundColor = colorDlg.ColorRGB;
                UpdateBackgroundImage();
            };
            colorDlg.Show();
        }
Exemplo n.º 4
0
        private void ColorPB_Click(object sender, EventArgs e)
        {
            if (dialogActive)
            {
                colorDlg.Focus();
                return;
            }
            dialogActive = true;
            if (sender is ColorAlphaBox)
            {
                colorDlg = new STColorDialog(((ColorAlphaBox)sender).Color);
            }

            colorDlg.FormClosed += delegate
            {
                dialogActive = false;
            };
            colorDlg.ColorChanged += delegate
            {
                ((ColorAlphaBox)sender).Color = colorDlg.NewColor;

                ApplyColors(ActiveMaterial, sender);

                //Apply to all selected panes
                foreach (BasePane pane in ParentEditor.SelectedPanes)
                {
                    var mat = pane.TryGetActiveMaterial() as Revolution.Material;
                    if (mat != null)
                    {
                        ApplyColors(mat, sender);
                    }
                }

                ParentEditor.PropertyChanged?.Invoke(sender, e);
            };
            colorDlg.Show();
        }