Dalamud/Dalamud/Interface/Internal/Windows/SelfTest/AgingSteps/GamepadStateAgingStep.cs
goat 448b0d16ea
Add "loading dialog" for service init, unify blocking logic (#1779)
* wip

* hacky fix for overlapping event text in profiler

* move IsResumeGameAfterPluginLoad logic to PluginManager

* fix some warnings

* handle exceptions properly

* remove ability to cancel, rename button to "hide" instead

* undo Dalamud.Service refactor for now

* warnings

* add explainer, show which plugins are still loading

* add some text if loading takes more than 3 minutes

* undo wrong CS merge
2024-04-21 17:28:37 +02:00

37 lines
856 B
C#

using Dalamud.Game.ClientState.GamePad;
using ImGuiNET;
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
/// <summary>
/// Test setup for the Gamepad State.
/// </summary>
internal class GamepadStateAgingStep : IAgingStep
{
/// <inheritdoc/>
public string Name => "Test GamePadState";
/// <inheritdoc/>
public SelfTestStepResult RunStep()
{
var gamepadState = Service<GamepadState>.Get();
ImGui.Text("Hold down North, East, L1");
if (gamepadState.Raw(GamepadButtons.North) == 1
&& gamepadState.Raw(GamepadButtons.East) == 1
&& gamepadState.Raw(GamepadButtons.L1) == 1)
{
return SelfTestStepResult.Pass;
}
return SelfTestStepResult.Waiting;
}
/// <inheritdoc/>
public void CleanUp()
{
// ignored
}
}