Listen to read-only entity state changes so we can refresh if the read-only state changes on one of our selected entities.
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
This commit is contained in:
+15
@@ -569,6 +569,12 @@ namespace AzToolsFramework
|
||||
AZ::EntitySystemBus::Handler::BusConnect();
|
||||
EntityPropertyEditorRequestBus::Handler::BusConnect();
|
||||
EditorWindowUIRequestBus::Handler::BusConnect();
|
||||
|
||||
AzFramework::EntityContextId editorEntityContextId = AzFramework::EntityContextId::CreateNull();
|
||||
EditorEntityContextRequestBus::BroadcastResult(
|
||||
editorEntityContextId, &EditorEntityContextRequests::GetEditorEntityContextId);
|
||||
ReadOnlyEntityPublicNotificationBus::Handler::BusConnect(editorEntityContextId);
|
||||
|
||||
m_spacer = nullptr;
|
||||
|
||||
m_emptyIcon = QIcon();
|
||||
@@ -618,6 +624,7 @@ namespace AzToolsFramework
|
||||
{
|
||||
qApp->removeEventFilter(this);
|
||||
|
||||
ReadOnlyEntityPublicNotificationBus::Handler::BusDisconnect();
|
||||
EditorWindowUIRequestBus::Handler::BusDisconnect();
|
||||
EntityPropertyEditorRequestBus::Handler::BusDisconnect();
|
||||
ToolsApplicationEvents::Bus::Handler::BusDisconnect();
|
||||
@@ -5762,6 +5769,14 @@ namespace AzToolsFramework
|
||||
SaveComponentEditorState();
|
||||
}
|
||||
|
||||
void EntityPropertyEditor::OnReadOnlyEntityStatusChanged(const AZ::EntityId& entityId, [[maybe_unused]] bool readOnly)
|
||||
{
|
||||
if (IsEntitySelected(entityId))
|
||||
{
|
||||
UpdateContents();
|
||||
}
|
||||
}
|
||||
|
||||
void EntityPropertyEditor::OnEditorModeActivated(
|
||||
[[maybe_unused]] const AzToolsFramework::ViewportEditorModesInterface& editorModeState, AzToolsFramework::ViewportEditorMode mode)
|
||||
{
|
||||
|
||||
+5
@@ -29,6 +29,7 @@
|
||||
#include <AzToolsFramework/API/ViewportEditorModeTrackerNotificationBus.h>
|
||||
#include <AzToolsFramework/ComponentMode/EditorComponentModeBus.h>
|
||||
#include <AzToolsFramework/Entity/EditorEntityContextBus.h>
|
||||
#include <AzToolsFramework/Entity/ReadOnly/ReadOnlyEntityBus.h>
|
||||
#include <AzToolsFramework/ToolsComponents/ComponentMimeData.h>
|
||||
#include <AzToolsFramework/ToolsComponents/EditorInspectorComponentBus.h>
|
||||
#include <AzQtComponents/Components/O3DEStylesheet.h>
|
||||
@@ -117,6 +118,7 @@ namespace AzToolsFramework
|
||||
, public AZ::EntitySystemBus::Handler
|
||||
, public AZ::TickBus::Handler
|
||||
, private EditorWindowUIRequestBus::Handler
|
||||
, private ReadOnlyEntityPublicNotificationBus::Handler
|
||||
{
|
||||
Q_OBJECT;
|
||||
public:
|
||||
@@ -254,6 +256,9 @@ namespace AzToolsFramework
|
||||
// EditorWindowRequestBus overrides
|
||||
void SetEditorUiEnabled(bool enable) override;
|
||||
|
||||
// ReadOnlyEntityPublicNotificationBus overrides ...
|
||||
void OnReadOnlyEntityStatusChanged(const AZ::EntityId& entityId, bool readOnly) override;
|
||||
|
||||
bool IsEntitySelected(const AZ::EntityId& id) const;
|
||||
bool IsSingleEntitySelected(const AZ::EntityId& id) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user