38 lines
1014 B
C#
38 lines
1014 B
C#
using Dalamud.Bindings.ImGui;
|
|
using Dalamud.Plugin.SelfTest;
|
|
|
|
namespace HellionChat.SelfTests;
|
|
|
|
internal sealed class SettingsWindowOpenStep : ISelfTestStep
|
|
{
|
|
private readonly Plugin _plugin;
|
|
|
|
public SettingsWindowOpenStep(Plugin plugin)
|
|
{
|
|
_plugin = plugin;
|
|
}
|
|
|
|
public string Name => "Hellion Chat - Settings window toggles via direct call";
|
|
|
|
public SelfTestStepResult RunStep()
|
|
{
|
|
var initial = _plugin.SettingsWindow.IsOpen;
|
|
_plugin.SettingsWindow.Toggle();
|
|
var afterFirst = _plugin.SettingsWindow.IsOpen;
|
|
_plugin.SettingsWindow.Toggle();
|
|
var afterSecond = _plugin.SettingsWindow.IsOpen;
|
|
|
|
if (afterFirst == initial || afterSecond != initial)
|
|
{
|
|
ImGui.Text(
|
|
$"Toggle did not flip state: initial={initial} after1={afterFirst} after2={afterSecond}"
|
|
);
|
|
return SelfTestStepResult.Fail;
|
|
}
|
|
|
|
return SelfTestStepResult.Pass;
|
|
}
|
|
|
|
public void CleanUp() { }
|
|
}
|