Make MenuStack::RemoveFromParent automatically close all menus remaining in the stack

This commit is contained in:
Steve Streeting 2020-11-19 15:17:12 +00:00
parent 9bcfeba9d7
commit 918ccc5cc2

View File

@ -238,6 +238,13 @@ void UMenuStack::FirstMenuOpened()
void UMenuStack::RemoveFromParent() void UMenuStack::RemoveFromParent()
{ {
if (Menus.Num() > 0)
{
CloseAll(false);
// LastMenuClosed will re-call this so don't duplicate
return;
}
Super::RemoveFromParent(); Super::RemoveFromParent();
// tell menu system if we're in-game (this gets called in editor too) // tell menu system if we're in-game (this gets called in editor too)