17.01.2021
+ WPF-Support + Game Controller System + GameKeybind System + SM_WPF_TEST
This commit is contained in:
parent
af90d617d3
commit
6f23a80f7f
60 changed files with 1536 additions and 143 deletions
28
SMOptionals/SM.Game/Controls/GameControllerStateDPad.cs
Normal file
28
SMOptionals/SM.Game/Controls/GameControllerStateDPad.cs
Normal 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")};";
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue