mirror of
https://github.com/sinbad/StevesUEHelpers.git
synced 2025-02-23 09:35:25 +00:00
Support not hiding when superceded when embedding; if next item is not embedded this works to overlay
This commit is contained in:
parent
e13e24643e
commit
46cd0c93c2
@ -52,12 +52,15 @@ void UMenuBase::RemovedFromStack(UMenuStack* Parent)
|
||||
PreviousFocusWidget.Reset();
|
||||
}
|
||||
|
||||
void UMenuBase::SupercededInStack()
|
||||
void UMenuBase::SupercededInStack(UMenuBase* ByMenu)
|
||||
{
|
||||
SavePreviousFocus();
|
||||
|
||||
if (bEmbedInParentContainer)
|
||||
{
|
||||
if (bHideWhenSuperceded)
|
||||
RemoveFromParent();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bHideWhenSuperceded)
|
||||
@ -85,7 +88,7 @@ void UMenuBase::EmbedInParent()
|
||||
|
||||
void UMenuBase::Open(bool bIsRegain)
|
||||
{
|
||||
if (ParentStack.IsValid() && bEmbedInParentContainer)
|
||||
if (ParentStack.IsValid() && bEmbedInParentContainer && bHideWhenSuperceded)
|
||||
EmbedInParent();
|
||||
else
|
||||
AddToViewport();
|
||||
|
@ -204,7 +204,7 @@ void UMenuStack::PushMenuByObject(UMenuBase* NewMenu)
|
||||
if (Menus.Num() > 0)
|
||||
{
|
||||
auto Top = Menus.Last();
|
||||
Top->SupercededInStack();
|
||||
Top->SupercededInStack(NewMenu);
|
||||
// We keep this allocated, to restore later on back
|
||||
}
|
||||
Menus.Add(NewMenu);
|
||||
|
@ -39,8 +39,9 @@ protected:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Layout")
|
||||
bool bEmbedInParentContainer = true;
|
||||
|
||||
/// Whether to hide this menu when it's superceded by another in the stack. This property is only relevant
|
||||
/// when bEmbedInParentContainer = false, since only one menu can be embedded at once.
|
||||
/// Whether to hide this menu when it's superceded by another in the stack.
|
||||
/// If you set this to "false" when bEmbedInParentContainer=true, then the superceding menu should have its
|
||||
/// own bEmbedInParentContainer set to false in order to overlay on top of this one.
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Behavior")
|
||||
bool bHideWhenSuperceded = true;
|
||||
|
||||
@ -92,7 +93,7 @@ public:
|
||||
|
||||
void AddedToStack(UMenuStack* Parent);
|
||||
void RemovedFromStack(UMenuStack* Parent);
|
||||
void SupercededInStack();
|
||||
void SupercededInStack(UMenuBase* ByMenu);
|
||||
void RegainedFocusInStack();
|
||||
void InputModeChanged(EInputMode OldMode, EInputMode NewMode);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user