Quick savestate menu

This commit is contained in:
Jeffrey Pfau 2014-10-15 23:53:01 -07:00
parent be9363b7f4
commit e2de508b99
1 changed files with 18 additions and 0 deletions

View File

@ -187,6 +187,24 @@ void Window::setupMenu(QMenuBar* menubar) {
connect(saveState, &QAction::triggered, [this]() { this->openStateWindow(LoadSave::SAVE); });
m_gameActions.append(saveState);
emulationMenu->addAction(saveState);
QMenu* quickLoadMenu = emulationMenu->addMenu(tr("Quick load"));
QMenu* quickSaveMenu = emulationMenu->addMenu(tr("Quick save"));
int i;
for (i = 1; i < 10; ++i) {
QAction* quickLoad = new QAction(tr("State &%1").arg(i), quickLoadMenu);
quickLoad->setShortcut(tr("F%1").arg(i));
connect(quickLoad, &QAction::triggered, [this, i]() { m_controller->loadState(i); });
m_gameActions.append(quickLoad);
quickLoadMenu->addAction(quickLoad);
QAction* quickSave = new QAction(tr("State &%1").arg(i), quickSaveMenu);
quickSave->setShortcut(tr("Shift+F%1").arg(i));
connect(quickSave, &QAction::triggered, [this, i]() { m_controller->saveState(i); });
m_gameActions.append(quickSave);
quickSaveMenu->addAction(quickSave);
}
emulationMenu->addSeparator();
QAction* pause = new QAction(tr("&Pause"), emulationMenu);