diff --git a/projects/frontend/data/resources/recalbox_x_kubii.svg b/projects/frontend/data/resources/recalbox_x_kubii.svg
deleted file mode 100755
index c9dc00e8e916e189caa400cd74b9c4cfc038b3bb..0000000000000000000000000000000000000000
--- a/projects/frontend/data/resources/recalbox_x_kubii.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/projects/frontend/data/resources/wizard/arcade_panel.svg b/projects/frontend/data/resources/wizard/arcade_panel.svg
new file mode 100644
index 0000000000000000000000000000000000000000..85eeb01ca2c04c4a704058c200c5aa42071991ed
--- /dev/null
+++ b/projects/frontend/data/resources/wizard/arcade_panel.svg
@@ -0,0 +1,104 @@
+
diff --git a/projects/frontend/data/resources/wizard/cardreader.png b/projects/frontend/data/resources/wizard/cardreader.png
new file mode 100644
index 0000000000000000000000000000000000000000..ae3c85a724b69e736157964d9645310d7b68948e
Binary files /dev/null and b/projects/frontend/data/resources/wizard/cardreader.png differ
diff --git a/projects/frontend/data/resources/wizard/controller.svg b/projects/frontend/data/resources/wizard/controller.svg
new file mode 100644
index 0000000000000000000000000000000000000000..72367c41b8f4d012a0e534ab78df812f17cb3457
--- /dev/null
+++ b/projects/frontend/data/resources/wizard/controller.svg
@@ -0,0 +1,122 @@
+
diff --git a/projects/frontend/data/resources/wizard/logo_recaltower_text_reduced.svg b/projects/frontend/data/resources/wizard/logo_recaltower_text_reduced.svg
new file mode 100644
index 0000000000000000000000000000000000000000..2dfc6938337312cf600845316b4627e2689da609
--- /dev/null
+++ b/projects/frontend/data/resources/wizard/logo_recaltower_text_reduced.svg
@@ -0,0 +1,18 @@
+
diff --git a/projects/frontend/data/resources/pad_info_fr.svg b/projects/frontend/data/resources/wizard/pad_info_fr.svg
similarity index 100%
rename from projects/frontend/data/resources/pad_info_fr.svg
rename to projects/frontend/data/resources/wizard/pad_info_fr.svg
diff --git a/projects/frontend/es-app/src/MainRunner.cpp b/projects/frontend/es-app/src/MainRunner.cpp
index 02fe7b0d1454130684c23ee5db0e9e135d91b0af..2428c2aa387926296e95e9e59d6b6ec64c46e044 100644
--- a/projects/frontend/es-app/src/MainRunner.cpp
+++ b/projects/frontend/es-app/src/MainRunner.cpp
@@ -24,7 +24,6 @@
#include "DemoMode.h"
#include "RootFolders.h"
#include "web/RestApiServer.h"
-#include "guis/wizards/WizardLite.h"
#include "network/Networks.h"
#include "guis/GuiSearch.h"
#include "guis/menus/modaltasks/MenuModalRescanRoms.h"
@@ -43,6 +42,7 @@
#include
#include
#include "utils/os/system/ProcessTree.h"
+#include "guis/wizards/WizardWelcome.h"
MainRunner::ExitState MainRunner::sRequestedExitState = MainRunner::ExitState::Quit;
bool MainRunner::sQuitRequested = false;
@@ -500,12 +500,6 @@ void MainRunner::CheckAlert(WindowManager& window, SystemManager& systemManager)
}
}
-void MainRunner::CheckRecalboxLite(WindowManager& window)
-{
- if (RecalboxSystem::IsLiteVersion())
- window.pushGui(new WizardLite(window));
-}
-
void MainRunner::CheckFirstTimeWizard(WindowManager& window)
{
if (RecalboxConf::Instance().GetFirstTimeUse())
@@ -551,12 +545,18 @@ void MainRunner::CheckFirstTimeWizard(WindowManager& window)
case BoardType::OdroidUnknown:
default:
{
- CheckRecalboxLite(window);
+ if (WizardWelcome::ShouldShowWizard())
+ window.pushGui(new WizardWelcome(window));
break;
}
}
RecalboxConf::Instance().SetFirstTimeUse(false);
}
+ else
+ {
+ if (WizardWelcome::ShouldShowWizard())
+ window.pushGui(new WizardWelcome(window));
+ }
}
void MainRunner::CheckBootNotification(WindowManager& window)
diff --git a/projects/frontend/es-app/src/MainRunner.h b/projects/frontend/es-app/src/MainRunner.h
index d388ae9785053e9542477b2d0a5986f3f34503e0..7ea55b0012667799d29fa93d28a674c8e659b294 100644
--- a/projects/frontend/es-app/src/MainRunner.h
+++ b/projects/frontend/es-app/src/MainRunner.h
@@ -208,11 +208,6 @@ class MainRunner
*/
static void CheckBootNotification(WindowManager& window);
- /*!
- * @brief Check Recalbox Lite status and show wizard
- */
- static void CheckRecalboxLite(WindowManager& window);
-
/*!
* @brief Initialize input configurations
* @param window Main window
diff --git a/projects/frontend/es-app/src/guis/wizards/WizardBase.cpp b/projects/frontend/es-app/src/guis/wizards/WizardBase.cpp
index 95d760726654f6efc6dd3453ee38974c0ea416cd..8e42ea0351293e906bb7722e282780155a0881b3 100644
--- a/projects/frontend/es-app/src/guis/wizards/WizardBase.cpp
+++ b/projects/frontend/es-app/src/guis/wizards/WizardBase.cpp
@@ -98,7 +98,7 @@ void WizardBase::Update(int deltaTime)
Component::Update(deltaTime);
if (mCurrentPage < 0)
- SetPage(0);
+ SetPage(FirstPage());
}
void WizardBase::SetPage(int page)
@@ -135,7 +135,16 @@ void WizardBase::DoButtonClick(int index)
{
if (index < 0)
{
- if (mCurrentPage < mPageCount - 1) SetPage(mCurrentPage + 1);
+ if (mCurrentPage < mPageCount - 1)
+ {
+ int nextPage = mCurrentPage + 1;
+ while (OnNextClick(nextPage) == Move::Forward && nextPage < mPageCount)
+ nextPage++;
+ if (nextPage < mPageCount)
+ SetPage(nextPage);
+ else
+ Close();
+ }
else Close();
}
else switch(OnButtonClick(mCurrentPage, index))
@@ -162,3 +171,8 @@ void WizardBase::UpdatePage()
{
SetPage(mCurrentPage);
}
+
+void WizardBase::SetTitle(const String& title)
+{
+ mTitle->setText(title);
+}
diff --git a/projects/frontend/es-app/src/guis/wizards/WizardBase.h b/projects/frontend/es-app/src/guis/wizards/WizardBase.h
index 01025602cf4d0b12a9fbe3224e0d9e6c4aee0bb3..9a979ea01840cf0db199b91ef174d98b2bdfcca7 100644
--- a/projects/frontend/es-app/src/guis/wizards/WizardBase.h
+++ b/projects/frontend/es-app/src/guis/wizards/WizardBase.h
@@ -65,6 +65,19 @@ class WizardBase: public Gui
*/
virtual Move OnButtonClick(int page, int buttonIndex) = 0;
+ /*!
+ * @brief Called when a button the 'next' is clicked allowing to execute custom operations as skip optional page
+ * @param nextPage next page
+ * @return
+ */
+ virtual Move OnNextClick(int nextPage) { return Move::None; }
+
+ /*!
+ * @brief Called when a button the 'next' is clicked allowing to execute custom operations as skip optional page
+ * @return
+ */
+ virtual int FirstPage() { return 0; }
+
/*!
* @brief Called when the help bar is being to be refreshed
* @param page Page to display
@@ -85,6 +98,13 @@ class WizardBase: public Gui
*/
void UpdatePage();
+ /*!
+ * @brief Set the title of the current page
+ * @param title the title
+ * @return
+ */
+ void SetTitle(const String& title);
+
private:
//! "Window" background
NinePatchComponent mBackground;
diff --git a/projects/frontend/es-app/src/guis/wizards/WizardLite.cpp b/projects/frontend/es-app/src/guis/wizards/WizardLite.cpp
deleted file mode 100644
index 145b83da4ee7611385e2cb56a0a0b6df5a55b634..0000000000000000000000000000000000000000
--- a/projects/frontend/es-app/src/guis/wizards/WizardLite.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-//
-// Created by bkg2k on 11/10/23.
-//
-
-#include "WizardLite.h"
-#include "components/PictureComponent.h"
-#include "themes/ThemeManager.h"
-#include "guis/menus/MenuProvider.h"
-
-WizardBase::Move WizardLite::OnKeyReceived(int page, const InputCompactEvent& event)
-{
- if (page != 0)
- if (event.CancelReleased()) return Move::Backward;
-
- return Move::None;
-}
-
-bool WizardLite::OnComponentRequired(int page, int componentIndex, Rectangle& where, std::shared_ptr& component)
-{
- switch((Pages)page)
- {
- case Pages::Intro:
- {
- if (componentIndex == 0)
- {
- component = std::make_shared(mWindow, Path(":/recalbox_x_kubii.svg"), ImgProps::KeepRatio);
- where = Rectangle(0, 0, 2, 10);
- return true;
- }
- if (componentIndex == 1)
- {
- const MenuThemeData& menuTheme = ThemeManager::Instance().Menu();
- String text = _("Recalbox et Kubii vous remercient pour votre confiance !\n"
- "\n"
- "Profitons de ce premier lancement pour découvrir ensemble comment utiliser votre Recalbox.");
- std::shared_ptr textComponent = std::make_shared(mWindow, text, menuTheme.Text().font, menuTheme.Text().color, ::Alignment::CenterLeft);
- textComponent->setVerticalAlignment(::VerticalAlignment::Top);
- component = textComponent;
- where = Rectangle(3, 1, 7, 9);
- return true;
- }
- break;
- }
- case Pages::HowTo:
- {
- if (componentIndex == 0)
- {
- component = std::make_shared(mWindow, Path(":/pad_info_fr.svg"), ImgProps::KeepRatio);
- where = Rectangle(0, 5, 10, 5);
- return true;
- }
- if (componentIndex == 1)
- {
- const MenuThemeData& menuTheme = ThemeManager::Instance().Menu();
- String text = _("Vous pouvez naviguer dans les menus à l’aide de la croix directionnelle, sélectionner un système ou un jeu à l’aide du bouton B et en sortir à l’aide du bouton A.\n\n"
- "Accédez au menu principal à l’aide du bouton START.\n"
- "Pour sortir d’un jeu, appuyez simultanément sur les boutons SELECT et START");
- std::shared_ptr textComponent = std::make_shared(mWindow, text, menuTheme.Text().font, menuTheme.Text().color, ::Alignment::CenterLeft);
- textComponent->setVerticalAlignment(::VerticalAlignment::Top);
- component = textComponent;
- where = Rectangle(0, 0, 10, 5);
- return true;
- }
- break;
- }
- case Pages::AddGames:
- {
- if (componentIndex == 0)
- {
- component = std::make_shared(mWindow, Path(":/win_network_share.png"), ImgProps::KeepRatio);
- where = Rectangle(0, 5, 10, 5);
- return true;
- }
- if (componentIndex == 1)
- {
- const MenuThemeData& menuTheme = ThemeManager::Instance().Menu();
- String text = _("Recalbox partage ses dossiers de roms, de bios et de sauvegardes sur le réseau local. Pour ajouter vos roms, rien de plus simple : sur votre ordinateur, recherchez votre “recalbox” dans les partages réseaux.\n"
- "Accédez au dossier roms, et copiez ensuite votre jeu dans le dossier correspondant à son système. Par exemple, pour ajouter un jeu “NES”, copiez-le dans le dossier 'roms/nes'.");
- std::shared_ptr textComponent = std::make_shared(mWindow, text, menuTheme.Text().font, menuTheme.Text().color, ::Alignment::CenterLeft);
- textComponent->setVerticalAlignment(::VerticalAlignment::Top);
- component = textComponent;
- where = Rectangle(0, 0, 10, 5);
- return true;
- }
- break;
- }
- case Pages::Update:
- {
- if (componentIndex == 0)
- {
- component = std::make_shared(mWindow, Path(":/recalbox_qrcode.svg"), ImgProps::KeepRatio);
- where = Rectangle(0, 0, 3, 10);
- return true;
- }
- if (componentIndex == 1)
- {
- const MenuThemeData& menuTheme = ThemeManager::Instance().Menu();
- String text = _("Passez gratuitement à la version complète du système en connectant votre recalbox à internet et profitez de tous les émulateurs et de toutes les fonctionnalités !\n\n"
- "Une fois votre Recalbox connectée, une mise à jour vous sera proposée automatiquement.\n\n"
- "Retrouvez des infos utiles et des tutoriels sur recalbox.com, ou sur le wiki recalbox en scannant le qr code.");
- std::shared_ptr textComponent = std::make_shared(mWindow, text, menuTheme.Text().font, menuTheme.Text().color, ::Alignment::CenterLeft);
- textComponent->setVerticalAlignment(::VerticalAlignment::Top);
- component = textComponent;
- where = Rectangle(4, 0, 6, 10);
- return true;
- }
- break;
- }
- case Pages::Count: break;
- }
-
- return false;
-}
-
-bool WizardLite::OnButtonRequired(int page, int buttonIndex, String& buttonText)
-{
- if ((Pages)page == Pages::Update && buttonIndex == 0)
- {
- buttonText = _("NETWORK SETTINGS");
- return true;
- }
- return false;
-}
-
-WizardBase::Move WizardLite::OnButtonClick(int page, int buttonIndex)
-{
- if ((Pages)page == Pages::Update && buttonIndex == 0)
- MenuProvider::ShowMenu(MenuContainerType::Network, InheritableContext());
- //mWindow.pushGui(new MenuNetwork(mWindow));
-
- return Move::None;
-}
diff --git a/projects/frontend/es-app/src/guis/wizards/WizardWelcome.cpp b/projects/frontend/es-app/src/guis/wizards/WizardWelcome.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..0a445f44ed6f2db0642fe160ce031b13243ecf77
--- /dev/null
+++ b/projects/frontend/es-app/src/guis/wizards/WizardWelcome.cpp
@@ -0,0 +1,279 @@
+//
+// Created by bkg2k on 11/10/23.
+//
+
+#include "WizardWelcome.h"
+#include "components/PictureComponent.h"
+#include "themes/ThemeManager.h"
+#include "guis/menus/MenuProvider.h"
+#include "hardware/cardreader/CardReader.h"
+
+
+WizardBase::Move WizardWelcome::OnKeyReceived(int page, const InputCompactEvent& event)
+{
+ if (page != 0)
+ if (event.CancelReleased()) return Move::Backward;
+
+ return Move::None;
+}
+
+bool WizardWelcome::OnComponentRequired(int page, int componentIndex, Rectangle& where, std::shared_ptr& component)
+{
+ switch((Pages)page)
+ {
+ case Pages::Intro:
+ {
+ if (componentIndex == 0)
+ {
+ const MenuThemeData& menuTheme = ThemeManager::Instance().Menu();
+
+ component = ShouldShowLite() ? std::make_shared(mWindow, Path(":/wizard/logo_recaltower_text_reduced.svg"), ImgProps::KeepRatio) : std::make_shared(mWindow, Path(":/recalbox.svg"), ImgProps::KeepRatio);
+ component->setColor(menuTheme.Text().color);
+ where = Rectangle(0, 0, 3, 15);
+ return true;
+ }
+ if (componentIndex == 1)
+ {
+ const MenuThemeData& menuTheme = ThemeManager::Instance().Menu();
+ String text = _("The Recalbox team thanks you for your trust!\n\n"
+ "Let's take advantage of this first launch to discover together how to use:\n- your Recalbox");
+
+ if (ShouldShowLite())
+ text.Append(" and its Recaltower");
+ if (!ShouldShowJAMMA2())
+ text.Append("\n- your controller");
+ if (ShouldShowDUAL2())
+ text.Append("\n- your Recalbox RGB DUAL 2");
+ if (ShouldShowJAMMA2())
+ text.Append("\n- your Recalbox RGB JAMMA 2");
+ if (ShouldShowCardReader())
+ text.Append("\n- your Recalbox Card Reader");
+
+ if (!ShouldShowJAMMA2() && InputManager::Instance().ConfiguredControllersCount() == 0)
+ text.Append("\n\nPlease connect your controller via USB and press X to continue.");
+ std::shared_ptr textComponent = std::make_shared(mWindow, text, *menuTheme.Text().font, menuTheme.Text().color, ::Alignment::TopLeft);
+ component = textComponent;
+ where = Rectangle(3, 1, 7, 9);
+ return true;
+ }
+ break;
+ }
+ case Pages::Controller:
+ {
+ SetTitle(_("Controller"));
+ if (componentIndex == 0)
+ {
+ component = std::make_shared(mWindow, Path(":/wizard/controller.svg"), ImgProps::KeepRatio);
+ where = Rectangle(0, 6, 10, 4);
+ return true;
+ }
+ if (componentIndex == 1)
+ {
+ const MenuThemeData& menuTheme = ThemeManager::Instance().Menu();
+ String text = _(
+ "You can navigate through the menus using the directional pad, **select a system**, or start a game with the **B button**. The **A button** allows you to exit a menu or game list.\n\n"
+ "Access the **main menu** using the **START button**.\n"
+ "To exit a game, press the SELECT and START buttons simultaneously.");
+ std::shared_ptr textComponent = std::make_shared(mWindow, text, *menuTheme.Text().font, menuTheme.Text().color, ::Alignment::TopLeft);
+ component = textComponent;
+ where = Rectangle(0, 0, 10, 6);
+ return true;
+ }
+ break;
+ }
+ case Pages::JAMMA2:
+ {
+ SetTitle(_("RGB JAMMA 2"));
+ if (componentIndex == 0)
+ {
+ component = std::make_shared(mWindow, Path(":/wizard/arcade_panel.svg"), ImgProps::KeepRatio);
+ where = Rectangle(0, 6, 10, 4);
+ return true;
+ }
+ if (componentIndex == 1)
+ {
+ const MenuThemeData& menuTheme = ThemeManager::Instance().Menu();
+ String text = _("You can navigate through the menus using the joystick, **select a system**, or start a game with the **button 1**. The **button 2** allows you to exit a menu or game list."
+ "\n\nAccess the **main menu** using the **START button**.\nTo **exit a game**, **press and hold START** for 4 seconds and release.");
+ std::shared_ptr textComponent = std::make_shared(mWindow, text, *menuTheme.Text().font, menuTheme.Text().color, ::Alignment::TopLeft);
+ component = textComponent;
+ where = Rectangle(0, 0, 10, 6);
+ RecalboxConf::Instance().SetFirstInstallJamma2(false).Save();
+ return true;
+ }
+ break;
+ }
+ case Pages::DUAL2:
+ {
+ SetTitle(_("RGB DUAL 2"));
+ if (componentIndex == 0)
+ {
+ component = std::make_shared(mWindow, Path(":/crt/logorgbdual2.png"), ImgProps::KeepRatio);
+ where = Rectangle(0, 0, 3, 10);
+ return true;
+ }
+ if (componentIndex == 1)
+ {
+ const MenuThemeData& menuTheme = ThemeManager::Instance().Menu();
+ String text = _("Your Recalbox RGB DUAL 2 has been detected and installed automatically! You can now enjoy **all your games** on Recalbox with **perfect pixels and frequency**!");
+ if (Board::Instance().CrtBoard().IsCrtAdapterAttached())
+ text.Append(_("\n\nConsider this: you can automatically switch back to **HDMI mode** by connecting an HDMI cable and restarting Recalbox!"));
+ else
+ text.Append(_("\n\nAn HDMI cable has been detected and the “HDMI priority” mode is enabled in the options. To switch back to CRT mode, disconnect the HDMI cable and restart, or disable the HDMI priority option in the Recalbox RGB DUAL 2 (START) menu options."));
+
+
+ std::shared_ptr textComponent = std::make_shared(mWindow, text, *menuTheme.Text().font, menuTheme.Text().color, ::Alignment::TopLeft);
+ component = textComponent;
+ where = Rectangle(3, 0, 6, 10);
+
+ RecalboxConf::Instance().SetFirstInstallDual2(false).Save();
+ return true;
+ }
+ break;
+ }
+ case Pages::CardReader:
+ {
+ SetTitle(_("Recalbox Card Reader"));
+ if (componentIndex == 0)
+ {
+ component = std::make_shared(mWindow, Path(":/wizard/cardreader.png"), ImgProps::KeepRatio);
+ where = Rectangle(0, 6, 10, 4);
+ return true;
+ }
+ if (componentIndex == 1)
+ {
+ const MenuThemeData& menuTheme = ThemeManager::Instance().Menu();
+ String text = _("Your Recalbox Card Reader has been detected and **installed automatically!**\n\nYou can start using it right away by **inserting a card** into the reader and going to the game of your choice to **associate the game and card** using the **menu** available with the **START** button.");
+ std::shared_ptr textComponent = std::make_shared(mWindow, text, *menuTheme.Text().font, menuTheme.Text().color, ::Alignment::TopLeft);
+ component = textComponent;
+ where = Rectangle(0, 0, 10, 6);
+ RecalboxConf::Instance().SetFirstInstallCardReader(false).Save();
+ return true;
+ }
+ break;
+ }
+ case Pages::AddGames:
+ {
+ SetTitle(_("Add games"));
+ if (componentIndex == 0)
+ {
+ component = std::make_shared(mWindow, Path(":/win_network_share.png"), ImgProps::KeepRatio);
+ where = Rectangle(0, 5, 10, 5);
+ return true;
+ }
+ if (componentIndex == 1)
+ {
+ const MenuThemeData& menuTheme = ThemeManager::Instance().Menu();
+ String text = _("Recalbox shares its ROM, BIOS, and save files folders on the local network. Adding your ROMs couldn't be easier: on your computer, search for your “recalbox” in the network shares.\n"
+ "Go to the ROMs folder, then copy your game to the folder corresponding to its system. For example, to add a “NES” game, copy it to the ‘roms/nes’ folder.");
+ std::shared_ptr textComponent = std::make_shared(mWindow, text, *menuTheme.Text().font, menuTheme.Text().color, ::Alignment::TopLeft);
+ component = textComponent;
+ where = Rectangle(0, 0, 10, 5);
+ return true;
+ }
+ break;
+ }
+ case Pages::Update:
+ {
+ SetTitle(_("Update"));
+ if (componentIndex == 0)
+ {
+ component = std::make_shared(mWindow, Path(":/recalbox_qrcode.svg"), ImgProps::KeepRatio);
+ where = Rectangle(0, 0, 2, 10);
+ return true;
+ }
+ if (componentIndex == 1)
+ {
+ const MenuThemeData& menuTheme = ThemeManager::Instance().Menu();
+ String text;
+ if (ShouldShowLite())
+ text.Append(_("You are currently using the *Lite* version of Recalbox. **Upgrade to the full version of the system for free** by connecting your Recalbox to the internet and enjoy all the emulators and features!\n\n"));
+ else
+ text.Append(_("Remember to connect your Recalbox to the internet to enjoy all its features!\n"));
+ text.Append(_("Updates will be offered to you automatically.\n\n"
+ "Find useful information and tutorials at recalbox.com, or on the recalbox wiki by scanning the QR code."));
+ std::shared_ptr textComponent = std::make_shared(mWindow, text, *menuTheme.Text().font, menuTheme.Text().color, ::Alignment::TopLeft);
+ component = textComponent;
+ where = Rectangle(3, 0, 7, 10);
+ RecalboxConf::Instance().SetFirstTimeUse(false).Save();
+ return true;
+ }
+ break;
+ }
+ case Pages::Count: break;
+ }
+
+ return false;
+}
+
+bool WizardWelcome::OnButtonRequired(int page, int buttonIndex, String& buttonText)
+{
+ if ((Pages)page == Pages::Update && buttonIndex == 0)
+ {
+ buttonText = _("NETWORK SETTINGS");
+ return true;
+ }
+ return false;
+}
+
+WizardBase::Move WizardWelcome::OnButtonClick(int page, int buttonIndex)
+{
+ if ((Pages)page == Pages::Update && buttonIndex == 0)
+ MenuProvider::ShowMenu(MenuContainerType::Network, InheritableContext());
+ //mWindow.pushGui(new MenuNetwork(mWindow));
+
+ if ((Pages)page == Pages::CardReader && true)
+ return Move::Forward;
+ return Move::None;
+}
+
+WizardBase::Move WizardWelcome::OnNextClick(int nextPage)
+{
+ if ( ((Pages)nextPage == Pages::DUAL2 && !ShouldShowDUAL2())
+ || ((Pages)nextPage == Pages::CardReader && !ShouldShowCardReader())
+ || ((Pages)nextPage == Pages::JAMMA2 && !ShouldShowJAMMA2())
+ || ((Pages)nextPage == Pages::Controller && ShouldShowJAMMA2())
+ || ((Pages)nextPage >= Pages::AddGames && !ShouldShowFirstInstall()))
+ return Move::Forward;
+ return Move::None;
+}
+
+int WizardWelcome::FirstPage()
+{
+ if (ShouldShowFirstInstall()) return static_cast(Pages::Intro);
+ if (ShouldShowDUAL2()) return static_cast(Pages::DUAL2);
+ if (ShouldShowJAMMA2()) return static_cast(Pages::JAMMA2);
+ if (ShouldShowCardReader()) return static_cast(Pages::CardReader);
+ return 0;
+}
+
+bool WizardWelcome::ShouldShowLite()
+{
+ return RecalboxSystem::IsLiteVersion();
+}
+
+bool WizardWelcome::ShouldShowFirstInstall()
+{
+ return RecalboxConf::Instance().GetFirstTimeUse();
+}
+
+bool WizardWelcome::ShouldShowJAMMA2()
+{
+ return Board::Instance().CrtBoard().GetCrtAdapter() == CrtAdapterType::RGBJamma && RecalboxConf::Instance().GetFirstInstallJamma2();
+}
+
+bool WizardWelcome::ShouldShowDUAL2()
+{
+ return Board::Instance().CrtBoard().GetCrtAdapter() == CrtAdapterType::RGBDual2 && RecalboxConf::Instance().GetFirstInstallDual2();
+}
+
+bool WizardWelcome::ShouldShowCardReader()
+{
+ return CardReader::Instance().IsAvailable() && RecalboxConf::Instance().GetFirstInstallCardReader();
+}
+
+bool WizardWelcome::ShouldShowWizard()
+{
+ return ShouldShowFirstInstall() || ShouldShowDUAL2() || ShouldShowJAMMA2() || ShouldShowCardReader();
+}
+
diff --git a/projects/frontend/es-app/src/guis/wizards/WizardLite.h b/projects/frontend/es-app/src/guis/wizards/WizardWelcome.h
similarity index 68%
rename from projects/frontend/es-app/src/guis/wizards/WizardLite.h
rename to projects/frontend/es-app/src/guis/wizards/WizardWelcome.h
index a1d0c258b1f6918bca406eba56926fbf8ee01be2..139f973ee4fe3addf6d5048637c24452150dd228 100644
--- a/projects/frontend/es-app/src/guis/wizards/WizardLite.h
+++ b/projects/frontend/es-app/src/guis/wizards/WizardWelcome.h
@@ -3,26 +3,35 @@
//
#pragma once
+#include "RecalboxConf.h"
#include "WizardBase.h"
+#include "hardware/Board.h"
+#include "hardware/crt/CrtAdapterType.h"
+#include "recalbox/RecalboxSystem.h"
#include "utils/locale/LocaleHelper.h"
-class WizardLite : public WizardBase
+class WizardWelcome : public WizardBase
{
public:
enum class Pages
{
Intro,
- HowTo,
+ Controller,
+ DUAL2,
+ JAMMA2,
+ CardReader,
AddGames,
Update,
Count,
};
- explicit WizardLite(WindowManager& window)
+ explicit WizardWelcome(WindowManager& window)
: WizardBase(window, _("WELCOME TO RECALBOX!"), int(Pages::Count), true)
{
}
+ static bool ShouldShowWizard();
+
private:
//! Called when a key event is received
@@ -66,4 +75,25 @@ class WizardLite : public WizardBase
* @param help Help to fill-in
*/
void OnHelpRequired(int page, Help& help) override { (void)page; (void)help; }
+
+ /*!
+ * @brief Called when a button the 'next' is clicked allowing to execute custom operations as skip optional page
+ * @param page Current page
+ * @param buttonIndex
+ * @return
+ */
+ Move OnNextClick(int nextPage) override;
+
+ /*!
+ * @brief Called when a button the 'next' is clicked allowing to execute custom operations as skip optional page
+ * @return
+ */
+ int FirstPage() override;
+
+ static bool ShouldShowFirstInstall();
+ static bool ShouldShowLite();
+ static bool ShouldShowJAMMA2();
+ static bool ShouldShowDUAL2();
+ static bool ShouldShowCardReader();
+
};
diff --git a/projects/frontend/es-core/src/RecalboxConf.h b/projects/frontend/es-core/src/RecalboxConf.h
index cddd2488b32e326a0e22ee1cf403c6b9e7f59f5a..6f57b208b15f6aede95ecbc55f4ce1ba6e70756f 100644
--- a/projects/frontend/es-core/src/RecalboxConf.h
+++ b/projects/frontend/es-core/src/RecalboxConf.h
@@ -328,6 +328,9 @@ class RecalboxConf: public IniFile, public StaticLifeCycleControler