Esempio n. 1
0
        public override void Update(GameTime gameTime)
        {
            if (!startUpFlag)
            {
                if (Main.LocalPlayer.EE().StickyGunpowderActive)
                {
                    leftPage.Append(StickyGunpowderImage);
                    ToggleStickyGunpowder.Append(new Active());
                }
                else
                {
                    leftPage.Append(StickyGunpowder_GreyscaleImage);
                    ToggleStickyGunpowder.Append(new Inactive());
                }
                if (Main.LocalPlayer.EE().LightweightBombshellsActive)
                {
                    rightPage.Append(LightweightBombshellsImage);
                    ToggleLightweightBombshells.Append(new Active());
                }
                else
                {
                    rightPage.Append(LightweightBombshells_GreyscaleImage);
                    ToggleLightweightBombshells.Append(new Inactive());
                }
                VelocitySliderBar.SetSlider((int)(Main.LocalPlayer.EE().LightweightBombshellVelocity));
                startUpFlag = true;
            }

            if (VelocitySliderBar != null && startUpFlag)
            {
                Main.LocalPlayer.EE().LightweightBombshellVelocity = VelocitySliderBar.value;
            }

            if (VelocitySliderBar.value != null)
            {
                VelocitySliderBar.RemoveChild(VelocityOut);
                VelocityOut            = new UIText($"Current Weight: {1 + (VelocitySliderBar.value) / 12}kg");
                VelocityOut.VAlign     = 1;
                VelocityOut.HAlign     = 0.5f;
                VelocityOut.Top.Pixels = 25;
                VelocitySliderBar.Append(VelocityOut);
            }
            base.Update(gameTime);
        }
Esempio n. 2
0
        public override void Update(GameTime gameTime)
        {
            if (!startUpFlag)
            {
                if (Main.LocalPlayer.EE().RandomFuelActive)
                {
                    leftPage.Append(RandomFuelImage);
                    ToggleRandomFuel.Append(new Active());
                }
                else
                {
                    leftPage.Append(RandomFuel_GreyscaleImage);
                    ToggleRandomFuel.Append(new Inactive());
                }

                /*
                 * if (Main.LocalPlayer.EE().RandomFuelOnFire)
                 * {
                 *  ToggleOnFire.Append(new Active());
                 * }
                 * else
                 * {
                 *  ToggleOnFire.Append(new Inactive());
                 * }
                 *
                 * if (Main.LocalPlayer.EE().RandomFuelFrostburn)
                 * {
                 *  ToggleFrostburn.Append(new Active());
                 * }
                 * else
                 * {
                 *  ToggleFrostburn.Append(new Inactive());
                 * }
                 *
                 * if (Main.LocalPlayer.EE().RandomFuelConfused)
                 * {
                 *  ToggleConfused.Append(new Active());
                 * }
                 * else
                 * {
                 *  ToggleConfused.Append(new Inactive());
                 * }
                 */

                if (Main.LocalPlayer.EE().ShortFuseActive)
                {
                    rightPage.Append(ShortFuzeImage);
                    ToggleShortFuze.Append(new Active());
                }
                else
                {
                    rightPage.Append(ShortFuze_GreyscaleImage);
                    ToggleShortFuze.Append(new Inactive());
                }
                if (Main.LocalPlayer.EE().ShortFuseTime != Single.NaN && Main.LocalPlayer.EE().ShortFuseTime != null)
                {
                    FuseSliderBar.SetSlider((int)(Main.LocalPlayer.EE().ShortFuseTime));
                }
                else
                {
                    Main.NewText("Something went wrong while setting up UI values");
                    Main.NewText("Please notify the Extra Explosives Devs (if this is a test build just @Charlie)");
                    FuseSliderBar.SetSlider(1);
                }
                startUpFlag = true;
            }

            if (FuseSliderBar != null && startUpFlag)
            {
                Main.LocalPlayer.EE().ShortFuseTime = FuseSliderBar.value;
            }

            if (FuseSliderBar.value != null)
            {
                FuseSliderBar.RemoveChild(FuseOut);
                float bounds = (float)Math.Round((FuseSliderBar.value - 5) / 87.5f + 0.5f, 2);
                if (bounds > 2)
                {
                    bounds = 2;
                }
                string text = (bounds < 1 ? " shorter" : " longer");
                FuseOut            = new UIText($"Fuze is {bounds} times" + text);
                FuseOut.VAlign     = 1f;
                FuseOut.HAlign     = 0.5f;
                FuseOut.Top.Pixels = 25;
                Main.LocalPlayer.EE().ShortFuseTime = bounds;
                FuseSliderBar.Append(FuseOut);
                FuseSliderBar.SetSlider(1);
            }
            base.Update(gameTime);
        }