Пример #1
0
 override public void Update()
 {
     try
     {
         if (!Instances.needEffectWindowReload)
         {
             if (this.IsEnabled != BloomDef.enable)
             {
                 if (this.IsEnabled)
                 {
                     // BloomDef.BackUp();
                     BloomDef.Reset();
                 }
                 else
                 {
                     BloomDef.Restore();
                 }
                 BloomDef.enable        = this.IsEnabled;
                 BloomDef.enabledInPane = this.IsEnabled;
             }
         }
         else
         {
             BloomDef.Restore();
         }
     }
     catch (Exception e)
     {
         Debug.LogError(e.ToString());
     }
 }
Пример #2
0
        override public void SetupPane()
        {
            if (BloomDef.bloomEffect == null)
            {
                BloomDef.Setup();
            }

            this.hdrBox               = new CustomComboBox(BLOOM_HDRMODE);
            this.hdrBox.Text          = Translation.GetText("Bloom", "hdr");
            this.hdrBox.SelectedIndex = (int)BloomDef.bloomEffect.hdr;
            this.ChildControls.Add(this.hdrBox);

            this.screenBlendModeBox               = new CustomComboBox(BLOOM_SCREENBLENDMODE);
            this.screenBlendModeBox.Text          = Translation.GetText("Bloom", "screenBlendMode");
            this.screenBlendModeBox.SelectedIndex = (int)BloomDef.bloomEffect.screenBlendMode;
            this.ChildControls.Add(this.screenBlendModeBox);

            this.tweakModeBox               = new CustomComboBox(BLOOM_TWEAKMODE);
            this.tweakModeBox.Text          = Translation.GetText("Bloom", "tweakMode");
            this.tweakModeBox.SelectedIndex = (int)BloomDef.bloomEffect.tweakMode;
            this.ChildControls.Add(this.tweakModeBox);

            this.qualityCheckbox      = new CustomToggleButton(BloomDef.bloomEffect.quality == Bloom.BloomQuality.High, "toggle");
            this.qualityCheckbox.Text = Translation.GetText("Bloom", "quality");
            this.ChildControls.Add(this.qualityCheckbox);

            this.bloomIntensitySlider      = new CustomSlider(GameMain.Instance.CMSystem.BloomValue, 0f, 100f, 2);
            this.bloomIntensitySlider.Text = Translation.GetText("Bloom", "bloomIntensity");
            this.ChildControls.Add(this.bloomIntensitySlider);
            this.bloomThreshholdSlider      = new CustomSlider(BloomDef.bloomEffect.bloomThreshhold, 0f, 1f, 4);
            this.bloomThreshholdSlider.Text = Translation.GetText("Bloom", "bloomThreshhold");
            this.ChildControls.Add(this.bloomThreshholdSlider);
            this.bloomBlurIterationsSlider      = new CustomSlider(BloomDef.bloomEffect.bloomBlurIterations, 1f, 10f, 0);
            this.bloomBlurIterationsSlider.Text = Translation.GetText("Bloom", "bloomBlurIterations");
            this.ChildControls.Add(this.bloomBlurIterationsSlider);

            this.sepBlurSpreadSlider      = new CustomSlider(BloomDef.bloomEffect.sepBlurSpread, 0f, 10f, 2);
            this.sepBlurSpreadSlider.Text = Translation.GetText("Bloom", "sepBlurSpread");
            this.ChildControls.Add(this.sepBlurSpreadSlider);

            this.bloomThreshholdColorPicker        = new CustomColorPicker(BloomDef.bloomEffect.bloomThreshholdColor);
            this.bloomThreshholdColorPicker.Text   = Translation.GetText("Bloom", "bloomThreshholdColor");
            this.bloomThreshholdColorPicker.IsRGBA = false;

            this.ChildControls.Add(this.bloomThreshholdColorPicker);

            this.lensflareModeBox               = new CustomComboBox(BLOOM_LENSFLARESTYLE);
            this.lensflareModeBox.Text          = Translation.GetText("Bloom", "lensflareMode");
            this.lensflareModeBox.SelectedIndex = (int)BloomDef.bloomEffect.lensflareMode;
            this.ChildControls.Add(this.lensflareModeBox);

            this.lensflareIntensitySlider      = new CustomSlider(BloomDef.bloomEffect.lensflareIntensity, 0f, 10f, 2);
            this.lensflareIntensitySlider.Text = Translation.GetText("Bloom", "lensflareIntensity");
            this.ChildControls.Add(this.lensflareIntensitySlider);
            this.lensFlareSaturationSlider      = new CustomSlider(BloomDef.bloomEffect.lensFlareSaturation, 0f, 1f, 2);
            this.lensFlareSaturationSlider.Text = Translation.GetText("Bloom", "lensFlareSaturation");
            this.ChildControls.Add(this.lensFlareSaturationSlider);
            this.lensflareThreshholdSlider      = new CustomSlider(BloomDef.bloomEffect.lensflareThreshhold, 0f, 1f, 2);
            this.lensflareThreshholdSlider.Text = Translation.GetText("Bloom", "lensflareThreshold");
            this.ChildControls.Add(this.lensflareThreshholdSlider);

            this.flareRotationSlider      = new CustomSlider(BloomDef.bloomEffect.flareRotation, 0f, 50f, 2);
            this.flareRotationSlider.Text = Translation.GetText("Bloom", "flareRotation");
            this.ChildControls.Add(this.flareRotationSlider);

            this.blurWidthSlider      = new CustomSlider(BloomDef.bloomEffect.blurWidth, 0f, 50f, 2);
            this.blurWidthSlider.Text = Translation.GetText("Bloom", "blurWidth");
            this.ChildControls.Add(this.blurWidthSlider);

            this.hollyStretchWidthSlider      = new CustomSlider(BloomDef.bloomEffect.hollyStretchWidth, 0f, 10f, 2);
            this.hollyStretchWidthSlider.Text = Translation.GetText("Bloom", "hollyStretchWidth");
            this.ChildControls.Add(this.hollyStretchWidthSlider);
            this.hollywoodFlareBlurIterationsSlider      = new CustomSlider(BloomDef.bloomEffect.hollywoodFlareBlurIterations, 0f, 10f, 0);
            this.hollywoodFlareBlurIterationsSlider.Text = Translation.GetText("Bloom", "hollywoodFlareBlurIterations");
            this.ChildControls.Add(this.hollywoodFlareBlurIterationsSlider);

            this.flareColorAPicker      = new CustomColorPicker(BloomDef.bloomEffect.flareColorA);
            this.flareColorAPicker.Text = Translation.GetText("Bloom", "flareColorA");
            this.ChildControls.Add(this.flareColorAPicker);
            this.flareColorBPicker      = new CustomColorPicker(BloomDef.bloomEffect.flareColorB);
            this.flareColorBPicker.Text = Translation.GetText("Bloom", "flareColorB");
            this.ChildControls.Add(this.flareColorBPicker);
            this.flareColorCPicker      = new CustomColorPicker(BloomDef.bloomEffect.flareColorC);
            this.flareColorCPicker.Text = Translation.GetText("Bloom", "flareColorC");
            this.ChildControls.Add(this.flareColorCPicker);
            this.flareColorDPicker      = new CustomColorPicker(BloomDef.bloomEffect.flareColorD);
            this.flareColorDPicker.Text = Translation.GetText("Bloom", "flareColorD");
            this.ChildControls.Add(this.flareColorDPicker);
        }
