Skip to content

Commit

Permalink
Add option to disable fastpath
Browse files Browse the repository at this point in the history
  • Loading branch information
slonopotamus committed Jul 29, 2024
1 parent ef25902 commit 6d7966f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions Source/EffectBox/Private/EffectBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ TSharedRef<SWidget> UEffectBox::RebuildWidget()
{
MyEffectBox = SNew(SEffectBox)
.IsDesignTime(IsDesignTime())
.AllowFastUpdate(bAllowFastUpdate)
[GetContentSlot() && GetContentSlot()->Content
? GetContentSlot()->Content->TakeWidget()
: SNullWidget::NullWidget];
Expand Down
2 changes: 1 addition & 1 deletion Source/EffectBox/Private/SEffectBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void SEffectBox::Construct(const FArguments& Args)
{
DPIScaler = SNew(SDPIScaler);
VirtualWindow = SNew(SVirtualWindow).Visibility(EVisibility::HitTestInvisible);
VirtualWindow->SetAllowFastUpdate(true);
VirtualWindow->SetAllowFastUpdate(Args._AllowFastUpdate);
VirtualWindow->SetContent(DPIScaler.ToSharedRef());
FSlateApplication::Get().RegisterVirtualWindow(VirtualWindow.ToSharedRef());
}
Expand Down
3 changes: 3 additions & 0 deletions Source/EffectBox/Public/EffectBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class EFFECTBOX_API UEffectBox : public UContentWidget
UPROPERTY(EditAnywhere, Category = "Effect")
UMaterialInterface* EffectMaterial = nullptr;

UPROPERTY(EditAnywhere, Category = "Effect")
bool bAllowFastUpdate = true;

virtual void OnSlotAdded(UPanelSlot* InSlot) override;
virtual void OnSlotRemoved(UPanelSlot* InSlot) override;

Expand Down
4 changes: 3 additions & 1 deletion Source/EffectBox/Public/SEffectBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ class EFFECTBOX_API SEffectBox final : public SCompoundWidget
public:
SLATE_BEGIN_ARGS(SEffectBox)
{
_Visibility = EVisibility::Visible;
_Visibility = EVisibility::HitTestInvisible;
_AllowFastUpdate = true;
_IsDesignTime = false;
_TextureParameter = NAME_None;
_EffectMaterial = nullptr;
}
SLATE_DEFAULT_SLOT(FArguments, Content)
SLATE_ARGUMENT(bool, IsDesignTime)
SLATE_ARGUMENT(bool, AllowFastUpdate)
SLATE_ARGUMENT(FName, TextureParameter)
SLATE_ARGUMENT(UMaterialInterface*, EffectMaterial)
SLATE_END_ARGS()
Expand Down

0 comments on commit 6d7966f

Please sign in to comment.