diff --git a/Source/StevesUEHelpers/Private/StevesUI/MenuBase.cpp b/Source/StevesUEHelpers/Private/StevesUI/MenuBase.cpp index 74fc3d9..d4a6238 100644 --- a/Source/StevesUEHelpers/Private/StevesUI/MenuBase.cpp +++ b/Source/StevesUEHelpers/Private/StevesUI/MenuBase.cpp @@ -105,7 +105,7 @@ void UMenuBase::Open(bool bIsRegain) EmbedInParent(); else AddToViewport(); - SetVisibility(ESlateVisibility::Visible); + SetVisibility(bBlockClicks ? ESlateVisibility::Visible : ESlateVisibility::SelfHitTestInvisible); auto PC = GetOwningPlayer(); switch (InputModeSetting) diff --git a/Source/StevesUEHelpers/Public/StevesUI/MenuBase.h b/Source/StevesUEHelpers/Public/StevesUI/MenuBase.h index 417c10f..3f7f42c 100644 --- a/Source/StevesUEHelpers/Public/StevesUI/MenuBase.h +++ b/Source/StevesUEHelpers/Public/StevesUI/MenuBase.h @@ -45,6 +45,11 @@ protected: UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Behavior") 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 /// This can be useful if your menus have variable input settings between levels in the stack UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Behavior")