You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#jira UE-134605 #rb patrick.enfedaque #preflight 619d3a42cb49ea94934aa11d #ROBOMERGE-AUTHOR: richard.malo #ROBOMERGE-SOURCE: CL 18273663 in //UE5/Release-5.0/... via CL 18273683 #ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469) [CL 18273700 by richard malo in ue5-release-engine-test branch]
56 lines
2.0 KiB
C++
56 lines
2.0 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "ActorFolderPickingMode.h"
|
|
#include "ActorFolderTreeItem.h"
|
|
#include "ActorFolderHierarchy.h"
|
|
|
|
#define LOCTEXT_NAMESPACE "SceneOutliner_ActoFolderPickingMode"
|
|
|
|
FActorFolderPickingMode::FActorFolderPickingMode(SSceneOutliner* InSceneOutliner, FOnSceneOutlinerItemPicked InOnItemPicked, TWeakObjectPtr<UWorld> InSpecifiedWorldToDisplay, const FFolder::FRootObject& InRootObject)
|
|
: FActorMode(FActorModeParams(InSceneOutliner, InSpecifiedWorldToDisplay))
|
|
, OnItemPicked(InOnItemPicked)
|
|
, RootObject(InRootObject)
|
|
{
|
|
Rebuild();
|
|
}
|
|
|
|
TUniquePtr<ISceneOutlinerHierarchy> FActorFolderPickingMode::CreateHierarchy()
|
|
{
|
|
return MakeUnique<FActorFolderHierarchy>(this, RepresentingWorld, RootObject);
|
|
}
|
|
|
|
void FActorFolderPickingMode::OnItemSelectionChanged(FSceneOutlinerTreeItemPtr Item, ESelectInfo::Type SelectionType, const FSceneOutlinerItemSelection& Selection)
|
|
{
|
|
// fire off the notification to whoever is listening.
|
|
// This may often cause the widget itself to be enqueued for destruction
|
|
auto SelectedItems = SceneOutliner->GetSelectedItems();
|
|
if (SelectedItems.Num() > 0)
|
|
{
|
|
auto FirstItem = SelectedItems[0];
|
|
if (FirstItem->CanInteract())
|
|
{
|
|
OnItemPicked.ExecuteIfBound(FirstItem.ToSharedRef());
|
|
}
|
|
}
|
|
}
|
|
|
|
void FActorFolderPickingMode::OnFilterTextCommited(FSceneOutlinerItemSelection& Selection, ETextCommit::Type CommitType)
|
|
{
|
|
// In folder picking mode, we check to see if we have a selected folder, and if so, fire
|
|
// off the notification to whoever is listening. This may often cause the widget itself
|
|
// to be enqueued for destruction
|
|
TArray<FActorFolderTreeItem*> Folders;
|
|
Selection.Get(Folders);
|
|
if (Folders.Num() == 1 && Folders[0])
|
|
{
|
|
// Signal that a folder was selected. We assume it is valid as it wouldn't not have been added to the selection if not
|
|
SceneOutliner->SetItemSelection(Folders[0]->AsShared(), true, ESelectInfo::OnKeyPress);
|
|
}
|
|
}
|
|
|
|
void FActorFolderPickingMode::CreateViewContent(FMenuBuilder& MenuBuilder)
|
|
{
|
|
FActorMode::BuildWorldPickerMenu(MenuBuilder);
|
|
}
|
|
|
|
#undef LOCTEXT_NAMESPACE |