mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-03 06:13:40 +01:00
Add question to toast self test
This commit is contained in:
parent
d2cae32bc2
commit
7286d9714c
1 changed files with 26 additions and 5 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue