Open 3D Engine AzToolsFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzToolsFramework::Prefab::PrefabFocusHandler Class Referencefinal

Handles Prefab Focus mode, determining which prefab file entity changes will target. More...

#include <PrefabFocusHandler.h>

Inherits PrefabFocusPublicRequestBus::Handler, AzToolsFramework::Prefab::PrefabFocusInterface, AzToolsFramework::Prefab::PrefabPublicNotificationBus::Handler, EditorEntityContextNotificationBus::Handler, and EditorEntityInfoNotificationBus::Handler.

Public Member Functions

 AZ_CLASS_ALLOCATOR (PrefabFocusHandler, AZ::SystemAllocator)
 
void RegisterPrefabFocusInterface ()
 
void UnregisterPrefabFocusInterface ()
 
void InitializeEditorInterfaces () override
 
PrefabFocusOperationResult FocusOnPrefabInstanceOwningEntityId (AZ::EntityId entityId) override
 
TemplateId GetFocusedPrefabTemplateId (AzFramework::EntityContextId entityContextId) const override
 
InstanceOptionalReference GetFocusedPrefabInstance (AzFramework::EntityContextId entityContextId) const override
 
bool IsFocusedPrefabInstanceReadOnly (AzFramework::EntityContextId entityContextId) const override
 
LinkId PrependPathFromFocusedInstanceToPatchPaths (PrefabDom &patches, AZ::EntityId entityId) const override
 
PrefabFocusOperationResult FocusOnOwningPrefab (AZ::EntityId entityId) override
 
PrefabFocusOperationResult FocusOnParentOfFocusedPrefab (AzFramework::EntityContextId entityContextId) override
 
PrefabFocusOperationResult FocusOnPathIndex (AzFramework::EntityContextId entityContextId, int index) override
 
PrefabFocusOperationResult SetOwningPrefabInstanceOpenState (AZ::EntityId entityId, bool openState) override
 
AZ::EntityId GetFocusedPrefabContainerEntityId (AzFramework::EntityContextId entityContextId) const override
 
bool IsOwningPrefabBeingFocused (AZ::EntityId entityId) const override
 
bool IsOwningPrefabInFocusHierarchy (AZ::EntityId entityId) const override
 
const AZ::IO::Path & GetPrefabFocusPath (AzFramework::EntityContextId entityContextId) const override
 
const int GetPrefabFocusPathLength (AzFramework::EntityContextId entityContextId) const override
 
void SetPrefabEditScope (AzFramework::EntityContextId entityContextId, PrefabEditScope mode) override
 
void OnPrepareForContextReset () override
 
void OnEntityInfoUpdatedName (AZ::EntityId entityId, const AZStd::string &name) override
 
void OnPrefabInstancePropagationEnd () override
 
void OnPrefabTemplateDirtyFlagUpdated (TemplateId templateId, bool status) override
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Detailed Description

Handles Prefab Focus mode, determining which prefab file entity changes will target.

Member Function Documentation

◆ FocusOnPrefabInstanceOwningEntityId()

PrefabFocusOperationResult AzToolsFramework::Prefab::PrefabFocusHandler::FocusOnPrefabInstanceOwningEntityId ( AZ::EntityId  entityId)
overridevirtual

Sets the focused instance to the owning instance of the entity id provided. If the entity id is invalid, then focus on the root prefab instance.

Parameters
EntityIdThe entity id of the entity whose owning instance we want the prefab system to focus on.
Returns
PrefabFocusOperationResult that shows if the operation succeeds.

Implements AzToolsFramework::Prefab::PrefabFocusInterface.

◆ GetFocusedPrefabInstance()

InstanceOptionalReference AzToolsFramework::Prefab::PrefabFocusHandler::GetFocusedPrefabInstance ( AzFramework::EntityContextId  entityContextId) const
overridevirtual

Returns a reference to the currently focused instance.

Parameters
EntityContextIdThe entity context id.
Returns
The focused instance.

Implements AzToolsFramework::Prefab::PrefabFocusInterface.

◆ GetFocusedPrefabTemplateId()

TemplateId AzToolsFramework::Prefab::PrefabFocusHandler::GetFocusedPrefabTemplateId ( AzFramework::EntityContextId  entityContextId) const
overridevirtual

Returns the template id of the currently focused instance.

Parameters
entityContextIdThe entity context id.
Returns
TemplateId of the focused instance.

Implements AzToolsFramework::Prefab::PrefabFocusInterface.

◆ InitializeEditorInterfaces()

void AzToolsFramework::Prefab::PrefabFocusHandler::InitializeEditorInterfaces ( )
overridevirtual

Initializes the editor interfaces for Prefab Focus mode. If this is not called on initialization, the Prefab Focus Mode functions will still work but won't trigger the Editor APIs to visualize focus mode on the UI.

Implements AzToolsFramework::Prefab::PrefabFocusInterface.

◆ IsFocusedPrefabInstanceReadOnly()

bool AzToolsFramework::Prefab::PrefabFocusHandler::IsFocusedPrefabInstanceReadOnly ( AzFramework::EntityContextId  entityContextId) const
overridevirtual

Returns whether the currently focused prefab instance is read-only.

Parameters
EntityContextIdThe entity context id.
Returns
True if the currently focused prefab instance is read-only, false otherwise.

Implements AzToolsFramework::Prefab::PrefabFocusInterface.

◆ PrependPathFromFocusedInstanceToPatchPaths()

LinkId AzToolsFramework::Prefab::PrefabFocusHandler::PrependPathFromFocusedInstanceToPatchPaths ( PrefabDom &  patches,
AZ::EntityId  entityId 
) const
overridevirtual

Prepends the path from the focused instance to entity id into the provided patch array.

Parameters
patchesThe provided patch array to prepend path to.
Returns
LinkId stored in the instance closest to the focused instance in hierarchy.

Implements AzToolsFramework::Prefab::PrefabFocusInterface.


The documentation for this class was generated from the following file: