Widget reparenting done.

This commit is contained in:
2026-03-23 17:29:48 -04:00
parent 5657d76ed6
commit 2bc06f3b02
5 changed files with 187 additions and 10 deletions

View File

@@ -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(' '));