UMG/Slate - Exposing the Widget Caching flag to the widget reflector. Also making it so invalidation is disabled when Picking Widgets is occuring, as invalidation causes that system of traversing the widget hierarchy to no longer function. Since it pretends there are no children to avoid Slate doing more work than it needs to.

[CL 2695558 by Nick Darnell in Main branch]
This commit is contained in:
Nick Darnell
2015-09-17 13:33:20 -04:00
committed by Nick.Darnell@epicgames.com
parent 6ae67a3bea
commit 4181457d07
3 changed files with 43 additions and 0 deletions

View File

@@ -210,6 +210,11 @@ private:
{
bShowFocus = false;
SetUIMode(EWidgetReflectorUIMode::Live);
SInvalidationPanel::SetEnableWidgetCaching(false);
}
else
{
SInvalidationPanel::SetEnableWidgetCaching(true);
}
return FReply::Handled();
@@ -611,6 +616,31 @@ TSharedRef<SDockTab> SWidgetReflector::SpawnWidgetHierarchyTab(const FSpawnTabAr
SNew(STextBlock)
.Text(LOCTEXT("ShowFocus", "Show Focus"))
]
+ SHorizontalBox::Slot()
.AutoWidth()
.Padding(5.0f)
[
SNew(SCheckBox)
.Style(FCoreStyle::Get(), "ToggleButtonCheckbox")
.IsChecked_Lambda([&]()
{
return SInvalidationPanel::GetEnableWidgetCaching() ? ECheckBoxState::Checked : ECheckBoxState::Unchecked;
})
.OnCheckStateChanged_Lambda([&](const ECheckBoxState NewState)
{
SInvalidationPanel::SetEnableWidgetCaching(( NewState == ECheckBoxState::Checked ) ? true : false);
})
[
SNew(SBox)
.VAlign(VAlign_Center)
.HAlign(HAlign_Center)
[
SNew(STextBlock)
.Text(LOCTEXT("EnableWidgetCaching", "Widget Caching"))
]
]
]
]
+SHorizontalBox::Slot()