You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Deleting folders in the World Outliner now promotes all children to the level above instead of directly to the root.
#jira UE-12338 - Level Editor: Deleting a folder item within another folder item in the World Outliner results in the instances "contained" within the deleted folder item being moved to the root level rather than to underneath the parent folder item. [CL 2506580 by Richard TalbotWatkin in Main branch]
This commit is contained in:
committed by
epic@richtech.es
parent
4643698344
commit
dcbedf3fa6
@@ -213,27 +213,29 @@ void FFolderTreeItem::Delete()
|
||||
|
||||
struct FResetActorFolders : IMutableTreeItemVisitor
|
||||
{
|
||||
explicit FResetActorFolders(FName InParentPath) : ParentPath(InParentPath) {}
|
||||
|
||||
virtual void Visit(FActorTreeItem& ActorItem) const override
|
||||
{
|
||||
if (AActor* Actor = ActorItem.Actor.Get())
|
||||
{
|
||||
Actor->SetFolderPath(FName());
|
||||
Actor->SetFolderPath(ParentPath);
|
||||
}
|
||||
}
|
||||
virtual void Visit(FFolderTreeItem& FolderItem) const override
|
||||
{
|
||||
FResetActorFolders ResetFolders;
|
||||
for (auto& Child : FolderItem.GetChildren())
|
||||
{
|
||||
Child.Pin()->Visit(ResetFolders);
|
||||
}
|
||||
FolderItem.Delete();
|
||||
UWorld* World = FolderItem.SharedData->RepresentingWorld;
|
||||
check(World != nullptr);
|
||||
|
||||
MoveFolderTo(FolderItem.Path, ParentPath, *World);
|
||||
}
|
||||
|
||||
FName ParentPath;
|
||||
};
|
||||
|
||||
const FScopedTransaction Transaction( LOCTEXT("DeleteFolder", "Delete Folder") );
|
||||
|
||||
FResetActorFolders ResetFolders;
|
||||
FResetActorFolders ResetFolders(GetParentPath(Path));
|
||||
for (auto& Child : GetChildren())
|
||||
{
|
||||
Child.Pin()->Visit(ResetFolders);
|
||||
|
||||
Reference in New Issue
Block a user