Esempio n. 1
0
        public SectionMeshData CreateMeshData(int sectionX, int sectionY, int sectionZ)
        {
            // Set the neutral tint colors.
            TintColor blockTint  = TintColor.Green;
            TintColor liquidTint = TintColor.Blue;

            Vector3i sectionPosition = (sectionX, sectionY, sectionZ);

            // Get the sections next to this section.
            ClientSection?[] neighbors = GetNeighborSections(sectionPosition);

            BlockMeshFaceHolder[] blockMeshFaceHolders = CreateBlockMeshFaceHolders();

            PooledList <float> complexVertexPositions = new(capacity : 64);
            PooledList <int>   complexVertexData      = new(capacity : 32);
            PooledList <uint>  complexIndices         = new(capacity : 16);

            uint complexVertexCount = 0;

            VaryingHeightMeshFaceHolder[] varyingHeightMeshFaceHolders = CreateVaryingHeightMeshFaceHolders();

            VaryingHeightMeshFaceHolder[] opaqueLiquidMeshFaceHolders      = CreateVaryingHeightMeshFaceHolders();
            VaryingHeightMeshFaceHolder[] transparentLiquidMeshFaceHolders = CreateVaryingHeightMeshFaceHolders();

            PooledList <int> crossPlantVertexData = new(capacity : 16);

            PooledList <int> cropPlantVertexData = new(capacity : 16);

            // Loop through the section
            for (var x = 0; x < SectionSize; x++)
            {
                for (var y = 0; y < SectionSize; y++)
                {
                    for (var z = 0; z < SectionSize; z++)
                    {
                        uint val = blocks[(x << SectionSizeExp2) + (y << SectionSizeExp) + z];

                        Decode(
                            val,
                            out Block currentBlock,
                            out uint data,
                            out Liquid currentLiquid,
                            out LiquidLevel level,
                            out bool isStatic);

                        var  pos    = new Vector3i(x, y, z);
                        bool isFull = level == LiquidLevel.Eight;

                        switch (currentBlock.TargetBuffer)
                        {
                        case TargetBuffer.Simple:
                        {
                            // Check all six sides of this block

                            MeshSimpleSide(BlockSide.Front);
                            MeshSimpleSide(BlockSide.Back);
                            MeshSimpleSide(BlockSide.Left);
                            MeshSimpleSide(BlockSide.Right);
                            MeshSimpleSide(BlockSide.Bottom);
                            MeshSimpleSide(BlockSide.Top);
Esempio n. 2
0
        public override void Draw(CGRect rect)
        {
            TintColor.SetColor();
            CGRect bounds = Bounds;
            float  x      = (float)bounds.Right - LineWidth;

            for (int n = 0; n < Count; n++)
            {
                x -= LineMargin;
                if ((n + 1) % LineGroupCount == 0)
                {
                    UIBezierPath path = new UIBezierPath();
                    path.MoveTo(
                        new CGPoint(x + 0.5f * LineWidth,
                                    bounds.Top + 0.5f * LineWidth));
                    path.AddLineTo(
                        new CGPoint(x + 0.5f * LineWidth + LineGroupCount * LineMargin,
                                    bounds.Bottom - 0.5f * LineWidth));
                    path.Stroke();
                }
                else
                {
                    CGRect lineRect = bounds;
                    lineRect.X     = x;
                    lineRect.Width = LineWidth;
                    UIGraphics.RectFill(lineRect);
                }
            }
        }
Esempio n. 3
0
        UIImage GetTintedImage(UIImage img)
        {
            //// Make sure tintColor is available (>= iOS 7.0 runtime)
            //if( [self respondsToSelector:@selector(tintColor)] && img.renderingMode == UIImageRenderingModeAlwaysTemplate )
            //{
            UIGraphics.BeginImageContextWithOptions(img.Size, false, UIScreen.MainScreen.Scale);
            var context = UIGraphics.GetCurrentContext();

            context.TranslateCTM(0, img.Size.Height);
            context.ScaleCTM((nfloat)1.0, (nfloat)(-1.0));
            var rect = new CGRect(0, 0, img.Size.Width, img.Size.Height);

            // draw alpha-mask
            context.SetBlendMode(CGBlendMode.Normal);
            context.DrawImage(rect, img.CGImage);
            // draw tint color, preserving alpha values of original image
            context.SetBlendMode(CGBlendMode.SourceIn);
            TintColor.SetFill();
            context.FillRect(rect);

            var tintedImage = UIGraphics.GetImageFromCurrentImageContext();

            UIGraphics.EndImageContext();
            //}
            return(tintedImage);
        }
Esempio n. 4
0
 protected override void WriteData(ESPWriter writer)
 {
     writer.Write((UInt32)IsAnimatable);
     writer.Write(Duration);
     writer.Write(HDREyeAdaptSpeedMult);
     writer.Write(HDREyeAdaptSpeedAdd);
     writer.Write(HDRBloomBlurRadiusMult);
     writer.Write(HDRBloomBlurRadiusAdd);
     writer.Write(HDRBloomThresholdMult);
     writer.Write(HDRBloomThresholdAdd);
     writer.Write(HDRBloomScaleMult);
     writer.Write(HDRBloomScaleAdd);
     writer.Write(HDRTargetLumMinMult);
     writer.Write(HDRTargetLumMinAdd);
     writer.Write(HDRTargetLumMaxMult);
     writer.Write(HDRTargetLumMaxAdd);
     writer.Write(HDRSunlightScaleMult);
     writer.Write(HDRSunlightScaleAdd);
     writer.Write(HDRSkyScaleMult);
     writer.Write(HDRSkyScaleAdd);
     if (Unknown1 == null)
     {
         writer.Write(new byte[72]);
     }
     else
     {
         writer.Write(Unknown1);
     }
     writer.Write(CinematicSaturationMult);
     writer.Write(CinematicSaturationAdd);
     writer.Write(CinematicBrightnessMult);
     writer.Write(CinematicBrightnessAdd);
     writer.Write(CinematicContrastMult);
     writer.Write(CinematicContrastAdd);
     if (Unknown2 == null)
     {
         writer.Write(new byte[8]);
     }
     else
     {
         writer.Write(Unknown2);
     }
     TintColor.WriteBinary(writer);
     writer.Write(BlurRadius);
     writer.Write(DoubleVisionStrength);
     writer.Write(RadialBlurStrength);
     writer.Write(RadialBlurRampUp);
     writer.Write(RadialBlurStart);
     writer.Write((UInt32)RadialBlurUseTarget);
     writer.Write(RadialBlurCenterX);
     writer.Write(RadialBlurCenterY);
     writer.Write(DepthOfFieldStrength);
     writer.Write(DepthOfFieldDistance);
     writer.Write(DepthOfFieldRange);
     writer.Write((UInt32)DepthOfFieldUseTarget);
     writer.Write(RadialBlurRampDown);
     writer.Write(RadialBlurDownStart);
     FadeColor.WriteBinary(writer);
     writer.Write((UInt32)MotionBlurStrength);
 }
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            _position += _velocity;

            if (_panelState == PanelState.Waiting && Condition != null && Condition(gameTime))
            {
                IsVisible = true;
                Velocity  = new Vector2(0, 0.75f);
                changeState(PanelState.Sliding);
            }

            if (_panelState == PanelState.Sliding && Position.Y > 0)
            {
                Velocity = Vector2.Zero;
                if (AchievementEarned != null)
                {
                    AchievementEarned(this, EventArgs.Empty);
                }
                changeState(PanelState.Fading);
            }

            if (_panelState == PanelState.Fading)
            {
                TintColor = new Color(TintColor.ToVector4() - (Vector4.One / _colorDeteriorationfactor));
                _colorDeteriorationfactor *= 0.98f;

                if (TintColor.R <= 0 && TintColor.G <= 0 && TintColor.B <= 0 && TintColor.A <= 0)
                {
                    IsVisible = false;
                    TintColor = Color.White;
                    changeState(PanelState.Done);
                }
            }
        }
 /*returns a tile color based on id*/
 public Color GetColor(TintColor color)
 {
     if (!_colorTable.ContainsKey(color))
     {
         throw new System.Exception("Color id non existent");
     }
     return(_colorTable[color]);
 }
Esempio n. 7
0
 protected override void ReadData(ESPReader reader)
 {
     using (MemoryStream stream = new MemoryStream(reader.ReadBytes(size)))
         using (ESPReader subReader = new ESPReader(stream, reader.Plugin))
         {
             try
             {
                 IsAnimatable            = subReader.ReadEnum <NoYes>();
                 Duration                = subReader.ReadSingle();
                 HDREyeAdaptSpeedMult    = subReader.ReadUInt32();
                 HDREyeAdaptSpeedAdd     = subReader.ReadUInt32();
                 HDRBloomBlurRadiusMult  = subReader.ReadUInt32();
                 HDRBloomBlurRadiusAdd   = subReader.ReadUInt32();
                 HDRBloomThresholdMult   = subReader.ReadUInt32();
                 HDRBloomThresholdAdd    = subReader.ReadUInt32();
                 HDRBloomScaleMult       = subReader.ReadUInt32();
                 HDRBloomScaleAdd        = subReader.ReadUInt32();
                 HDRTargetLumMinMult     = subReader.ReadUInt32();
                 HDRTargetLumMinAdd      = subReader.ReadUInt32();
                 HDRTargetLumMaxMult     = subReader.ReadUInt32();
                 HDRTargetLumMaxAdd      = subReader.ReadUInt32();
                 HDRSunlightScaleMult    = subReader.ReadUInt32();
                 HDRSunlightScaleAdd     = subReader.ReadUInt32();
                 HDRSkyScaleMult         = subReader.ReadUInt32();
                 HDRSkyScaleAdd          = subReader.ReadUInt32();
                 Unknown1                = subReader.ReadBytes(72);
                 CinematicSaturationMult = subReader.ReadUInt32();
                 CinematicSaturationAdd  = subReader.ReadUInt32();
                 CinematicBrightnessMult = subReader.ReadUInt32();
                 CinematicBrightnessAdd  = subReader.ReadUInt32();
                 CinematicContrastMult   = subReader.ReadUInt32();
                 CinematicContrastAdd    = subReader.ReadUInt32();
                 Unknown2                = subReader.ReadBytes(8);
                 TintColor.ReadBinary(subReader);
                 BlurRadius            = subReader.ReadUInt32();
                 DoubleVisionStrength  = subReader.ReadUInt32();
                 RadialBlurStrength    = subReader.ReadUInt32();
                 RadialBlurRampUp      = subReader.ReadUInt32();
                 RadialBlurStart       = subReader.ReadUInt32();
                 RadialBlurUseTarget   = subReader.ReadEnum <NoYes>();
                 RadialBlurCenterX     = subReader.ReadUInt32();
                 RadialBlurCenterY     = subReader.ReadUInt32();
                 DepthOfFieldStrength  = subReader.ReadUInt32();
                 DepthOfFieldDistance  = subReader.ReadUInt32();
                 DepthOfFieldRange     = subReader.ReadUInt32();
                 DepthOfFieldUseTarget = subReader.ReadEnum <NoYes>();
                 RadialBlurRampDown    = subReader.ReadUInt32();
                 RadialBlurDownStart   = subReader.ReadUInt32();
                 FadeColor.ReadBinary(subReader);
                 MotionBlurStrength = subReader.ReadEnum <NoYes>();
             }
             catch
             {
                 return;
             }
         }
 }
Esempio n. 8
0
        /// <inheritdoc />
        public override void Draw()
        {
            // Draw backbuffer texture
            var buffer = _backBufferOld ? _backBufferOld : _backBuffer;
            var color  = TintColor.RGBMultiplied(Brightness);

            Render2D.DrawTexture(buffer, new Rectangle(Vector2.Zero, Size), color);

            base.Draw();
        }
Esempio n. 9
0
    void Start()
    {
        tintColor     = GetComponent <TintColor>();
        currentHealth = maxHealth;

        realMaxDrop = maxDropQuantity + 1;
        if (maxDropQuantity < minDropQuantity)
        {
            Debug.Log("maxDrop less than minDrop (?)");
            maxDropQuantity = minDropQuantity;
        }
    }
        public override int GetHashCode()
        {
            unchecked
            {
                int hash = 17;

                hash = (hash * 23) + TintColor.GetHashCode();
                hash = (hash * 23) + TintOpacity.GetHashCode();
                hash = (hash * 23) + BackgroundSource.GetHashCode();
                hash = (hash * 23) + FallbackColor.GetHashCode();
                hash = (hash * 23) + MaterialColor.GetHashCode();

                return(hash);
            }
        }
Esempio n. 11
0
        void DoTintAnimation(Color TargetColor)
        {
            if (_tintAnimation != null)
            {
                return;
            }

            _tintAnimation = new ColorAnimation(TargetColor, new Duration(TimeSpan.FromSeconds(0.1)), FillBehavior.Stop)
            {
                RepeatBehavior = new RepeatBehavior(5)
            };

            _tintAnimation.Completed += (S, E) => _tintAnimation = null;

            TintColor.BeginAnimation(SolidColorBrush.ColorProperty, _tintAnimation);
        }
Esempio n. 12
0
    void Start()
    {
        currentScene  = SceneManager.GetActiveScene().buildIndex;
        currentHealth = maxHealth;
        if (healthBar != null)
        {
            healthBar.SetMaxHealth(maxHealth);
        }

        tintColor   = GetComponent <TintColor>();
        gameManager = GameObject.Find("GameManager").GetComponent <GameManager>();

        if (!loaded)
        {
            Load();
        }
        StartCoroutine(Save()); //start autosave routine
    }
Esempio n. 13
0
        private void BuildBrush()
        {
            if (_compositor == null)
            {
                return;
            }

            // adding a grey tint to the background
            var colorMatrix = TintColor.ToMatrix5X4();

            var graphicsEffect = new ColorMatrixEffect
            {
                ColorMatrix = colorMatrix,
                Source      = new CompositionEffectSourceParameter("Background")
            };

            var effectFactory = _compositor.CreateEffectFactory(graphicsEffect, null);
            var brush         = effectFactory.CreateBrush();

            brush.SetSourceParameter("Background", _compositor.CreateHostBackdropBrush());
            CompositionBrush = brush;
        }
Esempio n. 14
0
        /// <summary>
        /// Draws all of the subsprites of this <see cref="ComplexSprite"/> to the specified <see cref="SpriteBatch"/>.
        /// </summary>
        /// <param name="spriteBatch">The <see cref="SpriteBatch"/> to render objects to.</param>
        public override void Draw(SpriteBatch spriteBatch)
        {
            if (!_isVisible)
            {
                return;
            }

            foreach (var drawable in Subsprites)
            {
                if (!drawable.IsVisible)
                {
                    continue;
                }

                Vector2       pos    = drawable.Position;
                Vector2       origin = drawable.Origin;
                SpriteEffects effect = drawable.Effects;
                float         rotate = drawable.Rotation;
                Vector2       scale  = drawable.Scale;
                Color         tint   = drawable.TintColor;

                drawable.Effects  |= _effects;
                drawable.Origin   += Origin;
                drawable.Position += Position;
                drawable.Rotation += Rotation;
                drawable.Scale    *= Scale;
                drawable.TintColor = new Color(TintColor.ToVector4() * drawable.TintColor.ToVector4());

                drawable.Draw(spriteBatch);

                drawable.Effects   = effect;
                drawable.Origin    = origin;
                drawable.Position  = pos;
                drawable.Rotation  = rotate;
                drawable.Scale     = scale;
                drawable.TintColor = tint;
            }
        }
Esempio n. 15
0
    private Material generateTintMaterial(TintColor tintColor)
    {
        Color tint = new Color(0, 0, 0, 1);          //default to white

        switch (tintColor)
        {
        case TintColor.Red:
            tint = new Color(1, 0, 0, 1);
            break;

        case TintColor.Green:
            tint = new Color(0, 1, 0, 1);
            break;

        case TintColor.Blue:
            tint = new Color(0, 0, 1, 1);
            break;
        }

        Material newMaterial = new Material(Shader.Find("Sprites/Default"));

        newMaterial.color = tint;
        return(newMaterial);
    }
Esempio n. 16
0
            public override void Draw(CGRect rect)
            {
                //get graphics context
                using (CGContext g = UIGraphics.GetCurrentContext())
                {
                    //set up drawing attributes
                    g.SetLineWidth(1);
                    if (TintColor != null)
                    {
                        TintColor.SetFill();
                        TintColor.SetStroke();
                    }
                    else
                    {
                        UIColor.Black.SetFill();
                        UIColor.Black.SetStroke();
                    }

                    //create geometry
                    var path = new CGPath();

                    path.AddLines(new CGPoint[] {
                        new CGPoint(1, 30),
                        new CGPoint(5, 30),
                        new CGPoint(5, 26)
                    });

                    path.CloseSubpath();

                    //add geometry to graphics context and draw it
                    g.AddPath(path);
                    g.DrawPath(CGPathDrawingMode.FillStroke);
                }

                base.Draw(rect);
            }
            public override SChartSeries GetSeries(ShinobiChart chart, int index)
            {
                var lineSeries = new SChartLineSeries();

                // Bit convoluted to get the z-index correct
                if (_movingAverageDataPoints == null || index == 1)
                {
                    lineSeries.Style.AreaLineColor        = TintColor;
                    lineSeries.Style.AreaColor            = TintColor.ColorWithAlpha(0.1f);
                    lineSeries.Style.AreaColorLowGradient = TintColor.ColorWithAlpha(0.8f);
                    lineSeries.Style.AreaLineWidth        = 1.0;
                    lineSeries.Style.ShowFill             = true;
                    lineSeries.CrosshairEnabled           = true;
                }
                else
                {
                    lineSeries.Style.LineColor  = UIColor.Red.ColorWithAlpha(0.8f);
                    lineSeries.Style.LineWidth  = 1.0;
                    lineSeries.Style.ShowFill   = false;
                    lineSeries.CrosshairEnabled = false;
                }

                return(lineSeries);
            }
Esempio n. 18
0
        /// <inheritdoc />
        /// <summary>
        ///   Raises the <see cref="M:System.Windows.Forms.ButtonBase.OnPaint(System.Windows.Forms.PaintEventArgs)" />
        ///   event.
        /// </summary>
        /// <param name="eventArgs">
        ///   A <see cref="T:System.Windows.Forms.PaintEventArgs" /> that contains the event data.
        /// </param>
        protected override void OnPaint(PaintEventArgs eventArgs)
        {
            eventArgs.Graphics.InterpolationMode  = InterpolationMode.HighQualityBilinear;
            eventArgs.Graphics.CompositingQuality = CompositingQuality.HighQuality;
            eventArgs.Graphics.PixelOffsetMode    = PixelOffsetMode.HighQuality;
            eventArgs.Graphics.SmoothingMode      = SmoothingMode.HighQuality;

            using (var path = new GraphicsPath()) {
                const int diameter = 4;
                var       arc      = new Rectangle(0, 0, diameter, diameter);

                path.AddArc(arc, 180, 90);

                arc.X = Width - diameter;
                path.AddArc(arc, 270, 90);

                arc.Y = Height - diameter;
                path.AddArc(arc, 0, 90);

                arc.X = 0;
                path.AddArc(arc, 90, 90);

                path.CloseFigure();

                if (this.mouseOver || this.mouseDown)
                {
                    eventArgs.Graphics.FillPath(new SolidBrush(TintColor.Blend(ForeColor, this.mouseDown ? 0.5 : 0.75)
                                                               .Blend(Color.Transparent)),
                                                path);
                }
            }

            int horizontalMargin = Image == null ? 0 : 4;
            int imageRectWidth   = horizontalMargin + Image?.Width ?? 0;

            Point imageLocation = Point.Empty;

            if (!String.IsNullOrWhiteSpace(Text))
            {
                Size textSize = TextRenderer.MeasureText(eventArgs.Graphics, Text, Font);
                imageLocation = new Point((Width - textSize.Width - (Image?.Width ?? 0)) / 2,
                                          (Height - Image?.Height ?? 0) / 2);

                TextRenderer.DrawText(eventArgs.Graphics,
                                      Text,
                                      Font,
                                      new Rectangle(imageRectWidth, 0, Width - imageRectWidth, Height),
                                      Enabled ? this.mouseDown ? ForeColor : TintColor.Blend(ForeColor, this.mouseOver ? 0.25 : 0.5) : Color.Gray,
                                      TextFormatFlags.HorizontalCenter |
                                      TextFormatFlags.EndEllipsis |
                                      TextFormatFlags.VerticalCenter);
            }
            else if (Image != null)
            {
                imageLocation = new Point((Width - Image.Width) / 2, (Height - Image.Height) / 2);
            }

            if (Image != null)
            {
                var   attrs = new ImageAttributes();
                float n     = TintColor.R + TintColor.G + TintColor.B;
                n = Math.Abs(n) < 1 ? 255 : n;

                // normalize color values
                float cr = TintColor.R / n;
                float cg = TintColor.G / n;
                float cb = TintColor.B / n;

                // alpha
                float ca = this.mouseDown ? 1f : (this.mouseOver ? 0.875f : 0.75f);

                // brightness
                float br = cr * 0.6666f;
                float bg = cg * 0.6666f;
                float bb = cb * 0.6666f;

                attrs.SetColorMatrix(new ColorMatrix(new[] {
                    new[] { cr, cg, cb, 0f, 0f },
                    new[] { cb, cr, cg, 0f, 0f },
                    new[] { cg, cb, cr, 0f, 0f },
                    new[] { 0f, 0f, 0f, ca, 0f },
                    new[] { br, bg, bb, 0f, 1f }
                }));

                eventArgs.Graphics.DrawImage(Image,
                                             new Rectangle(imageLocation, Image.Size),
                                             0,
                                             0,
                                             Image.Width,
                                             Image.Height,
                                             GraphicsUnit.Pixel,
                                             attrs);
            }
        }
Esempio n. 19
0
        protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            ele.TryPathTo("IsAnimatable", true, out subEle);
            subEle.Value = IsAnimatable.ToString();

            ele.TryPathTo("Duration", true, out subEle);
            subEle.Value = Duration.ToString("G15");

            ele.TryPathTo("HDR/EyeAdaptSpeed/Mult", true, out subEle);
            subEle.Value = HDREyeAdaptSpeedMult.ToString();

            ele.TryPathTo("HDR/EyeAdaptSpeed/Add", true, out subEle);
            subEle.Value = HDREyeAdaptSpeedAdd.ToString();

            ele.TryPathTo("HDR/Bloom/BlurRadius/Mult", true, out subEle);
            subEle.Value = HDRBloomBlurRadiusMult.ToString();

            ele.TryPathTo("HDR/Bloom/BlurRadius/Add", true, out subEle);
            subEle.Value = HDRBloomBlurRadiusAdd.ToString();

            ele.TryPathTo("HDR/Bloom/Threshold/Mult", true, out subEle);
            subEle.Value = HDRBloomThresholdMult.ToString();

            ele.TryPathTo("HDR/Bloom/Threshold/Add", true, out subEle);
            subEle.Value = HDRBloomThresholdAdd.ToString();

            ele.TryPathTo("HDR/Bloom/Scale/Mult", true, out subEle);
            subEle.Value = HDRBloomScaleMult.ToString();

            ele.TryPathTo("HDR/Bloom/Scale/Add", true, out subEle);
            subEle.Value = HDRBloomScaleAdd.ToString();

            ele.TryPathTo("HDR/TargetLum/Min/Mult", true, out subEle);
            subEle.Value = HDRTargetLumMinMult.ToString();

            ele.TryPathTo("HDR/TargetLum/Min/Add", true, out subEle);
            subEle.Value = HDRTargetLumMinAdd.ToString();

            ele.TryPathTo("HDR/TargetLum/Max/Mult", true, out subEle);
            subEle.Value = HDRTargetLumMaxMult.ToString();

            ele.TryPathTo("HDR/TargetLum/Max/Add", true, out subEle);
            subEle.Value = HDRTargetLumMaxAdd.ToString();

            ele.TryPathTo("HDR/SunlightScale/Mult", true, out subEle);
            subEle.Value = HDRSunlightScaleMult.ToString();

            ele.TryPathTo("HDR/SunlightScale/Add", true, out subEle);
            subEle.Value = HDRSunlightScaleAdd.ToString();

            ele.TryPathTo("HDR/SkyScale/Mult", true, out subEle);
            subEle.Value = HDRSkyScaleMult.ToString();

            ele.TryPathTo("HDR/SkyScale/Add", true, out subEle);
            subEle.Value = HDRSkyScaleAdd.ToString();

            ele.TryPathTo("Unknown1", true, out subEle);
            subEle.Value = Unknown1.ToHex();

            ele.TryPathTo("Cinematic/Saturation/Mult", true, out subEle);
            subEle.Value = CinematicSaturationMult.ToString();

            ele.TryPathTo("Cinematic/Saturation/Add", true, out subEle);
            subEle.Value = CinematicSaturationAdd.ToString();

            ele.TryPathTo("Cinematic/Brightness/Mult", true, out subEle);
            subEle.Value = CinematicBrightnessMult.ToString();

            ele.TryPathTo("Cinematic/Brightness/Add", true, out subEle);
            subEle.Value = CinematicBrightnessAdd.ToString();

            ele.TryPathTo("Cinematic/Contrast/Mult", true, out subEle);
            subEle.Value = CinematicContrastMult.ToString();

            ele.TryPathTo("Cinematic/Contrast/Add", true, out subEle);
            subEle.Value = CinematicContrastAdd.ToString();

            ele.TryPathTo("Unknown2", true, out subEle);
            subEle.Value = Unknown2.ToHex();

            ele.TryPathTo("TintColor", true, out subEle);
            TintColor.WriteXML(subEle, master);

            ele.TryPathTo("BlurRadius", true, out subEle);
            subEle.Value = BlurRadius.ToString();

            ele.TryPathTo("DoubleVisionStrength", true, out subEle);
            subEle.Value = DoubleVisionStrength.ToString();

            ele.TryPathTo("RadialBlur/Strength", true, out subEle);
            subEle.Value = RadialBlurStrength.ToString();

            ele.TryPathTo("RadialBlur/RampUp", true, out subEle);
            subEle.Value = RadialBlurRampUp.ToString();

            ele.TryPathTo("RadialBlur/Start", true, out subEle);
            subEle.Value = RadialBlurStart.ToString();

            ele.TryPathTo("RadialBlur/UseTarget", true, out subEle);
            subEle.Value = RadialBlurUseTarget.ToString();

            ele.TryPathTo("RadialBlur/Center/X", true, out subEle);
            subEle.Value = RadialBlurCenterX.ToString();

            ele.TryPathTo("RadialBlur/Center/Y", true, out subEle);
            subEle.Value = RadialBlurCenterY.ToString();

            ele.TryPathTo("DepthOfField/Strength", true, out subEle);
            subEle.Value = DepthOfFieldStrength.ToString();

            ele.TryPathTo("DepthOfField/Distance", true, out subEle);
            subEle.Value = DepthOfFieldDistance.ToString();

            ele.TryPathTo("DepthOfField/Range", true, out subEle);
            subEle.Value = DepthOfFieldRange.ToString();

            ele.TryPathTo("DepthOfField/UseTarget", true, out subEle);
            subEle.Value = DepthOfFieldUseTarget.ToString();

            ele.TryPathTo("RadialBlur/RampDown", true, out subEle);
            subEle.Value = RadialBlurRampDown.ToString();

            ele.TryPathTo("RadialBlur/DownStart", true, out subEle);
            subEle.Value = RadialBlurDownStart.ToString();

            ele.TryPathTo("FadeColor", true, out subEle);
            FadeColor.WriteXML(subEle, master);

            ele.TryPathTo("MotionBlurStrength", true, out subEle);
            subEle.Value = MotionBlurStrength.ToString();
        }
Esempio n. 20
0
        protected override void ReadDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("IsAnimatable", false, out subEle))
            {
                IsAnimatable = subEle.ToEnum <NoYes>();
            }

            if (ele.TryPathTo("Duration", false, out subEle))
            {
                Duration = subEle.ToSingle();
            }

            if (ele.TryPathTo("HDR/EyeAdaptSpeed/Mult", false, out subEle))
            {
                HDREyeAdaptSpeedMult = subEle.ToUInt32();
            }

            if (ele.TryPathTo("HDR/EyeAdaptSpeed/Add", false, out subEle))
            {
                HDREyeAdaptSpeedAdd = subEle.ToUInt32();
            }

            if (ele.TryPathTo("HDR/Bloom/BlurRadius/Mult", false, out subEle))
            {
                HDRBloomBlurRadiusMult = subEle.ToUInt32();
            }

            if (ele.TryPathTo("HDR/Bloom/BlurRadius/Add", false, out subEle))
            {
                HDRBloomBlurRadiusAdd = subEle.ToUInt32();
            }

            if (ele.TryPathTo("HDR/Bloom/Threshold/Mult", false, out subEle))
            {
                HDRBloomThresholdMult = subEle.ToUInt32();
            }

            if (ele.TryPathTo("HDR/Bloom/Threshold/Add", false, out subEle))
            {
                HDRBloomThresholdAdd = subEle.ToUInt32();
            }

            if (ele.TryPathTo("HDR/Bloom/Scale/Mult", false, out subEle))
            {
                HDRBloomScaleMult = subEle.ToUInt32();
            }

            if (ele.TryPathTo("HDR/Bloom/Scale/Add", false, out subEle))
            {
                HDRBloomScaleAdd = subEle.ToUInt32();
            }

            if (ele.TryPathTo("HDR/TargetLum/Min/Mult", false, out subEle))
            {
                HDRTargetLumMinMult = subEle.ToUInt32();
            }

            if (ele.TryPathTo("HDR/TargetLum/Min/Add", false, out subEle))
            {
                HDRTargetLumMinAdd = subEle.ToUInt32();
            }

            if (ele.TryPathTo("HDR/TargetLum/Max/Mult", false, out subEle))
            {
                HDRTargetLumMaxMult = subEle.ToUInt32();
            }

            if (ele.TryPathTo("HDR/TargetLum/Max/Add", false, out subEle))
            {
                HDRTargetLumMaxAdd = subEle.ToUInt32();
            }

            if (ele.TryPathTo("HDR/SunlightScale/Mult", false, out subEle))
            {
                HDRSunlightScaleMult = subEle.ToUInt32();
            }

            if (ele.TryPathTo("HDR/SunlightScale/Add", false, out subEle))
            {
                HDRSunlightScaleAdd = subEle.ToUInt32();
            }

            if (ele.TryPathTo("HDR/SkyScale/Mult", false, out subEle))
            {
                HDRSkyScaleMult = subEle.ToUInt32();
            }

            if (ele.TryPathTo("HDR/SkyScale/Add", false, out subEle))
            {
                HDRSkyScaleAdd = subEle.ToUInt32();
            }

            if (ele.TryPathTo("Unknown1", false, out subEle))
            {
                Unknown1 = subEle.ToBytes();
            }

            if (ele.TryPathTo("Cinematic/Saturation/Mult", false, out subEle))
            {
                CinematicSaturationMult = subEle.ToUInt32();
            }

            if (ele.TryPathTo("Cinematic/Saturation/Add", false, out subEle))
            {
                CinematicSaturationAdd = subEle.ToUInt32();
            }

            if (ele.TryPathTo("Cinematic/Brightness/Mult", false, out subEle))
            {
                CinematicBrightnessMult = subEle.ToUInt32();
            }

            if (ele.TryPathTo("Cinematic/Brightness/Add", false, out subEle))
            {
                CinematicBrightnessAdd = subEle.ToUInt32();
            }

            if (ele.TryPathTo("Cinematic/Contrast/Mult", false, out subEle))
            {
                CinematicContrastMult = subEle.ToUInt32();
            }

            if (ele.TryPathTo("Cinematic/Contrast/Add", false, out subEle))
            {
                CinematicContrastAdd = subEle.ToUInt32();
            }

            if (ele.TryPathTo("Unknown2", false, out subEle))
            {
                Unknown2 = subEle.ToBytes();
            }

            if (ele.TryPathTo("TintColor", false, out subEle))
            {
                TintColor.ReadXML(subEle, master);
            }

            if (ele.TryPathTo("BlurRadius", false, out subEle))
            {
                BlurRadius = subEle.ToUInt32();
            }

            if (ele.TryPathTo("DoubleVisionStrength", false, out subEle))
            {
                DoubleVisionStrength = subEle.ToUInt32();
            }

            if (ele.TryPathTo("RadialBlur/Strength", false, out subEle))
            {
                RadialBlurStrength = subEle.ToUInt32();
            }

            if (ele.TryPathTo("RadialBlur/RampUp", false, out subEle))
            {
                RadialBlurRampUp = subEle.ToUInt32();
            }

            if (ele.TryPathTo("RadialBlur/Start", false, out subEle))
            {
                RadialBlurStart = subEle.ToUInt32();
            }

            if (ele.TryPathTo("RadialBlur/UseTarget", false, out subEle))
            {
                RadialBlurUseTarget = subEle.ToEnum <NoYes>();
            }

            if (ele.TryPathTo("RadialBlur/Center/X", false, out subEle))
            {
                RadialBlurCenterX = subEle.ToUInt32();
            }

            if (ele.TryPathTo("RadialBlur/Center/Y", false, out subEle))
            {
                RadialBlurCenterY = subEle.ToUInt32();
            }

            if (ele.TryPathTo("DepthOfField/Strength", false, out subEle))
            {
                DepthOfFieldStrength = subEle.ToUInt32();
            }

            if (ele.TryPathTo("DepthOfField/Distance", false, out subEle))
            {
                DepthOfFieldDistance = subEle.ToUInt32();
            }

            if (ele.TryPathTo("DepthOfField/Range", false, out subEle))
            {
                DepthOfFieldRange = subEle.ToUInt32();
            }

            if (ele.TryPathTo("DepthOfField/UseTarget", false, out subEle))
            {
                DepthOfFieldUseTarget = subEle.ToEnum <NoYes>();
            }

            if (ele.TryPathTo("RadialBlur/RampDown", false, out subEle))
            {
                RadialBlurRampDown = subEle.ToUInt32();
            }

            if (ele.TryPathTo("RadialBlur/DownStart", false, out subEle))
            {
                RadialBlurDownStart = subEle.ToUInt32();
            }

            if (ele.TryPathTo("FadeColor", false, out subEle))
            {
                FadeColor.ReadXML(subEle, master);
            }

            if (ele.TryPathTo("MotionBlurStrength", false, out subEle))
            {
                MotionBlurStrength = subEle.ToEnum <NoYes>();
            }
        }
 private void ColorComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     glazer.Color = TintColor.ToString();
 }
 private LiquidMeshData(int textureIndex, TintColor tint)
 {
     TextureIndex = textureIndex;
     Tint         = tint;
 }