Пример #3
0
        override public void Update()
        {
            try
            {
                if (Instances.needEffectWindowReload)
                {
                    this.ChildControls.Clear();
                    this.Awake();
                }

                ColorCorrectionCurvesDef.Update(this.colorCorrectionCurvesPane);
                SepiaDef.Update(this.sepiaPane);
                GrayscaleDef.Update(this.grayscalePane);
                ContrastDef.Update(this.contrastPane);
                EdgeDetectDef.Update(this.edgeDetectPane);
                // SSAODef.Update(this.ssaoPane);
                CreaseDef.Update(this.creasePane);
                AntialiasingDef.Update(this.antialiasingPane);
                NoiseAndGrainDef.Update(this.noiseAndGrainPane);
                BlurDef.Update(this.blurPane);
                DepthOfFieldDef.Update(this.depthOfFieldPane);
                MotionBlurDef.Update(this.motionBlurPane);
                BloomDef.Update(this.bloomPane);
                GlobalFogDef.Update(this.globalFogPane);
                TiltShiftHdrDef.Update(this.tiltShiftHdrPane);
                FisheyeDef.Update(this.fisheyePane);
                VignettingDef.Update(this.vignettingPane);
                SunShaftsDef.Update(this.sunShaftsPane);
                LensDistortionBlurDef.Update(this.lensDistortionBlurPane);
                LetterboxDef.Update(this.letterboxPane);
                HueFocusDef.Update(this.hueFocusPane);
                ChannelSwapDef.Update(this.channelSwapPane);
                TechnicolorDef.Update(this.technicolorPane);
                DynamicLookupDef.Update(this.dynamicLookupPane);
                AnalogGlitchDef.Update(this.analogGlitchPane);
                DigitalGlitchDef.Update(this.digitalGlitchPane);
                BokehDef.Update(this.bokehPane);
                ObscuranceDef.Update(this.obscurancePane);
                AnalogTVDef.Update(this.analogTVPane);
                BleachBypassDef.Update(this.bleachBypassPane);
                BlendDef.Update(this.blendPane);
                BrightnessContrastGammaDef.Update(this.brightnessContrastGammaPane);
                ChannelMixerDef.Update(this.channelMixerPane);
                ComicBookDef.Update(this.comicBookPane);
                ContrastVignetteDef.Update(this.contrastVignettePane);
                Convolution3x3Def.Update(this.convolution3x3Pane);
                DoubleVisionDef.Update(this.doubleVisionPane);
                HalftoneDef.Update(this.halftonePane);
                IsolineDef.Update(this.isolinePane);
                KuwaharaDef.Update(this.kuwaharaPane);
                LookupFilterDef.Update(this.lookupFilterPane);
                PixelateDef.Update(this.pixelatePane);
                RGBSplitDef.Update(this.rgbSplitPane);
                ShadowsMidtonesHighlightsDef.Update(this.shadowsMidtonesHighlightsPane);
                WaveDistortionDef.Update(this.waveDistortionPane);
                WhiteBalanceDef.Update(this.whiteBalancePane);
                WiggleDef.Update(this.wigglePane);

                if (Instances.needEffectWindowReload)
                {
                    Instances.needEffectWindowReload = false;
                }
            }

            catch (Exception e)
            {
                Debug.LogError(e.ToString());
            }
        }