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::Layers::EditorLayerComponentRequests Class Referenceabstract

#include <EditorLayerComponentBus.h>

Inherits AZ::ComponentBus.

Public Member Functions

virtual bool HasLayer ()=0
 
virtual void RestoreEditorData ()=0
 
virtual LayerResult WriteLayerAndGetEntities (QString levelAbsoluteFolder, AZStd::vector< AZ::Entity * > &entityList, AZ::SliceComponent::SliceReferenceToInstancePtrs &layerInstances)=0
 
virtual void UpdateLayerNameConflictMapping (AZStd::unordered_map< AZStd::string, int > &nameConflictMapping)=0
 
virtual void SetLayerColor (AZ::Color newColor)=0
 
virtual QColor GetLayerColor ()=0
 
virtual AZ::Color GetColorPropertyValue ()=0
 
virtual bool IsSaveFormatBinary ()=0
 
virtual bool IsLayerNameValid ()=0
 
virtual AZ::Outcome< AZStd::string, AZStd::string > GetLayerBaseFileName ()=0
 
virtual AZ::Outcome< AZStd::string, AZStd::string > GetLayerFullFileName ()=0
 
virtual AZ::Outcome< AZStd::string, AZStd::string > GetLayerFullFilePath (const QString &levelAbsoluteFolder)=0
 
virtual bool HasUnsavedChanges ()=0
 
virtual void MarkLayerWithUnsavedChanges ()=0
 
virtual void SetOverwriteFlag (bool set)=0
 
virtual bool GetOverwriteFlag ()=0
 
virtual bool DoesLayerFileExistOnDisk (const QString &levelAbsoluteFolder)=0
 
virtual bool AreLayerChildrenVisible ()=0
 
virtual void SetLayerChildrenVisibility (bool visible)=0
 
virtual bool GatherSaveDependencies (AZStd::unordered_set< AZ::EntityId > &allLayersToSave, bool &mustSaveLevel)=0
 
virtual void AddLayerSaveDependency (const AZ::EntityId &layerSaveDependency)=0
 
virtual void AddLevelSaveDependency ()=0
 

Detailed Description

This bus can be used to check if an entity is a layer, and to retrieve information about that layer.

Member Function Documentation

◆ AddLayerSaveDependency()

virtual void AzToolsFramework::Layers::EditorLayerComponentRequests::AddLayerSaveDependency ( const AZ::EntityId &  layerSaveDependency)
pure virtual

Marks the passed in layer Entity ID as a save dependency for this layer. This is necessary when an entity switches parents, to make sure that both layers are saved.

Parameters
layerSaveDependencyThe layer that must be saved when this layer is saved.

◆ AddLevelSaveDependency()

virtual void AzToolsFramework::Layers::EditorLayerComponentRequests::AddLevelSaveDependency ( )
pure virtual

Marks the level as a save dependency for this layer. This is necessary when an entity switches parents, to make sure that the level is saved with this layer.

◆ AreLayerChildrenVisible()

virtual bool AzToolsFramework::Layers::EditorLayerComponentRequests::AreLayerChildrenVisible ( )
pure virtual

Layers themselves are never visible, and need to be set not visible in other systems to function as designed. However, layers still need to be able to toggle on and off a visibility state, so that they can apply an override to their children. Returns if children of this layer should be visible or not.

◆ DoesLayerFileExistOnDisk()

virtual bool AzToolsFramework::Layers::EditorLayerComponentRequests::DoesLayerFileExistOnDisk ( const QString &  levelAbsoluteFolder)
pure virtual

Returns true if the layer is saved on disk.

◆ GatherSaveDependencies()

virtual bool AzToolsFramework::Layers::EditorLayerComponentRequests::GatherSaveDependencies ( AZStd::unordered_set< AZ::EntityId > &  allLayersToSave,
bool &  mustSaveLevel 
)
pure virtual

Collects what else must be saved to safely save this layer.

Parameters
allLayersToSaveA set of layer entity IDs that will be saved, this is updated with the current layer's dependencies.
mustSaveLevelSet to true if the current level must be saved to safely save this layer.

◆ GetColorPropertyValue()

virtual AZ::Color AzToolsFramework::Layers::EditorLayerComponentRequests::GetColorPropertyValue ( )
pure virtual

