From 53a29b8314cbd05d97f4c7fce94183c48e2a1cbe Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 21 Feb 2023 18:52:48 +0100 Subject: [PATCH] Changed the order of dialogs shown on application startup. Also made the startup animation finish before the dialogs are displayed. --- es-app/src/main.cpp | 35 ++++++++++++++--------------- es-app/src/views/ViewController.cpp | 21 ++++++++--------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index 0d5b1efd3..fe5ce6ea1 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -750,16 +750,6 @@ int main(int argc, char* argv[]) } } - // Check if any of the enabled systems have an invalid alternative emulator entry, - // which means that a label is present in the gamelist.xml file which is not matching - // any command tag in es_systems.xml. - for (auto system : SystemData::sSystemVector) { - if (system->getAlternativeEmulator().substr(0, 9) == "") { - ViewController::getInstance()->invalidAlternativeEmulatorDialog(); - break; - } - } - // Don't generate controller events while we're loading. SDL_GameControllerEventState(SDL_DISABLE); @@ -776,14 +766,17 @@ int main(int argc, char* argv[]) applicationUpdater->getResults(updaterResults); #endif } - // Open the input configuration GUI if the force flag was passed from the command line. - if (!loadSystemsStatus) { - if (forceInputConfig) { - window->pushGui(new GuiDetectDevice( - false, true, [] { ViewController::getInstance()->goToStart(true); })); - } - else { - ViewController::getInstance()->goToStart(true); + + if (!loadSystemsStatus) + ViewController::getInstance()->goToStart(true); + + // Check if any of the enabled systems have an invalid alternative emulator entry, + // which means that a label is present in the gamelist.xml file which is not matching + // any command tag in es_systems.xml. + for (auto system : SystemData::sSystemVector) { + if (system->getAlternativeEmulator().substr(0, 9) == "") { + ViewController::getInstance()->invalidAlternativeEmulatorDialog(); + break; } } @@ -808,6 +801,12 @@ int main(int argc, char* argv[]) ViewController::getInstance()->updateAvailableDialog(updaterResults); #endif + // Open the input configuration GUI if the force flag was passed from the command line. + if (forceInputConfig) { + ViewController::getInstance()->cancelViewTransitions(); + window->pushGui(new GuiDetectDevice(false, true, nullptr)); + } + // Main application loop. if (!SystemData::sStartupExitSignal) { diff --git a/es-app/src/views/ViewController.cpp b/es-app/src/views/ViewController.cpp index 3b0d2d449..2c956c6f7 100644 --- a/es-app/src/views/ViewController.cpp +++ b/es-app/src/views/ViewController.cpp @@ -65,7 +65,7 @@ void ViewController::invalidSystemsFileDialog() "SOMETHING IS LIKELY WRONG WITH YOUR XML SYNTAX. " "IF YOU DON'T HAVE A CUSTOM SYSTEMS FILE, THEN THE " "EMULATIONSTATION INSTALLATION IS BROKEN. SEE THE " - "APPLICATION LOG FILE es_log.txt FOR ADDITIONAL INFO."; + "APPLICATION LOG FILE es_log.txt FOR ADDITIONAL INFO"; mWindow->pushGui(new GuiMsgBox( HelpStyle(), errorMessage.c_str(), "QUIT", @@ -200,19 +200,20 @@ void ViewController::noGamesDialog() void ViewController::invalidAlternativeEmulatorDialog() { - mWindow->pushGui(new GuiMsgBox(getHelpStyle(), "AT LEAST ONE OF YOUR SYSTEMS HAS AN\n" - "INVALID ALTERNATIVE EMULATOR CONFIGURED\n" - "WITH NO MATCHING ENTRY IN THE SYSTEMS\n" - "CONFIGURATION FILE, PLEASE REVIEW YOUR\n" - "SETUP USING THE 'ALTERNATIVE EMULATORS'\n" - "INTERFACE IN THE 'OTHER SETTINGS' MENU")); + cancelViewTransitions(); + mWindow->pushGui(new GuiMsgBox(getHelpStyle(), + "AT LEAST ONE OF YOUR SYSTEMS HAS AN\n" + "INVALID ALTERNATIVE EMULATOR CONFIGURED\n" + "WITH NO MATCHING ENTRY IN THE SYSTEMS\n" + "CONFIGURATION FILE, PLEASE REVIEW YOUR\n" + "SETUP USING THE 'ALTERNATIVE EMULATORS'\n" + "INTERFACE IN THE 'OTHER SETTINGS' MENU", + "OK", nullptr, "", nullptr, "", nullptr, true, true)); } void ViewController::updateAvailableDialog(const std::string& message) { - if (isAnimationPlaying(0)) - finishAnimation(0); - + cancelViewTransitions(); mWindow->pushGui(new GuiMsgBox(getHelpStyle(), message, "OK", nullptr, "", nullptr, "", nullptr, true, true, (mRenderer->getIsVerticalOrientation() ?