[LYN-3356] Replaced GetSelectedEntities + size() with new API.
This commit is contained in:
@@ -1509,10 +1509,10 @@ bool EditorViewportWidget::AddCameraMenuItems(QMenu* menu)
|
||||
}
|
||||
|
||||
action = customCameraMenu->addAction(tr("Look through entity"));
|
||||
AzToolsFramework::EntityIdList selectedEntityList;
|
||||
AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(selectedEntityList, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities);
|
||||
action->setCheckable(selectedEntityList.size() > 0 || m_viewSourceType == ViewSourceType::AZ_Entity);
|
||||
action->setEnabled(selectedEntityList.size() > 0 || m_viewSourceType == ViewSourceType::AZ_Entity);
|
||||
bool areAnyEntitiesSelected = false;
|
||||
AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(areAnyEntitiesSelected, &AzToolsFramework::ToolsApplicationRequests::AreAnyEntitiesSelected);
|
||||
action->setCheckable(areAnyEntitiesSelected || m_viewSourceType == ViewSourceType::AZ_Entity);
|
||||
action->setEnabled(areAnyEntitiesSelected || m_viewSourceType == ViewSourceType::AZ_Entity);
|
||||
action->setChecked(m_viewSourceType == ViewSourceType::AZ_Entity);
|
||||
connect(action, &QAction::triggered, this, [this](bool isChecked)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user