LuaIDEApplication.cpp 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include "LuaIDEApplication.h"
  9. #include <AzCore/Asset/AssetManagerComponent.h>
  10. #include <AzFramework/Script/ScriptRemoteDebugging.h>
  11. #include <AzFramework/Asset/AssetCatalogComponent.h>
  12. #include <AzToolsFramework/SourceControl/PerforceComponent.h>
  13. #include <AzToolsFramework/Asset/AssetSystemComponent.h>
  14. #include <AzFramework/Asset/AssetSystemComponent.h>
  15. #include <AzToolsFramework/AssetBrowser/AssetBrowserComponent.h>
  16. #include <AzToolsFramework/ToolsComponents/EditorSelectionAccentSystemComponent.h>
  17. #include <AzToolsFramework/Thumbnails/ThumbnailerNullComponent.h>
  18. #include <Source/AssetDatabaseLocationListener.h>
  19. #include <Source/LUA/LUAEditorContext.h>
  20. #include <Source/LUA/LUADebuggerComponent.h>
  21. #include <AzToolsFramework/UI/PropertyEditor/PropertyManagerComponent.h>
  22. namespace LUAEditor
  23. {
  24. Application::Application(int argc, char **argv)
  25. : BaseApplication(argc, argv)
  26. {
  27. AzToolsFramework::SourceControlNotificationBus::Handler::BusConnect();
  28. }
  29. Application::~Application()
  30. {
  31. AzToolsFramework::SourceControlNotificationBus::Handler::BusDisconnect();
  32. }
  33. void Application::RegisterCoreComponents()
  34. {
  35. StandaloneTools::BaseApplication::RegisterCoreComponents();
  36. RegisterComponentDescriptor(LUAEditor::Context::CreateDescriptor());
  37. RegisterComponentDescriptor(LUADebugger::Component::CreateDescriptor());
  38. RegisterComponentDescriptor(AzFramework::CreateScriptDebugAgentFactory());
  39. RegisterComponentDescriptor(AzToolsFramework::PerforceComponent::CreateDescriptor());
  40. RegisterComponentDescriptor(AzFramework::AssetCatalogComponent::CreateDescriptor());
  41. RegisterComponentDescriptor(AzToolsFramework::Components::PropertyManagerComponent::CreateDescriptor());
  42. RegisterComponentDescriptor(AzFramework::AssetSystem::AssetSystemComponent::CreateDescriptor());
  43. RegisterComponentDescriptor(AzToolsFramework::AssetSystem::AssetSystemComponent::CreateDescriptor());
  44. RegisterComponentDescriptor(AzToolsFramework::Thumbnailer::ThumbnailerNullComponent::CreateDescriptor());
  45. RegisterComponentDescriptor(AzToolsFramework::AssetBrowser::AssetBrowserComponent::CreateDescriptor());
  46. RegisterComponentDescriptor(AzToolsFramework::Components::EditorSelectionAccentSystemComponent::CreateDescriptor());
  47. RegisterComponentDescriptor(AzFramework::CreateScriptDebugAgentFactory());
  48. }
  49. void Application::CreateApplicationComponents()
  50. {
  51. StandaloneTools::BaseApplication::CreateApplicationComponents();
  52. EnsureComponentCreated(LUAEditor::Context::RTTI_Type());
  53. EnsureComponentCreated(LUADebugger::Component::RTTI_Type());
  54. EnsureComponentCreated(AZ::Uuid("{624a7be2-3c7e-4119-aee2-1db2bdb6cc89}"));
  55. EnsureComponentCreated(AzToolsFramework::PerforceComponent::RTTI_Type());
  56. EnsureComponentCreated(AzFramework::AssetCatalogComponent::RTTI_Type());
  57. EnsureComponentCreated(AZ::AssetManagerComponent::RTTI_Type());
  58. EnsureComponentCreated(AzToolsFramework::Components::PropertyManagerComponent::RTTI_Type());
  59. EnsureComponentCreated(AzFramework::AssetSystem::AssetSystemComponent::RTTI_Type());
  60. EnsureComponentCreated(AzToolsFramework::AssetSystem::AssetSystemComponent::RTTI_Type());
  61. EnsureComponentCreated(AzToolsFramework::Thumbnailer::ThumbnailerNullComponent::RTTI_Type());
  62. EnsureComponentCreated(AzToolsFramework::AssetBrowser::AssetBrowserComponent::RTTI_Type());
  63. EnsureComponentCreated(AzToolsFramework::Components::EditorSelectionAccentSystemComponent::RTTI_Type());
  64. }
  65. void Application::ConnectivityStateChanged(const AzToolsFramework::SourceControlState state)
  66. {
  67. using SCConnectionBus = AzToolsFramework::SourceControlConnectionRequestBus;
  68. using AzToolsFramework::SourceControlState;
  69. // If status invalid, just disconnect from source control
  70. if (state == SourceControlState::ConfigurationInvalid)
  71. {
  72. SCConnectionBus::Broadcast(&SCConnectionBus::Events::EnableSourceControl, false);
  73. }
  74. }
  75. }