private void stageDifHueTB_TextChanged(object sender, EventArgs e)
        {
            float i = 0;

            if (float.TryParse(stageDifHueTB.Text, out i))
            {
                stageDifHueTB.BackColor = Color.White;
                selectedStageLight.setDifHue(i);
            }
            else
            {
                stageDifHueTB.BackColor = Color.Red;
            }

            UpdateStageButtonColor();
            UpdateSliderFromValue(i, stageDifHueTrackBar, 360.0f);
        }
Esempio n. 2
0
        private void stageDifHueTB_TextChanged(object sender, EventArgs e)
        {
            float i = 0;

            if (float.TryParse(stageDifHueTB.Text, out i))
            {
                stageDifHueTB.BackColor = Color.White;
                selectedStageLight.setDifHue(i);
            }
            else
            {
                stageDifHueTB.BackColor = Color.Red;
            }

            UpdateStageButtonColor();

            int newSliderValue = (int)(selectedStageLight.difHue * (float)stageDifHueTrackBar.Maximum / 360.0f);

            newSliderValue            = Math.Min(newSliderValue, stageDifHueTrackBar.Maximum);
            newSliderValue            = Math.Max(newSliderValue, 0);
            stageDifHueTrackBar.Value = newSliderValue;
        }
        private void charColor1XTB_TextChanged(object sender, EventArgs e)
        {
            float i = 0;

            if (charLightsListBox.Items[charLightsListBox.SelectedIndex].ToString() == "Fresnel")
            {
                i = 0;
                if (float.TryParse(charColor1XTB.Text, out i))
                {
                    charColor1XTB.BackColor = Color.White;
                    Lights.fresnelLight.setSkyHue(i);
                }
                else
                {
                    charColor1XTB.BackColor = Color.Red;
                }

                RenderCharacterLightColor(new Vector3(Lights.fresnelLight.skyR, Lights.fresnelLight.skyG, Lights.fresnelLight.skyB),
                                          new Vector3(Lights.fresnelLight.groundR, Lights.fresnelLight.groundG, Lights.fresnelLight.groundB));
            }
            else if (charLightsListBox.Items[charLightsListBox.SelectedIndex].ToString().Contains("Diffuse"))
            {
                i = 0;
                if (float.TryParse(charColor1XTB.Text, out i))
                {
                    charColor1XTB.BackColor = Color.White;
                    selectedCharDiffuseLight.setDifHue(i);
                }
                else
                {
                    charColor1XTB.BackColor = Color.Red;
                }

                RenderCharacterLightColor(new Vector3(selectedCharDiffuseLight.difR, selectedCharDiffuseLight.difG, selectedCharDiffuseLight.difB),
                                          new Vector3(selectedCharDiffuseLight.ambR, selectedCharDiffuseLight.ambG, selectedCharDiffuseLight.ambB));
            }

            UpdateSliderFromValue(i, charColor1XTrackBar, 360.0f);
        }