diff --git a/src/duckstation-qt/mainwindow.cpp b/src/duckstation-qt/mainwindow.cpp index 030a292a5..8dd37fd3f 100644 --- a/src/duckstation-qt/mainwindow.cpp +++ b/src/duckstation-qt/mainwindow.cpp @@ -435,7 +435,7 @@ void MainWindow::updateEmulationActions(bool starting, bool running) { m_ui.actionStartDisc->setDisabled(starting || running); m_ui.actionStartBios->setDisabled(starting || running); - m_ui.actionPowerOff->setDisabled(starting || running); + m_ui.actionResumeLastState->setDisabled(starting || running); m_ui.actionPowerOff->setDisabled(starting || !running); m_ui.actionReset->setDisabled(starting || !running); @@ -490,6 +490,7 @@ void MainWindow::connectSignals() connect(m_ui.actionStartDisc, &QAction::triggered, this, &MainWindow::onStartDiscActionTriggered); connect(m_ui.actionStartBios, &QAction::triggered, this, &MainWindow::onStartBIOSActionTriggered); + connect(m_ui.actionResumeLastState, &QAction::triggered, m_host_interface, &QtHostInterface::resumeSystemFromMostRecentState); connect(m_ui.actionChangeDisc, &QAction::triggered, [this] { m_ui.menuChangeDisc->exec(QCursor::pos()); }); connect(m_ui.actionChangeDiscFromFile, &QAction::triggered, this, &MainWindow::onChangeDiscFromFileActionTriggered); connect(m_ui.actionChangeDiscFromGameList, &QAction::triggered, this, diff --git a/src/duckstation-qt/mainwindow.ui b/src/duckstation-qt/mainwindow.ui index 455a93579..fe0b3aa41 100644 --- a/src/duckstation-qt/mainwindow.ui +++ b/src/duckstation-qt/mainwindow.ui @@ -69,6 +69,7 @@ + @@ -97,6 +98,7 @@ + @@ -163,7 +165,7 @@ - + @@ -202,7 +204,7 @@ :/icons/folder-open.png:/icons/folder-open.png - Refresh + &Refresh Game List @@ -506,6 +508,18 @@ &Memory Card Settings... + + + + :/icons/media-playback-start.png:/icons/media-playback-start.png + + + Resume + + + Resumes the last save state created. + + diff --git a/src/duckstation-qt/qthostinterface.cpp b/src/duckstation-qt/qthostinterface.cpp index d5a95412f..22718173c 100644 --- a/src/duckstation-qt/qthostinterface.cpp +++ b/src/duckstation-qt/qthostinterface.cpp @@ -227,6 +227,17 @@ void QtHostInterface::resumeSystemFromState(const QString& filename, bool boot_o HostInterface::ResumeSystemFromState(filename.toStdString().c_str(), boot_on_failure); } +void QtHostInterface::resumeSystemFromMostRecentState() +{ + if (!isOnWorkerThread()) + { + QMetaObject::invokeMethod(this, "resumeSystemFromMostRecentState"); + return; + } + + HostInterface::ResumeSystemFromMostRecentState(); +} + void QtHostInterface::onDisplayWindowKeyEvent(int key, bool pressed) { DebugAssert(isOnWorkerThread()); diff --git a/src/duckstation-qt/qthostinterface.h b/src/duckstation-qt/qthostinterface.h index f56a75085..edc38776e 100644 --- a/src/duckstation-qt/qthostinterface.h +++ b/src/duckstation-qt/qthostinterface.h @@ -118,6 +118,7 @@ public Q_SLOTS: void onDisplayWindowMouseButtonEvent(int button, bool pressed); void bootSystem(const SystemBootParameters& params); void resumeSystemFromState(const QString& filename, bool boot_on_failure); + void resumeSystemFromMostRecentState(); void powerOffSystem(); void synchronousPowerOffSystem(); void resetSystem();