Example #1
0
 private void OnMaidManagerFind()
 {
     DepthOfFieldDef.OnMaidManagerFind(this);
     BokehDef.OnMaidManagerFind(this);
 }
Example #2
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());
            }
        }
        override public void SetupPane()
        {
            this.focusDistanceSlider      = new CustomSlider(BokehDef.bokehEffect.focusDistance, 0f, 200f, 2);
            this.focusDistanceSlider.Text = Translation.GetText("Bokeh", "focusDistance");
            this.ChildControls.Add(this.focusDistanceSlider);

            this.fNumberSlider      = new CustomSlider(BokehDef.bokehEffect.fNumber, 1f, 50f, 3);
            this.fNumberSlider.Text = Translation.GetText("Bokeh", "fNumber");
            this.ChildControls.Add(this.fNumberSlider);

            this.kernelSizeBox               = new CustomComboBox(BOKEH_KERNEL_SIZES);
            this.kernelSizeBox.Text          = Translation.GetText("Bokeh", "kernelSize");
            this.kernelSizeBox.SelectedIndex = (int)BokehDef.bokehEffect.kernelSize;
            this.ChildControls.Add(this.kernelSizeBox);

            this.useCameraFovCheckbox      = new CustomToggleButton(BokehDef.bokehEffect.useCameraFov, "toggle");
            this.useCameraFovCheckbox.Text = Translation.GetText("Bokeh", "useCameraFov");
            this.ChildControls.Add(this.useCameraFovCheckbox);

            this.focalLengthSlider      = new CustomSlider(BokehDef.bokehEffect.focalLength, 0f, 10f, 4);
            this.focalLengthSlider.Text = Translation.GetText("Bokeh", "focalLength");
            this.ChildControls.Add(this.focalLengthSlider);

            this.visualizeCheckbox      = new CustomToggleButton(BokehDef.bokehEffect.visualize, "toggle");
            this.visualizeCheckbox.Text = Translation.GetText("Bokeh", "visualize");
            this.ChildControls.Add(this.visualizeCheckbox);

            this.transformFromMaidCheckbox                 = new CustomToggleButton(BokehDef.transformFromMaid, "toggle");
            this.transformFromMaidCheckbox.Text            = Translation.GetText("UI", "transformFromMaid");
            this.transformFromMaidCheckbox.CheckedChanged += (o, e) => {
                if (this.transformFromMaidCheckbox.Value == true)
                {
                    BokehDef.SetTransform(this.maidManager);
                }
                else
                {
                    BokehDef.SetTransform();
                }
            };
            this.ChildControls.Add(this.transformFromMaidCheckbox);

            this.prevMaidButton        = new CustomButton();
            this.prevMaidButton.Text   = "<";
            this.prevMaidButton.Click += (o, e) => {
                this.maidManager.Prev();
                DepthOfFieldDef.SetTransform(this.maidManager);
                this.maidManager.bUpdateRequest = true;
            };
            this.ChildControls.Add(this.prevMaidButton);

            this.nextMaidButton        = new CustomButton();
            this.nextMaidButton.Text   = ">";
            this.nextMaidButton.Click += (o, e) => {
                this.maidManager.Next();
                DepthOfFieldDef.SetTransform(this.maidManager);
                this.maidManager.bUpdateRequest = true;
            };
            this.ChildControls.Add(this.nextMaidButton);

            this.reloadMaidsButton        = new CustomButton();
            this.reloadMaidsButton.Text   = Translation.GetText("UI", "reloadMaids");
            this.reloadMaidsButton.Click += (o, e) => {
                this.maidManager.bUpdateRequest = true;
            };
            this.ChildControls.Add(this.reloadMaidsButton);

            this.maidManager = new MaidManager();
            this.maidManager.Find();

            this.focusMaidLabel = new CustomLabel();
            this.ChildControls.Add(this.focusMaidLabel);
        }