123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432 |
- #pragma once
- #ifndef CRYINCLUDE_EDITOR_SETTINGS_H
- #define CRYINCLUDE_EDITOR_SETTINGS_H
- #include "SettingsManager.h"
- #include <QColor>
- #include <QFont>
- #include <QRect>
- #include <QSettings>
- #include <AzToolsFramework/Editor/EditorSettingsAPIBus.h>
- #include <AzToolsFramework/Prefab/PrefabLoaderInterface.h>
- #include <AzCore/JSON/document.h>
- #include <AzCore/Console/IConsole.h>
- #include <AzQtComponents/Components/Widgets/ToolBar.h>
- struct SSnapSettings
- {
- SSnapSettings()
- {
- constructPlaneDisplay = false;
- constructPlaneSize = 5;
- markerDisplay = false;
- markerColor = QColor(0, 200, 200);
- markerSize = 1.0f;
- bGridUserDefined = false;
- bGridGetFromSelected = false;
- }
-
- bool constructPlaneDisplay;
- float constructPlaneSize;
-
- bool markerDisplay;
- QColor markerColor;
- float markerSize;
- bool bGridUserDefined;
- bool bGridGetFromSelected;
- };
- struct SToolViewSettings
- {
- SToolViewSettings()
- {
- }
- int nFrameRate;
- QString codec;
- };
- struct SDeepSelectionSettings
- {
- SDeepSelectionSettings()
- : fRange(1.f)
- , bStickDuplicate(false) {}
-
-
-
- float fRange;
- bool bStickDuplicate;
- };
- struct SObjectColors
- {
- SObjectColors()
- {
- groupHighlight = QColor(0, 255, 0);
- entityHighlight = QColor(112, 117, 102);
- fBBoxAlpha = 0.3f;
- geometryHighlightColor = QColor(192, 0, 192);
- solidBrushGeometryColor = QColor(192, 0, 192);
- fGeomAlpha = 0.2f;
- fChildGeomAlpha = 0.4f;
- }
- QColor groupHighlight;
- QColor entityHighlight;
- QColor geometryHighlightColor;
- QColor solidBrushGeometryColor;
- float fBBoxAlpha;
- float fGeomAlpha;
- float fChildGeomAlpha;
- };
- struct SViewportsSettings
- {
-
- bool bAlwaysShowRadiuses;
-
- bool bSync2DViews;
-
- float fDefaultAspectRatio;
-
- bool bHighlightSelectedGeometry;
-
- bool bHighlightSelectedVegetation;
-
- int bHighlightMouseOverGeometry;
-
- bool bShowMeshStatsOnMouseOver;
-
- bool bDrawEntityLabels;
-
- bool bShowTriggerBounds;
-
- int nShowFrozenHelpers;
-
- bool bFillSelectedShapes;
-
- bool bTopMapSwapXY;
-
- int nTopMapTextureResolution;
-
- bool bShowGridGuide;
-
- bool bHideMouseCursorWhenCaptured;
-
- int nDragSquareSize;
-
- bool bEnableContextMenu;
-
- float fWarningIconsDrawDistance;
-
- bool bShowScaleWarnings;
-
- bool bShowRotationWarnings;
- };
- struct SSelectObjectDialogSettings
- {
- QString columns;
- int nLastColumnSortDirection;
- SSelectObjectDialogSettings()
- : nLastColumnSortDirection(0)
- {
- }
- };
- struct SGUI_Settings
- {
- int nToolbarIconSize;
- };
- struct STextureBrowserSettings
- {
- int nCellSize;
- };
- struct SExperimentalFeaturesSettings
- {
- bool bTotalIlluminationEnabled;
- };
- struct SLevelSaveSettings
- {
- AzToolsFramework::Prefab::SaveAllPrefabsPreference saveAllPrefabsPreference;
- };
- struct SAssetBrowserSettings
- {
-
- int nThumbSize;
-
- QString sFilenameSearch,
-
- sPresetName;
-
- QString sVisibleDatabaseNames;
-
- QString sVisibleColumnNames;
-
- QString sColumnNames;
-
- bool bShowUsedInLevel,
-
- bShowLoadedInLevel,
-
- bShowFavorites,
-
- bHideLods,
-
- bAutoSaveFilterPreset,
-
- bAutoChangeViewportSelection,
-
- bAutoFilterFromViewportSelection;
- };
- struct SSmartOpenDialogSettings
- {
- QRect rect;
- QString lastSearchTerm;
- };
- AZ_CVAR_EXTERNED(int64_t, ed_backgroundSystemTickCap);
- AZ_PUSH_DISABLE_DLL_EXPORT_BASECLASS_WARNING
- struct SANDBOX_API SEditorSettings
- : AzToolsFramework::EditorSettingsAPIBus::Handler
- {
- AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING
- SEditorSettings();
- ~SEditorSettings() = default;
- void Save(bool isEditorClosing = false);
- void Load();
- void LoadCloudSettings();
- void Connect();
- void Disconnect();
-
- AZStd::vector<AZStd::string> BuildSettingsList() override;
- SettingOutcome GetValue(const AZStd::string_view path) override;
- SettingOutcome SetValue(const AZStd::string_view path, const AZStd::any& value) override;
- AzToolsFramework::ConsoleColorTheme GetConsoleColorTheme() const override;
- AZ::u64 GetMaxNumberOfItemsShownInSearchView() const override;
- void SaveSettingsRegistryFile() override;
- void ConvertPath(const AZStd::string_view sourcePath, AZStd::string& category, AZStd::string& attribute);
-
- void LoadDefaultGamePaths();
-
-
- void SaveEnableSourceControlFlag(bool triggerUpdate = false);
- void LoadEnableSourceControlFlag();
- void PostInitApply();
-
-
-
- int undoLevels;
- bool bShowDashboardAtStartup;
- bool bAutoloadLastLevelAtStartup;
- bool bMuteAudio;
-
- float cameraMoveSpeed;
- float cameraRotateSpeed;
- float cameraFastMoveSpeed;
- float wheelZoomSpeed;
- bool invertYRotation;
- bool invertPan;
- bool stylusMode;
- bool restoreViewportCamera;
-
- int objectHideMask;
-
- int objectSelectMask;
-
-
-
- SViewportsSettings viewports;
- AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
- SToolViewSettings toolViewSettings;
-
-
-
-
- bool bBackupOnSave;
-
- int backupOnSaveMaxCount;
-
-
-
-
- int autoBackupTime;
-
- int autoBackupMaxCount;
-
- bool autoBackupEnabled;
-
- int autoRemindTime;
-
-
- bool bPreviewGeometryWindow;
- int showErrorDialogOnLoad;
-
- int keepEditorActive;
-
- SSnapSettings snap;
-
- bool enableSourceControl = false;
- bool clearConsoleOnGameModeStart;
-
- QString textEditorForScript;
- QString textEditorForShaders;
- QString textEditorForBspaces;
-
- QString textureEditor;
- QString animEditor;
-
-
- QStringList searchPaths[10];
-
- QString strStandardTempDirectory;
- SGUI_Settings gui;
-
- STextureBrowserSettings sTextureBrowserSettings;
-
- SExperimentalFeaturesSettings sExperimentalFeaturesSettings;
-
- SAssetBrowserSettings sAssetBrowserSettings;
- SSelectObjectDialogSettings selectObjectDialog;
- AzToolsFramework::ConsoleColorTheme consoleBackgroundColorTheme;
- bool bShowTimeInConsole;
-
- bool enableSceneInspector;
-
- SDeepSelectionSettings deepSelectionSettings;
-
- SObjectColors objectColorSettings;
- AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
- SSmartOpenDialogSettings smartOpenSettings;
- bool bSettingsManagerMode;
- bool bNavigationContinuousUpdate;
- bool bNavigationShowAreas;
- bool bNavigationDebugDisplay;
- bool bVisualizeNavigationAccessibility;
- int navigationDebugAgentType;
- int backgroundUpdatePeriod;
- const char* g_TemporaryLevelName;
- SLevelSaveSettings levelSaveSettings;
-
- struct SSliceSettings
- {
- bool dynamicByDefault;
- };
- SSliceSettings sliceSettings;
- bool prefabSystem = true;
- private:
- void SaveValue(const char* sSection, const char* sKey, int value);
- void SaveValue(const char* sSection, const char* sKey, const QColor& value);
- void SaveValue(const char* sSection, const char* sKey, float value);
- void SaveValue(const char* sSection, const char* sKey, const QString& value);
- void LoadValue(const char* sSection, const char* sKey, int& value);
- void LoadValue(const char* sSection, const char* sKey, QColor& value);
- void LoadValue(const char* sSection, const char* sKey, float& value);
- void LoadValue(const char* sSection, const char* sKey, bool& value);
- void LoadValue(const char* sSection, const char* sKey, QString& value);
- void SaveCloudSettings();
- };
- SANDBOX_API extern SEditorSettings gSettings;
- #endif
|