Remove the Level Inspector from Prefab mode and move behavior to Entity Inspector. (#149)

* Remove Level Inspector from Prefab mode, and integrate the same behavior in the Entity Inspector

* Show prefab name in level entity row of the Outliner. Allow Ui Handlers to prevent renaming.

* Separate setting the prefab's template path and the container entity name.

* Disable reparenting to root level

* Disable the ability to rename the level entity.

* Fixes as per Ram's review
This commit is contained in:
AMZN-daimini
2021-04-20 16:22:34 -07:00
committed by GitHub
parent 23656f0bd3
commit 62bc7a66bb
16 changed files with 171 additions and 53 deletions
+18 -2
View File
@@ -36,6 +36,8 @@
#include <algorithm>
#include <QScopedValueRollback>
#include <AzFramework/API/ApplicationAPI.h>
#include <AzAssetBrowser/AzAssetBrowserWindow.h>
#include <AzToolsFramework/UI/UICore/WidgetHelpers.h>
#include <AzQtComponents/Utilities/AutoSettingsGroup.h>
@@ -983,6 +985,11 @@ bool QtViewPaneManager::ClosePanesWithRollback(const QVector<QString>& panesToKe
*/
void QtViewPaneManager::RestoreDefaultLayout(bool resetSettings)
{
// Get whether the prefab system is enabled
bool isPrefabSystemEnabled = false;
AzFramework::ApplicationRequests::Bus::BroadcastResult(
isPrefabSystemEnabled, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
if (resetSettings)
{
// We're going to do something destructive (removing all of the viewpane settings). Better confirm with the user
@@ -1022,7 +1029,11 @@ void QtViewPaneManager::RestoreDefaultLayout(bool resetSettings)
state.viewPanes.push_back(LyViewPane::EntityInspector);
state.viewPanes.push_back(LyViewPane::AssetBrowser);
state.viewPanes.push_back(LyViewPane::Console);
state.viewPanes.push_back(LyViewPane::LevelInspector);
if (!isPrefabSystemEnabled)
{
state.viewPanes.push_back(LyViewPane::LevelInspector);
}
state.mainWindowState = m_defaultMainWindowState;
@@ -1047,7 +1058,12 @@ void QtViewPaneManager::RestoreDefaultLayout(bool resetSettings)
const QtViewPane* assetBrowserViewPane = OpenPane(LyViewPane::AssetBrowser, QtViewPane::OpenMode::UseDefaultState);
const QtViewPane* entityInspectorViewPane = OpenPane(LyViewPane::EntityInspector, QtViewPane::OpenMode::UseDefaultState);
const QtViewPane* consoleViewPane = OpenPane(LyViewPane::Console, QtViewPane::OpenMode::UseDefaultState);
const QtViewPane* levelInspectorPane = OpenPane(LyViewPane::LevelInspector, QtViewPane::OpenMode::UseDefaultState);
const QtViewPane* levelInspectorPane = nullptr;
if (!isPrefabSystemEnabled)
{
levelInspectorPane = OpenPane(LyViewPane::LevelInspector, QtViewPane::OpenMode::UseDefaultState);
}
// This class does all kinds of behind the scenes magic to make docking / restore work, especially with groups
// so instead of doing our special default layout attach / docking right now, we want to make it happen