mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix fast forward crashing when no game is loaded
This commit is contained in:
parent
56c6e3b497
commit
55330698cb
|
@ -1163,6 +1163,7 @@ void Window::setupMenu(QMenuBar* menubar) {
|
||||||
m_controller->forceFastForward(value);
|
m_controller->forceFastForward(value);
|
||||||
});
|
});
|
||||||
addControlledAction(emulationMenu, turbo, "fastForward");
|
addControlledAction(emulationMenu, turbo, "fastForward");
|
||||||
|
m_gameActions.append(turbo);
|
||||||
|
|
||||||
QMenu* ffspeedMenu = emulationMenu->addMenu(tr("Fast forward speed"));
|
QMenu* ffspeedMenu = emulationMenu->addMenu(tr("Fast forward speed"));
|
||||||
ConfigOption* ffspeed = m_config->addOption("fastForwardRatio");
|
ConfigOption* ffspeed = m_config->addOption("fastForwardRatio");
|
||||||
|
@ -1178,9 +1179,13 @@ void Window::setupMenu(QMenuBar* menubar) {
|
||||||
m_config->updateOption("fastForwardRatio");
|
m_config->updateOption("fastForwardRatio");
|
||||||
|
|
||||||
m_shortcutController->addFunctions(emulationMenu, [this]() {
|
m_shortcutController->addFunctions(emulationMenu, [this]() {
|
||||||
|
if (m_controller) {
|
||||||
m_controller->setRewinding(true);
|
m_controller->setRewinding(true);
|
||||||
|
}
|
||||||
}, [this]() {
|
}, [this]() {
|
||||||
|
if (m_controller) {
|
||||||
m_controller->setRewinding(false);
|
m_controller->setRewinding(false);
|
||||||
|
}
|
||||||
}, QKeySequence("`"), tr("Rewind (held)"), "holdRewind");
|
}, QKeySequence("`"), tr("Rewind (held)"), "holdRewind");
|
||||||
|
|
||||||
QAction* rewind = new QAction(tr("Re&wind"), emulationMenu);
|
QAction* rewind = new QAction(tr("Re&wind"), emulationMenu);
|
||||||
|
|
Loading…
Reference in New Issue