Add question to toast self test

This commit is contained in:
goaaats 2025-04-03 00:03:16 +02:00
parent d2cae32bc2
commit 7286d9714c

View file

@ -1,5 +1,7 @@
using Dalamud.Game.Gui.Toast; using Dalamud.Game.Gui.Toast;
using ImGuiNET;
namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps; namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;
/// <summary> /// <summary>
@ -7,23 +9,42 @@ namespace Dalamud.Interface.Internal.Windows.SelfTest.Steps;
/// </summary> /// </summary>
internal class ToastSelfTestStep : ISelfTestStep internal class ToastSelfTestStep : ISelfTestStep
{ {
private bool sentToasts = false;
/// <inheritdoc/> /// <inheritdoc/>
public string Name => "Test Toasts"; public string Name => "Test Toasts";
/// <inheritdoc/> /// <inheritdoc/>
public SelfTestStepResult RunStep() public SelfTestStepResult RunStep()
{ {
var toastGui = Service<ToastGui>.Get(); if (!this.sentToasts)
{
var toastGui = Service<ToastGui>.Get();
toastGui.ShowNormal("Normal Toast");
toastGui.ShowError("Error Toast");
toastGui.ShowQuest("Quest Toast");
this.sentToasts = true;
}
toastGui.ShowNormal("Normal Toast"); ImGui.Text("Did you see a normal toast, a quest toast and an error toast?");
toastGui.ShowError("Error Toast");
return SelfTestStepResult.Pass; if (ImGui.Button("Yes"))
{
return SelfTestStepResult.Pass;
}
ImGui.SameLine();
if (ImGui.Button("No"))
{
return SelfTestStepResult.Fail;
}
return SelfTestStepResult.Waiting;
} }
/// <inheritdoc/> /// <inheritdoc/>
public void CleanUp() public void CleanUp()
{ {
// ignored this.sentToasts = false;
} }
} }