Merge fix

Signed-off-by: Dayo Lawal <lawalfua@amazon.com>
This commit is contained in:
Dayo Lawal
2021-08-05 14:07:48 -05:00
parent f8c8181b0c
commit bf7512ebf4
6 changed files with 37 additions and 59 deletions
@@ -11,6 +11,7 @@
#include <AtomToolsFramework/Util/Util.h>
#include <AtomToolsFramework/Application/AtomToolsApplication.h>
#include <AtomToolsFramework/Window/AtomToolsMainWindowFactoryRequestBus.h>
#include <AtomToolsFramework/Window/AtomToolsMainWindowRequestBus.h>
#include <AzCore/IO/Path/Path.h>
#include <AzCore/Utils/Utils.h>
@@ -70,6 +71,8 @@ namespace AtomToolsFramework
AtomToolsApplication ::~AtomToolsApplication()
{
AtomToolsMainWindowNotificationBus::Handler::BusDisconnect();
AzToolsFramework::AssetDatabase::AssetDatabaseRequestsBus::Handler::BusDisconnect();
AzToolsFramework::EditorPythonConsoleNotificationBus::Handler::BusDisconnect();
}
void AtomToolsApplication::CreateReflectionManager()
@@ -93,14 +96,12 @@ namespace AtomToolsFramework
if (auto behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
{
auto targetName = GetBuildTargetName();
// this will put these methods into the 'azlmbr.AtomTools.general' module
auto addGeneral = [targetName](AZ::BehaviorContext::GlobalMethodBuilder methodBuilder)
auto addGeneral = [](AZ::BehaviorContext::GlobalMethodBuilder methodBuilder)
{
methodBuilder->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation)
->Attribute(AZ::Script::Attributes::Category, "Editor")
->Attribute(AZ::Script::Attributes::Module, targetName);
->Attribute(AZ::Script::Attributes::Module, "atomtools.general");
};
// The reflection here is based on patterns in CryEditPythonHandler::Reflect
addGeneral(behaviorContext->Method(
@@ -288,6 +289,13 @@ namespace AtomToolsFramework
void AtomToolsApplication::ProcessCommandLine(const AZ::CommandLine& commandLine)
{
const AZStd::string activateWindowSwitchName = "activatewindow";
if (commandLine.HasSwitch(activateWindowSwitchName))
{
AtomToolsFramework::AtomToolsMainWindowRequestBus::Broadcast(
&AtomToolsFramework::AtomToolsMainWindowRequestBus::Handler::ActivateWindow);
}
const AZStd::string timeoputSwitchName = "timeout";
if (commandLine.HasSwitch(timeoputSwitchName))
{