protected override void DrawSelf(SpriteBatch spriteBatch) { base.DrawSelf(spriteBatch); float num = 6f; int num2 = 0; rightHover = null; if (!Main.mouseLeft) { rightLock = null; } if (rightLock == this) { num2 = 1; } else if (rightLock != null) { num2 = 2; } CalculatedStyle dimensions = base.GetDimensions(); float num3 = dimensions.Width + 1f; Vector2 vector = new Vector2(dimensions.X, dimensions.Y); bool flag2 = base.IsMouseHovering; if (num2 == 1) { flag2 = true; } if (num2 == 2) { flag2 = false; } Vector2 vector2 = vector; vector2.X += 8f; vector2.Y += 2f + num; vector2.X -= 17f; //TextureAssets.ColorBar.Value.Frame(1, 1, 0, 0); vector2 = new Vector2(dimensions.X + dimensions.Width - 10f, dimensions.Y + 10f + num); IngameOptions.valuePosition = vector2; float obj = DrawValueBar(spriteBatch, 1f, Proportion, num2, colorMethod); if (IngameOptions.inBar || rightLock == this) { rightHover = this; if (PlayerInput.Triggers.Current.MouseLeft && rightLock == this) { Proportion = obj; } } if (rightHover != null && rightLock == null && PlayerInput.Triggers.JustPressed.MouseLeft) { rightLock = rightHover; } }
protected override void DrawSelf(SpriteBatch spriteBatch) { base.DrawSelf(spriteBatch); float num = 6f; int num2 = 0; //IngameOptions.rightHover = -1; rightHover = null; if (!Main.mouseLeft) { //IngameOptions.rightLock = -1; rightLock = null; } //if (IngameOptions.rightLock == this._sliderIDInPage) if (rightLock == this) { num2 = 1; } //else if (IngameOptions.rightLock != -1) else if (rightLock != null) { num2 = 2; } CalculatedStyle dimensions = base.GetDimensions(); float num3 = dimensions.Width + 1f; Vector2 vector = new Vector2(dimensions.X, dimensions.Y); bool flag2 = base.IsMouseHovering; if (num2 == 1) { flag2 = true; } if (num2 == 2) { flag2 = false; } Vector2 vector2 = vector; vector2.X += 8f; vector2.Y += 2f + num; vector2.X -= 17f; Main.colorBarTexture.Frame(1, 1, 0, 0); vector2 = new Vector2(dimensions.X + dimensions.Width - 10f, dimensions.Y + 10f + num); IngameOptions.valuePosition = vector2; float obj = DrawValueBar(spriteBatch, 1f, this._GetProportion(), num2); //if (IngameOptions.inBar || IngameOptions.rightLock == this._sliderIDInPage) if (IngameOptions.inBar || rightLock == this) { rightHover = this; //IngameOptions.rightHover = this._sliderIDInPage; if (PlayerInput.Triggers.Current.MouseLeft && rightLock == this) //if (PlayerInput.Triggers.Current.MouseLeft && IngameOptions.rightLock == this._sliderIDInPage) { this._SetProportion(obj); } } if (rightHover != null && rightLock == null) //if (IngameOptions.rightHover != -1 && IngameOptions.rightLock == -1) { //IngameOptions.rightLock = IngameOptions.rightHover; rightLock = rightHover; } }