447832dd81
* Updated the GameApplication to mount the engine.pak This allows loading the autoexec.cfg and bootstrap.game.<config>.<platform>.setreg from the engine.pak files The engine.pak is searched for in the following order: <ExecutableDirectory>/engine.pak, followed by <ProjectCacheRoot>/engine.pak Removed a lot of unused APIs from the AZ::IO::Archive feature suite Updated many of the AZ::IO::Archive classes to use AZ::IO::Path internally. The logic to search for files within an Archive has been updated to use AZ::IO::Path and to remove case-insensitve string comparisons Somehow removed the CryFile dependency on anything Cry Updated the Settings Registry to support reading from the FileIOBase and therefore Archive files in the GameLauncher via the `SetUseFileIO` function Removed AzFramework Dependency on md5 3rdParty library Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Linux build fix Added an include of <stdio.h> before the <rapidxml/rapidxml.h> include as it usesnprintf. Added `static` to the constexpr constants in ExtractFileDescription in SettingsRegistryImpl.cpp to fix clang compile issue Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated the case used to mount the Engine PAK file in the GameApplication to be Engine.pak to match the other locations where it is mounted Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated the proper FFont call to FileIOBase::Size to supply the correct integer type of AZ::u64 instead of size_t This fixes building on platforms where size_t is type defined to be unsigned long Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Fixed segmentation fault in Archive::Unregister when outputing the filename of the Archive file being closed Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Fix calls to OpenPack in the Legacy LevelSystem The LevelSystem was calling the incorrect overload of OpenPack that accepts BindRoot for the mounted level.pak instead of the overload that that passes a memory block object. This was causing the level pak files to be mounted using an invalid directory, causing file accesses inside the level pak to fail. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated the error messages in the ZipDir CacheFactory class to use AZ_Warning directly Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated the ArchiveFileIO m_trackedFiles container to store mapped type as an AZ::IO::Path Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
171 lines
4.8 KiB
C++
171 lines
4.8 KiB
C++
#pragma once
|
|
/*
|
|
* Copyright (c) Contributors to the Open 3D Engine Project.
|
|
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
*
|
|
*/
|
|
#pragma once
|
|
|
|
#include <AzCore/IO/Path/Path.h>
|
|
#include <AzCore/std/any.h>
|
|
|
|
namespace AzToolsFramework
|
|
{
|
|
/**
|
|
* This bus can be used to send commands to the editor.
|
|
*/
|
|
class EditorLayerPythonRequests
|
|
: public AZ::ComponentBus
|
|
{
|
|
public:
|
|
|
|
/*
|
|
* Gets a CVar value as a string.
|
|
*/
|
|
virtual const char* GetCVar(const char* pName) = 0;
|
|
|
|
/*
|
|
* Sets a CVar value from any simple value.
|
|
*/
|
|
virtual void SetCVar(const char* pName, const AZStd::any& value) = 0;
|
|
|
|
/*
|
|
* Sets a CVar value from a string.
|
|
*/
|
|
virtual void SetCVarFromString(const char* pName, const char* pValue) = 0;
|
|
|
|
/*
|
|
* Sets a CVar value from an integer.
|
|
*/
|
|
virtual void SetCVarFromInteger(const char* pName, int pValue) = 0;
|
|
|
|
/*
|
|
* Sets a CVar value from a float.
|
|
*/
|
|
virtual void SetCVarFromFloat(const char* pName, float pValue) = 0;
|
|
|
|
/*
|
|
* Runs a console command.
|
|
*/
|
|
virtual void PyRunConsole(const char* text) = 0;
|
|
|
|
/*
|
|
* Enters the editor game mode.
|
|
*/
|
|
virtual void EnterGameMode() = 0;
|
|
|
|
/*
|
|
* Queries if it's in the game mode or not.
|
|
*/
|
|
virtual bool IsInGameMode() = 0;
|
|
|
|
/*
|
|
* Exits the editor game mode.
|
|
*/
|
|
virtual void ExitGameMode() = 0;
|
|
|
|
/*
|
|
* Enters the editor AI/Physics simulation mode.
|
|
*/
|
|
virtual void EnterSimulationMode() = 0;
|
|
|
|
/*
|
|
* Queries if the editor is currently in the AI/Physics simulation mode or not.
|
|
*/
|
|
virtual bool IsInSimulationMode() = 0;
|
|
|
|
/*
|
|
* Exits the editor AI/Physics simulation mode.
|
|
*/
|
|
virtual void ExitSimulationMode() = 0;
|
|
|
|
/*
|
|
* Runs a script file. A relative path from the editor user folder or an absolute path should be given as an argument.
|
|
*/
|
|
virtual void RunFile(const char* pFile) = 0;
|
|
|
|
/*
|
|
* Runs a script file with parameters. A relative path from the editor user folder or an absolute path should be given as an argument. The arguments should be separated by whitespace.
|
|
*/
|
|
virtual void RunFileParameters(const char* pFile, const char* pArguments) = 0;
|
|
|
|
/*
|
|
* Executes a given string as an editor command.
|
|
*/
|
|
virtual void ExecuteCommand(const char* cmdline) = 0;
|
|
|
|
/*
|
|
* Shows a confirmation message box with ok|cancel and shows a custom message.
|
|
*/
|
|
virtual bool MessageBoxOkCancel(const char* pMessage) = 0;
|
|
|
|
/*
|
|
* Shows a confirmation message box with yes|no and shows a custom message.
|
|
*/
|
|
virtual bool MessageBoxYesNo(const char* pMessage) = 0;
|
|
|
|
/*
|
|
* Shows a confirmation message box with only ok and shows a custom message.
|
|
*/
|
|
virtual bool MessageBoxOk(const char* pMessage) = 0;
|
|
|
|
/*
|
|
* Shows an edit box and returns the value as string.
|
|
*/
|
|
virtual AZStd::string EditBox(AZStd::string_view pTitle) = 0;
|
|
|
|
/*
|
|
* Shows an edit box and checks the custom value to use the return value with other functions correctly.
|
|
*/
|
|
virtual AZStd::any EditBoxCheckDataType(const char* pTitle) = 0;
|
|
|
|
/*
|
|
* Shows an open file box and returns the selected file path and name.
|
|
*/
|
|
virtual AZStd::string OpenFileBox() = 0;
|
|
|
|
/*
|
|
* Gets axis.
|
|
*/
|
|
virtual const char* GetAxisConstraint() = 0;
|
|
|
|
/*
|
|
* Sets axis.
|
|
*/
|
|
virtual void SetAxisConstraint(AZStd::string_view pConstrain) = 0;
|
|
|
|
/*
|
|
* Finds a pak file name for a given file.
|
|
*/
|
|
virtual AZ::IO::Path GetPakFromFile(const char* filename) = 0;
|
|
|
|
/*
|
|
* Prints the message to the editor console window.
|
|
*/
|
|
virtual void Log(const char* pMessage) = 0;
|
|
|
|
/*
|
|
* Undoes the last operation.
|
|
*/
|
|
virtual void Undo() = 0;
|
|
|
|
/*
|
|
* Redoes the last undone operation.
|
|
*/
|
|
virtual void Redo() = 0;
|
|
|
|
/*
|
|
* Shows a 2d label on the screen at the given position and given color.
|
|
*/
|
|
virtual void DrawLabel(int x, int y, float size, float r, float g, float b, float a, const char* pLabel) = 0;
|
|
|
|
/*
|
|
* Shows a combo box listing each value passed in, returns string value selected by the user.
|
|
*/
|
|
virtual AZStd::string ComboBox(AZStd::string title, AZStd::vector<AZStd::string> values, int selectedIdx = 0) = 0;
|
|
};
|
|
using EditorLayerPythonRequestBus = AZ::EBus<EditorLayerPythonRequests>;
|
|
}
|