Exemplo n.º 1
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            Vector3 hSLVector = colorSet.GetHSLVector();
            DelegateMethods.v3_1 = hSLVector;

            Vector2 pos = GetDimensions().Position().Offset(texture.Width, texture.Height);
            IngameOptions.valuePosition = pos;
            IngameOptions.DrawValueBar(spriteBatch, 1f, hSLVector.X, 0, new Utils.ColorLerpMethod(DelegateMethods.ColorLerp_HSL_H));

            pos = pos.Offset(0, texture.Height * 2);
            IngameOptions.valuePosition = pos;
            IngameOptions.DrawValueBar(spriteBatch, 1f, hSLVector.Y, 0, new Utils.ColorLerpMethod(DelegateMethods.ColorLerp_HSL_S));

            pos = pos.Offset(0, texture.Height * 2);
            IngameOptions.valuePosition = pos;
            IngameOptions.DrawValueBar(spriteBatch, 1f, hSLVector.Z, 0, new Utils.ColorLerpMethod(DelegateMethods.ColorLerp_HSL_L));

            colorSet.SetHSL(hSLVector);
        }
Exemplo n.º 2
0
        public override void HandleMe(ref string label, bool clicked, ref int yPosition, int index)
        {
            int yPos = yPosition;

            base.HandleMe(ref label, clicked, ref yPosition, index);
            int xPos = 390 + Main.screenWidth / 2 - 400 - 100;

            // String 1
            Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontDeathText, this.label, (float)xPos, (float)yPos, Interface.color, Color.Black, Vector2.Zero, 0.5f);
            // String 2
            xPos += 270;            //180;
            if (secondStringOnly)
            {
                xPos -= 270;
            }
            Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontDeathText, estimationString(getter()), (float)xPos, (float)yPos, Interface.color, Color.Black, Vector2.Zero, 0.5f);
            // Slider
            if (!noSlider)
            {
                IngameOptions.valuePosition = new Vector2((float)(Main.screenWidth / 2 - 140), (float)(yPos + 12));                 // line up correctly
                float percent = IngameOptions.DrawValueBar(Main.spriteBatch, 1.3f, getter() / ratio);
                if (IngameOptions.inBar || IngameOptions.rightLock == index)
                {
                    IngameOptions.rightHover = index;
                    if (Main.mouseLeft && IngameOptions.rightLock == index)
                    {
                        setter(ratio * percent);
                    }
                }
                if (IngameOptions.inBar && Interface.keyboardSliderAdjustment != 0)
                {
                    float newPercent = (getter() / ratio + (.001f * Interface.keyboardSliderAdjustment));
                    newPercent = Math.Min(Math.Max(0f, newPercent), 1f);
                    setter(ratio * newPercent);
                }
            }
        }
Exemplo n.º 3
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            float num = 6f;

            base.DrawSelf(spriteBatch);
            int num2 = 0;

            IngameOptions.rightHover = -1;
            if (!Main.mouseLeft)
            {
                IngameOptions.rightLock = -1;
            }
            if (IngameOptions.rightLock == _sliderIDInPage)
            {
                num2 = 1;
            }
            else if (IngameOptions.rightLock != -1)
            {
                num2 = 2;
            }
            CalculatedStyle dimensions = GetDimensions();
            float           num3       = dimensions.Width + 1f;
            Vector2         vector     = new Vector2(dimensions.X, dimensions.Y);
            bool            flag       = base.IsMouseHovering;

            if (num2 == 1)
            {
                flag = true;
            }
            if (num2 == 2)
            {
                flag = false;
            }
            Vector2 baseScale = new Vector2(0.8f);
            Color   value     = (false ? Color.Gold : (flag ? Color.White : Color.Silver));

            value = Color.Lerp(value, Color.White, flag ? 0.5f : 0f);
            Color   color    = (flag ? _color : _color.MultiplyRGBA(new Color(180, 180, 180)));
            Vector2 position = vector;

            Utils.DrawSettingsPanel(spriteBatch, position, num3, color);
            position.X += 8f;
            position.Y += 2f + num;
            ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.ItemStack.Value, _TextDisplayFunction(), position, value, 0f, Vector2.Zero, baseScale, num3);
            position.X -= 17f;
            TextureAssets.ColorBar.Frame();
            position = (IngameOptions.valuePosition = new Vector2(dimensions.X + dimensions.Width - 10f, dimensions.Y + 10f + num));
            float obj = IngameOptions.DrawValueBar(spriteBatch, 1f, _GetStatusFunction(), num2);

            if (IngameOptions.inBar || IngameOptions.rightLock == _sliderIDInPage)
            {
                IngameOptions.rightHover = _sliderIDInPage;
                if (PlayerInput.Triggers.Current.MouseLeft && PlayerInput.CurrentProfile.AllowEditting && !PlayerInput.UsingGamepad && IngameOptions.rightLock == _sliderIDInPage)
                {
                    _SlideKeyboardAction(obj);
                }
            }
            if (IngameOptions.rightHover != -1 && IngameOptions.rightLock == -1)
            {
                IngameOptions.rightLock = IngameOptions.rightHover;
            }
            if (base.IsMouseHovering && PlayerInput.CurrentProfile.AllowEditting)
            {
                _SlideGamepadAction();
            }
        }
Exemplo n.º 4
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            float num1 = 6f;

            base.DrawSelf(spriteBatch);
            int lockState = 0;

            IngameOptions.rightHover = -1;
            if (!Main.mouseLeft)
            {
                IngameOptions.rightLock = -1;
            }
            if (IngameOptions.rightLock == this._sliderIDInPage)
            {
                lockState = 1;
            }
            else if (IngameOptions.rightLock != -1)
            {
                lockState = 2;
            }
            CalculatedStyle dimensions = this.GetDimensions();
            float           num2       = dimensions.Width + 1f;
            Vector2         vector2    = new Vector2(dimensions.X, dimensions.Y);
            bool            flag1      = false;
            bool            flag2      = this.IsMouseHovering;

            if (lockState == 1)
            {
                flag2 = true;
            }
            if (lockState == 2)
            {
                flag2 = false;
            }
            Vector2 baseScale = new Vector2(0.8f);
            Color   baseColor = Color.Lerp(flag1 ? Color.Gold : (flag2 ? Color.White : Color.Silver), Color.White, flag2 ? 0.5f : 0.0f);
            Color   color     = flag2 ? this._color : this._color.MultiplyRGBA(new Color(180, 180, 180));
            Vector2 position  = vector2;

            Utils.DrawSettingsPanel(spriteBatch, position, num2, color);
            position.X += 8f;
            position.Y += 2f + num1;
            ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontItemStack, this._TextDisplayFunction(), position, baseColor, 0.0f, Vector2.Zero, baseScale, num2, 2f);
            position.X -= 17f;
            Main.colorBarTexture.Frame(1, 1, 0, 0);
            position = new Vector2((float)((double)dimensions.X + (double)dimensions.Width - 10.0), dimensions.Y + 10f + num1);
            IngameOptions.valuePosition = position;
            float num3 = IngameOptions.DrawValueBar(spriteBatch, 1f, this._GetStatusFunction(), lockState, (Utils.ColorLerpMethod)null);

            if (IngameOptions.inBar || IngameOptions.rightLock == this._sliderIDInPage)
            {
                IngameOptions.rightHover = this._sliderIDInPage;
                if (PlayerInput.Triggers.Current.MouseLeft && PlayerInput.CurrentProfile.AllowEditting && (!PlayerInput.UsingGamepad && IngameOptions.rightLock == this._sliderIDInPage))
                {
                    this._SlideKeyboardAction(num3);
                }
            }
            if (IngameOptions.rightHover != -1 && IngameOptions.rightLock == -1)
            {
                IngameOptions.rightLock = IngameOptions.rightHover;
            }
            if (!this.IsMouseHovering || !PlayerInput.CurrentProfile.AllowEditting)
            {
                return;
            }
            this._SlideGamepadAction();
        }
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            float num1 = 6f;

            base.DrawSelf(spriteBatch);
            int lockState = 0;

            IngameOptions.rightHover = -1;
            if (!Main.mouseLeft)
            {
                IngameOptions.rightLock = -1;
            }
            if (IngameOptions.rightLock == this._sliderIDInPage)
            {
                lockState = 1;
            }
            else if (IngameOptions.rightLock != -1)
            {
                lockState = 2;
            }
            CalculatedStyle dimensions = this.GetDimensions();
            float           num2       = dimensions.Width + 1f;
            Vector2         vector2;

            // ISSUE: explicit reference operation
            ((Vector2)@vector2).\u002Ector(dimensions.X, dimensions.Y);
            bool flag1 = false;
            bool flag2 = this.IsMouseHovering;

            if (lockState == 1)
            {
                flag2 = true;
            }
            if (lockState == 2)
            {
                flag2 = false;
            }
            Vector2 baseScale;

            // ISSUE: explicit reference operation
            ((Vector2)@baseScale).\u002Ector(0.8f);
            Color   baseColor = Color.Lerp(flag1 ? Color.get_Gold() : (flag2 ? Color.get_White() : Color.get_Silver()), Color.get_White(), flag2 ? 0.5f : 0.0f);
            Color   color     = flag2 ? this._color : this._color.MultiplyRGBA(new Color(180, 180, 180));
            Vector2 position  = vector2;

            Utils.DrawSettingsPanel(spriteBatch, position, num2, color);
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            Vector2& local1 = @position;
            // ISSUE: explicit reference operation
            double num3 = (^ local1).X + 8.0;

            // ISSUE: explicit reference operation
            (^ local1).X = (__Null)num3;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            Vector2& local2 = @position;
            // ISSUE: explicit reference operation
            double num4 = (^ local2).Y + (2.0 + (double)num1);

            // ISSUE: explicit reference operation
            (^ local2).Y = (__Null)num4;
            ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontItemStack, this._TextDisplayFunction.Invoke(), position, baseColor, 0.0f, Vector2.get_Zero(), baseScale, num2, 2f);
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            Vector2& local3 = @position;
            // ISSUE: explicit reference operation
            double num5 = (^ local3).X - 17.0;

            // ISSUE: explicit reference operation
            (^ local3).X = (__Null)num5;
            Main.colorBarTexture.Frame(1, 1, 0, 0);
            // ISSUE: explicit reference operation
            ((Vector2)@position).\u002Ector((float)((double)dimensions.X + (double)dimensions.Width - 10.0), dimensions.Y + 10f + num1);
            IngameOptions.valuePosition = position;
            float num6 = IngameOptions.DrawValueBar(spriteBatch, 1f, this._GetStatusFunction.Invoke(), lockState, (Utils.ColorLerpMethod)null);

            if (IngameOptions.inBar || IngameOptions.rightLock == this._sliderIDInPage)
            {
                IngameOptions.rightHover = this._sliderIDInPage;
                if (PlayerInput.Triggers.Current.MouseLeft && PlayerInput.CurrentProfile.AllowEditting && (!PlayerInput.UsingGamepad && IngameOptions.rightLock == this._sliderIDInPage))
                {
                    this._SlideKeyboardAction(num6);
                }
            }
            if (IngameOptions.rightHover != -1 && IngameOptions.rightLock == -1)
            {
                IngameOptions.rightLock = IngameOptions.rightHover;
            }
            if (!this.IsMouseHovering || !PlayerInput.CurrentProfile.AllowEditting)
            {
                return;
            }
            this._SlideGamepadAction.Invoke();
        }
