fix(ContextMenu): stop processing events when test is over

This commit is contained in:
goaaats 2022-01-29 00:30:07 +01:00
parent 6475da469b
commit c2f5941435
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B

View file

@ -35,6 +35,7 @@ namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
TestGameObject, TestGameObject,
TestSubMenu, TestSubMenu,
TestMultiple, TestMultiple,
Finish,
} }
/// <inheritdoc/> /// <inheritdoc/>
@ -118,7 +119,10 @@ namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
case SubStep.TestMultiple: case SubStep.TestMultiple:
if (this.multipleTriggerOne && this.multipleTriggerTwo) if (this.multipleTriggerOne && this.multipleTriggerTwo)
{
this.currentSubStep = SubStep.Finish;
return SelfTestStepResult.Pass; return SelfTestStepResult.Pass;
}
ImGui.Text("Select both options on any context menu."); ImGui.Text("Select both options on any context menu.");
if (ImGui.Button("Skip")) if (ImGui.Button("Skip"))
@ -139,6 +143,8 @@ namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
this.currentSubStep = SubStep.Start; this.currentSubStep = SubStep.Start;
this.clickedItemId = 0; this.clickedItemId = 0;
this.clickedPlayerName = null;
this.multipleTriggerOne = this.multipleTriggerTwo = false;
} }
private void ContextMenuOnContextMenuOpened(ContextMenuOpenedArgs args) private void ContextMenuOnContextMenuOpened(ContextMenuOpenedArgs args)
@ -174,6 +180,9 @@ namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
})); }));
return; return;
case SubStep.Finish:
return;
default: default:
switch (args.ParentAddonName) switch (args.ParentAddonName)
{ {