Checked for no Entity selected and fixed UI

Signed-off-by: John Jones-Steele <jjjoness@amazon.com>
This commit is contained in:
John Jones-Steele
2021-07-21 15:00:46 +01:00
parent c831f8037a
commit 7cb6ef4f47
@@ -4965,21 +4965,29 @@ namespace AzToolsFramework
void EntityPropertyEditor::SetEditorUiEnabled(bool enable)
{
if (enable)
if (!m_selectedEntityIds.empty())
{
EnableComponentActions(this, m_entityComponentActions);
if (enable)
{
EnableComponentActions(this, m_entityComponentActions);
}
else
{
DisableComponentActions(this, m_entityComponentActions);
}
SetPropertyEditorState(m_gui, enable);
for (auto componentEditor : m_componentEditors)
{
AzQtComponents::SetWidgetInteractEnabled(componentEditor, enable);
}
}
else
{
DisableComponentActions(this, m_entityComponentActions);
AzQtComponents::SetWidgetInteractEnabled(m_gui->m_entityDetailsLabel, enable);
}
m_disabled = !enable;
SetPropertyEditorState(m_gui, enable);
for (auto componentEditor : m_componentEditors)
{
AzQtComponents::SetWidgetInteractEnabled(componentEditor, enable);
}
// record the selected state after entering/leaving component mode
SaveComponentEditorState();
}