Address some PR feedback

- Use AZ::IConsole instead of deprecated Cry IConsole.
- Create fullscreen preview widget on the same screen where the main window is found, instead of on the 'primary' screen
- Remove "ed_previewGameInFullscreen", which had the effect of always doing a full screen preview. If this functionality is desired, it should be re-added as a registry key instead of a cvar
This commit is contained in:
Yuriy Toporovskyy
2021-06-14 16:19:18 -04:00
parent 5becf25a79
commit 84492dee48
3 changed files with 15 additions and 25 deletions
+4 -2
View File
@@ -53,6 +53,7 @@ AZ_POP_DISABLE_WARNING
#include <AzCore/std/smart_ptr/make_shared.h>
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
#include <AzCore/Utils/Utils.h>
#include <AzCore/Console/IConsole.h>
// AzFramework
#include <AzFramework/Components/CameraBus.h>
@@ -356,6 +357,8 @@ CCryEditDoc* CCryDocManager::OpenDocumentFile(LPCTSTR lpszFileName, BOOL bAddToM
for (int i = idStart; i <= idEnd; ++i) \
ON_COMMAND(i, method);
AZ_CVAR_EXTERNED(bool, ed_previewGameInFullscreen_once);
void CCryEditApp::RegisterActionHandlers()
{
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
@@ -377,8 +380,7 @@ void CCryEditApp::RegisterActionHandlers()
ON_COMMAND(ID_FILE_EXPORTTOGAMENOSURFACETEXTURE, OnFileExportToGameNoSurfaceTexture)
ON_COMMAND(ID_VIEW_SWITCHTOGAME, OnViewSwitchToGame)
MainWindow::instance()->GetActionManager()->RegisterActionHandler(ID_VIEW_SWITCHTOGAME_FULLSCREEN, [this]() {
auto fs = gEnv->pConsole->GetCVar("ed_previewGameInFullscreen_once");
fs->Set(1);
ed_previewGameInFullscreen_once = true;
OnViewSwitchToGame();
});
ON_COMMAND(ID_MOVE_OBJECT, OnMoveObject)