From c102e3e64e66ae66b05dd53f1eab13e1bd6f7b6e Mon Sep 17 00:00:00 2001 From: Raymond Date: Tue, 10 Aug 2021 08:57:21 -0400 Subject: [PATCH] Gamepad moved to a separate namespace, update public property name --- .../ClientState/{ => GamePad}/GamepadButtons.cs | 4 ++-- .../{Structs => GamePad}/GamepadInput.cs | 2 +- .../Game/ClientState/{ => GamePad}/GamepadState.cs | 13 ++++--------- 3 files changed, 7 insertions(+), 12 deletions(-) rename Dalamud/Game/ClientState/{ => GamePad}/GamepadButtons.cs (97%) rename Dalamud/Game/ClientState/{Structs => GamePad}/GamepadInput.cs (98%) rename Dalamud/Game/ClientState/{ => GamePad}/GamepadState.cs (97%) diff --git a/Dalamud/Game/ClientState/GamepadButtons.cs b/Dalamud/Game/ClientState/GamePad/GamepadButtons.cs similarity index 97% rename from Dalamud/Game/ClientState/GamepadButtons.cs rename to Dalamud/Game/ClientState/GamePad/GamepadButtons.cs index 80a745d53..7813803c8 100644 --- a/Dalamud/Game/ClientState/GamepadButtons.cs +++ b/Dalamud/Game/ClientState/GamePad/GamepadButtons.cs @@ -1,6 +1,6 @@ -using System; +using System; -namespace Dalamud.Game.ClientState +namespace Dalamud.Game.ClientState.GamePad { /// /// Bitmask of the Button ushort used by the game. diff --git a/Dalamud/Game/ClientState/Structs/GamepadInput.cs b/Dalamud/Game/ClientState/GamePad/GamepadInput.cs similarity index 98% rename from Dalamud/Game/ClientState/Structs/GamepadInput.cs rename to Dalamud/Game/ClientState/GamePad/GamepadInput.cs index df80b0ef4..d6d46a0cc 100644 --- a/Dalamud/Game/ClientState/Structs/GamepadInput.cs +++ b/Dalamud/Game/ClientState/GamePad/GamepadInput.cs @@ -1,6 +1,6 @@ using System.Runtime.InteropServices; -namespace Dalamud.Game.ClientState.Structs +namespace Dalamud.Game.ClientState.GamePad { /// /// Struct which gets populated by polling the gamepads. diff --git a/Dalamud/Game/ClientState/GamepadState.cs b/Dalamud/Game/ClientState/GamePad/GamepadState.cs similarity index 97% rename from Dalamud/Game/ClientState/GamepadState.cs rename to Dalamud/Game/ClientState/GamePad/GamepadState.cs index 2d84fdb83..8759673b2 100644 --- a/Dalamud/Game/ClientState/GamepadState.cs +++ b/Dalamud/Game/ClientState/GamePad/GamepadState.cs @@ -1,11 +1,10 @@ using System; -using Dalamud.Game.ClientState.Structs; using Dalamud.Hooking; using ImGuiNET; using Serilog; -namespace Dalamud.Game.ClientState +namespace Dalamud.Game.ClientState.GamePad { /// /// Exposes the game gamepad state to dalamud. @@ -24,7 +23,7 @@ namespace Dalamud.Game.ClientState private int rightStickY; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// Resolver knowing the pointer to the GamepadPoll function. public GamepadState(ClientStateAddressResolver resolver) @@ -43,12 +42,10 @@ namespace Dalamud.Game.ClientState private delegate int ControllerPoll(IntPtr controllerInput); -#if DEBUG /// /// Gets the pointer to the current instance of the GamepadInput struct. /// - public IntPtr GamepadInput { get; private set; } -#endif + public IntPtr GamepadInputAddress { get; private set; } /// /// Gets the state of the left analogue stick in the left direction between 0 (not tilted) and 1 (max tilt). @@ -189,9 +186,7 @@ namespace Dalamud.Game.ClientState var original = this.gamepadPoll.Original(gamepadInput); try { -#if DEBUG - this.GamepadInput = gamepadInput; -#endif + this.GamepadInputAddress = gamepadInput; var input = (GamepadInput*)gamepadInput; this.leftStickX = input->LeftStickX; this.leftStickY = input->LeftStickY;