17.01.2021

+ WPF-Support
+ Game Controller System
+ GameKeybind System

+ SM_WPF_TEST
This commit is contained in:
Michel Fedde 2021-01-17 21:13:37 +01:00
parent af90d617d3
commit 6f23a80f7f
60 changed files with 1536 additions and 143 deletions

View file

@ -0,0 +1,28 @@
using SharpDX.XInput;
namespace SM.Game.Controls
{
public struct GameControllerStateDPad
{
public static GameControllerStateDPad Default = new GameControllerStateDPad(GamepadButtonFlags.None);
public bool Up;
public bool Down;
public bool Left;
public bool Right;
internal GameControllerStateDPad(GamepadButtonFlags flags)
{
Up = flags.HasFlag(GamepadButtonFlags.DPadUp);
Down = flags.HasFlag(GamepadButtonFlags.DPadDown);
Left = flags.HasFlag(GamepadButtonFlags.DPadLeft);
Right = flags.HasFlag(GamepadButtonFlags.DPadRight);
}
public override string ToString()
{
return
$"Up: {(Up ? "1" : "0")}; Down: {(Down ? "1" : "0")}; Left: {(Left ? "1" : "0")}; Right: {(Right ? "1" : "0")};";
}
}
}