Exemplo n.º 6
0
 protected override void DrawSelf(SpriteBatch spriteBatch)
 {
     IngameOptions.valuePosition = GetDimensions().Position().Offset(Main.colorBarTexture.Width, Main.colorBarTexture.Height);
     IngameOptions.DrawValueBar(spriteBatch, 1f, Value);
 }
Exemplo n.º 7
0
        // Token: 0x060010E7 RID: 4327 RVA: 0x00407DF4 File Offset: 0x00405FF4
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            float num = 6f;

            base.DrawSelf(spriteBatch);
            int num2 = 0;

            IngameOptions.rightHover = -1;
            if (!Main.mouseLeft)
            {
                IngameOptions.rightLock = -1;
            }
            if (IngameOptions.rightLock == this._sliderIDInPage)
            {
                num2 = 1;
            }
            else if (IngameOptions.rightLock != -1)
            {
                num2 = 2;
            }
            CalculatedStyle dimensions = base.GetDimensions();
            float           num3       = dimensions.Width + 1f;
            Vector2         arg_EB_0   = new Vector2(dimensions.X, dimensions.Y);
            bool            arg_85_0   = false;
            bool            flag       = base.IsMouseHovering;

            if (num2 == 1)
            {
                flag = true;
            }
            if (num2 == 2)
            {
                flag = false;
            }
            Vector2 baseScale = new Vector2(0.8f);
            Color   color     = arg_85_0 ? Color.Gold : (flag ? Color.White : Color.Silver);

            color = Color.Lerp(color, Color.White, flag ? 0.5f : 0f);
            Color   color2 = flag ? this._color : this._color.MultiplyRGBA(new Color(180, 180, 180));
            Vector2 vector = arg_EB_0;

            Utils.DrawSettingsPanel(spriteBatch, vector, num3, color2);
            vector.X += 8f;
            vector.Y += 2f + num;
            ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontItemStack, this._TextDisplayFunction(), vector, color, 0f, Vector2.Zero, baseScale, num3, 2f);
            vector.X -= 17f;
            Main.colorBarTexture.Frame(1, 1, 0, 0);
            vector = new Vector2(dimensions.X + dimensions.Width - 10f, dimensions.Y + 10f + num);
            IngameOptions.valuePosition = vector;
            float obj = IngameOptions.DrawValueBar(spriteBatch, 1f, this._GetStatusFunction(), num2, null);

            if (IngameOptions.inBar || IngameOptions.rightLock == this._sliderIDInPage)
            {
                IngameOptions.rightHover = this._sliderIDInPage;
                if (PlayerInput.Triggers.Current.MouseLeft && PlayerInput.CurrentProfile.AllowEditting && !PlayerInput.UsingGamepad && IngameOptions.rightLock == this._sliderIDInPage)
                {
                    this._SlideKeyboardAction(obj);
                }
            }
            if (IngameOptions.rightHover != -1 && IngameOptions.rightLock == -1)
            {
                IngameOptions.rightLock = IngameOptions.rightHover;
            }
            if (base.IsMouseHovering && PlayerInput.CurrentProfile.AllowEditting)
            {
                this._SlideGamepadAction();
            }
        }