- class TreeItemDataIterator
- {
- public:
- typedef T Type;
- typedef TreeItemIterator InternalIterator;
-
- //iterator traits, required by STL
- typedef ptrdiff_t difference_type;
- typedef Type* value_type;
- typedef Type** pointer;
- typedef Type*& reference;
- typedef std::forward_iterator_tag iterator_category;
-
- TreeItemDataIterator() {}
- TreeItemDataIterator(const TreeItemDataIterator& other)
- : iterator(other.iterator) {AdvanceToValidIterator(); }
- explicit TreeItemDataIterator(const InternalIterator& iterator)
- : iterator(iterator) {AdvanceToValidIterator(); }
-
- Type* operator*() {return reinterpret_cast(iterator.pCtrl->GetItemData(iterator.hItem)); }
- bool operator==(const TreeItemDataIterator& other) const {return iterator == other.iterator; }
- bool operator!=(const TreeItemDataIterator& other) const {return iterator != other.iterator; }
-
- HTREEITEM GetTreeItem() {return iterator.hItem; }
-
- TreeItemDataIterator& operator++()
- {
- ++iterator;
- AdvanceToValidIterator();
- return *this;
- }
-
- TreeItemDataIterator operator++(int) {TreeItemDataIterator old = *this; ++(*this); return old; }
-
- private:
- void AdvanceToValidIterator()
- {
- while (iterator.pCtrl && iterator.hItem && !iterator.pCtrl->GetItemData(iterator.hItem))
- {
- ++iterator;
- }
- }
-
- InternalIterator iterator;
- };
-
- template
- class RecursiveItemDataIteratorType
- {
- public: typedef TreeItemDataIterator type;
- };
- template
- inline TreeItemDataIterator BeginTreeItemDataRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0)
- {
- return TreeItemDataIterator(BeginTreeItemsRecursive(pCtrl, hItem));
- }
-
- template
- inline TreeItemDataIterator EndTreeItemDataRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0)
- {
- return TreeItemDataIterator(EndTreeItemsRecursive(pCtrl, hItem));
- }
-
- template
- class NonRecursiveItemDataIteratorType
- {
- typedef TreeItemDataIterator type;
- };
- template
- inline TreeItemDataIterator BeginTreeItemDataNonRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0)
- {
- return TreeItemDataIterator(BeginTreeItemsNonRecursive(pCtrl, hItem));
- }
-
- template
- inline TreeItemDataIterator EndTreeItemDataNonRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0)
- {
- return TreeItemDataIterator(EndTreeItemsNonRecursive(pCtrl, hItem));
- }
-
- class SelectedTreeItemIterator
- {
- public:
- SelectedTreeItemIterator()
- : pCtrl(0)
- , hItem(0) {}
- SelectedTreeItemIterator(const SelectedTreeItemIterator& other)
- : pCtrl(other.pCtrl)
- , hItem(other.hItem) {}
- SelectedTreeItemIterator(CXTTreeCtrl* pCtrl, HTREEITEM hItem)
- : pCtrl(pCtrl)
- , hItem(hItem) {}
-
- HTREEITEM operator*() {return hItem; }
- bool operator==(const SelectedTreeItemIterator& other) const {return pCtrl == other.pCtrl && hItem == other.hItem; }
- bool operator!=(const SelectedTreeItemIterator& other) const {return pCtrl != other.pCtrl || hItem != other.hItem; }
-
- SelectedTreeItemIterator& operator++()
- {
- hItem = (pCtrl ? pCtrl->GetNextSelectedItem(hItem) : 0);
-
- return *this;
- }
-
- SelectedTreeItemIterator operator++(int) {SelectedTreeItemIterator old = *this; ++(*this); return old; }
-
- CXTTreeCtrl* pCtrl;
- HTREEITEM hItem;
- };
-
- SelectedTreeItemIterator BeginSelectedTreeItems(CXTTreeCtrl* pCtrl)
- {
- return SelectedTreeItemIterator(pCtrl, (pCtrl ? pCtrl->GetFirstSelectedItem() : 0));
- }
-
- SelectedTreeItemIterator EndSelectedTreeItems(CXTTreeCtrl* pCtrl)
- {
- return SelectedTreeItemIterator(pCtrl, 0);
- }
-
- template
- class SelectedTreeItemDataIterator
- {
- public:
- typedef T Type;
- typedef SelectedTreeItemIterator InternalIterator;
-
- SelectedTreeItemDataIterator() {}
- SelectedTreeItemDataIterator(const SelectedTreeItemDataIterator& other)
- : iterator(other.iterator) {AdvanceToValidIterator(); }
- explicit SelectedTreeItemDataIterator(const InternalIterator& iterator)
- : iterator(iterator) {AdvanceToValidIterator(); }
-
- Type* operator*() {return reinterpret_cast(iterator.pCtrl->GetItemData(iterator.hItem)); }
- bool operator==(const SelectedTreeItemDataIterator& other) const {return iterator == other.iterator; }
- bool operator!=(const SelectedTreeItemDataIterator& other) const {return iterator != other.iterator; }
-
- HTREEITEM GetTreeItem() {return iterator.hItem; }
-
- SelectedTreeItemDataIterator& operator++()
- {
- ++iterator;
- AdvanceToValidIterator();
- return *this;
- }
-
- SelectedTreeItemDataIterator operator++(int) {SelectedTreeItemDataIterator old = *this; ++(*this); return old; }
-
- private:
- void AdvanceToValidIterator()
- {
- while (iterator.pCtrl && iterator.hItem && !iterator.pCtrl->GetItemData(iterator.hItem))
- {
- ++iterator;
- }
- }
-
- InternalIterator iterator;
- };
-
- template
- SelectedTreeItemDataIterator BeginSelectedTreeItemData(CXTTreeCtrl* pCtrl)
- {
- return SelectedTreeItemDataIterator(BeginSelectedTreeItems(pCtrl));
- }
-
- template
- SelectedTreeItemDataIterator EndSelectedTreeItemData(CXTTreeCtrl* pCtrl)
- {
- return SelectedTreeItemDataIterator(EndSelectedTreeItems(pCtrl));
- }
-}
-
-#endif // CRYINCLUDE_EDITOR_CONTROLS_TREECTRLUTILS_H
diff --git a/Code/Editor/Core/LevelEditorMenuHandler.cpp b/Code/Editor/Core/LevelEditorMenuHandler.cpp
index a90b0a597a..05f06c87aa 100644
--- a/Code/Editor/Core/LevelEditorMenuHandler.cpp
+++ b/Code/Editor/Core/LevelEditorMenuHandler.cpp
@@ -104,6 +104,11 @@ namespace
}
}
+ // Currently (December 13, 2021), this function is only used by slice editor code.
+ // When the slice editor is not enabled, there are no references to the
+ // HideActionWhileEntitiesDeselected function, causing a compiler warning and
+ // subsequently a build error.
+#ifdef ENABLE_SLICE_EDITOR
void HideActionWhileEntitiesDeselected(QAction* action, EEditorNotifyEvent editorNotifyEvent)
{
if (action == nullptr)
@@ -127,6 +132,7 @@ namespace
break;
}
}
+#endif
void DisableActionWhileInSimMode(QAction* action, EEditorNotifyEvent editorNotifyEvent)
{
@@ -374,7 +380,6 @@ QMenu* LevelEditorMenuHandler::CreateFileMenu()
{
DisableActionWhileLevelChanges(fileOpenSlice, e);
}));
-#endif
// Save Selected Slice
auto saveSelectedSlice = fileMenu.AddAction(ID_FILE_SAVE_SELECTED_SLICE);
@@ -391,7 +396,7 @@ QMenu* LevelEditorMenuHandler::CreateFileMenu()
{
HideActionWhileEntitiesDeselected(saveSliceToRoot, e);
}));
-
+#endif
// Open Recent
m_mostRecentLevelsMenu = fileMenu.AddMenu(tr("Open Recent"));
connect(m_mostRecentLevelsMenu, &QMenu::aboutToShow, this, &LevelEditorMenuHandler::UpdateMRUFiles);
@@ -439,9 +444,10 @@ QMenu* LevelEditorMenuHandler::CreateFileMenu()
// Show Log File
fileMenu.AddAction(ID_FILE_EDITLOGFILE);
+#ifdef ENABLE_SLICE_EDITOR
fileMenu.AddSeparator();
-
fileMenu.AddAction(ID_FILE_RESAVESLICES);
+#endif
fileMenu.AddSeparator();
diff --git a/Code/Editor/CrtDebug.cpp b/Code/Editor/CrtDebug.cpp
deleted file mode 100644
index f9335373da..0000000000
--- a/Code/Editor/CrtDebug.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * 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
- *
- */
-
-
-#include "EditorDefs.h"
-
-
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-
-//#ifdef _CRTDBG_MAP_ALLOC
-#ifdef CRTDBG_MAP_ALLOC
-#pragma pack (push,1)
-#define nNoMansLandSize 4
-typedef struct MyCrtMemBlockHeader
-{
- struct MyCrtMemBlockHeader* pBlockHeaderNext;
- struct MyCrtMemBlockHeader* pBlockHeaderPrev;
- char* szFileName;
- int nLine;
- size_t nDataSize;
- int nBlockUse;
- long lRequest;
- unsigned char gap[nNoMansLandSize];
- /* followed by:
- * unsigned char data[nDataSize];
- * unsigned char anotherGap[nNoMansLandSize];
- */
-} MyCrtMemBlockHeader;
-#pragma pack (pop)
-
-#define pbData(pblock) ((unsigned char*)((MyCrtMemBlockHeader*)pblock + 1))
-#define pHdr(pbData) (((MyCrtMemBlockHeader*)pbData) - 1)
-
-
-void crtdebug(const char* s, ...)
-{
- char str[32768];
- va_list arg_ptr;
- va_start(arg_ptr, s);
- vsprintf(str, s, arg_ptr);
- va_end(arg_ptr);
-
- FILE* l = nullptr;
- azfopen(&l, "crtdump.txt", "a+t");
- if (l)
- {
- fprintf(l, "%s", str);
- fclose(l);
- }
-}
-
-int crtAllocHook(int nAllocType, void* pvData,
- size_t nSize, int nBlockUse, long lRequest,
- const unsigned char* szFileName, int nLine)
-{
- if (nBlockUse == _CRT_BLOCK)
- {
- return TRUE;
- }
-
- static int total_cnt = 0;
- static int total_mem = 0;
- if (nAllocType == _HOOK_ALLOC)
- {
- //total_mem += nSize;
- //total_cnt++;
- //_CrtMemState mem_state;
- //_CrtMemCheckpoint( &mem_state );
- //total_cnt = mem_state.lCounts[_NORMAL_BLOCK];
- //total_mem = mem_state.lTotalCount;
- if ((total_cnt & 0xF) == 0)
- {
- //_CrtCheckMemory();
- }
-
- total_cnt++;
- total_mem += nSize;
-
- //crtdebug( " Alloc %d,size=%d,in: %s %d (total size=%d,num=%d)\n",lRequest,nSize,szFileName,nLine,total_mem,total_cnt );
- crtdebug("Size=%d, [Total=%d,N=%d] [%s:%d]\n", nSize, total_mem, total_cnt, szFileName, nLine);
- }
- else if (nAllocType == _HOOK_FREE)
- {
- MyCrtMemBlockHeader* pHead;
- pHead = pHdr(pvData);
-
- total_cnt--;
- total_mem -= pHead->nDataSize;
-
- crtdebug("Size=%d, [Total=%d,N=%d] [%s:%d]\n", pHead->nDataSize, total_mem, total_cnt, pHead->szFileName, pHead->nLine);
- //crtdebug( " Free size=%d,in: %s %d (total size=%d,num=%d)\n",pHead->nDataSize,pHead->szFileName,pHead->nLine,total_mem,total_cnt );
- //total_mem -= nSize;
- //total_cnt--;
- }
- return TRUE;
-}
-
-int crtReportHook(int nRptType, char* szMsg, int* retVal)
-{
- static int gl_num_asserts = 0;
- if (gl_num_asserts != 0)
- {
- return TRUE;
- }
- gl_num_asserts++;
- switch (nRptType)
- {
- case _CRT_WARN:
- crtdebug(" %s\n", szMsg);
- break;
- case _CRT_ERROR:
- crtdebug(" %s\n", szMsg);
- break;
- case _CRT_ASSERT:
- crtdebug(" %s\n", szMsg);
- break;
- }
- gl_num_asserts--;
- return TRUE;
-}
-
-void InitCrt()
-{
- FILE* l = nullptr;
- azfopen(&l, "crtdump.txt", "w");
- if (l)
- {
- fclose(l);
- }
-
- //_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_DEBUG );
- //_CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_DEBUG );
- //_CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_DEBUG );
-
- _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_WNDW);
- _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_WNDW);
- _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_WNDW);
-
- //_CrtSetDbgFlag( _CRTDBG_CHECK_ALWAYS_DF|_CRTDBG_CHECK_CRT_DF|_CRTDBG_LEAK_CHECK_DF|_CRTDBG_DELAY_FREE_MEM_DF | _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) );
- //_CrtSetDbgFlag( _CRTDBG_CHECK_CRT_DF|_CRTDBG_LEAK_CHECK_DF/*|_CRTDBG_DELAY_FREE_MEM_DF*/ | _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) );
- int flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
- flags &= ~_CRTDBG_DELAY_FREE_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_CRT_DF;
-
- _CrtSetDbgFlag(flags);
-
- _CrtSetAllocHook (crtAllocHook);
- _CrtSetReportHook(crtReportHook);
-}
-
-void DoneCrt()
-{
- //_CrtCheckMemory();
- //_CrtDumpMemoryLeaks();
-}
-
-// Autoinit CRT.
-//struct __autoinit_crt { __autoinit_crt() { InitCrt(); }; ~__autoinit_crt() { DoneCrt(); } } __autoinit_crt_var;
-#endif
-
-
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp
index 4415308730..982f8ba411 100644
--- a/Code/Editor/CryEdit.cpp
+++ b/Code/Editor/CryEdit.cpp
@@ -36,14 +36,6 @@ AZ_POP_DISABLE_WARNING
#include
#include
-// Aws Native SDK
-#include
-#include
-#include
-#include
-#include
-#include
-
// AzCore
#include
#include
@@ -124,9 +116,6 @@ AZ_POP_DISABLE_WARNING
#include "ScopedVariableSetter.h"
#include "Util/3DConnexionDriver.h"
-
-#include "DimensionsDialog.h"
-
#include "Util/AutoDirectoryRestoreFileDialog.h"
#include "Util/EditorAutoLevelLoadTest.h"
#include "AboutDialog.h"
@@ -147,9 +136,7 @@ AZ_POP_DISABLE_WARNING
#include "Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.h"
-// AWSNativeSDK
#include
-#include
#if defined(AZ_PLATFORM_WINDOWS)
@@ -380,13 +367,13 @@ void CCryEditApp::RegisterActionHandlers()
ON_COMMAND(ID_IMPORT_ASSET, OnOpenAssetImporter)
ON_COMMAND(ID_EDIT_LEVELDATA, OnEditLevelData)
ON_COMMAND(ID_FILE_EDITLOGFILE, OnFileEditLogFile)
- ON_COMMAND(ID_FILE_RESAVESLICES, OnFileResaveSlices)
ON_COMMAND(ID_FILE_EDITEDITORINI, OnFileEditEditorini)
ON_COMMAND(ID_PREFERENCES, OnPreferences)
ON_COMMAND(ID_REDO, OnRedo)
ON_COMMAND(ID_TOOLBAR_WIDGET_REDO, OnRedo)
ON_COMMAND(ID_FILE_OPEN_LEVEL, OnOpenLevel)
#ifdef ENABLE_SLICE_EDITOR
+ ON_COMMAND(ID_FILE_RESAVESLICES, OnFileResaveSlices)
ON_COMMAND(ID_FILE_NEW_SLICE, OnCreateSlice)
ON_COMMAND(ID_FILE_OPEN_SLICE, OnOpenSlice)
#endif
@@ -1352,8 +1339,27 @@ void CCryEditApp::CompileCriticalAssets() const
}
}
assetsInQueueNotifcation.BusDisconnect();
- CCryEditApp::OutputStartupMessage(QString("Asset Processor is now ready."));
+ // Signal the "CriticalAssetsCompiled" lifecycle event
+ // Also reload the "assetcatalog.xml" if it exists
+ if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
+ {
+ AZ::ComponentApplicationLifecycle::SignalEvent(*settingsRegistry, "CriticalAssetsCompiled", R"({})");
+ // Reload the assetcatalog.xml at this point again
+ // Start Monitoring Asset changes over the network and load the AssetCatalog
+ auto LoadCatalog = [settingsRegistry](AZ::Data::AssetCatalogRequests* assetCatalogRequests)
+ {
+ if (AZ::IO::FixedMaxPath assetCatalogPath;
+ settingsRegistry->Get(assetCatalogPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_CacheRootFolder))
+ {
+ assetCatalogPath /= "assetcatalog.xml";
+ assetCatalogRequests->LoadCatalog(assetCatalogPath.c_str());
+ }
+ };
+ AZ::Data::AssetCatalogRequestBus::Broadcast(AZStd::move(LoadCatalog));
+ }
+
+ CCryEditApp::OutputStartupMessage(QString("Asset Processor is now ready."));
}
bool CCryEditApp::ConnectToAssetProcessor() const
@@ -1669,7 +1675,7 @@ bool CCryEditApp::InitInstance()
return false;
}
- if (AZ::SettingsRegistryInterface* settingsRegistry = AZ::SettingsRegistry::Get())
+ if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
{
AZ::ComponentApplicationLifecycle::SignalEvent(*settingsRegistry, "LegacySystemInterfaceCreated", R"({})");
}
@@ -1703,7 +1709,6 @@ bool CCryEditApp::InitInstance()
mainWindow->Initialize();
GetIEditor()->GetCommandManager()->RegisterAutoCommands();
- GetIEditor()->AddUIEnums();
mainWindowWrapper->enableSaveRestoreGeometry("O3DE", "O3DE", "mainWindowGeometry");
m_pDocManager->OnFileNew();
@@ -1787,12 +1792,6 @@ bool CCryEditApp::InitInstance()
InitLevel(cmdInfo);
});
-#ifdef USE_WIP_FEATURES_MANAGER
- // load the WIP features file
- CWipFeatureManager::Instance()->EnableManager(!cmdInfo.m_bDeveloperMode);
- CWipFeatureManager::Init();
-#endif
-
if (!m_bConsoleMode && !m_bPreviewMode)
{
GetIEditor()->UpdateViews();
@@ -1820,10 +1819,7 @@ bool CCryEditApp::InitInstance()
if (GetIEditor()->GetCommandManager()->IsRegistered("editor.open_lnm_editor"))
{
CCommand0::SUIInfo uiInfo;
-#if !defined(NDEBUG)
- bool ok =
-#endif
- GetIEditor()->GetCommandManager()->GetUIInfo("editor.open_lnm_editor", uiInfo);
+ [[maybe_unused]] bool ok = GetIEditor()->GetCommandManager()->GetUIInfo("editor.open_lnm_editor", uiInfo);
assert(ok);
}
@@ -2115,21 +2111,12 @@ bool CCryEditApp::FixDanglingSharedMemory(const QString& sharedMemName) const
int CCryEditApp::ExitInstance(int exitCode)
{
- AZ_TracePrintf("Exit", "Called ExitInstance() with exit code: 0x%x", exitCode);
-
if (m_pEditor)
{
m_pEditor->OnBeginShutdownSequence();
}
qobject_cast(qApp)->UnloadSettings();
- #ifdef USE_WIP_FEATURES_MANAGER
- //
- // close wip features manager
- //
- CWipFeatureManager::Shutdown();
- #endif
-
if (IsInRegularEditorMode())
{
if (GetIEditor())
@@ -2629,6 +2616,7 @@ void CCryEditApp::OnFileEditLogFile()
CFileUtil::EditTextFile(CLogFile::GetLogFileName(), 0, IFileUtil::FILE_TYPE_SCRIPT);
}
+#ifdef ENABLE_SLICE_EDITOR
void CCryEditApp::OnFileResaveSlices()
{
AZStd::vector sliceAssetInfos;
@@ -2759,6 +2747,7 @@ void CCryEditApp::OnFileResaveSlices()
}
}
+#endif
//////////////////////////////////////////////////////////////////////////
void CCryEditApp::OnFileEditEditorini()
@@ -3358,6 +3347,10 @@ CCryEditDoc* CCryEditApp::OpenDocumentFile(const char* filename, bool addToMostR
return GetIEditor()->GetDocument();
}
+ bool usePrefabSystemForLevels = false;
+ AzFramework::ApplicationRequests::Bus::BroadcastResult(
+ usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled);
+
// If we are loading and we're in simulate mode, then switch it off before we do anything else
if (GetIEditor()->GetGameEngine() && GetIEditor()->GetGameEngine()->GetSimulationMode())
{
@@ -3365,6 +3358,15 @@ CCryEditDoc* CCryEditApp::OpenDocumentFile(const char* filename, bool addToMostR
bool bIsDocModified = GetIEditor()->GetDocument()->IsModified();
OnSwitchPhysics();
GetIEditor()->GetDocument()->SetModifiedFlag(bIsDocModified);
+
+ if (usePrefabSystemForLevels)
+ {
+ auto* rootSpawnableInterface = AzFramework::RootSpawnableInterface::Get();
+ if (rootSpawnableInterface)
+ {
+ rootSpawnableInterface->ProcessSpawnableQueue();
+ }
+ }
}
// We're about to start loading a level, so start recording errors to display at the end.
diff --git a/Code/Editor/CryEdit.h b/Code/Editor/CryEdit.h
index 97fcde8f34..48f362003c 100644
--- a/Code/Editor/CryEdit.h
+++ b/Code/Editor/CryEdit.h
@@ -14,7 +14,6 @@
#if !defined(Q_MOC_RUN)
#include
#include
-#include "WipFeatureManager.h"
#include "CryEditDoc.h"
#include "ViewPane.h"
diff --git a/Code/Editor/CryEditDoc.cpp b/Code/Editor/CryEditDoc.cpp
index 3bcba4d5e0..c7d719184d 100644
--- a/Code/Editor/CryEditDoc.cpp
+++ b/Code/Editor/CryEditDoc.cpp
@@ -45,7 +45,6 @@
#include "ActionManager.h"
#include "Include/IObjectManager.h"
#include "ErrorReportDialog.h"
-#include "SurfaceTypeValidator.h"
#include "Util/AutoLogTime.h"
#include "CheckOutDialog.h"
#include "GameExporter.h"
@@ -58,7 +57,6 @@
// LmbrCentral
#include
-#include // for LmbrCentral::EditorLightComponentRequestBus
static const char* kAutoBackupFolder = "_autobackup";
static const char* kHoldFolder = "$tmp_hold"; // conform to the ignored file types $tmp[0-9]*_ regex
@@ -99,8 +97,7 @@ namespace Internal
// CCryEditDoc construction/destruction
CCryEditDoc::CCryEditDoc()
- : doc_validate_surface_types(nullptr)
- , m_modifiedModuleFlags(eModifiedNothing)
+ : m_modifiedModuleFlags(eModifiedNothing)
{
////////////////////////////////////////////////////////////////////////
// Set member variables to initial values
@@ -120,7 +117,6 @@ CCryEditDoc::CCryEditDoc()
GetIEditor()->SetDocument(this);
CLogFile::WriteLine("Document created");
- RegisterConsoleVariables();
MainWindow::instance()->GetActionManager()->RegisterActionHandler(ID_FILE_SAVE_AS, this, &CCryEditDoc::OnFileSaveAs);
bool isPrefabSystemEnabled = false;
@@ -459,8 +455,6 @@ void CCryEditDoc::Load(TDocMultiArchive& arrXmlAr, const QString& szFilename)
}
}
- CSurfaceTypeValidator().Validate();
-
LogLoadTime(GetTickCount() - t0);
// Loaded with success, remove event from log file
GetIEditor()->GetSettingsManager()->UnregisterEvent(loadEvent);
@@ -1910,25 +1904,6 @@ void CCryEditDoc::SetDocumentReady(bool bReady)
m_bDocumentReady = bReady;
}
-void CCryEditDoc::RegisterConsoleVariables()
-{
- doc_validate_surface_types = gEnv->pConsole->GetCVar("doc_validate_surface_types");
-
- if (!doc_validate_surface_types)
- {
- doc_validate_surface_types = REGISTER_INT_CB("doc_validate_surface_types", 0, 0,
- "Flag indicating whether icons are displayed on the animation graph.\n"
- "Default is 1.\n",
- OnValidateSurfaceTypesChanged);
- }
-}
-
-void CCryEditDoc::OnValidateSurfaceTypesChanged(ICVar*)
-{
- CErrorsRecorder errorsRecorder(GetIEditor());
- CSurfaceTypeValidator().Validate();
-}
-
void CCryEditDoc::OnStartLevelResourceList()
{
// after loading another level we clear the RFOM_Level list, the first time the list should be empty
@@ -2154,52 +2129,13 @@ void CCryEditDoc::ReleaseXmlArchiveArray(TDocMultiArchive& arrXmlAr)
//////////////////////////////////////////////////////////////////////////
// AzToolsFramework::EditorEntityContextNotificationBus interface implementation
-void CCryEditDoc::OnSliceInstantiated(const AZ::Data::AssetId& sliceAssetId, AZ::SliceComponent::SliceInstanceAddress& sliceAddress, const AzFramework::SliceInstantiationTicket& /*ticket*/)
+void CCryEditDoc::OnSliceInstantiated([[maybe_unused]] const AZ::Data::AssetId& sliceAssetId, [[maybe_unused]] AZ::SliceComponent::SliceInstanceAddress& sliceAddress, [[maybe_unused]] const AzFramework::SliceInstantiationTicket& ticket)
{
- if (m_envProbeSliceAssetId == sliceAssetId)
- {
- const AZ::SliceComponent::EntityList& entities = sliceAddress.GetInstance()->GetInstantiated()->m_entities;
- const AZ::Uuid editorEnvProbeComponentId("{8DBD6035-583E-409F-AFD9-F36829A0655D}");
- AzToolsFramework::EntityIdList entityIds;
- entityIds.reserve(entities.size());
- for (const AZ::Entity* entity : entities)
- {
- if (entity->FindComponent(editorEnvProbeComponentId))
- {
- // Update Probe Area size to cover the whole terrain
- LmbrCentral::EditorLightComponentRequestBus::Event(entity->GetId(), &LmbrCentral::EditorLightComponentRequests::SetProbeAreaDimensions, AZ::Vector3(m_terrainSize, m_terrainSize, m_envProbeHeight));
-
- // Force update the light to apply cubemap
- LmbrCentral::EditorLightComponentRequestBus::Event(entity->GetId(), &LmbrCentral::EditorLightComponentRequests::RefreshLight);
- }
- entityIds.push_back(entity->GetId());
- }
-
- //Detach instantiated env probe entities from engine slice
- AzToolsFramework::SliceEditorEntityOwnershipServiceRequestBus::Broadcast(
- &AzToolsFramework::SliceEditorEntityOwnershipServiceRequests::DetachSliceEntities, entityIds);
-
- sliceAddress.SetInstance(nullptr);
- sliceAddress.SetReference(nullptr);
- SetModifiedFlag(true);
- SetModifiedModules(eModifiedEntities);
-
- AzToolsFramework::SliceEditorEntityOwnershipServiceNotificationBus::Handler::BusDisconnect();
-
- //save after level default slice fully instantiated
- Save();
- }
GetIEditor()->ResumeUndo();
}
-
-void CCryEditDoc::OnSliceInstantiationFailed(const AZ::Data::AssetId& sliceAssetId, const AzFramework::SliceInstantiationTicket& /*ticket*/)
+void CCryEditDoc::OnSliceInstantiationFailed([[maybe_unused]] const AZ::Data::AssetId& sliceAssetId, [[maybe_unused]] const AzFramework::SliceInstantiationTicket& ticket)
{
- if (m_envProbeSliceAssetId == sliceAssetId)
- {
- AzToolsFramework::SliceEditorEntityOwnershipServiceNotificationBus::Handler::BusDisconnect();
- AZ_Warning("Editor", false, "Failed to instantiate default environment probe slice.");
- }
GetIEditor()->ResumeUndo();
}
//////////////////////////////////////////////////////////////////////////
diff --git a/Code/Editor/CryEditDoc.h b/Code/Editor/CryEditDoc.h
index f7e97d308e..3874914396 100644
--- a/Code/Editor/CryEditDoc.h
+++ b/Code/Editor/CryEditDoc.h
@@ -176,9 +176,7 @@ protected:
virtual void OnFileSaveAs();
//! called immediately after saving the level.
void AfterSave();
- void RegisterConsoleVariables();
void OnStartLevelResourceList();
- static void OnValidateSurfaceTypesChanged(ICVar*);
QString GetCryIndexPath(const char* levelFilePath) const;
@@ -194,7 +192,6 @@ protected:
XmlNodeRef m_environmentTemplate;
std::list m_listeners;
bool m_bDocumentReady = false;
- ICVar* doc_validate_surface_types = nullptr;
int m_modifiedModuleFlags;
// On construction, it assumes loaded levels have already been exported. Can be a big fat lie, though.
// The right way would require us to save to the level folder the export status of the level.
@@ -203,7 +200,6 @@ protected:
QString m_pathName;
QString m_slicePathName;
QString m_title;
- AZ::Data::AssetId m_envProbeSliceAssetId;
float m_terrainSize;
const char* m_envProbeSliceRelativePath = "EngineAssets/Slices/DefaultLevelSetup.slice";
const float m_envProbeHeight = 200.0f;
diff --git a/Code/Editor/CryEditLiveCreate.rc b/Code/Editor/CryEditLiveCreate.rc
deleted file mode 100644
index 3dac96d682..0000000000
--- a/Code/Editor/CryEditLiveCreate.rc
+++ /dev/null
@@ -1,213 +0,0 @@
-ÿþ// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "winres.h"
-#include "resource.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (United States) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-2 TEXTINCLUDE
-BEGIN
- "#include ""winres.h""\r\n"
- "#include ""resource.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\n"
- "\0"
-END
-
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDR_MENU_LIVECREATE MENU
-BEGIN
- POPUP "&File"
- BEGIN
- MENUITEM "Save settings", ID_FILE_SAVESETTINGS
- MENUITEM "Close", ID_FILE_CLOSE_LIVECREATE_VIEW
- END
- POPUP "&View"
- BEGIN
- MENUITEM "LiveCreate Logger", ID_VIEW_LIVECREATELOGGER, CHECKED
- MENUITEM "LiveCreate Profile Editor", ID_VIEW_LIVECREATEPROFILEEDITOR, CHECKED
- MENUITEM "LiveCreate File Sync Settings", ID_VIEW_LIVECREATEFILESYNCSETTINGS, CHECKED
- END
-END
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_LIVECREATE_PICKER DIALOGEX 0, 0, 316, 259
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Select game build directory"
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
- DEFPUSHBUTTON "OK",IDOK,200,238,50,14
- PUSHBUTTON "Cancel",IDCANCEL,259,238,50,14
- CONTROL "",IDC_DIRECTORY_TREE,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,7,7,302,227
-END
-
-IDD_LIVECREATE_ADD_TARGETS DIALOGEX 0, 0, 500, 400
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Discover LiveCreate targets"
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
- PUSHBUTTON "Refresh",IDC_REFRESH,8,8,70,18
- PUSHBUTTON "Add custom...",IDC_BUTTON_ADD_PEER,82,8,70,18
- CONTROL "Use wider search (broadcast)",IDC_CHECK_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,233,12,200,10
- CONTROL "",IDC_LIST_PEERS,"XTPReport",WS_TABSTOP,8,32,484,342,WS_EX_STATICEDGE
- DEFPUSHBUTTON "Use selected",IDOK,180,379,70,18
- PUSHBUTTON "Cancel",IDCANCEL,259,379,70,18
- PUSHBUTTON "Add by IP...",IDC_BUTTON_ADD_MATERIAL,157,8,70,18
-END
-
-IDD_LIVECREATE_PEER_LIST DIALOGEX 0, 0, 395, 213
-STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_SYSMENU
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
- LTEXT "Peers:",IDC_STATIC,17,27,22,8
- PUSHBUTTON "Add...",IDC_BUTTON_ADD_PEER,56,24,56,16
- PUSHBUTTON "Edit...",IDC_BUTTON_EDIT_PEER,116,24,56,16
- PUSHBUTTON "Remove",IDC_BUTTON_DELETE_PEER,176,24,52,16
- DEFPUSHBUTTON "Start All",IDC_BUTTON_START_ALL,4,4,48,16
- PUSHBUTTON "Reset All",IDC_BUTTON_RESET_ALL,176,4,52,16
- PUSHBUTTON "Force Sync All",IDC_BUTTON_FORCE_SYNC_ALL,56,4,56,16
- PUSHBUTTON "Clean All",IDC_BUTTON_CLEAN_ALL,232,4,52,16
- PUSHBUTTON "Screenshot All",IDC_BUTTON_SCREENSHOT_ALL,116,4,56,16
- CONTROL "",IDC_LIST_PEERS,"XTPReport",WS_TABSTOP,4,44,386,164,WS_EX_STATICEDGE
- CHECKBOX "LiveCreate",IDC_BUTTON_ENABLE_LIVECREATE,288,4,52,36,BS_PUSHLIKE | BS_MULTILINE
- CHECKBOX "Sync\nCamera",IDC_BUTTON_CAMERA_SYNC,345,4,52,36,BS_PUSHLIKE | BS_MULTILINE
- PUSHBUTTON "Discover",IDC_BUTTON_DISCOVER_PEERS,232,24,52,16
-END
-
-IDD_IDD_LIVECREATE_SETTINGS_PANEL DIALOGEX 0, 0, 156, 204
-STYLE DS_SETFONT | WS_CHILD
-FONT 8, "MS Shell Dlg 2", 400, 0, 0x1
-BEGIN
- PUSHBUTTON "Add targets...",IDC_BUTTON_DISCOVER_PEERS,4,4,80,16
-END
-
-IDD_LIVECREATE_EDIT_CONNECTION DIALOGEX 0, 0, 288, 183
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "LiveCreate host settings"
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
- DEFPUSHBUTTON "OK",IDOK,158,154,58,20
- PUSHBUTTON "Cancel",IDCANCEL,221,154,58,20
- LTEXT "Name:",IDC_STATIC,16,46,22,8
- EDITTEXT IDC_EDIT_TARGET_NAME,44,44,100,14,ES_AUTOHSCROLL
- LTEXT "IP:",IDC_STATIC,152,46,10,8
- CONTROL "",IDC_TARGET_IPADDRESS,"SysIPAddress32",WS_TABSTOP,168,44,100,15
- LTEXT "Platform:",IDC_STATIC,8,26,30,8
- LTEXT "Build path (automatic):",IDC_STATIC,19,120,74,8
- PUSHBUTTON "Test IP",IDC_BUTTON_TEST_CONNECTION,168,60,100,16
- COMBOBOX IDC_COMBO_PLATFORM,44,24,100,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- PUSHBUTTON "Resovle name to IP",IDC_BUTTON_REFRESH_IP,44,60,100,16
- CONTROL "Enable this peer",IDC_CHECK_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,8,67,10
- GROUPBOX "Build settings",IDC_STATIC,7,80,272,71
- LTEXT "Build executable:",IDC_STATIC,19,92,56,8
- PUSHBUTTON "...",IDC_BUTTON_PICK_GAME_DIRECTORY,249,104,22,14
- EDITTEXT IDC_EDIT_BUILD_ROOT_PATH,20,104,226,14,ES_AUTOHSCROLL
- EDITTEXT IDC_EDIT_BUILD_EXECUTABLE,20,131,249,14,ES_AUTOHSCROLL
-END
-
-IDD_LIVECREATE_TASK_WAIT DIALOGEX 0, 0, 238, 41
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Dialog"
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
- PUSHBUTTON "Cancel",IDCANCEL,94,20,50,14
- LTEXT "Static",IDC_TASK_PROGRESS_TEXT,7,7,224,8
-END
-
-IDD_LIVECREATE_ADD_BY_IP DIALOGEX 0, 0, 137, 75
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Add LiveCreate by IP"
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
- DEFPUSHBUTTON "OK",IDOK,7,48,58,20
- PUSHBUTTON "Cancel",IDCANCEL,71,48,58,20
- LTEXT "IP:",-1,9,12,10,8
- EDITTEXT IDC_TARGET_IPADDRESS,25,10,100,15,WS_TABSTOP
- PUSHBUTTON "Test IP",IDC_BUTTON_TEST_CONNECTION,25,27,100,16
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_LIVECREATE_ADD_TARGETS, DIALOG
- BEGIN
- END
-
- IDD_LIVECREATE_EDIT_CONNECTION, DIALOG
- BEGIN
- END
-
- IDD_LIVECREATE_TASK_WAIT, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 231
- TOPMARGIN, 7
- BOTTOMMARGIN, 34
- END
-
- IDD_LIVECREATE_ADD_BY_IP, DIALOG
- BEGIN
- END
-END
-#endif // APSTUDIO_INVOKED
-
-#endif // English (United States) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
\ No newline at end of file
diff --git a/Code/Editor/CryEditPy.cpp b/Code/Editor/CryEditPy.cpp
index a25a497a4e..5dea57c1ed 100644
--- a/Code/Editor/CryEditPy.cpp
+++ b/Code/Editor/CryEditPy.cpp
@@ -26,7 +26,6 @@
#include "Core/QtEditorApplication.h"
#include "CheckOutDialog.h"
#include "GameEngine.h"
-#include "UndoConfigSpec.h"
#include "ViewManager.h"
#include "EditorViewportCamera.h"
@@ -369,21 +368,6 @@ namespace
inline namespace Commands
{
- void PySetConfigSpec(int spec, int platform)
- {
- CUndo undo("Set Config Spec");
- if (CUndo::IsRecording())
- {
- CUndo::Record(new CUndoConficSpec());
- }
- GetIEditor()->SetEditorConfigSpec((ESystemConfigSpec)spec, (ESystemConfigPlatform)platform);
- }
-
- int PyGetConfigSpec()
- {
- return static_cast(GetIEditor()->GetEditorConfigSpec());
- }
-
int PyGetConfigPlatform()
{
return static_cast(GetIEditor()->GetEditorConfigPlatform());
@@ -434,9 +418,7 @@ namespace AzToolsFramework
addLegacyGeneral(behaviorContext->Method("set_current_view_rotation", PySetCurrentViewRotation, nullptr, "Sets the rotation of the current view as given x, y, z Euler angles in degrees."));
addLegacyGeneral(behaviorContext->Method("export_to_engine", CCryEditApp::Command_ExportToEngine, nullptr, "Exports the current level to the engine."));
- addLegacyGeneral(behaviorContext->Method("set_config_spec", PySetConfigSpec, nullptr, "Sets the system config spec and platform."));
addLegacyGeneral(behaviorContext->Method("get_config_platform", PyGetConfigPlatform, nullptr, "Gets the system config platform."));
- addLegacyGeneral(behaviorContext->Method("get_config_spec", PyGetConfigSpec, nullptr, "Gets the system config spec."));
addLegacyGeneral(behaviorContext->Method("set_result_to_success", PySetResultToSuccess, nullptr, "Sets the result of a script execution to success. Used only for Sandbox AutoTests."));
addLegacyGeneral(behaviorContext->Method("set_result_to_failure", PySetResultToFailure, nullptr, "Sets the result of a script execution to failure. Used only for Sandbox AutoTests."));
@@ -464,17 +446,6 @@ namespace AzToolsFramework
};
addCheckoutDialog(behaviorContext->Method("enable_for_all", PyCheckOutDialogEnableForAll, nullptr, "Enables the 'Apply to all' button in the checkout dialog; useful for allowing the user to apply a decision to check out files to multiple, related operations."));
- behaviorContext->EnumProperty("SystemConfigSpec_Auto")
- ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation);
- behaviorContext->EnumProperty("SystemConfigSpec_Low")
- ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation);
- behaviorContext->EnumProperty("SystemConfigSpec_Medium")
- ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation);
- behaviorContext->EnumProperty("SystemConfigSpec_High")
- ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation);
- behaviorContext->EnumProperty("SystemConfigSpec_VeryHigh")
- ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation);
-
behaviorContext->EnumProperty("SystemConfigPlatform_InvalidPlatform")
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation);
behaviorContext->EnumProperty("SystemConfigPlatform_Pc")
diff --git a/Code/Editor/DimensionsDialog.cpp b/Code/Editor/DimensionsDialog.cpp
deleted file mode 100644
index 6c8e6a616b..0000000000
--- a/Code/Editor/DimensionsDialog.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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
- *
- */
-
-
-#include "EditorDefs.h"
-
-#include "DimensionsDialog.h"
-
-// Qt
-#include
-
-AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
-#include
-AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-CDimensionsDialog::CDimensionsDialog(QWidget* pParent /*=nullptr*/)
- : QDialog(pParent)
- , m_group(new QButtonGroup(this))
- , ui(new Ui::CDimensionsDialog)
-{
- ui->setupUi(this);
-
- setWindowTitle(tr("Generate Terrain Texture"));
-
- m_group->addButton(ui->Dim512, 512);
- m_group->addButton(ui->Dim1024, 1024);
- m_group->addButton(ui->Dim2048, 2048);
- m_group->addButton(ui->Dim4096, 4096);
- m_group->addButton(ui->Dim8192, 8192);
- m_group->addButton(ui->Dim16384, 16384);
-}
-
-
-//////////////////////////////////////////////////////////////////////////
-CDimensionsDialog::~CDimensionsDialog()
-{
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CDimensionsDialog::SetDimensions(unsigned int iWidth)
-{
- ////////////////////////////////////////////////////////////////////////
- // Select a dimension option button in the dialog
- ////////////////////////////////////////////////////////////////////////
-
- QAbstractButton* button = m_group->button(iWidth);
- assert(button);
-
- button->setChecked(true);
-}
-
-UINT CDimensionsDialog::GetDimensions()
-{
- ////////////////////////////////////////////////////////////////////////
- // Get the currently selected dimension option button in the dialog
- ////////////////////////////////////////////////////////////////////////
-
- assert(m_group->checkedId() != -1);
-
- return m_group->checkedId();
-}
-
-#include
diff --git a/Code/Editor/DimensionsDialog.h b/Code/Editor/DimensionsDialog.h
deleted file mode 100644
index b94c58bf95..0000000000
--- a/Code/Editor/DimensionsDialog.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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
-#ifndef CRYINCLUDE_EDITOR_DIMENSIONSDIALOG_H
-#define CRYINCLUDE_EDITOR_DIMENSIONSDIALOG_H
-
-#if !defined(Q_MOC_RUN)
-#include
-
-#include
-#endif
-
-class QButtonGroup;
-
-namespace Ui {
- class CDimensionsDialog;
-}
-
-class CDimensionsDialog
- : public QDialog
-{
- Q_OBJECT
-
-public:
- CDimensionsDialog(QWidget* pParent = nullptr); // standard constructor
- ~CDimensionsDialog();
-
- UINT GetDimensions();
- void SetDimensions(unsigned int iWidth);
-
-protected:
- void UpdateData(bool fromUi = true); // DDX/DDV support
-
-private:
- QButtonGroup* m_group;
-
- QScopedPointer ui;
-};
-
-#endif // CRYINCLUDE_EDITOR_DIMENSIONSDIALOG_H
diff --git a/Code/Editor/DimensionsDialog.ui b/Code/Editor/DimensionsDialog.ui
deleted file mode 100644
index 316a060c92..0000000000
--- a/Code/Editor/DimensionsDialog.ui
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
- CDimensionsDialog
-
-
-
- 0
- 0
- 465
- 237
-
-
-
- Qt::StrongFocus
-
-
- -
-
-
- Texture Dimensions (Texture Dimensions divided by Terrain Size = Texels per meter)
-
-
-
-
-
-
- Qt::StrongFocus
-
-
- 512 x 512
-
-
- true
-
-
-
- -
-
-
- Qt::StrongFocus
-
-
- 1024 x 1024
-
-
-
- -
-
-
- Qt::StrongFocus
-
-
- 2048 x 2048
-
-
-
- -
-
-
- Qt::StrongFocus
-
-
- 4096 x 4096
-
-
-
- -
-
-
- Qt::StrongFocus
-
-
- 8192 x 8192
-
-
-
- -
-
-
- Qt::StrongFocus
-
-
- 16384 x 16384
-
-
-
-
-
-
- -
-
-
- Qt::StrongFocus
-
-
- QDialogButtonBox::Ok
-
-
-
-
-
-
-
-
- buttonBox
- accepted()
- CDimensionsDialog
- accept()
-
-
- 77
- 294
-
-
- 7
- 296
-
-
-
-
-
diff --git a/Code/Editor/EditMode/DeepSelection.cpp b/Code/Editor/EditMode/DeepSelection.cpp
deleted file mode 100644
index 3e232a230c..0000000000
--- a/Code/Editor/EditMode/DeepSelection.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * 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
- *
- */
-
-
-#include "EditorDefs.h"
-
-#include "DeepSelection.h"
-
-// Editor
-#include "Objects/BaseObject.h"
-
-
-//! Functor for sorting selected objects on deep selection mode.
-struct NearDistance
-{
- NearDistance(){}
- bool operator()(const CDeepSelection::RayHitObject& lhs, const CDeepSelection::RayHitObject& rhs) const
- {
- return lhs.distance < rhs.distance;
- }
-};
-
-//-----------------------------------------------------------------------------
-CDeepSelection::CDeepSelection()
- : m_Mode(DSM_NONE)
- , m_previousMode(DSM_NONE)
- , m_CandidateObjectCount(0)
- , m_CurrentSelectedPos(-1)
-{
- m_LastPickPoint = QPoint(-1, -1);
-}
-
-//-----------------------------------------------------------------------------
-CDeepSelection::~CDeepSelection()
-{
-}
-
-//-----------------------------------------------------------------------------
-void CDeepSelection::Reset(bool bResetLastPick)
-{
- for (int i = 0; i < m_CandidateObjectCount; ++i)
- {
- m_RayHitObjects[i].object->ClearFlags(OBJFLAG_NO_HITTEST);
- }
-
- m_CandidateObjectCount = 0;
- m_CurrentSelectedPos = -1;
-
- m_RayHitObjects.clear();
-
- if (bResetLastPick)
- {
- m_LastPickPoint = QPoint(-1, -1);
- }
-}
-
-//-----------------------------------------------------------------------------
-void CDeepSelection::AddObject(float distance, CBaseObject* pObj)
-{
- m_RayHitObjects.push_back(RayHitObject(distance, pObj));
-}
-
-//-----------------------------------------------------------------------------
-bool CDeepSelection::OnCycling (const QPoint& pt)
-{
- QPoint diff = m_LastPickPoint - pt;
- LONG epsilon = 2;
- m_LastPickPoint = pt;
-
- if (abs(diff.x()) < epsilon && abs(diff.y()) < epsilon)
- {
- return true;
- }
- else
- {
- return false;
- }
-}
-
-//-----------------------------------------------------------------------------
-void CDeepSelection::ExcludeHitTest(int except)
-{
- int nExcept = except % m_CandidateObjectCount;
-
- for (int i = 0; i < m_CandidateObjectCount; ++i)
- {
- m_RayHitObjects[i].object->SetFlags(OBJFLAG_NO_HITTEST);
- }
-
- m_RayHitObjects[nExcept].object->ClearFlags(OBJFLAG_NO_HITTEST);
-}
-
-//-----------------------------------------------------------------------------
-int CDeepSelection::CollectCandidate(float fMinDistance, float fRange)
-{
- m_CandidateObjectCount = 0;
-
- if (!m_RayHitObjects.empty())
- {
- std::sort(m_RayHitObjects.begin(), m_RayHitObjects.end(), NearDistance());
-
- for (std::vector::iterator itr = m_RayHitObjects.begin();
- itr != m_RayHitObjects.end(); ++itr)
- {
- if (itr->distance - fMinDistance < fRange)
- {
- ++m_CandidateObjectCount;
- }
- else
- {
- break;
- }
- }
- }
-
- return m_CandidateObjectCount;
-}
-
-//-----------------------------------------------------------------------------
-CBaseObject* CDeepSelection::GetCandidateObject(int index)
-{
- m_CurrentSelectedPos = index % m_CandidateObjectCount;
-
- return m_RayHitObjects[m_CurrentSelectedPos].object;
-}
-
-//-----------------------------------------------------------------------------
-//!
-void CDeepSelection::SetMode(EDeepSelectionMode mode)
-{
- m_previousMode = m_Mode;
- m_Mode = mode;
-}
diff --git a/Code/Editor/EditMode/DeepSelection.h b/Code/Editor/EditMode/DeepSelection.h
deleted file mode 100644
index b6f652abc5..0000000000
--- a/Code/Editor/EditMode/DeepSelection.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * 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
- *
- */
-
-
-// Description : Deep Selection Header
-
-
-#ifndef CRYINCLUDE_EDITOR_EDITMODE_DEEPSELECTION_H
-#define CRYINCLUDE_EDITOR_EDITMODE_DEEPSELECTION_H
-#pragma once
-
-class CBaseObject;
-
-//! Deep Selection
-//! Additional output information of HitContext on using "deep selection mode".
-//! At the deep selection mode, it supports second selection pass for easy
-//! selection on crowded area with two different method.
-//! One is to show pop menu of candidate objects list. Another is the cyclic
-//! selection on pick clicking.
-class CDeepSelection
- : public _i_reference_target_t
-{
-public:
- //! Deep Selection Mode Definition
- enum EDeepSelectionMode
- {
- DSM_NONE = 0, // Not using deep selection.
- DSM_POP = 1, // Deep selection mode with pop context menu.
- DSM_CYCLE = 2 // Deep selection mode with cyclic selection on each clinking same point.
- };
-
- //! Subclass for container of the selected object with hit distance.
- struct RayHitObject
- {
- RayHitObject(float dist, CBaseObject* pObj)
- : distance(dist)
- , object(pObj)
- {
- }
-
- float distance;
- CBaseObject* object;
- };
-
- //! Constructor
- CDeepSelection();
- virtual ~CDeepSelection();
-
- void Reset(bool bResetLastPick = false);
- void AddObject(float distance, CBaseObject* pObj);
- //! Check if clicking point is same position with last position,
- //! to decide whether to continue cycling mode.
- bool OnCycling (const QPoint& pt);
- //! All objects in list are excluded for hitting test except one, current selection.
- void ExcludeHitTest(int except);
- void SetMode(EDeepSelectionMode mode);
- inline EDeepSelectionMode GetMode() const { return m_Mode; }
- inline EDeepSelectionMode GetPreviousMode() const { return m_previousMode; }
- //! Collect object in the deep selection range. The distance from the minimum
- //! distance is less than deep selection range.
- int CollectCandidate(float fMinDistance, float fRange);
- //! Return the candidate object in index position, then it is to be current
- //! selection position.
- CBaseObject* GetCandidateObject(int index);
- //! Return the current selection position that is update in "GetCandidateObject"
- //! function call.
- inline int GetCurrentSelectPos() const { return m_CurrentSelectedPos; }
- //! Return the number of objects in the deep selection range.
- inline int GetCandidateObjectCount() const { return m_CandidateObjectCount; }
-
-private:
- //! Current mode
- EDeepSelectionMode m_Mode;
- EDeepSelectionMode m_previousMode;
- //! Last picking point to check whether cyclic selection continue.
- QPoint m_LastPickPoint;
- //! List of the selected objects with ray hitting
- std::vector m_RayHitObjects;
- int m_CandidateObjectCount;
- int m_CurrentSelectedPos;
-};
-#endif // CRYINCLUDE_EDITOR_EDITMODE_DEEPSELECTION_H
diff --git a/Code/Editor/EditorDefs.h b/Code/Editor/EditorDefs.h
index 97c03b2b45..e86f007604 100644
--- a/Code/Editor/EditorDefs.h
+++ b/Code/Editor/EditorDefs.h
@@ -123,9 +123,7 @@
#include "Util/XmlTemplate.h"
// Utility classes.
-#include "Util/bitarray.h"
#include "Util/RefCountBase.h"
-#include "Util/TRefCountBase.h"
#include "Util/MemoryBlock.h"
#include "Util/PathUtil.h"
@@ -168,18 +166,3 @@
#ifdef LoadCursor
#undef LoadCursor
#endif
-
-
-#ifdef _DEBUG
-#if !defined(AZ_PLATFORM_LINUX)
-#ifdef assert
-#undef assert
-#if defined(USE_AZ_ASSERT)
-#define assert(condition) AZ_Assert(condition, "")
-#else
-#define assert CRY_ASSERT
-#endif
-#endif // !defined(AZ_PLATFORM_LINUX)
-#endif
-#endif
-
diff --git a/Code/Editor/EditorPanelUtils.cpp b/Code/Editor/EditorPanelUtils.cpp
deleted file mode 100644
index a270de5978..0000000000
--- a/Code/Editor/EditorPanelUtils.cpp
+++ /dev/null
@@ -1,542 +0,0 @@
-/*
- * 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
- *
- */
-
-
-
-#include "EditorDefs.h"
-
-#include "EditorPanelUtils.h"
-
-#include
-
-// Qt
-#include
-#include
-#include
-
-// Editor
-#include "IEditorPanelUtils.h"
-#include "Objects/EntityObject.h"
-#include "CryEditDoc.h"
-#include "ViewManager.h"
-#include "Controls/QToolTipWidget.h"
-#include "Objects/SelectionGroup.h"
-
-
-
-#ifndef PI
-#define PI 3.14159265358979323f
-#endif
-
-
-struct ToolTip
-{
- bool isValid;
- QString title;
- QString content;
- QString specialContent;
- QString disabledContent;
-};
-
-// internal implementation for better compile times - should also never be used externally, use IParticleEditorUtils interface for that.
-class CEditorPanelUtils_Impl
- : public IEditorPanelUtils
-{
-public:
- void SetViewportDragOperation(void(* dropCallback)(CViewport* viewport, int dragPointX, int dragPointY, void* custom), void* custom) override
- {
- for (int i = 0; i < GetIEditor()->GetViewManager()->GetViewCount(); i++)
- {
- GetIEditor()->GetViewManager()->GetView(i)->SetGlobalDropCallback(dropCallback, custom);
- }
- }
-
-public:
-
- int PreviewWindow_GetDisplaySettingsDebugFlags(CDisplaySettings* settings) override
- {
- CRY_ASSERT(settings);
- return settings->GetDebugFlags();
- }
-
- void PreviewWindow_SetDisplaySettingsDebugFlags(CDisplaySettings* settings, int flags) override
- {
- CRY_ASSERT(settings);
- settings->SetDebugFlags(flags);
- }
-
-protected:
- QVector hotkeys;
- bool m_hotkeysAreEnabled;
-public:
-
- bool HotKey_Import() override
- {
- QVector > keys;
- QString filepath = QFileDialog::getOpenFileName(nullptr, "Select shortcut configuration to load",
- QString(), "HotKey Config Files (*.hkxml)");
- QFile file(filepath);
- if (!file.open(QIODevice::ReadOnly))
- {
- return false;
- }
- QXmlStreamReader stream(&file);
- bool result = true;
-
- while (!stream.isEndDocument())
- {
- if (stream.isStartElement())
- {
- if (stream.name() == "HotKey")
- {
- QPair key;
- QXmlStreamAttributes att = stream.attributes();
- for (QXmlStreamAttribute attr : att)
- {
- if (attr.name().compare(QLatin1String("path"), Qt::CaseInsensitive) == 0)
- {
- key.first = attr.value().toString();
- }
- if (attr.name().compare(QLatin1String("sequence"), Qt::CaseInsensitive) == 0)
- {
- key.second = attr.value().toString();
- }
- }
- if (!key.first.isEmpty())
- {
- keys.push_back(key); // we allow blank key sequences for unassigned shortcuts
- }
- else
- {
- result = false; //but not blank paths!
- }
- }
- }
- stream.readNext();
- }
- file.close();
-
- if (result)
- {
- HotKey_BuildDefaults();
- for (QPair key : keys)
- {
- for (int j = 0; j < hotkeys.count(); j++)
- {
- if (hotkeys[j].path.compare(key.first, Qt::CaseInsensitive) == 0)
- {
- hotkeys[j].SetPath(key.first.toStdString().c_str());
- hotkeys[j].SetSequenceFromString(key.second.toStdString().c_str());
- }
- }
- }
- }
- return result;
- }
-
- void HotKey_Export() override
- {
- auto settingDir = AZ::IO::FixedMaxPath(AZ::Utils::GetEnginePath()) / "Editor" / "Plugins" / "ParticleEditorPlugin" / "settings";
- QString filepath = QFileDialog::getSaveFileName(nullptr, "Select shortcut configuration to load", settingDir.c_str(), "HotKey Config Files (*.hkxml)");
- QFile file(filepath);
- if (!file.open(QIODevice::WriteOnly))
- {
- return;
- }
-
- QXmlStreamWriter stream(&file);
- stream.setAutoFormatting(true);
- stream.writeStartDocument();
- stream.writeStartElement("HotKeys");
-
- for (HotKey key : hotkeys)
- {
- stream.writeStartElement("HotKey");
- stream.writeAttribute("path", key.path);
- stream.writeAttribute("sequence", key.sequence.toString());
- stream.writeEndElement();
- }
- stream.writeEndElement();
- stream.writeEndDocument();
- file.close();
- }
-
- QKeySequence HotKey_GetShortcut(const char* path) override
- {
- for (HotKey combo : hotkeys)
- {
- if (combo.IsMatch(path))
- {
- return combo.sequence;
- }
- }
- return QKeySequence();
- }
-
- bool HotKey_IsPressed(const QKeyEvent* event, const char* path) override
- {
- if (!m_hotkeysAreEnabled)
- {
- return false;
- }
- unsigned int keyInt = 0;
- //Capture any modifiers
- Qt::KeyboardModifiers modifiers = QApplication::keyboardModifiers();
- if (modifiers & Qt::ShiftModifier)
- {
- keyInt += Qt::SHIFT;
- }
- if (modifiers & Qt::ControlModifier)
- {
- keyInt += Qt::CTRL;
- }
- if (modifiers & Qt::AltModifier)
- {
- keyInt += Qt::ALT;
- }
- if (modifiers & Qt::MetaModifier)
- {
- keyInt += Qt::META;
- }
- //Capture any key
- keyInt += event->key();
-
- QString t0 = QKeySequence(keyInt).toString();
- QString t1 = HotKey_GetShortcut(path).toString();
-
- //if strings match then shortcut is pressed
- if (t1.compare(t0, Qt::CaseInsensitive) == 0)
- {
- return true;
- }
- return false;
- }
-
- bool HotKey_IsPressed(const QShortcutEvent* event, const char* path) override
- {
- if (!m_hotkeysAreEnabled)
- {
- return false;
- }
-
- QString t0 = event->key().toString();
- QString t1 = HotKey_GetShortcut(path).toString();
-
- //if strings match then shortcut is pressed
- if (t1.compare(t0, Qt::CaseInsensitive) == 0)
- {
- return true;
- }
- return false;
- }
-
- bool HotKey_LoadExisting() override
- {
- QSettings settings("O3DE", "O3DE");
- QString group = "Hotkeys/";
-
- HotKey_BuildDefaults();
-
- int size = settings.beginReadArray(group);
-
- for (int i = 0; i < size; i++)
- {
- settings.setArrayIndex(i);
- QPair hotkey;
- hotkey.first = settings.value("name").toString();
- hotkey.second = settings.value("keySequence").toString();
- if (!hotkey.first.isEmpty())
- {
- for (int j = 0; j < hotkeys.count(); j++)
- {
- if (hotkeys[j].path.compare(hotkey.first, Qt::CaseInsensitive) == 0)
- {
- hotkeys[j].SetPath(hotkey.first.toStdString().c_str());
- hotkeys[j].SetSequenceFromString(hotkey.second.toStdString().c_str());
- }
- }
- }
- }
-
- settings.endArray();
- if (hotkeys.isEmpty())
- {
- return false;
- }
- return true;
- }
-
- void HotKey_SaveCurrent() override
- {
- QSettings settings("O3DE", "O3DE");
- QString group = "Hotkeys/";
- settings.remove("Hotkeys/");
- settings.sync();
- settings.beginWriteArray(group);
- int saveIndex = 0;
- for (HotKey key : hotkeys)
- {
- if (!key.path.isEmpty())
- {
- settings.setArrayIndex(saveIndex++);
- settings.setValue("name", key.path);
- settings.setValue("keySequence", key.sequence.toString());
- }
- }
- settings.endArray();
- settings.sync();
- }
-
- void HotKey_BuildDefaults() override
- {
- m_hotkeysAreEnabled = true;
- QVector > keys;
- while (hotkeys.count() > 0)
- {
- hotkeys.takeAt(0);
- }
-
- //MENU SELECTION SHORTCUTS////////////////////////////////////////////////
- keys.push_back(QPair("Menus.File Menu", "Alt+F"));
- keys.push_back(QPair("Menus.Edit Menu", "Alt+E"));
- keys.push_back(QPair("Menus.View Menu", "Alt+V"));
- //FILE MENU SHORTCUTS/////////////////////////////////////////////////////
- keys.push_back(QPair("File Menu.Create new emitter", "Ctrl+N"));
- keys.push_back(QPair("File Menu.Create new library", "Ctrl+Shift+N"));
- keys.push_back(QPair("File Menu.Create new folder", ""));
- keys.push_back(QPair("File Menu.Import", "Ctrl+I"));
- keys.push_back(QPair("File Menu.Import level library", "Ctrl+Shift+I"));
- keys.push_back(QPair("File Menu.Save", "Ctrl+S"));
- keys.push_back(QPair("File Menu.Close", "Ctrl+Q"));
- //EDIT MENU SHORTCUTS/////////////////////////////////////////////////////
- keys.push_back(QPair("Edit Menu.Copy", "Ctrl+C"));
- keys.push_back(QPair("Edit Menu.Paste", "Ctrl+V"));
- keys.push_back(QPair("Edit Menu.Duplicate", "Ctrl+D"));
- keys.push_back(QPair("Edit Menu.Undo", "Ctrl+Z"));
- keys.push_back(QPair("Edit Menu.Redo", "Ctrl+Shift+Z"));
- keys.push_back(QPair("Edit Menu.Group", "Ctrl+G"));
- keys.push_back(QPair("Edit Menu.Ungroup", "Ctrl+Shift+G"));
- keys.push_back(QPair("Edit Menu.Rename", "Ctrl+R"));
- keys.push_back(QPair("Edit Menu.Reset", ""));
- keys.push_back(QPair("Edit Menu.Edit Hotkeys", ""));
- keys.push_back(QPair("Edit Menu.Assign to selected", "Ctrl+Space"));
- keys.push_back(QPair("Edit Menu.Insert Comment", "Ctrl+Alt+M"));
- keys.push_back(QPair("Edit Menu.Enable/Disable Emitter", "Ctrl+E"));
- keys.push_back(QPair("File Menu.Enable All", ""));
- keys.push_back(QPair("File Menu.Disable All", ""));
- keys.push_back(QPair("Edit Menu.Delete", "Del"));
- //VIEW MENU SHORTCUTS/////////////////////////////////////////////////////
- keys.push_back(QPair("View Menu.Reset Layout", ""));
- //PLAYBACK CONTROL////////////////////////////////////////////////////////
- keys.push_back(QPair("Previewer.Play/Pause Toggle", "Space"));
- keys.push_back(QPair("Previewer.Step forward through time", "c"));
- keys.push_back(QPair("Previewer.Loop Toggle", "z"));
- keys.push_back(QPair("Previewer.Reset Playback", "x"));
- keys.push_back(QPair("Previewer.Focus", "Ctrl+F"));
- keys.push_back(QPair("Previewer.Zoom In", "w"));
- keys.push_back(QPair("Previewer.Zoom Out", "s"));
- keys.push_back(QPair("Previewer.Pan Left", "a"));
- keys.push_back(QPair("Previewer.Pan Right", "d"));
-
- for (QPair key : keys)
- {
- unsigned int index = hotkeys.count();
- hotkeys.push_back(HotKey());
- hotkeys[index].SetPath(key.first.toStdString().c_str());
- hotkeys[index].SetSequenceFromString(key.second.toStdString().c_str());
- }
- }
-
- void HotKey_SetKeys(QVector keys) override
- {
- hotkeys = keys;
- }
-
- QVector HotKey_GetKeys() override
- {
- return hotkeys;
- }
-
- QString HotKey_GetPressedHotkey(const QKeyEvent* event) override
- {
- if (!m_hotkeysAreEnabled)
- {
- return "";
- }
- for (HotKey key : hotkeys)
- {
- if (HotKey_IsPressed(event, key.path.toUtf8()))
- {
- return key.path;
- }
- }
- return "";
- }
- QString HotKey_GetPressedHotkey(const QShortcutEvent* event) override
- {
- if (!m_hotkeysAreEnabled)
- {
- return "";
- }
- for (HotKey key : hotkeys)
- {
- if (HotKey_IsPressed(event, key.path.toUtf8()))
- {
- return key.path;
- }
- }
- return "";
- }
- //building the default hotkey list re-enables hotkeys
- //do not use this when rebuilding the default list is a possibility.
- void HotKey_SetEnabled(bool val) override
- {
- m_hotkeysAreEnabled = val;
- }
-
- bool HotKey_IsEnabled() const override
- {
- return m_hotkeysAreEnabled;
- }
-
-protected:
- QMap m_tooltips;
-
- void ToolTip_ParseNode(XmlNodeRef node)
- {
- if (QString(node->getTag()).compare("tooltip", Qt::CaseInsensitive) != 0)
- {
- unsigned int childCount = node->getChildCount();
-
- for (unsigned int i = 0; i < childCount; i++)
- {
- ToolTip_ParseNode(node->getChild(i));
- }
- }
-
- QString title = node->getAttr("title");
- QString content = node->getAttr("content");
- QString specialContent = node->getAttr("special_content");
- QString disabledContent = node->getAttr("disabled_content");
-
- QMap::iterator itr = m_tooltips.insert(node->getAttr("path"), ToolTip());
- itr->isValid = true;
- itr->title = title;
- itr->content = content;
- itr->specialContent = specialContent;
- itr->disabledContent = disabledContent;
-
- unsigned int childCount = node->getChildCount();
-
- for (unsigned int i = 0; i < childCount; i++)
- {
- ToolTip_ParseNode(node->getChild(i));
- }
- }
-
- ToolTip GetToolTip(QString path)
- {
- if (m_tooltips.contains(path))
- {
- return m_tooltips[path];
- }
- ToolTip temp;
- temp.isValid = false;
- return temp;
- }
-
-public:
- void ToolTip_LoadConfigXML(QString filepath) override
- {
- XmlNodeRef node = GetIEditor()->GetSystem()->LoadXmlFromFile(filepath.toStdString().c_str());
- ToolTip_ParseNode(node);
- }
-
- void ToolTip_BuildFromConfig(IQToolTip* tooltip, QString path, QString option, QString optionalData = "", bool isEnabled = true) override
- {
- AZ_Assert(tooltip, "tooltip cannot be null");
-
- QString title = ToolTip_GetTitle(path, option);
- QString content = ToolTip_GetContent(path, option);
- QString specialContent = ToolTip_GetSpecialContentType(path, option);
- QString disabledContent = ToolTip_GetDisabledContent(path, option);
-
- // Even if these items are empty, we set them anyway to clear out any data that was left over from when the tooltip was used for a different object.
- tooltip->SetTitle(title);
- tooltip->SetContent(content);
-
- //this only handles simple creation...if you need complex call this then add specials separate
- if (!specialContent.contains("::"))
- {
- tooltip->AddSpecialContent(specialContent, optionalData);
- }
-
- if (!isEnabled) // If disabled, add disabled value
- {
- tooltip->AppendContent(disabledContent);
- }
- }
-
- QString ToolTip_GetTitle(QString path, QString option) override
- {
- if (!option.isEmpty() && GetToolTip(path + "." + option).isValid)
- {
- return GetToolTip(path + "." + option).title;
- }
- if (!option.isEmpty() && GetToolTip("Options." + option).isValid)
- {
- return GetToolTip("Options." + option).title;
- }
- return GetToolTip(path).title;
- }
-
- QString ToolTip_GetContent(QString path, QString option) override
- {
- if (!option.isEmpty() && GetToolTip(path + "." + option).isValid)
- {
- return GetToolTip(path + "." + option).content;
- }
- if (!option.isEmpty() && GetToolTip("Options." + option).isValid)
- {
- return GetToolTip("Options." + option).content;
- }
- return GetToolTip(path).content;
- }
-
- QString ToolTip_GetSpecialContentType(QString path, QString option) override
- {
- if (!option.isEmpty() && GetToolTip(path + "." + option).isValid)
- {
- return GetToolTip(path + "." + option).specialContent;
- }
- if (!option.isEmpty() && GetToolTip("Options." + option).isValid)
- {
- return GetToolTip("Options." + option).specialContent;
- }
- return GetToolTip(path).specialContent;
- }
-
- QString ToolTip_GetDisabledContent(QString path, QString option) override
- {
- if (!option.isEmpty() && GetToolTip(path + "." + option).isValid)
- {
- return GetToolTip(path + "." + option).disabledContent;
- }
- if (!option.isEmpty() && GetToolTip("Options." + option).isValid)
- {
- return GetToolTip("Options." + option).disabledContent;
- }
- return GetToolTip(path).disabledContent;
- }
-};
-
-IEditorPanelUtils* CreateEditorPanelUtils()
-{
- return new CEditorPanelUtils_Impl();
-}
-
diff --git a/Code/Editor/EditorPanelUtils.h b/Code/Editor/EditorPanelUtils.h
deleted file mode 100644
index 6ac15ebfc9..0000000000
--- a/Code/Editor/EditorPanelUtils.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * 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
- *
- */
-// Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
-#ifndef CRYINCLUDE_CRYEDITOR_EDITORPANELUTILS_H
-#define CRYINCLUDE_CRYEDITOR_EDITORPANELUTILS_H
-#pragma once
-
-struct IEditorPanelUtils;
-IEditorPanelUtils* CreateEditorPanelUtils();
-
-#endif
diff --git a/Code/Editor/EditorPreferencesBus.h b/Code/Editor/EditorPreferencesBus.h
deleted file mode 100644
index d6c9e3ed55..0000000000
--- a/Code/Editor/EditorPreferencesBus.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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
-
-//! Allows handlers to be notified when settings are changed to refresh accordingly
-class EditorPreferencesNotifications
- : public AZ::EBusTraits
-{
-public:
- static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
- static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
-
- //! Notifies about changes in the Editor Preferences
- virtual void OnEditorPreferencesChanged() {}
-};
-using EditorPreferencesNotificationBus = AZ::EBus;
diff --git a/Code/Editor/EditorPreferencesDialog.cpp b/Code/Editor/EditorPreferencesDialog.cpp
index 665daf52a8..42f7446716 100644
--- a/Code/Editor/EditorPreferencesDialog.cpp
+++ b/Code/Editor/EditorPreferencesDialog.cpp
@@ -112,29 +112,31 @@ void EditorPreferencesDialog::showEvent(QShowEvent* event)
QDialog::showEvent(event);
}
-void WidgetHandleKeyPressEvent(QWidget* widget, QKeyEvent* event)
+bool WidgetConsumesKeyPressEvent(QKeyEvent* event)
{
// If the enter key is pressed during any text input, the dialog box will close
// making it inconvenient to do multiple edits. This routine captures the
// Key_Enter or Key_Return and clears the focus to give a visible cue that
- // editing of that field has finished and then doesn't propogate it.
+ // editing of that field has finished and then doesn't propagate it.
if (event->key() != Qt::Key::Key_Enter && event->key() != Qt::Key::Key_Return)
{
- QApplication::sendEvent(widget, event);
+ return false;
}
- else
+
+ if (QWidget* editWidget = QApplication::focusWidget())
{
- if (QWidget* editWidget = QApplication::focusWidget())
- {
- editWidget->clearFocus();
- }
+ editWidget->clearFocus();
}
-}
+ return true;
+}
void EditorPreferencesDialog::keyPressEvent(QKeyEvent* event)
{
- WidgetHandleKeyPressEvent(this, event);
+ if (!WidgetConsumesKeyPressEvent(event))
+ {
+ QDialog::keyPressEvent(event);
+ }
}
void EditorPreferencesDialog::OnTreeCurrentItemChanged()
diff --git a/Code/Editor/EditorPreferencesDialog.h b/Code/Editor/EditorPreferencesDialog.h
index a3f05ad00d..70a186375b 100644
--- a/Code/Editor/EditorPreferencesDialog.h
+++ b/Code/Editor/EditorPreferencesDialog.h
@@ -19,7 +19,7 @@ namespace Ui
class EditorPreferencesTreeWidgetItem;
-void WidgetHandleKeyPressEvent(QWidget* widget, QKeyEvent* event);
+bool WidgetConsumesKeyPressEvent(QKeyEvent* event);
class EditorPreferencesDialog
: public QDialog
diff --git a/Code/Editor/EditorPreferencesPageAWS.cpp b/Code/Editor/EditorPreferencesPageAWS.cpp
index 68a9d6889f..968969245d 100644
--- a/Code/Editor/EditorPreferencesPageAWS.cpp
+++ b/Code/Editor/EditorPreferencesPageAWS.cpp
@@ -28,7 +28,7 @@ void CEditorPreferencesPage_AWS::Reflect(AZ::SerializeContext& serialize)
if (editContext)
{
editContext->Class("Options", "")
- ->DataElement(AZ::Edit::UIHandlers::CheckBox, &UsageOptions::m_awsAttributionEnabled, "Allow O3DE to send information about your use of AWS Core Gem to AWS",
+ ->DataElement(AZ::Edit::UIHandlers::CheckBox, &UsageOptions::m_awsAttributionEnabled, "Allow O3DE to send information about your use of AWS Core Gem to AWS",
"");
editContext->Class("AWS Preferences", "AWS Preferences")
@@ -101,7 +101,7 @@ void CEditorPreferencesPage_AWS::SaveSettingsRegistryFile()
return;
}
- bool saved{};
+ [[maybe_unused]] bool saved{};
constexpr auto configurationMode =
AZ::IO::SystemFile::SF_OPEN_CREATE | AZ::IO::SystemFile::SF_OPEN_CREATE_PATH | AZ::IO::SystemFile::SF_OPEN_WRITE_ONLY;
if (AZ::IO::SystemFile outputFile; outputFile.Open(resolvedPath.data(), configurationMode))
diff --git a/Code/Editor/EditorPreferencesPageGeneral.cpp b/Code/Editor/EditorPreferencesPageGeneral.cpp
index 95b3bc4c50..642b9c37e7 100644
--- a/Code/Editor/EditorPreferencesPageGeneral.cpp
+++ b/Code/Editor/EditorPreferencesPageGeneral.cpp
@@ -30,7 +30,6 @@ void CEditorPreferencesPage_General::Reflect(AZ::SerializeContext& serialize)
serialize.Class()
->Version(3)
->Field("PreviewPanel", &GeneralSettings::m_previewPanel)
- ->Field("ApplyConfigSpec", &GeneralSettings::m_applyConfigSpec)
->Field("EnableSourceControl", &GeneralSettings::m_enableSourceControl)
->Field("ClearConsole", &GeneralSettings::m_clearConsoleOnGameModeStart)
->Field("ConsoleBackgroundColorTheme", &GeneralSettings::m_consoleBackgroundColorTheme)
@@ -81,7 +80,6 @@ void CEditorPreferencesPage_General::Reflect(AZ::SerializeContext& serialize)
{
editContext->Class("General Settings", "General Editor Preferences")
->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_previewPanel, "Show Geometry Preview Panel", "Show Geometry Preview Panel")
- ->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_applyConfigSpec, "Hide objects by config spec", "Hide objects by config spec")
->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_enableSourceControl, "Enable Source Control", "Enable Source Control")
->DataElement(
AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_clearConsoleOnGameModeStart, "Clear Console at game startup", "Clear Console when game mode starts")
@@ -157,7 +155,6 @@ void CEditorPreferencesPage_General::OnApply()
{
//general settings
gSettings.bPreviewGeometryWindow = m_generalSettings.m_previewPanel;
- gSettings.bApplyConfigSpecInEditor = m_generalSettings.m_applyConfigSpec;
gSettings.enableSourceControl = m_generalSettings.m_enableSourceControl;
gSettings.clearConsoleOnGameModeStart = m_generalSettings.m_clearConsoleOnGameModeStart;
gSettings.consoleBackgroundColorTheme = m_generalSettings.m_consoleBackgroundColorTheme;
@@ -195,7 +192,6 @@ void CEditorPreferencesPage_General::InitializeSettings()
{
//general settings
m_generalSettings.m_previewPanel = gSettings.bPreviewGeometryWindow;
- m_generalSettings.m_applyConfigSpec = gSettings.bApplyConfigSpecInEditor;
m_generalSettings.m_enableSourceControl = gSettings.enableSourceControl;
m_generalSettings.m_clearConsoleOnGameModeStart = gSettings.clearConsoleOnGameModeStart;
m_generalSettings.m_consoleBackgroundColorTheme = gSettings.consoleBackgroundColorTheme;
diff --git a/Code/Editor/EditorPreferencesPageGeneral.h b/Code/Editor/EditorPreferencesPageGeneral.h
index 01700dea88..ff2ebf79f8 100644
--- a/Code/Editor/EditorPreferencesPageGeneral.h
+++ b/Code/Editor/EditorPreferencesPageGeneral.h
@@ -45,7 +45,6 @@ private:
AZ_TYPE_INFO(GeneralSettings, "{C2AE8F6D-7AA6-499E-A3E8-ECCD0AC6F3D2}")
bool m_previewPanel;
- bool m_applyConfigSpec;
bool m_enableSourceControl;
bool m_clearConsoleOnGameModeStart;
AzToolsFramework::ConsoleColorTheme m_consoleBackgroundColorTheme;
diff --git a/Code/Editor/EditorPreferencesPageViewportGeneral.cpp b/Code/Editor/EditorPreferencesPageViewportGeneral.cpp
index 77560e24f8..f33cc3f725 100644
--- a/Code/Editor/EditorPreferencesPageViewportGeneral.cpp
+++ b/Code/Editor/EditorPreferencesPageViewportGeneral.cpp
@@ -41,8 +41,6 @@ void CEditorPreferencesPage_ViewportGeneral::Reflect(AZ::SerializeContext& seria
->Field("ShowBBoxes", &Display::m_showBBoxes)
->Field("DrawEntityLabels", &Display::m_drawEntityLabels)
->Field("ShowTriggerBounds", &Display::m_showTriggerBounds)
- ->Field("ShowIcons", &Display::m_showIcons)
- ->Field("DistanceScaleIcons", &Display::m_distanceScaleIcons)
->Field("ShowFrozenHelpers", &Display::m_showFrozenHelpers)
->Field("FillSelectedShapes", &Display::m_fillSelectedShapes)
->Field("ShowGridGuide", &Display::m_showGridGuide)
@@ -118,10 +116,6 @@ void CEditorPreferencesPage_ViewportGeneral::Reflect(AZ::SerializeContext& seria
AZ::Edit::UIHandlers::CheckBox, &Display::m_drawEntityLabels, "Always Draw Entity Labels", "Always Draw Entity Labels")
->DataElement(
AZ::Edit::UIHandlers::CheckBox, &Display::m_showTriggerBounds, "Always Show Trigger Bounds", "Always Show Trigger Bounds")
- ->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_showIcons, "Show Object Icons", "Show Object Icons")
- ->DataElement(
- AZ::Edit::UIHandlers::CheckBox, &Display::m_distanceScaleIcons, "Scale Object Icons with Distance",
- "Scale Object Icons with Distance")
->DataElement(
AZ::Edit::UIHandlers::CheckBox, &Display::m_showFrozenHelpers, "Show Helpers of Frozen Objects",
"Show Helpers of Frozen Objects")
@@ -244,8 +238,6 @@ void CEditorPreferencesPage_ViewportGeneral::OnApply()
}
gSettings.viewports.bDrawEntityLabels = m_display.m_drawEntityLabels;
gSettings.viewports.bShowTriggerBounds = m_display.m_showTriggerBounds;
- gSettings.viewports.bShowIcons = m_display.m_showIcons;
- gSettings.viewports.bDistanceScaleIcons = m_display.m_distanceScaleIcons;
gSettings.viewports.nShowFrozenHelpers = m_display.m_showFrozenHelpers;
gSettings.viewports.bFillSelectedShapes = m_display.m_fillSelectedShapes;
gSettings.viewports.bShowGridGuide = m_display.m_showGridGuide;
@@ -300,8 +292,6 @@ void CEditorPreferencesPage_ViewportGeneral::InitializeSettings()
m_display.m_showBBoxes = (ds->GetRenderFlags() & RENDER_FLAG_BBOX) == RENDER_FLAG_BBOX;
m_display.m_drawEntityLabels = gSettings.viewports.bDrawEntityLabels;
m_display.m_showTriggerBounds = gSettings.viewports.bShowTriggerBounds;
- m_display.m_showIcons = gSettings.viewports.bShowIcons;
- m_display.m_distanceScaleIcons = gSettings.viewports.bDistanceScaleIcons;
m_display.m_showFrozenHelpers = gSettings.viewports.nShowFrozenHelpers;
m_display.m_fillSelectedShapes = gSettings.viewports.bFillSelectedShapes;
m_display.m_showGridGuide = gSettings.viewports.bShowGridGuide;
diff --git a/Code/Editor/EditorPreferencesPageViewportGeneral.h b/Code/Editor/EditorPreferencesPageViewportGeneral.h
index be89cc6df4..2d2a207d6c 100644
--- a/Code/Editor/EditorPreferencesPageViewportGeneral.h
+++ b/Code/Editor/EditorPreferencesPageViewportGeneral.h
@@ -62,8 +62,6 @@ private:
bool m_showBBoxes;
bool m_drawEntityLabels;
bool m_showTriggerBounds;
- bool m_showIcons;
- bool m_distanceScaleIcons;
bool m_showFrozenHelpers;
bool m_fillSelectedShapes;
bool m_showGridGuide;
diff --git a/Code/Editor/EditorViewportWidget.cpp b/Code/Editor/EditorViewportWidget.cpp
index 754ea84544..9a9e9f5ad3 100644
--- a/Code/Editor/EditorViewportWidget.cpp
+++ b/Code/Editor/EditorViewportWidget.cpp
@@ -89,6 +89,7 @@
#include
// Atom
+#include
#include
#include
#include