mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 05:04:15 +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>
|
||||
/// Gets the raw value from the key state array.
|
||||
/// No bounds checking is done.
|
||||
/// </summary>
|
||||
/// <param name="vkCode">Virtual key code.</param>
|
||||
/// <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.Enums;
|
||||
using Dalamud.Game.ClientState.JobGauge.Types;
|
||||
using Dalamud.Game.ClientState.Keys;
|
||||
using Dalamud.Game.ClientState.Objects;
|
||||
using Dalamud.Game.ClientState.Objects.SubKinds;
|
||||
using Dalamud.Game.ClientState.Objects.Types;
|
||||
|
|
@ -22,6 +23,7 @@ using Dalamud.Game.Gui;
|
|||
using Dalamud.Game.Gui.FlyText;
|
||||
using Dalamud.Game.Gui.Toast;
|
||||
using Dalamud.Game.Text;
|
||||
using Dalamud.Interface.Colors;
|
||||
using Dalamud.Interface.Internal.Notifications;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using Dalamud.Memory;
|
||||
|
|
@ -131,6 +133,7 @@ namespace Dalamud.Interface.Internal.Windows
|
|||
FlyText,
|
||||
ImGui,
|
||||
Tex,
|
||||
KeyState,
|
||||
Gamepad,
|
||||
}
|
||||
|
||||
|
|
@ -288,6 +291,10 @@ namespace Dalamud.Interface.Internal.Windows
|
|||
this.DrawTex();
|
||||
break;
|
||||
|
||||
case DataKind.KeyState:
|
||||
this.DrawKeyState();
|
||||
break;
|
||||
|
||||
case DataKind.Gamepad:
|
||||
this.DrawGamepad();
|
||||
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()
|
||||
{
|
||||
var gamepadState = Service<GamepadState>.Get();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue