Added event to signal when the Editor is fully initialized so test scripts can listen for that instead of needed arbitrary wait commands. (#5623)

Signed-off-by: Chris Galvan <chgalvan@amazon.com>
monroegm-disable-blank-issue-2
Chris Galvan 4 years ago committed by GitHub
parent e1fb2ad368
commit 7031147e32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4181,6 +4181,8 @@ extern "C" int AZ_DLL_EXPORT CryEditMain(int argc, char* argv[])
"\nThis could be because of incorrectly configured components, or missing required gems." "\nThis could be because of incorrectly configured components, or missing required gems."
"\nSee other errors for more details."); "\nSee other errors for more details.");
AzToolsFramework::EditorEventsBus::Broadcast(&AzToolsFramework::EditorEvents::NotifyEditorInitialized);
if (didCryEditStart) if (didCryEditStart)
{ {
app->EnableOnIdle(); app->EnableOnIdle();

@ -927,6 +927,9 @@ namespace AzToolsFramework
/// Notify that the MainWindow has been fully initialized /// Notify that the MainWindow has been fully initialized
virtual void NotifyMainWindowInitialized(QMainWindow* /*mainWindow*/) {} virtual void NotifyMainWindowInitialized(QMainWindow* /*mainWindow*/) {}
/// Notify that the Editor has been fully initialized
virtual void NotifyEditorInitialized() {}
/// Signal that an asset should be highlighted / selected /// Signal that an asset should be highlighted / selected
virtual void SelectAsset(const QString& /* assetPath */) {} virtual void SelectAsset(const QString& /* assetPath */) {}
}; };

@ -214,12 +214,17 @@ namespace AzToolsFramework
, public AZ::BehaviorEBusHandler , public AZ::BehaviorEBusHandler
{ {
AZ_EBUS_BEHAVIOR_BINDER(EditorEventsBusHandler, "{352F80BB-469A-40B6-B322-FE57AB51E4DA}", AZ::SystemAllocator, AZ_EBUS_BEHAVIOR_BINDER(EditorEventsBusHandler, "{352F80BB-469A-40B6-B322-FE57AB51E4DA}", AZ::SystemAllocator,
NotifyRegisterViews); NotifyRegisterViews, NotifyEditorInitialized);
void NotifyRegisterViews() override void NotifyRegisterViews() override
{ {
Call(FN_NotifyRegisterViews); Call(FN_NotifyRegisterViews);
} }
void NotifyEditorInitialized() override
{
Call(FN_NotifyEditorInitialized);
}
}; };
} // Internal } // Internal
@ -443,6 +448,7 @@ namespace AzToolsFramework
->Attribute(AZ::Script::Attributes::Module, "editor") ->Attribute(AZ::Script::Attributes::Module, "editor")
->Handler<Internal::EditorEventsBusHandler>() ->Handler<Internal::EditorEventsBusHandler>()
->Event("NotifyRegisterViews", &EditorEvents::NotifyRegisterViews) ->Event("NotifyRegisterViews", &EditorEvents::NotifyRegisterViews)
->Event("NotifyEditorInitialized", &EditorEvents::NotifyEditorInitialized)
; ;
behaviorContext->EBus<ViewPaneCallbackBus>("ViewPaneCallbackBus") behaviorContext->EBus<ViewPaneCallbackBus>("ViewPaneCallbackBus")

Loading…
Cancel
Save