/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ #pragma once #include #include "Core/EditorMetricsPlainTextNameRegistration.h" #include "EditorToolsApplicationAPI.h" namespace EditorInternal { // Override the ToolsApplication so that we can special case when the config file is not // found and give the user of the Editor a specific message about it. class EditorToolsApplication : public AzToolsFramework::ToolsApplication , public EditorToolsApplicationRequests::Bus::Handler { public: EditorToolsApplication(int* argc, char*** argv); ~EditorToolsApplication(); bool OnFailedToFindConfiguration(const char* configFilePath) override; bool IsStartupAborted() const; void RegisterCoreComponents() override; AZ::ComponentTypeList GetRequiredSystemComponents() const; void StartCommon(AZ::Entity* systemEntity) override; using AzToolsFramework::ToolsApplication::Start; bool Start(); ////////////////////////////////////////////////////////////////////////// // AzFramework::ApplicationRequests::Bus void QueryApplicationType(AzFramework::ApplicationTypeQuery& appType) const override; ////////////////////////////////////////////////////////////////////////// // From AzToolsFramework::ToolsApplication void CreateReflectionManager() override; void Reflect(AZ::ReflectContext* context) override; void CalculateAppRoot(const char* appRootOverride = nullptr) override; void SetupAliasConfigStorage(SSystemInitParams initParams); protected: // From EditorToolsApplicationRequests bool OpenLevel(AZStd::string_view levelName) override; bool OpenLevelNoPrompt(AZStd::string_view levelName) override; int CreateLevel(AZStd::string_view levelName, int resolution, int unitSize, bool bUseTerrain) override; int CreateLevelNoPrompt(AZStd::string_view levelName, int heightmapResolution, int heightmapUnitSize, int terrainExportTextureSize, bool useTerrain) override; void Exit() override; void ExitNoPrompt() override; AZStd::string GetGameFolder() const override; AZStd::string GetCurrentLevelName() const override; AZStd::string GetCurrentLevelPath() const override; private: static constexpr char DefaultFileExtension[] = ".ly"; static constexpr char OldFileExtension[] = ".cry"; static constexpr char DefaultLevelFolder[] = "Levels"; bool m_StartupAborted = false; Editor::EditorMetricsPlainTextNameRegistrationBusListener m_metricsPlainTextRegistrar; bool GetOptionalAppRootArg(int argc, char* argv[], char destinationRootArgBuffer[], size_t destinationRootArgBufferSize) const; }; }