@@ -1191,8 +1191,8 @@ void LevelEditorMenuHandler::OnEditorModeActivated(
|
||||
{
|
||||
if (mode == ViewportEditorMode::Component)
|
||||
{
|
||||
auto menuWrapper = m_actionManager->FindMenu(s_editMenuId);
|
||||
if (!menuWrapper.isNull())
|
||||
if (auto menuWrapper = m_actionManager->FindMenu(s_editMenuId);
|
||||
!menuWrapper.isNull())
|
||||
{
|
||||
// copy of menu actions
|
||||
auto actions = menuWrapper.Get()->actions();
|
||||
@@ -1222,8 +1222,8 @@ void LevelEditorMenuHandler::OnEditorModeDeactivated(
|
||||
|
||||
void LevelEditorMenuHandler::AddEditMenuAction(QAction* action)
|
||||
{
|
||||
auto menuWrapper = m_actionManager->FindMenu(s_editMenuId);
|
||||
if (!menuWrapper.isNull())
|
||||
if (auto menuWrapper = m_actionManager->FindMenu(s_editMenuId);
|
||||
!menuWrapper.isNull())
|
||||
{
|
||||
menuWrapper.Get()->addAction(action);
|
||||
}
|
||||
@@ -1247,8 +1247,8 @@ void LevelEditorMenuHandler::AddMenuAction(AZStd::string_view categoryId, QActio
|
||||
|
||||
void LevelEditorMenuHandler::RestoreEditMenuToDefault()
|
||||
{
|
||||
auto menuWrapper = m_actionManager->FindMenu(s_editMenuId);
|
||||
if (!menuWrapper.isNull())
|
||||
if (auto menuWrapper = m_actionManager->FindMenu(s_editMenuId);
|
||||
!menuWrapper.isNull())
|
||||
{
|
||||
menuWrapper.Get()->clear();
|
||||
PopulateEditMenu(menuWrapper);
|
||||
|
||||
@@ -247,7 +247,7 @@ private:
|
||||
|
||||
AZStd::unique_ptr<ViewportEditorModeNotificationsBusImpl>
|
||||
m_componentModeNotifications; //!< Helper for EditorComponentModeNotificationBus so
|
||||
//!< QtViewPaneManager does not need to inherit directly from it. */
|
||||
//!< QtViewPaneManager does not need to inherit directly from it. */
|
||||
|
||||
using EditorWindowRequestBusImpl = AzToolsFramework::EditorWindowRequestBusImpl;
|
||||
EditorWindowRequestBusImpl m_windowRequest; //!< Helper for EditorWindowRequestBus so
|
||||
|
||||
+2
-1
@@ -23,6 +23,7 @@ namespace AzToolsFramework
|
||||
virtual ~ComponentModeCollectionInterface() = default;
|
||||
|
||||
//! Retrieves the list of all Component types (usually one).
|
||||
virtual const AZStd::vector<AZ::Uuid>& GetComponentTypes() const = 0;
|
||||
//! @note If called outside of component mode, an empty vector will be returned.
|
||||
virtual AZStd::vector<AZ::Uuid> GetComponentTypes() const = 0;
|
||||
};
|
||||
} // namespace AzToolsFramework
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ namespace AzToolsFramework
|
||||
{
|
||||
void ViewportEditorModeNotifications::Reflect(AZ::ReflectContext* context)
|
||||
{
|
||||
if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
|
||||
if (auto* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
|
||||
{
|
||||
behaviorContext->EBus<ViewportEditorModeNotificationsBus>("ViewportEditorModeNotificationsBus")
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation)
|
||||
|
||||
+3
-2
@@ -203,9 +203,10 @@ namespace AzToolsFramework
|
||||
}
|
||||
}
|
||||
|
||||
const AZStd::vector<AZ::Uuid>& ComponentModeCollection::GetComponentTypes() const
|
||||
AZStd::vector<AZ::Uuid> ComponentModeCollection::GetComponentTypes() const
|
||||
{
|
||||
return m_activeComponentTypes;
|
||||
// If in component mode, return the active component types, otherwise return an empty vector
|
||||
return InComponentMode() ? m_activeComponentTypes : AZStd::vector<AZ::Uuid>{};
|
||||
}
|
||||
|
||||
void ComponentModeCollection::BeginComponentMode()
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ namespace AzToolsFramework
|
||||
void PopulateViewportUi();
|
||||
|
||||
// ComponentModeCollectionInterface overrides ...
|
||||
const AZStd::vector<AZ::Uuid>& GetComponentTypes() const override;
|
||||
AZStd::vector<AZ::Uuid> GetComponentTypes() const override;
|
||||
|
||||
private:
|
||||
// Internal helper used by Select[|Prev|Next]ActiveComponentMode
|
||||
|
||||
+2
-2
@@ -5710,7 +5710,7 @@ namespace AzToolsFramework
|
||||
{
|
||||
DisableComponentActions(this, m_entityComponentActions);
|
||||
SetPropertyEditorState(m_gui, false);
|
||||
const auto& componentModeTypes = m_componentModeCollection->GetComponentTypes();
|
||||
const auto componentModeTypes = m_componentModeCollection->GetComponentTypes();
|
||||
m_disabled = true;
|
||||
|
||||
if (!componentModeTypes.empty())
|
||||
@@ -5735,7 +5735,7 @@ namespace AzToolsFramework
|
||||
{
|
||||
EnableComponentActions(this, m_entityComponentActions);
|
||||
SetPropertyEditorState(m_gui, true);
|
||||
const auto& componentModeTypes = m_componentModeCollection->GetComponentTypes();
|
||||
const auto componentModeTypes = m_componentModeCollection->GetComponentTypes();
|
||||
m_disabled = false;
|
||||
|
||||
for (auto componentEditor : m_componentEditors)
|
||||
|
||||
Reference in New Issue
Block a user