1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-25 22:18:34 +01:00

fixed the slider using the wrong left and right buttons

This commit is contained in:
Ellpeck 2019-09-11 12:30:29 +02:00
parent 88ce9de00a
commit 2084f927ae

View file

@ -1,3 +1,4 @@
using System.Linq;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
using MLEM.Misc; using MLEM.Misc;
@ -19,9 +20,9 @@ namespace MLEM.Ui.Elements {
base.Update(time); base.Update(time);
if (this.IsSelected) { 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; 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; this.CurrentValue += this.StepPerScroll;
} }
} }