Merge branch 'development' into UsingCommaAsDecimalSeperator
Signed-off-by: John Jones-Steele <jjjoness@amazon.com>
This commit is contained in:
+39
-101
@@ -266,13 +266,13 @@ CCrySingleDocTemplate* CCryDocManager::SetDefaultTemplate(CCrySingleDocTemplate*
|
||||
// Copied from MFC to get rid of the silly ugly unoverridable doc-type pick dialog
|
||||
void CCryDocManager::OnFileNew()
|
||||
{
|
||||
assert(m_pDefTemplate != NULL);
|
||||
assert(m_pDefTemplate != nullptr);
|
||||
|
||||
m_pDefTemplate->OpenDocumentFile(NULL);
|
||||
m_pDefTemplate->OpenDocumentFile(nullptr);
|
||||
// if returns NULL, the user has already been alerted
|
||||
}
|
||||
BOOL CCryDocManager::DoPromptFileName(QString& fileName, [[maybe_unused]] UINT nIDSTitle,
|
||||
[[maybe_unused]] DWORD lFlags, BOOL bOpenFileDialog, [[maybe_unused]] CDocTemplate* pTemplate)
|
||||
bool CCryDocManager::DoPromptFileName(QString& fileName, [[maybe_unused]] UINT nIDSTitle,
|
||||
[[maybe_unused]] DWORD lFlags, bool bOpenFileDialog, [[maybe_unused]] CDocTemplate* pTemplate)
|
||||
{
|
||||
CLevelFileDialog levelFileDialog(bOpenFileDialog);
|
||||
levelFileDialog.show();
|
||||
@@ -286,15 +286,15 @@ BOOL CCryDocManager::DoPromptFileName(QString& fileName, [[maybe_unused]] UINT n
|
||||
|
||||
return false;
|
||||
}
|
||||
CCryEditDoc* CCryDocManager::OpenDocumentFile(LPCTSTR lpszFileName, BOOL bAddToMRU)
|
||||
CCryEditDoc* CCryDocManager::OpenDocumentFile(LPCTSTR lpszFileName, bool bAddToMRU)
|
||||
{
|
||||
assert(lpszFileName != NULL);
|
||||
assert(lpszFileName != nullptr);
|
||||
|
||||
// find the highest confidence
|
||||
auto pos = m_templateList.begin();
|
||||
CCrySingleDocTemplate::Confidence bestMatch = CCrySingleDocTemplate::noAttempt;
|
||||
CCrySingleDocTemplate* pBestTemplate = NULL;
|
||||
CCryEditDoc* pOpenDocument = NULL;
|
||||
CCrySingleDocTemplate* pBestTemplate = nullptr;
|
||||
CCryEditDoc* pOpenDocument = nullptr;
|
||||
|
||||
if (lpszFileName[0] == '\"')
|
||||
{
|
||||
@@ -311,7 +311,7 @@ CCryEditDoc* CCryDocManager::OpenDocumentFile(LPCTSTR lpszFileName, BOOL bAddToM
|
||||
auto pTemplate = *(pos++);
|
||||
|
||||
CCrySingleDocTemplate::Confidence match;
|
||||
assert(pOpenDocument == NULL);
|
||||
assert(pOpenDocument == nullptr);
|
||||
match = pTemplate->MatchDocType(szPath.toUtf8().data(), pOpenDocument);
|
||||
if (match > bestMatch)
|
||||
{
|
||||
@@ -324,18 +324,18 @@ CCryEditDoc* CCryDocManager::OpenDocumentFile(LPCTSTR lpszFileName, BOOL bAddToM
|
||||
}
|
||||
}
|
||||
|
||||
if (pOpenDocument != NULL)
|
||||
if (pOpenDocument != nullptr)
|
||||
{
|
||||
return pOpenDocument;
|
||||
}
|
||||
|
||||
if (pBestTemplate == NULL)
|
||||
if (pBestTemplate == nullptr)
|
||||
{
|
||||
QMessageBox::critical(AzToolsFramework::GetActiveWindow(), QString(), QObject::tr("Failed to open document."));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return pBestTemplate->OpenDocumentFile(szPath.toUtf8().data(), bAddToMRU, FALSE);
|
||||
return pBestTemplate->OpenDocumentFile(szPath.toUtf8().data(), bAddToMRU, false);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@@ -460,7 +460,7 @@ void CCryEditApp::RegisterActionHandlers()
|
||||
ON_COMMAND(ID_FILE_SAVE_LEVEL, OnFileSave)
|
||||
ON_COMMAND(ID_FILE_EXPORTOCCLUSIONMESH, OnFileExportOcclusionMesh)
|
||||
|
||||
// Project Manager
|
||||
// Project Manager
|
||||
ON_COMMAND(ID_FILE_PROJECT_MANAGER_SETTINGS, OnOpenProjectManagerSettings)
|
||||
ON_COMMAND(ID_FILE_PROJECT_MANAGER_NEW, OnOpenProjectManagerNew)
|
||||
ON_COMMAND(ID_FILE_PROJECT_MANAGER_OPEN, OnOpenProjectManager)
|
||||
@@ -653,7 +653,7 @@ struct SharedData
|
||||
//
|
||||
// This function uses a technique similar to that described in KB
|
||||
// article Q141752 to locate the previous instance of the application. .
|
||||
BOOL CCryEditApp::FirstInstance(bool bForceNewInstance)
|
||||
bool CCryEditApp::FirstInstance(bool bForceNewInstance)
|
||||
{
|
||||
QSystemSemaphore sem(QString(O3DEApplicationName) + "_sem", 1);
|
||||
sem.acquire();
|
||||
@@ -801,12 +801,12 @@ void CCryEditApp::InitDirectory()
|
||||
// Needed to work with custom memory manager.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CCryEditDoc* CCrySingleDocTemplate::OpenDocumentFile(LPCTSTR lpszPathName, BOOL bMakeVisible /*= true*/)
|
||||
CCryEditDoc* CCrySingleDocTemplate::OpenDocumentFile(LPCTSTR lpszPathName, bool bMakeVisible /*= true*/)
|
||||
{
|
||||
return OpenDocumentFile(lpszPathName, true, bMakeVisible);
|
||||
}
|
||||
|
||||
CCryEditDoc* CCrySingleDocTemplate::OpenDocumentFile(LPCTSTR lpszPathName, BOOL bAddToMRU, [[maybe_unused]] BOOL bMakeVisible)
|
||||
CCryEditDoc* CCrySingleDocTemplate::OpenDocumentFile(LPCTSTR lpszPathName, bool bAddToMRU, [[maybe_unused]] bool bMakeVisible)
|
||||
{
|
||||
CCryEditDoc* pCurDoc = GetIEditor()->GetDocument();
|
||||
|
||||
@@ -847,8 +847,8 @@ CCryEditDoc* CCrySingleDocTemplate::OpenDocumentFile(LPCTSTR lpszPathName, BOOL
|
||||
|
||||
CCrySingleDocTemplate::Confidence CCrySingleDocTemplate::MatchDocType(LPCTSTR lpszPathName, CCryEditDoc*& rpDocMatch)
|
||||
{
|
||||
assert(lpszPathName != NULL);
|
||||
rpDocMatch = NULL;
|
||||
assert(lpszPathName != nullptr);
|
||||
rpDocMatch = nullptr;
|
||||
|
||||
// go through all documents
|
||||
CCryEditDoc* pDoc = GetIEditor()->GetDocument();
|
||||
@@ -1055,7 +1055,7 @@ AZ::Outcome<void, AZStd::string> CCryEditApp::InitGameSystem(HWND hwndForInputSy
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
BOOL CCryEditApp::CheckIfAlreadyRunning()
|
||||
bool CCryEditApp::CheckIfAlreadyRunning()
|
||||
{
|
||||
bool bForceNewInstance = false;
|
||||
|
||||
@@ -1299,7 +1299,7 @@ void CCryEditApp::InitLevel(const CEditCommandLineInfo& cmdInfo)
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
BOOL CCryEditApp::InitConsole()
|
||||
bool CCryEditApp::InitConsole()
|
||||
{
|
||||
// Execute command from cmdline -exec_line if applicable
|
||||
if (!m_execLineCmd.isEmpty())
|
||||
@@ -1431,7 +1431,7 @@ struct CCryEditApp::PythonOutputHandler
|
||||
AzToolsFramework::EditorPythonConsoleNotificationBus::Handler::BusConnect();
|
||||
}
|
||||
|
||||
virtual ~PythonOutputHandler()
|
||||
~PythonOutputHandler() override
|
||||
{
|
||||
AzToolsFramework::EditorPythonConsoleNotificationBus::Handler::BusDisconnect();
|
||||
}
|
||||
@@ -1463,7 +1463,7 @@ struct PythonTestOutputHandler final
|
||||
: public CCryEditApp::PythonOutputHandler
|
||||
{
|
||||
PythonTestOutputHandler() = default;
|
||||
virtual ~PythonTestOutputHandler() = default;
|
||||
~PythonTestOutputHandler() override = default;
|
||||
|
||||
void OnTraceMessage(AZStd::string_view message) override
|
||||
{
|
||||
@@ -1589,7 +1589,7 @@ void CCryEditApp::RunInitPythonScript(CEditCommandLineInfo& cmdInfo)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CCryEditApp initialization
|
||||
BOOL CCryEditApp::InitInstance()
|
||||
bool CCryEditApp::InitInstance()
|
||||
{
|
||||
QElapsedTimer startupTimer;
|
||||
startupTimer.start();
|
||||
@@ -1616,7 +1616,7 @@ BOOL CCryEditApp::InitInstance()
|
||||
{
|
||||
CAboutDialog aboutDlg(FormatVersion(m_pEditor->GetFileVersion()), FormatRichTextCopyrightNotice());
|
||||
aboutDlg.exec();
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Reflect property control classes to the serialize context...
|
||||
@@ -1756,7 +1756,7 @@ BOOL CCryEditApp::InitInstance()
|
||||
}
|
||||
}
|
||||
|
||||
SetEditorWindowTitle(0, AZ::Utils::GetProjectName().c_str(), 0);
|
||||
SetEditorWindowTitle(nullptr, AZ::Utils::GetProjectName().c_str(), nullptr);
|
||||
if (!GetIEditor()->IsInMatEditMode())
|
||||
{
|
||||
m_pEditor->InitFinished();
|
||||
@@ -1841,8 +1841,8 @@ void CCryEditApp::RegisterEventLoopHook(IEventLoopHook* pHook)
|
||||
|
||||
void CCryEditApp::UnregisterEventLoopHook(IEventLoopHook* pHookToRemove)
|
||||
{
|
||||
IEventLoopHook* pPrevious = 0;
|
||||
for (IEventLoopHook* pHook = m_pEventLoopHook; pHook != 0; pHook = pHook->pNextHook)
|
||||
IEventLoopHook* pPrevious = nullptr;
|
||||
for (IEventLoopHook* pHook = m_pEventLoopHook; pHook != nullptr; pHook = pHook->pNextHook)
|
||||
{
|
||||
if (pHook == pHookToRemove)
|
||||
{
|
||||
@@ -1855,7 +1855,7 @@ void CCryEditApp::UnregisterEventLoopHook(IEventLoopHook* pHookToRemove)
|
||||
m_pEventLoopHook = pHookToRemove->pNextHook;
|
||||
}
|
||||
|
||||
pHookToRemove->pNextHook = 0;
|
||||
pHookToRemove->pNextHook = nullptr;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1878,7 +1878,7 @@ void CCryEditApp::LoadFile(QString fileName)
|
||||
|
||||
if (MainWindow::instance() || m_pConsoleDialog)
|
||||
{
|
||||
SetEditorWindowTitle(0, AZ::Utils::GetProjectName().c_str(), GetIEditor()->GetGameEngine()->GetLevelName());
|
||||
SetEditorWindowTitle(nullptr, AZ::Utils::GetProjectName().c_str(), GetIEditor()->GetGameEngine()->GetLevelName());
|
||||
}
|
||||
|
||||
GetIEditor()->SetModifiedFlag(false);
|
||||
@@ -1919,7 +1919,7 @@ void CCryEditApp::EnableAccelerator([[maybe_unused]] bool bEnable)
|
||||
CMainFrame *mainFrame = (CMainFrame*)m_pMainWnd;
|
||||
if (mainFrame->m_hAccelTable)
|
||||
DestroyAcceleratorTable( mainFrame->m_hAccelTable );
|
||||
mainFrame->m_hAccelTable = NULL;
|
||||
mainFrame->m_hAccelTable = nullptr;
|
||||
mainFrame->LoadAccelTable( MAKEINTRESOURCE(IDR_GAMEACCELERATOR) );
|
||||
CLogFile::WriteLine( "Disable Accelerators" );
|
||||
}
|
||||
@@ -2256,7 +2256,7 @@ void CCryEditApp::EnableIdleProcessing()
|
||||
AZ_Assert(m_disableIdleProcessingCounter >= 0, "m_disableIdleProcessingCounter must be nonnegative");
|
||||
}
|
||||
|
||||
BOOL CCryEditApp::OnIdle([[maybe_unused]] LONG lCount)
|
||||
bool CCryEditApp::OnIdle([[maybe_unused]] LONG lCount)
|
||||
{
|
||||
if (0 == m_disableIdleProcessingCounter)
|
||||
{
|
||||
@@ -2264,7 +2264,7 @@ BOOL CCryEditApp::OnIdle([[maybe_unused]] LONG lCount)
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3139,7 +3139,7 @@ void CCryEditApp::OnCreateLevel()
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CCryEditApp::CreateLevel(bool& wasCreateLevelOperationCancelled)
|
||||
{
|
||||
BOOL bIsDocModified = GetIEditor()->GetDocument()->IsModified();
|
||||
bool bIsDocModified = GetIEditor()->GetDocument()->IsModified();
|
||||
if (GetIEditor()->GetDocument()->IsDocumentReady() && bIsDocModified)
|
||||
{
|
||||
QString str = QObject::tr("Level %1 has been changed. Save Level?").arg(GetIEditor()->GetGameEngine()->GetLevelName());
|
||||
@@ -3227,11 +3227,11 @@ bool CCryEditApp::CreateLevel(bool& wasCreateLevelOperationCancelled)
|
||||
|
||||
#ifdef WIN32
|
||||
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
NULL,
|
||||
nullptr,
|
||||
dw,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
windowsErrorMessage.data(),
|
||||
windowsErrorMessage.length(), NULL);
|
||||
windowsErrorMessage.length(), nullptr);
|
||||
_getcwd(cwd.data(), cwd.length());
|
||||
#else
|
||||
windowsErrorMessage = strerror(dw);
|
||||
@@ -3641,24 +3641,12 @@ void CCryEditApp::OnToolsPreferences()
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnSwitchToDefaultCamera()
|
||||
{
|
||||
CViewport* vp = GetIEditor()->GetViewManager()->GetSelectedViewport();
|
||||
if (CRenderViewport* rvp = viewport_cast<CRenderViewport*>(vp))
|
||||
{
|
||||
rvp->SetDefaultCamera();
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnUpdateSwitchToDefaultCamera(QAction* action)
|
||||
{
|
||||
Q_ASSERT(action->isCheckable());
|
||||
CViewport* pViewport = GetIEditor()->GetViewManager()->GetSelectedViewport();
|
||||
if (CRenderViewport* rvp = viewport_cast<CRenderViewport*>(pViewport))
|
||||
{
|
||||
action->setEnabled(true);
|
||||
action->setChecked(rvp->IsDefaultCamera());
|
||||
}
|
||||
else
|
||||
{
|
||||
action->setEnabled(false);
|
||||
}
|
||||
@@ -3667,39 +3655,12 @@ void CCryEditApp::OnUpdateSwitchToDefaultCamera(QAction* action)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnSwitchToSequenceCamera()
|
||||
{
|
||||
CViewport* vp = GetIEditor()->GetViewManager()->GetSelectedViewport();
|
||||
if (CRenderViewport* rvp = viewport_cast<CRenderViewport*>(vp))
|
||||
{
|
||||
rvp->SetSequenceCamera();
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnUpdateSwitchToSequenceCamera(QAction* action)
|
||||
{
|
||||
Q_ASSERT(action->isCheckable());
|
||||
|
||||
CViewport* pViewport = GetIEditor()->GetViewManager()->GetSelectedViewport();
|
||||
|
||||
if (CRenderViewport* rvp = viewport_cast<CRenderViewport*>(pViewport))
|
||||
{
|
||||
bool enableAction = false;
|
||||
|
||||
// only enable if we're editing a sequence in Track View and have cameras in the level
|
||||
if (GetIEditor()->GetAnimation()->GetSequence())
|
||||
{
|
||||
|
||||
AZ::EBusAggregateResults<AZ::EntityId> componentCameras;
|
||||
Camera::CameraBus::BroadcastResult(componentCameras, &Camera::CameraRequests::GetCameras);
|
||||
|
||||
const int numCameras = componentCameras.values.size();
|
||||
enableAction = (numCameras > 0);
|
||||
}
|
||||
|
||||
action->setEnabled(enableAction);
|
||||
action->setChecked(rvp->IsSequenceCamera());
|
||||
}
|
||||
else
|
||||
{
|
||||
action->setEnabled(false);
|
||||
}
|
||||
@@ -3708,31 +3669,12 @@ void CCryEditApp::OnUpdateSwitchToSequenceCamera(QAction* action)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnSwitchToSelectedcamera()
|
||||
{
|
||||
CViewport* vp = GetIEditor()->GetViewManager()->GetSelectedViewport();
|
||||
if (CRenderViewport* rvp = viewport_cast<CRenderViewport*>(vp))
|
||||
{
|
||||
rvp->SetSelectedCamera();
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnUpdateSwitchToSelectedCamera(QAction* action)
|
||||
{
|
||||
Q_ASSERT(action->isCheckable());
|
||||
AzToolsFramework::EntityIdList selectedEntityList;
|
||||
AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(selectedEntityList, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities);
|
||||
AZ::EBusAggregateResults<AZ::EntityId> cameras;
|
||||
Camera::CameraBus::BroadcastResult(cameras, &Camera::CameraRequests::GetCameras);
|
||||
bool isCameraComponentSelected = selectedEntityList.size() > 0 ? AZStd::find(cameras.values.begin(), cameras.values.end(), *selectedEntityList.begin()) != cameras.values.end() : false;
|
||||
|
||||
CViewport* pViewport = GetIEditor()->GetViewManager()->GetSelectedViewport();
|
||||
CRenderViewport* rvp = viewport_cast<CRenderViewport*>(pViewport);
|
||||
if (isCameraComponentSelected && rvp)
|
||||
{
|
||||
action->setEnabled(true);
|
||||
action->setChecked(rvp->IsSelectedCamera());
|
||||
}
|
||||
else
|
||||
{
|
||||
action->setEnabled(false);
|
||||
}
|
||||
@@ -3741,11 +3683,7 @@ void CCryEditApp::OnUpdateSwitchToSelectedCamera(QAction* action)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CCryEditApp::OnSwitchcameraNext()
|
||||
{
|
||||
CViewport* vp = GetIEditor()->GetActiveView();
|
||||
if (CRenderViewport* rvp = viewport_cast<CRenderViewport*>(vp))
|
||||
{
|
||||
rvp->CycleCamera();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -3818,7 +3756,7 @@ bool CCryEditApp::IsInRegularEditorMode()
|
||||
|
||||
void CCryEditApp::OnOpenQuickAccessBar()
|
||||
{
|
||||
if (m_pQuickAccessBar == NULL)
|
||||
if (m_pQuickAccessBar == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -4166,7 +4104,7 @@ extern "C" int AZ_DLL_EXPORT CryEditMain(int argc, char* argv[])
|
||||
|
||||
int exitCode = 0;
|
||||
|
||||
BOOL didCryEditStart = CCryEditApp::instance()->InitInstance();
|
||||
bool didCryEditStart = CCryEditApp::instance()->InitInstance();
|
||||
AZ_Error("Editor", didCryEditStart, "O3DE Editor did not initialize correctly, and will close."
|
||||
"\nThis could be because of incorrectly configured components, or missing required gems."
|
||||
"\nSee other errors for more details.");
|
||||
|
||||
Reference in New Issue
Block a user