3dec5d3b71
* LYN-2537 Moved the Engine and Editor folder to be within the EngineAssets folder * Fixed Documentation in bootstrap.cfg to correct the path to the user project specific registry file * Adding a newline to the output of AssetCatalog 'Registering asset..., but type is not set' message * Updating the AssetProcessorPlatformConfig.setreg Scan Folder to detect the @ENGINEROOT@/EngineAssets/Engine path for engine runtime assets and @ENGINEROOT@/EngineAssets/Editor path for engine tool assets * Updating references to Icons and other assets to account for moving the Engine and Editor folder under a single EngineAssets folder * Moving the Engine Settings Registry folder from Engine/Registry -> Registry * Removed the LY_PROJECT_CMAKE_PATH define as it is not portable to other locations. It is hard coded to the project location that was used for the CMake configuration. Furthermore it paths with backslashes within it are treated as escape characters and not a path separator * Updated the LyTestTools asset_processor.py script to copy the exclude.filetag from the EngineAssets/Engine directory now * Fixed Atom Shader Preprocessing when running using an External Project * Updated the TSGenerateAction.cpp to fix the build error with using a renamed variable * Updated the Install_Common.cmake ly_setup_others function to install the EngineAssets directory and the each of the Gem's Assets directory while maintaining the relative directory structure to the Engine Root Also updated the install step to install the Registry folder at the engine root * Fixed the copying of the Registry folder to be in the install root, instead of under a second 'Registry' folder * Moving the AssetProcessorPlatformConfig.setreg file over to the Registry folder * Updated the LyTestTools and C++ code to point that the new location of the AssetProcessorPlatformConfig.setreg file inside of the Registry folder * Renamed Test AssetProcessor*Config.ini files to have the .setreg extension * Converted the AssetProcessor test setreg files from ini format to json format using the SerializeContextTools convert-ini command * Updated the AssetProcessor CMakeLists.txt to copy over the test setreg files to the build folder * Updated the assetprocessor test file list to point at the renamed AsssetProcessor*Config setreg filenames * Removed the Output Prefix code from the AssetProcessor. The complexity that it brought to the AP code is not needed, as users can replicate the behavior by just moving there assets underneath a another folder, underneath the scan folder * Adding back support to read the AssetProcessorPlatformConfig.setreg file from the asset root. This is only needed for C++ UnitTests as they run in an environment where the accessing the Engine Settings Registry is not available * Updating the Install_common.cmake logic to copy any "Assets" folder to the install layout. The Script has also been updated to copy over the "Assets" folder in the Engine Root to the install layout instead of an "EngineAssets" folder * Updating References to EngineAssets source asset folder in code to be the Assets source folder * Moved the Engine Source Asset folder of 'EngineAssets' to a new folder name of 'Assets'. This is inline with the naming scheme we use for Gem asset folders * Adding the EngineFinder.cmake to the AutomatedTesting project to allow it to work in a project centric manner * Updating the LyTestTools copy_assets_to_project function to be able to copy assets with folders to the temporary project root Fixed an issue in LyTestTools where the temporary log directory could have shutil.rmtree being called twice on it leading to an exception which fails an automated test Updated the asset_procesor_gui_tests_2 AddScanFolder test to not use the output prefix, but instead place the source asset root into a subdirectory * Correct the AssetProcessorPlatformConfig Scan Folders for the EngineAssets directory to point at the Assets directory * Updated the asset procesor batch dependency test scan folder to point at the 'Assets' folder instead of 'EngineAssets'
156 lines
5.4 KiB
C++
156 lines
5.4 KiB
C++
/*
|
|
* 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.
|
|
*
|
|
*/
|
|
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
|
|
|
#ifndef CRYINCLUDE_EDITOR_SETTINGSMANAGER_H
|
|
#define CRYINCLUDE_EDITOR_SETTINGSMANAGER_H
|
|
#pragma once
|
|
|
|
#include <QString>
|
|
|
|
class QByteArray;
|
|
|
|
#define EDITOR_LAYOUT_FILE_PATH "@user@/Editor/EditorLayout.xml"
|
|
#define EDITOR_SETTINGS_FILE_PATH "@user@/Editor/EditorSettings.xml"
|
|
#define EDITOR_LAYOUT_ROOT_NODE "EditorLayout"
|
|
#define EDITOR_SETTINGS_ROOT_NODE "EditorSettings"
|
|
#define EDITOR_SETTINGS_CONTENT_NODE "EditorSettingsContent"
|
|
#define NEED_SETTINGS_VALID_LOOKUP_PATH "Settings"
|
|
#define EDITOR_LAYOUT_NODE "DockingPaneLayouts"
|
|
#define EDITOR_SETTINGS_ATTRIB_NAME "value"
|
|
#define CVARS_NODE "CVars"
|
|
#define CVAR_NODE "CVar"
|
|
|
|
#define EDITOR_EVENT_LOG_FILE_PATH "@user@/Editor/EditorEventLog.xml"
|
|
#define EDITOR_EVENT_LOG_ROOT_NODE "EventRecorder"
|
|
#define EVENT_LOG_EVENT_NAME "eventName"
|
|
#define EDITOR_EVENT_LOG_ATTRIB_NAME "value"
|
|
#define EVENT_LOG_START "start"
|
|
#define EVENT_LOG_END "end"
|
|
|
|
#define LOG_DATETIME_FORMAT "MM/dd/yyyy HH:mm:ss"
|
|
|
|
#define EVENT_LOG_CALLER_VERSION "callerVersion"
|
|
|
|
enum EditorSettingsManagerType
|
|
{
|
|
eSettingsManagerMemoryStorage = 0,
|
|
eSettingsManagerLast
|
|
};
|
|
|
|
enum EditorSettingsExportType
|
|
{
|
|
eSettingsManagerExportSettings = 0,
|
|
eSettingsManagerExportLayout
|
|
};
|
|
|
|
typedef std::map<QString, QString> TToolNamesMap;
|
|
|
|
struct SEventLog;
|
|
|
|
struct SEventLog
|
|
{
|
|
SEventLog(QString eventName, QString eventState, QString callerVersion = "")
|
|
{
|
|
m_eventName = eventName;
|
|
m_eventState = eventState;
|
|
m_callerVersion = callerVersion;
|
|
}
|
|
|
|
QString m_eventName;
|
|
QString m_callerVersion;
|
|
QString m_eventState;
|
|
};
|
|
|
|
class CSettingsManager
|
|
{
|
|
public:
|
|
// eMemoryStorage=0
|
|
CSettingsManager(EditorSettingsManagerType managerType);
|
|
~CSettingsManager();
|
|
|
|
// Sandbox Editor events
|
|
void RegisterEvent(const SEventLog& event);
|
|
void UnregisterEvent(const SEventLog& event);
|
|
bool IsEventSafe(const SEventLog& event);
|
|
QString GenerateContentHash(XmlNodeRef& node, QString sourceName);
|
|
|
|
XmlNodeRef LoadLogEventSetting(const QString& path, const QString& attr, QString& val, XmlNodeRef& root);
|
|
void SaveLogEventSetting(const QString& path, const QString& attr, const QString& val);
|
|
|
|
bool CreateDefaultLayoutSettingsFile();
|
|
|
|
void SaveLayoutSettings(const QByteArray& layout, const QString& toolName);
|
|
|
|
AZStd::vector<AZStd::string> BuildSettingsList();
|
|
void BuildSettingsList_Helper(const XmlNodeRef& nodeList, const AZStd::string_view& previousPath, AZStd::vector<AZStd::string>& result);
|
|
|
|
void LoadSetting(const QString& path, const QString& attr, bool& val);
|
|
void LoadSetting(const QString& path, const QString& attr, int& iVal);
|
|
void LoadSetting(const QString& path, const QString& attr, float& fVal);
|
|
void LoadSetting(const QString& path, const QString& attr, QColor& color);
|
|
XmlNodeRef LoadSetting(const QString& path, const QString& attr, QString& val);
|
|
|
|
void SaveSetting(const QString& path, const QString& attr, bool val);
|
|
void SaveSetting(const QString& path, const QString& attr, float fVal);
|
|
void SaveSetting(const QString& path, const QString& attr, int iVal);
|
|
void SaveSetting(const QString& path, const QString& attr, QColor color);
|
|
void SaveSetting(const QString& path, const QString& attr, const QString& val);
|
|
|
|
void AddSettingsNode(XmlNodeRef newNode);
|
|
|
|
void AddToolVersion(const QString& toolName, const QString& toolVersion);
|
|
QString& GetToolVersion(const QString& sPaneClassName){ return m_toolVersions[sPaneClassName]; };
|
|
|
|
void AddToolName(const QString& toolName, const QString& humanReadableName = QString());
|
|
TToolNamesMap* GetToolNames() { return &m_toolNames; };
|
|
|
|
// Test if all tools can be safely opened
|
|
bool IsToolsOpenSafe();
|
|
|
|
void ClearToolNames(){ m_toolNames.clear(); m_toolVersions.clear(); };
|
|
|
|
void UpdateLayoutNode();
|
|
|
|
void ImportSettings(QString file);
|
|
|
|
void ExportSettings(XmlNodeRef exportNode, QString fileName);
|
|
void Export();
|
|
|
|
void GetMatchingLayoutNames(TToolNamesMap& foundTools, XmlNodeRef& resultNode, QString file);
|
|
bool NeedSettingsNode(const QString& path);
|
|
|
|
void SerializeCVars(XmlNodeRef& node, bool bLoad);
|
|
|
|
void ReadValueStr(XmlNodeRef& sourceNode, const QString& path, const QString& attr, QString& val);
|
|
|
|
void SetExportFileName(QString exportFilePath) { m_ExportFilePath = exportFilePath; };
|
|
|
|
private:
|
|
// Save settings to memory or file
|
|
EditorSettingsManagerType m_managerType;
|
|
|
|
// Full path of exported file
|
|
QString m_ExportFilePath;
|
|
|
|
// Node created in memory to be used for exporting editor settings, console-set cvars and layout
|
|
XmlNodeRef m_pSettingsManagerMemoryNode;
|
|
|
|
// Registered Tool Names
|
|
TToolNamesMap m_toolNames;
|
|
TToolNamesMap m_toolVersions;
|
|
|
|
//static B4BugCrytekExtension s_b4BugCrytekExtension;
|
|
};
|
|
|
|
#endif // CRYINCLUDE_EDITOR_SETTINGSMANAGER_H
|