Retrieve the layer's color property value in it's native format

◆ GetLayerColor()

virtual QColor AzToolsFramework::Layers::EditorLayerComponentRequests::GetLayerColor ( )
pure virtual

Retrieves the color of the layer.

◆ GetLayerFullFileName()

virtual AZ::Outcome< AZStd::string, AZStd::string > AzToolsFramework::Layers::EditorLayerComponentRequests::GetLayerFullFileName ( )
pure virtual

If successful, returns the layer's file name with an extension. If not successful, returns an error message.

◆ GetLayerFullFilePath()

virtual AZ::Outcome< AZStd::string, AZStd::string > AzToolsFramework::Layers::EditorLayerComponentRequests::GetLayerFullFilePath ( const QString &  levelAbsoluteFolder)
pure virtual

If successful, returns the layer's full file path. If not successful, returns an error message.

◆ GetOverwriteFlag()

virtual bool AzToolsFramework::Layers::EditorLayerComponentRequests::GetOverwriteFlag ( )
pure virtual

Returns the value of the overwrite check.

◆ HasUnsavedChanges()

virtual bool AzToolsFramework::Layers::EditorLayerComponentRequests::HasUnsavedChanges ( )
pure virtual

Returns true if this layer has unsaved changes, false if not.

◆ IsLayerNameValid()

virtual bool AzToolsFramework::Layers::EditorLayerComponentRequests::IsLayerNameValid ( )
pure virtual

Returns true if the layer name is valid for saving to disk.

◆ IsSaveFormatBinary()

virtual bool AzToolsFramework::Layers::EditorLayerComponentRequests::IsSaveFormatBinary ( )
pure virtual

Retrieves the save format.

◆ MarkLayerWithUnsavedChanges()

virtual void AzToolsFramework::Layers::EditorLayerComponentRequests::MarkLayerWithUnsavedChanges ( )
pure virtual

Tells the layer to mark itself as having unsaved changes.

◆ RestoreEditorData()

virtual void AzToolsFramework::Layers::EditorLayerComponentRequests::RestoreEditorData ( )
pure virtual

Requests this layer to restore its cached editor data. This information is cached and restored as part of saving, so that the data can show up in the inspector to edit the layer, but does not save to the layer entity in the level. The data instead saves to the layer file.

◆ SetLayerChildrenVisibility()

virtual void AzToolsFramework::Layers::EditorLayerComponentRequests::SetLayerChildrenVisibility ( bool  visible)
pure virtual

Requests the layer to mark its children as visible or not.

Parameters
visibleTrue to allow children to be visible, false to force children to not be visible.

◆ SetLayerColor()

virtual void AzToolsFramework::Layers::EditorLayerComponentRequests::SetLayerColor ( AZ::Color  newColor)
pure virtual

Sets the color of the layer.

◆ SetOverwriteFlag()

virtual void AzToolsFramework::Layers::EditorLayerComponentRequests::SetOverwriteFlag ( bool  set)
pure virtual

Tells the layer to mark itself as needing overwrite check. When a new layer is created, mark it as requiring an overwrite check, this will also be set when rename is called and reset when the layer is succesfully saved or just loaded

◆ UpdateLayerNameConflictMapping()

virtual void AzToolsFramework::Layers::EditorLayerComponentRequests::UpdateLayerNameConflictMapping ( AZStd::unordered_map< AZStd::string, int > &  nameConflictMapping)
pure virtual

Populated the passed in map with the number of layers (map value) that have the same name (map key).

Parameters
nameConflictMappingAn output parameter populated with each layer's file name as the key and the number of layers with that name as the value.

◆ WriteLayerAndGetEntities()

virtual LayerResult AzToolsFramework::Layers::EditorLayerComponentRequests::WriteLayerAndGetEntities ( QString  levelAbsoluteFolder,
AZStd::vector< AZ::Entity * > &  entityList,
AZ::SliceComponent::SliceReferenceToInstancePtrs &  layerInstances 
)
pure virtual

Writes this layer to disk, and gathers entities and instances tracked by this layer, so they can be removed from the level slice.

Parameters
levelAbsoluteFolderThe path to the level this layer is saved in.
entityListAn output parameter that is populated with entities tracked by this layer.
layerInstancesAn output parameter that is populated with instances tracked by this layer.

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