Add the option to not block clicks through the menu base panel

This commit is contained in:
Steve Streeting 2024-10-08 16:01:16 +01:00
parent d7bdf57e0d
commit 407e7e750b
2 changed files with 6 additions and 1 deletions

View File

@ -105,7 +105,7 @@ void UMenuBase::Open(bool bIsRegain)
EmbedInParent(); EmbedInParent();
else else
AddToViewport(); AddToViewport();
SetVisibility(ESlateVisibility::Visible); SetVisibility(bBlockClicks ? ESlateVisibility::Visible : ESlateVisibility::SelfHitTestInvisible);
auto PC = GetOwningPlayer(); auto PC = GetOwningPlayer();
switch (InputModeSetting) switch (InputModeSetting)

View File

@ -45,6 +45,11 @@ protected:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Behavior") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Behavior")
bool bHideWhenSuperceded = true; bool bHideWhenSuperceded = true;
/// Whether this panel should block clicks itself (useful for preventing click-through).
/// Set to false if you want to be able to click through the panel to other elements.
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Behavior")
bool bBlockClicks = true;
/// How this menu should set the input mode when it becomes the top of the stack /// How this menu should set the input mode when it becomes the top of the stack
/// This can be useful if your menus have variable input settings between levels in the stack /// This can be useful if your menus have variable input settings between levels in the stack
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Behavior") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Behavior")