From 2084f927ae60fb9d0565c8635765c81ee3f7ed12 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 11 Sep 2019 12:30:29 +0200 Subject: [PATCH] fixed the slider using the wrong left and right buttons --- MLEM.Ui/Elements/Slider.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MLEM.Ui/Elements/Slider.cs b/MLEM.Ui/Elements/Slider.cs index 980a7db..17e20d1 100644 --- a/MLEM.Ui/Elements/Slider.cs +++ b/MLEM.Ui/Elements/Slider.cs @@ -1,3 +1,4 @@ +using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Input; using MLEM.Misc; @@ -19,9 +20,9 @@ namespace MLEM.Ui.Elements { base.Update(time); if (this.IsSelected) { - if (this.Input.IsGamepadButtonDown(Buttons.DPadLeft) || this.Input.IsGamepadButtonDown(Buttons.LeftThumbstickLeft)) { + if (this.Controls.LeftButtons.Any(b => this.Input.IsDown(b, this.Controls.GamepadIndex))) { this.CurrentValue -= this.StepPerScroll; - } else if (this.Input.IsGamepadButtonDown(Buttons.DPadRight) || this.Input.IsGamepadButtonDown(Buttons.LeftThumbstickRight)) { + } else if (this.Controls.RightButtons.Any(b => this.Input.IsDown(b, this.Controls.GamepadIndex))) { this.CurrentValue += this.StepPerScroll; } }