Files
UnrealEngineUWP/Engine/Source/Editor/Persona/Private/IPersonaEditorModeManager.cpp
zach rammell 99738c0f68 Refactor persona editor modes/mode manager to use ITF context objects for persona-only interfaces instead of static casting
#rb brooke.hubert Thomas.Sarkanen
#jira UE-143249
#preflight 628549709e72602f6ab62b3b

[CL 20282438 by zach rammell in ue5-main branch]
2022-05-19 12:34:51 -04:00

41 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "IPersonaEditorModeManager.h"
#include "ContextObjectStore.h"
#include "EdModeInteractiveToolsContext.h"
IPersonaEditorModeManager* UPersonaEditorModeManagerContext::GetPersonaEditorModeManager() const
{
return ModeManager;
}
bool UPersonaEditorModeManagerContext::GetCameraTarget(FSphere& OutTarget) const
{
check(ModeManager);
return ModeManager->GetCameraTarget(OutTarget);
}
void UPersonaEditorModeManagerContext::GetOnScreenDebugInfo(TArray<FText>& OutDebugText) const
{
check(ModeManager);
return ModeManager->GetOnScreenDebugInfo(OutDebugText);
}
IPersonaEditorModeManager::IPersonaEditorModeManager() : FAssetEditorModeManager()
{
UContextObjectStore* ContextObjectStore = GetInteractiveToolsContext()->ContextObjectStore;
ContextObjectStore->AddContextObject(PersonaModeManagerContext.Get());
}
IPersonaEditorModeManager::~IPersonaEditorModeManager()
{
UContextObjectStore* ContextObjectStore = GetInteractiveToolsContext()->ContextObjectStore;
ContextObjectStore->RemoveContextObject(PersonaModeManagerContext.Get());
}
void IPersonaEditorModeManager::AddReferencedObjects(FReferenceCollector& Collector)
{
FAssetEditorModeManager::AddReferencedObjects(Collector);
Collector.AddReferencedObject(PersonaModeManagerContext);
}