main.cpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 <AzToolsFramework/API/ToolsApplicationAPI.h>
  9. #include <AzToolsFramework/API/ViewPaneOptions.h>
  10. #include <Include/IPlugin.h>
  11. #include "ProjectSettingsToolWindow.h"
  12. #include "../Editor/LyViewPaneNames.h"
  13. class ProjectSettingsToolPlugin
  14. : public IPlugin
  15. {
  16. public:
  17. ProjectSettingsToolPlugin([[maybe_unused]] IEditor* editor)
  18. {
  19. AzToolsFramework::ViewPaneOptions options;
  20. options.showInMenu = false;
  21. AzToolsFramework::RegisterViewPane<ProjectSettingsTool::ProjectSettingsToolWindow>(LyViewPane::ProjectSettingsTool, LyViewPane::ProjectSettingsTool, options);
  22. }
  23. void Release() override
  24. {
  25. AzToolsFramework::UnregisterViewPane(LyViewPane::ProjectSettingsTool);
  26. delete this;
  27. }
  28. void ShowAbout() override {}
  29. const char* GetPluginGUID() override { return "{C5B96A1A-036A-46F9-B7F0-5DF93494F988}"; }
  30. DWORD GetPluginVersion() override { return 1; }
  31. const char* GetPluginName() override { return "ProjectSettingsTool"; }
  32. bool CanExitNow() override { return true; }
  33. void OnEditorNotify([[maybe_unused]] EEditorNotifyEvent aEventId) override {}
  34. };
  35. PLUGIN_API IPlugin* CreatePluginInstance(PLUGIN_INIT_PARAM* pInitParam)
  36. {
  37. ISystem* pSystem = pInitParam->pIEditorInterface->GetSystem();
  38. ModuleInitISystem(pSystem, "ProjectSettingsTool");
  39. // the above line initializes the gEnv global variable if necessary, and also makes GetIEditor() and other similar functions work correctly.
  40. return new ProjectSettingsToolPlugin(GetIEditor());
  41. }
  42. #if defined(AZ_PLATFORM_WINDOWS)
  43. HINSTANCE g_hInstance = 0;
  44. BOOL __stdcall DllMain(HINSTANCE hinstDLL, ULONG fdwReason, [[maybe_unused]] LPVOID lpvReserved)
  45. {
  46. if (fdwReason == DLL_PROCESS_ATTACH)
  47. {
  48. g_hInstance = hinstDLL;
  49. }
  50. return TRUE;
  51. }
  52. #endif