mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-22 08:29:18 +01:00
feat: keystate data window
This commit is contained in:
parent
bb3ec9d408
commit
eb6680e097
2 changed files with 33 additions and 1 deletions
|
|
@ -137,7 +137,6 @@ namespace Dalamud.Game.ClientState.Keys
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the raw value from the key state array.
|
/// Gets the raw value from the key state array.
|
||||||
/// No bounds checking is done.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="vkCode">Virtual key code.</param>
|
/// <param name="vkCode">Virtual key code.</param>
|
||||||
/// <returns>A reference to the indexed array.</returns>
|
/// <returns>A reference to the indexed array.</returns>
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ using Dalamud.Game.ClientState.GamePad;
|
||||||
using Dalamud.Game.ClientState.JobGauge;
|
using Dalamud.Game.ClientState.JobGauge;
|
||||||
using Dalamud.Game.ClientState.JobGauge.Enums;
|
using Dalamud.Game.ClientState.JobGauge.Enums;
|
||||||
using Dalamud.Game.ClientState.JobGauge.Types;
|
using Dalamud.Game.ClientState.JobGauge.Types;
|
||||||
|
using Dalamud.Game.ClientState.Keys;
|
||||||
using Dalamud.Game.ClientState.Objects;
|
using Dalamud.Game.ClientState.Objects;
|
||||||
using Dalamud.Game.ClientState.Objects.SubKinds;
|
using Dalamud.Game.ClientState.Objects.SubKinds;
|
||||||
using Dalamud.Game.ClientState.Objects.Types;
|
using Dalamud.Game.ClientState.Objects.Types;
|
||||||
|
|
@ -22,6 +23,7 @@ using Dalamud.Game.Gui;
|
||||||
using Dalamud.Game.Gui.FlyText;
|
using Dalamud.Game.Gui.FlyText;
|
||||||
using Dalamud.Game.Gui.Toast;
|
using Dalamud.Game.Gui.Toast;
|
||||||
using Dalamud.Game.Text;
|
using Dalamud.Game.Text;
|
||||||
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Internal.Notifications;
|
using Dalamud.Interface.Internal.Notifications;
|
||||||
using Dalamud.Interface.Windowing;
|
using Dalamud.Interface.Windowing;
|
||||||
using Dalamud.Memory;
|
using Dalamud.Memory;
|
||||||
|
|
@ -131,6 +133,7 @@ namespace Dalamud.Interface.Internal.Windows
|
||||||
FlyText,
|
FlyText,
|
||||||
ImGui,
|
ImGui,
|
||||||
Tex,
|
Tex,
|
||||||
|
KeyState,
|
||||||
Gamepad,
|
Gamepad,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -288,6 +291,10 @@ namespace Dalamud.Interface.Internal.Windows
|
||||||
this.DrawTex();
|
this.DrawTex();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case DataKind.KeyState:
|
||||||
|
this.DrawKeyState();
|
||||||
|
break;
|
||||||
|
|
||||||
case DataKind.Gamepad:
|
case DataKind.Gamepad:
|
||||||
this.DrawGamepad();
|
this.DrawGamepad();
|
||||||
break;
|
break;
|
||||||
|
|
@ -1150,6 +1157,32 @@ namespace Dalamud.Interface.Internal.Windows
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void DrawKeyState()
|
||||||
|
{
|
||||||
|
var keyState = Service<KeyState>.Get();
|
||||||
|
|
||||||
|
ImGui.Columns(4);
|
||||||
|
|
||||||
|
var i = 0;
|
||||||
|
foreach (var vkCode in keyState.GetValidVirtualKeys())
|
||||||
|
{
|
||||||
|
var code = (int)vkCode;
|
||||||
|
var value = keyState[code];
|
||||||
|
|
||||||
|
ImGui.PushStyleColor(ImGuiCol.Text, value ? ImGuiColors.HealerGreen : ImGuiColors.DPSRed);
|
||||||
|
|
||||||
|
ImGui.Text($"{vkCode} ({code})");
|
||||||
|
|
||||||
|
ImGui.PopStyleColor();
|
||||||
|
|
||||||
|
i++;
|
||||||
|
if (i % 24 == 0)
|
||||||
|
ImGui.NextColumn();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.Columns(1);
|
||||||
|
}
|
||||||
|
|
||||||
private void DrawGamepad()
|
private void DrawGamepad()
|
||||||
{
|
{
|
||||||
var gamepadState = Service<GamepadState>.Get();
|
var gamepadState = Service<GamepadState>.Get();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue