private void tabParticleDx_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
 {
     //Count为0&Speed不为0,将可以自定义颜色,Count大于0则随机化颜色。
     if (e.Key == System.Windows.Input.Key.Enter)
     {
         if (asd.getParticle(tabParticleSel.SelectedIndex) == "reddust" || asd.getParticle(tabParticleSel.SelectedIndex) == "mobSpell" || asd.getParticle(tabParticleSel.SelectedIndex) == "mobSpellAmbient")
         {
             tabParticleCount.Value = 0;
             tabParticleSpeed.Value = 0.5;
             ColorSel cs = new ColorSel();
             cs.ShowDialog();
             byte[] temp = cs.reColor();
             double _R   = temp[0] / 255d;
             if (asd.getParticle(tabParticleSel.SelectedIndex) == "reddust")
             {
                 _R--;
             }
             tabParticleDx.Value = System.Math.Round(_R, 3);
             double _G = temp[1] / 255d;
             tabParticleDy.Value = System.Math.Round(_G, 3);
             double _B = temp[2] / 255d;
             tabParticleDz.Value = System.Math.Round(_B, 3);
         }
     }
 }
        private void colorBtn_Click(object sender, RoutedEventArgs e)
        {
            tabParticleCount.Value = 0;
            ColorSel cs = new ColorSel();

            cs.ShowDialog();
            byte[] cstr = cs.reColor();
            double r, g, b;

            if (asd.getParticle(tabParticleSel.SelectedIndex) == "reddust")
            {
                if (cstr[0] != 0)
                {
                    r = cstr[0] / 255d + 0.001d;
                }
                else
                {
                    r = 0.001d;
                }
            }
            else
            {
                if (cstr[0] != 0)
                {
                    r = cstr[0] / 255d;
                }
                else
                {
                    r = 0d;
                }
            }
            if (cstr[1] != 0)
            {
                g = cstr[1] / 255d;
            }
            else
            {
                g = 0d;
            }
            if (cstr[2] != 0)
            {
                b = cstr[2] / 255d;
            }
            else
            {
                b = 0d;
            }
            tabParticleDx.Value = System.Math.Round(r, 3);
            tabParticleDy.Value = System.Math.Round(g, 3);
            tabParticleDz.Value = System.Math.Round(b, 3);
        }
示例#3
0
        private void tabFireColorInBtn_Click(object sender, RoutedEventArgs e)
        {
            ColorSel csl = new ColorSel();

            if (tempColorIn[0] != 255 && tempColorIn[1] != 255 && tempColorIn[2] != 255)
            {
                csl.setColor(tempColorIn[0], tempColorIn[1], tempColorIn[2]);
            }
            csl.ShowDialog();
            byte[] colorList = csl.reColor();
            string colorhex  = colorList[0].ToString("x") + colorList[1].ToString("x") + colorList[2].ToString("x");

            tabFireColorIn.Value = System.Convert.ToInt32(colorhex, 16);
        }
 private void colorBtn_Click(object sender, RoutedEventArgs e)
 {
     tabParticleCount.Value = 0;
     ColorSel cs = new ColorSel();
     cs.ShowDialog();
     byte[] cstr = cs.reColor();
     double r, g, b;
     if (asd.getParticle(tabParticleSel.SelectedIndex) == "reddust")
     {
         if (cstr[0] != 0) r = cstr[0] / 255d + 0.001d; else r = 0.001d;
     }
     else
     {
         if (cstr[0] != 0) r = cstr[0] / 255d; else r = 0d;
     }
     if (cstr[1] != 0) g = cstr[1] / 255d; else g = 0d;
     if (cstr[2] != 0) b = cstr[2] / 255d; else b = 0d;
     tabParticleDx.Value = System.Math.Round(r, 3);
     tabParticleDy.Value = System.Math.Round(g, 3);
     tabParticleDz.Value = System.Math.Round(b, 3);
 }
 private void tabParticleDz_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
 {
     if (e.Key == System.Windows.Input.Key.Enter)
     {
         if (asd.getParticle(tabParticleSel.SelectedIndex) == "reddust" || asd.getParticle(tabParticleSel.SelectedIndex) == "mobSpell" || asd.getParticle(tabParticleSel.SelectedIndex) == "mobSpellAmbient")
         {
             tabParticleCount.Value = 0;
             tabParticleSpeed.Value = 0.5;
             ColorSel cs = new ColorSel();
             cs.ShowDialog();
             byte[] temp = cs.reColor();
             double _R = temp[0] / 255d;
             if (asd.getParticle(tabParticleSel.SelectedIndex) == "reddust") { _R--; }
             tabParticleDx.Value = System.Math.Round(_R, 3);
             double _G = temp[1] / 255d;
             tabParticleDy.Value = System.Math.Round(_G, 3);
             double _B = temp[2] / 255d;
             tabParticleDz.Value = System.Math.Round(_B, 3);
         }
     }
 }
 private void tabSumosEParticleColor_Click(object sender, RoutedEventArgs e)
 {
     ColorSel cs = new ColorSel();
     cs.ShowDialog();
     byte[] temp = cs.reColor();
     string colorhex = temp[0].ToString("x") + temp[1].ToString("x") + temp[2].ToString("x");
     globalParticleColor = System.Convert.ToInt32(colorhex, 16).ToString();
 }
 private void tabPotionColor_PreviewMouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     ColorSel cs = new ColorSel();
     cs.setColor((int)tabPotionColor.Value.Value);
     cs.ShowDialog();
     tabPotionColor.Value = cs.reColorInt();
 }
 private void tabFireColorInBtn_Click(object sender, RoutedEventArgs e)
 {
     ColorSel csl = new ColorSel();
     if (tempColorIn[0] != 255 && tempColorIn[1] != 255 && tempColorIn[2] != 255)
     {
         csl.setColor(tempColorIn[0], tempColorIn[1], tempColorIn[2]);
     }
     csl.ShowDialog();
     byte[] colorList = csl.reColor();
     string colorhex = colorList[0].ToString("x") + colorList[1].ToString("x") + colorList[2].ToString("x");
     tabFireColorIn.Value = System.Convert.ToInt32(colorhex, 16);
 }