Widget reparenting done.
This commit is contained in:
@@ -90,6 +90,22 @@ TArray<WingWidgets::Type> WingWidgets::Search(const FString& Query, int32 MaxRes
|
||||
return Results;
|
||||
}
|
||||
|
||||
bool WingWidgets::CheckCanBeParent(UWidget* Widget)
|
||||
{
|
||||
UPanelWidget* Panel = Cast<UPanelWidget>(Widget);
|
||||
if (!Panel)
|
||||
{
|
||||
UWingServer::Printf(TEXT("ERROR: '%s' is not a panel widget and cannot have children\n"), *WingUtils::FormatName(Widget));
|
||||
return false;
|
||||
}
|
||||
if (!Panel->CanAddMoreChildren())
|
||||
{
|
||||
UWingServer::Printf(TEXT("ERROR: '%s' already has a child and cannot accept more\n"), *WingUtils::FormatName(Widget));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void WingWidgets::PrintWidgetTree(UWidget* Widget, int32 Depth)
|
||||
{
|
||||
FString Indent = FString::ChrN(Depth * 2, TEXT(' '));
|
||||
|
||||
Reference in New Issue
Block a user