Full screen game preview for Atom viewport

This commit is contained in:
Yuriy Toporovskyy
2021-06-14 10:02:49 -04:00
parent aee7fc72cc
commit 73d5617af3
7 changed files with 174 additions and 4 deletions
+12 -4
View File
@@ -949,6 +949,12 @@ void MainWindow::InitActions()
.SetApplyHoverEffect()
.SetCheckable(true)
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdatePlayGame);
am->AddAction(ID_VIEW_SWITCHTOGAME_FULLSCREEN, tr("Play &Game (Maximized)"))
.SetShortcut(tr("Ctrl+Shift+G"))
.SetStatusTip(tr("Activate the game input mode (maximized)"))
.SetIcon(Style::icon("Play"))
.SetApplyHoverEffect()
.SetCheckable(true);
am->AddAction(ID_TOOLBAR_WIDGET_PLAYCONSOLE_LABEL, tr("Play Controls"))
.SetText(tr("Play Controls"));
am->AddAction(ID_SWITCH_PHYSICS, tr("Simulate"))
@@ -1266,10 +1272,12 @@ void MainWindow::OnGameModeChanged(bool inGameMode)
{
menuBar()->setDisabled(inGameMode);
m_toolbarManager->SetEnabled(!inGameMode);
QAction* action = m_actionManager->GetAction(ID_VIEW_SWITCHTOGAME);
action->blockSignals(true); // avoid a loop
action->setChecked(inGameMode);
action->blockSignals(false);
// avoid a loop
AZStd::vector<QAction*> actions = { m_actionManager->GetAction(ID_VIEW_SWITCHTOGAME), m_actionManager->GetAction(ID_VIEW_SWITCHTOGAME_FULLSCREEN) };
for (auto action : actions) action->blockSignals(true);
for (auto action : actions) action->setChecked(inGameMode);
for (auto action : actions) action->blockSignals(false);
}
void MainWindow::OnEditorNotifyEvent(EEditorNotifyEvent ev)