Additional read-only prefab workflow changes.

Signed-off-by: Chris Galvan <chgalvan@amazon.com>
This commit is contained in:
Chris Galvan
2021-12-08 12:30:31 -06:00
parent 045eea03e6
commit 9dc32a0381
2 changed files with 40 additions and 7 deletions
@@ -277,6 +277,8 @@ namespace AzToolsFramework
}
}
bool itemWasShown = false;
// Create Prefab
{
if (!selectedEntities.empty())
@@ -312,33 +314,43 @@ namespace AzToolsFramework
QObject::connect(createAction, &QAction::triggered, createAction, [selectedEntities] {
ContextMenu_CreatePrefab(selectedEntities);
});
itemWasShown = true;
}
}
}
}
// Instantiate Prefab
if (!readOnlyEntityInSelection)
{
QAction* instantiateAction = menu->addAction(QObject::tr("Instantiate Prefab..."));
instantiateAction->setToolTip(QObject::tr("Instantiates a prefab file in the scene."));
QObject::connect(
instantiateAction, &QAction::triggered, instantiateAction, [] { ContextMenu_InstantiatePrefab(); });
itemWasShown = true;
}
// Instantiate Procedural Prefab
if (AZ::Prefab::ProceduralPrefabAsset::UseProceduralPrefabs())
if (AZ::Prefab::ProceduralPrefabAsset::UseProceduralPrefabs() && !readOnlyEntityInSelection)
{
QAction* action = menu->addAction(QObject::tr("Instantiate Procedural Prefab..."));
action->setToolTip(QObject::tr("Instantiates a procedural prefab file in a prefab."));
QObject::connect(
action, &QAction::triggered, action, [] { ContextMenu_InstantiateProceduralPrefab(); });
itemWasShown = true;
}
menu->addSeparator();
if (itemWasShown)
{
menu->addSeparator();
}
bool itemWasShown = false;
itemWasShown = false;
// Edit/Save Prefab
{