#include <EditorLayerComponentBus.h>
Inherits AZ::ComponentBus.
This bus can be used to check if an entity is a layer, and to retrieve information about that layer.
◆ 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
-
layerSaveDependency | The 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
-
allLayersToSave | A set of layer entity IDs that will be saved, this is updated with the current layer's dependencies. |
mustSaveLevel | Set 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
-
visible | True 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
-
nameConflictMapping | An 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
-
levelAbsoluteFolder | The path to the level this layer is saved in. |
entityList | An output parameter that is populated with entities tracked by this layer. |
layerInstances | An output parameter that is populated with instances tracked by this layer. |
The documentation for this class was generated from the following file:
- Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorLayerComponentBus.h