diff --git a/RetroFE/Source/Database/GlobalOpts.cpp b/RetroFE/Source/Database/GlobalOpts.cpp index 23ddbfc2d..d21805f5f 100644 --- a/RetroFE/Source/Database/GlobalOpts.cpp +++ b/RetroFE/Source/Database/GlobalOpts.cpp @@ -135,6 +135,7 @@ const global_options::options_entry global_options::s_option_entries[] = { nullptr, nullptr, global_options::option_type::HEADER, "WINDOWS ONLY OPTIONS" }, { OPTION_LEDBLINKYDIRECTORY, "", global_options::option_type::PATH, "Path to LEDBlinky installation" }, + { OPTION_LEDBLINKYCLOSEONEXIT, "true", global_options::option_type::BOOLEAN, "If set to false, LEDBlinky will not close with RetroFE and keep the session open" }, { nullptr, nullptr, global_options::option_type::HEADER, "MEDIA SEARCH PATH OPTIONS" }, { OPTION_BASEMEDIAPATH, "", global_options::option_type::PATH, "Path to media if stored outside the build" }, diff --git a/RetroFE/Source/Database/GlobalOpts.h b/RetroFE/Source/Database/GlobalOpts.h index a937786a7..1f496f9b6 100644 --- a/RetroFE/Source/Database/GlobalOpts.h +++ b/RetroFE/Source/Database/GlobalOpts.h @@ -128,6 +128,7 @@ // WINDOWS ONLY OPTIONS #define OPTION_LEDBLINKYDIRECTORY "LEDBlinkyDirectory" +#define OPTION_LEDBLINKYCLOSEONEXIT "LEDBlinkyCloseOnExit" // MEDIA SEARCH PATH OPTIONS #define OPTION_BASEMEDIAPATH "baseMediaPath" @@ -254,7 +255,8 @@ class global_options bool showparenthesis() { return bool_value(OPTION_SHOWPARENTHESIS); } bool showsquarebrackets() { return bool_value(OPTION_SHOWSQUAREBRACKETS); } - const char *ledblinkydirectory() { return value(OPTION_LEDBLINKYDIRECTORY); } + const char *ledblinkydirectory() const { return value(OPTION_LEDBLINKYDIRECTORY); } + bool ledblinkycloseonexit() const { return bool_value(OPTION_LEDBLINKYCLOSEONEXIT); } const char *basemediapath() { return value(OPTION_BASEMEDIAPATH); } const char *baseitempath() { return value(OPTION_BASEITEMPATH); } diff --git a/RetroFE/Source/Execute/Launcher.cpp b/RetroFE/Source/Execute/Launcher.cpp index bfda0b6c9..7d8684cd2 100644 --- a/RetroFE/Source/Execute/Launcher.cpp +++ b/RetroFE/Source/Execute/Launcher.cpp @@ -585,9 +585,15 @@ void Launcher::LEDBlinky(int command, std::string collection, Item* collectionIt } std::string args = std::to_string(command); bool wait = false; - if (command == 2) - wait = true; - if (command == 8) { + if ( command == 2 ) { + bool LEDBlinkyCloseOnExit; + config_.getProperty(OPTION_LEDBLINKYCLOSEONEXIT, LEDBlinkyCloseOnExit); + if (LEDBlinkyCloseOnExit == true) { + wait = true; + } + else wait = false; + } + if ( command == 8 ) { std::string launcherName = collectionItem->collectionInfo->launcher; std::string launcherFile = Utils::combinePath(Configuration::absolutePath, "collections", collectionItem->collectionInfo->name, "launchers", collectionItem->name + ".conf"); if (std::ifstream launcherStream(launcherFile.c_str()); launcherStream.good()) // Launcher file found diff --git a/RetroFE/Source/RetroFE.cpp b/RetroFE/Source/RetroFE.cpp index 2ebf66cd1..64f945b89 100644 --- a/RetroFE/Source/RetroFE.cpp +++ b/RetroFE/Source/RetroFE.cpp @@ -2250,11 +2250,14 @@ bool RetroFE::run() // Wait for onExit animation to finish before quitting RetroFE case RETROFE_QUIT: - if (currentPage_->isGraphicsIdle()) - { - l.LEDBlinky(2); - l.exitScript(); - running = false; + bool LEDBlinkyCloseOnExit = true; + config_.getProperty(OPTION_LEDBLINKYCLOSEONEXIT, LEDBlinkyCloseOnExit); + if ( currentPage_->isGraphicsIdle() ) { + if (LEDBlinkyCloseOnExit == true) { + l.LEDBlinky(2); + running = false; + } + else running = false; } break; }