Changed Play Console from comments in PR.

This commit is contained in:
jjjoness
2021-04-27 18:37:14 +01:00
parent 275d99359d
commit 0607f6efa6
6 changed files with 14 additions and 33 deletions
+6 -25
View File
@@ -1171,15 +1171,17 @@ void MainWindow::InitActions()
am->AddAction(ID_AUDIO_REFRESH_AUDIO_SYSTEM, tr("Refresh Audio"))
.Connect(&QAction::triggered, this, &MainWindow::OnRefreshAudioSystem);
// Fame actions
am->AddAction(ID_TOOLBAR_WIDGET_SWITCHTOGAME, tr("Play Console"))
// Game actions
am->AddAction(ID_VIEW_SWITCHTOGAME, tr("Play Game"))
.SetIcon(QIcon(":/stylesheet/img/UI20/toolbar/Play.svg"))
.SetShortcut(tr("Ctrl+G"))
.SetToolTip(tr("Play Console (Ctrl+G)"))
.SetToolTip(tr("Play Game (Ctrl+G)"))
.SetStatusTip(tr("Activate the game input mode"))
.SetApplyHoverEffect()
.SetCheckable(true)
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdatePlayGame);
am->AddAction(ID_TOOLBAR_WIDGET_PLAYCONSOLE_LABEL, tr("Play Console"))
.SetText(tr("Play Console"));
am->AddAction(ID_SWITCH_PHYSICS, tr("Simulate"))
.SetShortcut(tr("Ctrl+P"))
.SetToolTip(tr("Simulate (Ctrl+P)"))
@@ -1499,24 +1501,6 @@ QWidget* MainWindow::CreateSpacerRightWidget()
return spacer;
}
QWidget* MainWindow::CreateSwitchToGameButton()
{
QWidget* playConsole = new QWidget();
QHBoxLayout* layout = new QHBoxLayout();
playConsole->setLayout(layout);
QLabel* label = new QLabel();
label->setText(tr("Play Console"));
QToolButton*play = new QToolButton();
play->setAutoRaise(true);
play->setDefaultAction(m_actionManager->GetAction(ID_TOOLBAR_WIDGET_SWITCHTOGAME));
layout->addWidget(label);
layout->addWidget(play);
return playConsole;
}
void MainWindow::InitEnvironmentModeMenu(CVarMenu* environmentModeMenu)
{
environmentModeMenu->clear();
@@ -1724,7 +1708,7 @@ void MainWindow::OnGameModeChanged(bool inGameMode)
{
menuBar()->setDisabled(inGameMode);
m_toolbarManager->SetEnabled(!inGameMode);
QAction* action = m_actionManager->GetAction(ID_TOOLBAR_WIDGET_SWITCHTOGAME);
QAction* action = m_actionManager->GetAction(ID_VIEW_SWITCHTOGAME);
action->blockSignals(true); // avoid a loop
action->setChecked(inGameMode);
action->blockSignals(false);
@@ -2426,9 +2410,6 @@ QWidget* MainWindow::CreateToolbarWidget(int actionId)
case ID_TOOLBAR_WIDGET_SPACER_RIGHT:
w = CreateSpacerRightWidget();
break;
case ID_TOOLBAR_WIDGET_SWITCHTOGAME:
w = CreateSwitchToGameButton();
break;
default:
qWarning() << Q_FUNC_INFO << "Unknown id " << actionId;
return nullptr;