mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-02 05:43:40 +01:00
Add GameConfig service
This commit is contained in:
parent
03f33adbce
commit
1f262ce7d5
11 changed files with 6879 additions and 0 deletions
|
|
@ -0,0 +1,107 @@
|
|||
using Dalamud.Game.Config;
|
||||
using ImGuiNET;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
|
||||
|
||||
/// <summary>
|
||||
/// Test of GameConfig.
|
||||
/// </summary>
|
||||
internal class GameConfigAgingStep : IAgingStep
|
||||
{
|
||||
private bool started;
|
||||
private bool isStartedLegacy;
|
||||
private bool isSwitchedLegacy;
|
||||
private bool isSwitchedStandard;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test GameConfig";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
var gameConfig = Service<GameConfig>.Get();
|
||||
|
||||
if (!gameConfig.UiControl.TryGetBool("MoveMode", out var isLegacy))
|
||||
{
|
||||
return SelfTestStepResult.Fail;
|
||||
}
|
||||
|
||||
if (!this.started)
|
||||
{
|
||||
this.started = true;
|
||||
this.isStartedLegacy = isLegacy;
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
if (this.isStartedLegacy)
|
||||
{
|
||||
if (!this.isSwitchedStandard)
|
||||
{
|
||||
if (!isLegacy)
|
||||
{
|
||||
this.isSwitchedStandard = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui.Text("Switch Movement Type to Standard");
|
||||
}
|
||||
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
if (!this.isSwitchedLegacy)
|
||||
{
|
||||
if (isLegacy)
|
||||
{
|
||||
this.isSwitchedLegacy = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui.Text("Switch Movement Type to Legacy");
|
||||
}
|
||||
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!this.isSwitchedLegacy)
|
||||
{
|
||||
if (isLegacy)
|
||||
{
|
||||
this.isSwitchedLegacy = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui.Text("Switch Movement Type to Legacy");
|
||||
}
|
||||
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
if (!this.isSwitchedStandard)
|
||||
{
|
||||
if (!isLegacy)
|
||||
{
|
||||
this.isSwitchedStandard = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui.Text("Switch Movement Type to Standard");
|
||||
}
|
||||
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
}
|
||||
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
this.isSwitchedLegacy = false;
|
||||
this.isSwitchedStandard = false;
|
||||
this.started = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -42,6 +42,7 @@ internal class SelfTestWindow : Window
|
|||
new PartyFinderAgingStep(),
|
||||
new HandledExceptionAgingStep(),
|
||||
new DutyStateAgingStep(),
|
||||
new GameConfigAgingStep(),
|
||||
new LogoutEventAgingStep(),
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue