Removed slice based context menu options from the RPE when prefabs are enabled.

Signed-off-by: Chris Galvan <chgalvan@amazon.com>
monroegm-disable-blank-issue-2
Chris Galvan 5 years ago
parent e6927ffc14
commit 90ef2ba13f

@ -1951,12 +1951,13 @@ namespace AzToolsFramework
return;
}
// If prefabs are enabled, there will be no root slice so bail out here since we don't need
// to show any slice options in the menu
AZ::SliceComponent* rootSlice = nullptr;
AzFramework::SliceEntityOwnershipServiceRequestBus::EventResult(rootSlice, contextId,
&AzFramework::SliceEntityOwnershipServiceRequestBus::Events::GetRootSlice);
if (!rootSlice)
{
AZ_Error("PropertyEditor", false, "Entity context has no root slice");
return;
}
@ -2105,10 +2106,6 @@ namespace AzToolsFramework
{
QMenu* revertMenu = nullptr;
revertMenu = menu.addMenu(tr("Revert overrides"));
revertMenu->setToolTipsVisible(true);
revertMenu->setEnabled(false);
//check for changes on selected property
if (componentClassData)
{
@ -2128,6 +2125,11 @@ namespace AzToolsFramework
return;
}
// Only add the "Revert overrides" menu option if it belongs to a slice
revertMenu = menu.addMenu(tr("Revert overrides"));
revertMenu->setToolTipsVisible(true);
revertMenu->setEnabled(false);
if (fieldNode)
{
bool hasChanges = fieldNode->HasChangesVersusComparison(false);

Loading…
Cancel
Save