From 665e54747a5460027b322441228572afd32de106 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Sun, 26 Jan 2020 08:53:27 +0100 Subject: [PATCH] block power-on options dialog when not a valid ROM is selected --- src/gui/LauncherDialog.cxx | 10 ++++++---- src/gui/R77HelpDialog.cxx | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index a3fe2d71b..3fb563360 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -376,9 +376,9 @@ void LauncherDialog::handleKeyDown(StellaKey key, StellaMod mod, bool repeated) switch(key) { case KBDK_F8: // front ("Skill P2") - myGlobalProps->open(); + if (!currentNode().isDirectory() && Bankswitch::isValidRomName(currentNode())) + myGlobalProps->open(); break; - case KBDK_F4: // back ("COLOR", "B/W") openSettings(); break; @@ -408,7 +408,8 @@ void LauncherDialog::handleJoyDown(int stick, int button, bool longPress) // open power-up options and settings for 2nd and 4th button if not mapped otherwise Event::Type e = instance().eventHandler().eventForJoyButton(EventMode::kMenuMode, stick, button); - if (button == 1 && (e == Event::UIOK || e == Event::NoType)) + if (button == 1 && (e == Event::UIOK || e == Event::NoType) && + !currentNode().isDirectory() && Bankswitch::isValidRomName(currentNode())) myGlobalProps->open(); if (button == 3 && (e == Event::Event::UITabPrev || e == Event::NoType)) openSettings(); @@ -497,7 +498,8 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd, break; case ListWidget::kLongButtonPressCmd: - myGlobalProps->open(); + if (!currentNode().isDirectory() && Bankswitch::isValidRomName(currentNode())) + myGlobalProps->open(); myEventHandled = true; break; diff --git a/src/gui/R77HelpDialog.cxx b/src/gui/R77HelpDialog.cxx index 3941e1540..617f783be 100644 --- a/src/gui/R77HelpDialog.cxx +++ b/src/gui/R77HelpDialog.cxx @@ -115,7 +115,7 @@ void R77HelpDialog::updateStrings(uInt8 page, uInt8 lines, string& title) ADD_BIND("\\c2Button 4", "4:3,16:9", "Open command dialog"); ADD_BIND("\\c2Button 5", "FRY", "Return to launcher"); ADD_BIND("\\c2Button 6", "\\c2-", "Open settings"); - ADD_BIND("\\c2Button 7", "-", "Rewind game"); + ADD_BIND("\\c2Button 7", "\\c2-", "Rewind game"); ADD_BIND("\\c2Button 8", "MODE", "Select"); ADD_BIND("\\c2Button 9", "RESET", "Reset"); break;