Files
o3de/Code/Editor/PythonEditorFuncs.h
T
lumberyard-employee-dm 447832dd81 Updated the GameApplication to mount the engine.pak (#4128)
* 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>
2021-09-16 11:01:00 -05:00

108 lines
3.1 KiB
C++

/*
* 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 <Include/SandboxAPI.h>
#include <AzCore/Component/Component.h>
#include "PythonEditorEventsBus.h"
namespace AzToolsFramework
{
//! A component to reflect scriptable commands for the Editor
class PythonEditorFuncsHandler
: public AZ::Component
{
public:
AZ_COMPONENT(PythonEditorFuncsHandler, "{0F470E7E-9741-4608-84B1-7E4735FDA526}")
SANDBOX_API static void Reflect(AZ::ReflectContext* context);
// AZ::Component ...
void Activate() override {}
void Deactivate() override {}
};
//! Component to access the PythonEditorFuncs
class PythonEditorComponent final
: public AZ::Component
, public EditorLayerPythonRequestBus::Handler
{
public:
AZ_COMPONENT(PythonEditorComponent, "{B06810A1-E3C0-4A63-8DDD-3A01C5299DD3}")
PythonEditorComponent() = default;
~PythonEditorComponent() override = default;
static void Reflect(AZ::ReflectContext* context);
// Component...
void Activate() override;
void Deactivate() override;
const char* GetCVar(const char* pName) override;
void SetCVar(const char* pName, const AZStd::any& value) override;
void SetCVarFromString(const char* pName, const char* pValue) override;
void SetCVarFromInteger(const char* pName, int pValue) override;
void SetCVarFromFloat(const char* pName, float pValue) override;
void PyRunConsole(const char* text) override;
void EnterGameMode() override;
bool IsInGameMode() override;
void ExitGameMode() override;
void EnterSimulationMode() override;
bool IsInSimulationMode() override;
void ExitSimulationMode() override;
void RunFile(const char* pFile) override;
void RunFileParameters(const char* pFile, const char* pArguments) override;
void ExecuteCommand(const char* cmdline) override;
bool MessageBoxOkCancel(const char* pMessage) override;
bool MessageBoxYesNo(const char* pMessage) override;
bool MessageBoxOk(const char* pMessage) override;
AZStd::string EditBox(AZStd::string_view pTitle) override;
AZStd::any EditBoxCheckDataType(const char* pTitle) override;
AZStd::string OpenFileBox() override;
const char* GetAxisConstraint() override;
void SetAxisConstraint(AZStd::string_view pConstrain) override;
AZ::IO::Path GetPakFromFile(const char* filename) override;
void Log(const char* pMessage) override;
void Undo() override;
void Redo() override;
void DrawLabel(int x, int y, float size, float r, float g, float b, float a, const char* pLabel) override;
AZStd::string ComboBox(AZStd::string title, AZStd::vector<AZStd::string> values, int selectedIdx = 0) override;
};
} // namespace AzToolsFramework