feat: Add support for gamepad control of ImGui

Alongside a settings option and the ability for plugins to query gamepad state.
PLugins cannot, however, as of now set an input as 'handled' and block it
for the game.
Whether game or ImGui is receiving gamepad input can be be checked via
`(ImGui.GetIO().ConfigFlags & ImGuiConfigFlags.NavEnableGamepad) > 0`
This commit is contained in:
Chivalrik 2021-04-18 15:18:26 +02:00
parent 9d38069fb3
commit 76bf0bc52d
8 changed files with 396 additions and 155 deletions

View file

@ -16,7 +16,14 @@ namespace Dalamud.Game.ClientState
public IntPtr SetupTerritoryType { get; private set; }
//public IntPtr SomeActorTableAccess { get; private set; }
//public IntPtr PartyListUpdate { get; private set; }
/// <summary>
/// Game function which polls the gamepads for data.
///
/// Called every frame, even when `Enable Gamepad` is off in the settings.
/// </summary>
public IntPtr GamepadPoll { get; private set; }
public IntPtr ConditionFlags { get; private set; }
protected override void Setup64Bit(SigScanner sig) {
@ -38,6 +45,8 @@ namespace Dalamud.Game.ClientState
ConditionFlags = sig.GetStaticAddressFromSig("48 8D 0D ?? ?? ?? ?? BA ?? ?? ?? ?? E8 ?? ?? ?? ?? B0 01 48 83 C4 30");
TargetManager = sig.GetStaticAddressFromSig("48 8B 05 ?? ?? ?? ?? 48 8D 0D ?? ?? ?? ?? FF 50 ?? 48 85 DB", 3);
this.GamepadPoll = sig.ScanText("40 ?? 57 41 ?? 48 81 EC ?? ?? ?? ?? 44 0F ?? ?? ?? ?? ?? ?? ?? 48 8B");
}
}
}