block power-on options dialog when not a valid ROM is selected

This commit is contained in:
thrust26 2020-01-26 08:53:27 +01:00
parent 380c28c94e
commit 665e54747a
2 changed files with 7 additions and 5 deletions

View File

@ -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;

View File

@ -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;