mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
GamepadWidget resolve obsoletes (#1291)
This commit is contained in:
parent
40aa70d05f
commit
3bf1a05f7d
1 changed files with 27 additions and 33 deletions
|
|
@ -27,7 +27,37 @@ internal class GamepadWidget : IDataWindowWidget
|
|||
{
|
||||
var gamepadState = Service<GamepadState>.Get();
|
||||
|
||||
static void DrawHelper(string text, uint mask, Func<GamepadButtons, float> resolve)
|
||||
ImGui.Text($"GamepadInput 0x{gamepadState.GamepadInputAddress.ToInt64():X}");
|
||||
|
||||
#if DEBUG
|
||||
if (ImGui.IsItemHovered())
|
||||
ImGui.SetMouseCursor(ImGuiMouseCursor.Hand);
|
||||
|
||||
if (ImGui.IsItemClicked())
|
||||
ImGui.SetClipboardText($"0x{gamepadState.GamepadInputAddress.ToInt64():X}");
|
||||
#endif
|
||||
|
||||
this.DrawHelper(
|
||||
"Buttons Raw",
|
||||
gamepadState.ButtonsRaw,
|
||||
gamepadState.Raw);
|
||||
this.DrawHelper(
|
||||
"Buttons Pressed",
|
||||
gamepadState.ButtonsPressed,
|
||||
gamepadState.Pressed);
|
||||
this.DrawHelper(
|
||||
"Buttons Repeat",
|
||||
gamepadState.ButtonsRepeat,
|
||||
gamepadState.Repeat);
|
||||
this.DrawHelper(
|
||||
"Buttons Released",
|
||||
gamepadState.ButtonsReleased,
|
||||
gamepadState.Released);
|
||||
ImGui.Text($"LeftStick {gamepadState.LeftStick}");
|
||||
ImGui.Text($"RightStick {gamepadState.RightStick}");
|
||||
}
|
||||
|
||||
private void DrawHelper(string text, uint mask, Func<GamepadButtons, float> resolve)
|
||||
{
|
||||
ImGui.Text($"{text} {mask:X4}");
|
||||
ImGui.Text($"DPadLeft {resolve(GamepadButtons.DpadLeft)} " +
|
||||
|
|
@ -47,40 +77,4 @@ internal class GamepadWidget : IDataWindowWidget
|
|||
$"L3 {resolve(GamepadButtons.L3)} " +
|
||||
$"R3 {resolve(GamepadButtons.R3)} ");
|
||||
}
|
||||
|
||||
ImGui.Text($"GamepadInput 0x{gamepadState.GamepadInputAddress.ToInt64():X}");
|
||||
|
||||
#if DEBUG
|
||||
if (ImGui.IsItemHovered())
|
||||
ImGui.SetMouseCursor(ImGuiMouseCursor.Hand);
|
||||
|
||||
if (ImGui.IsItemClicked())
|
||||
ImGui.SetClipboardText($"0x{gamepadState.GamepadInputAddress.ToInt64():X}");
|
||||
#endif
|
||||
|
||||
DrawHelper(
|
||||
"Buttons Raw",
|
||||
gamepadState.ButtonsRaw,
|
||||
gamepadState.Raw);
|
||||
DrawHelper(
|
||||
"Buttons Pressed",
|
||||
gamepadState.ButtonsPressed,
|
||||
gamepadState.Pressed);
|
||||
DrawHelper(
|
||||
"Buttons Repeat",
|
||||
gamepadState.ButtonsRepeat,
|
||||
gamepadState.Repeat);
|
||||
DrawHelper(
|
||||
"Buttons Released",
|
||||
gamepadState.ButtonsReleased,
|
||||
gamepadState.Released);
|
||||
ImGui.Text($"LeftStickLeft {gamepadState.LeftStickLeft:0.00} " +
|
||||
$"LeftStickUp {gamepadState.LeftStickUp:0.00} " +
|
||||
$"LeftStickRight {gamepadState.LeftStickRight:0.00} " +
|
||||
$"LeftStickDown {gamepadState.LeftStickDown:0.00} ");
|
||||
ImGui.Text($"RightStickLeft {gamepadState.RightStickLeft:0.00} " +
|
||||
$"RightStickUp {gamepadState.RightStickUp:0.00} " +
|
||||
$"RightStickRight {gamepadState.RightStickRight:0.00} " +
|
||||
$"RightStickDown {gamepadState.RightStickDown:0.00} ");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue