diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index 8144d2e87..c7447ba57 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -446,7 +446,7 @@ void GuiMenu::openUISettings() // Enable the 'Y' button for tagging games as favorites. auto favorites_add_button = std::make_shared(mWindow); favorites_add_button->setState(Settings::getInstance()->getBool("FavoritesAddButton")); - s->addWithLabel("ENABLE SHORTCUT TO TOGGLE FAVORITES", favorites_add_button); + s->addWithLabel("ENABLE TOGGLE FAVORITES BUTTON", favorites_add_button); s->addSaveFunc([favorites_add_button, s] { if (Settings::getInstance()->getBool("FavoritesAddButton") != favorites_add_button->getState()) { @@ -456,6 +456,19 @@ void GuiMenu::openUISettings() } }); + // Enable the thumbstick click buttons for jumping to a random system or game. + auto random_add_button = std::make_shared(mWindow); + random_add_button->setState(Settings::getInstance()->getBool("RandomAddButton")); + s->addWithLabel("ENABLE RANDOM SYSTEM OR GAME BUTTON", random_add_button); + s->addSaveFunc([random_add_button, s] { + if (Settings::getInstance()->getBool("RandomAddButton") != + random_add_button->getState()) { + Settings::getInstance()->setBool("RandomAddButton", + random_add_button->getState()); + s->setNeedsSaving(); + } + }); + // Gamelist filters. auto gamelist_filters = std::make_shared(mWindow); gamelist_filters->setState(Settings::getInstance()->getBool("GamelistFilters")); diff --git a/es-app/src/views/SystemView.cpp b/es-app/src/views/SystemView.cpp index ef57a39e6..8f2494e13 100644 --- a/es-app/src/views/SystemView.cpp +++ b/es-app/src/views/SystemView.cpp @@ -232,9 +232,10 @@ bool SystemView::input(InputConfig* config, Input input) NavigationSounds::getInstance()->playThemeNavigationSound(SELECTSOUND); return true; } - if (config->isMappedTo("x", input)) { - // Get random system. - // Go to system. + if (Settings::getInstance()->getBool("RandomAddButton") && + (config->isMappedTo("leftthumbstickclick", input) || + config->isMappedTo("rightthumbstickclick", input))) { + // Get a random system and jump to it. NavigationSounds::getInstance()->playThemeNavigationSound(SYSTEMBROWSESOUND); setCursor(SystemData::getRandomSystem(getSelected())); return true; @@ -422,8 +423,11 @@ std::vector SystemView::getHelpPrompts() prompts.push_back(HelpPrompt("up/down", "choose")); else prompts.push_back(HelpPrompt("left/right", "choose")); + prompts.push_back(HelpPrompt("a", "select")); - prompts.push_back(HelpPrompt("x", "random")); + + if (Settings::getInstance()->getBool("RandomAddButton")) + prompts.push_back(HelpPrompt("thumbstickclick", "random")); if (!UIModeController::getInstance()->isUIModeKid() && Settings::getInstance()->getBool("ScreensaverControls")) diff --git a/es-app/src/views/gamelist/BasicGameListView.cpp b/es-app/src/views/gamelist/BasicGameListView.cpp index 96e682f46..d852ea61f 100644 --- a/es-app/src/views/gamelist/BasicGameListView.cpp +++ b/es-app/src/views/gamelist/BasicGameListView.cpp @@ -314,8 +314,8 @@ std::vector BasicGameListView::getHelpPrompts() prompts.push_back(HelpPrompt("b", "back")); if (!UIModeController::getInstance()->isUIModeKid()) prompts.push_back(HelpPrompt("select", "options")); - if (mRoot->getSystem()->isGameSystem()) - prompts.push_back(HelpPrompt("x", "random")); + if (mRoot->getSystem()->isGameSystem() && Settings::getInstance()->getBool("RandomAddButton")) + prompts.push_back(HelpPrompt("thumbstickclick", "random")); if (mRoot->getSystem()->getThemeFolder() == "custom-collections" && !CollectionSystemsManager::get()->isEditing() && mCursorStack.empty() && diff --git a/es-app/src/views/gamelist/ISimpleGameListView.cpp b/es-app/src/views/gamelist/ISimpleGameListView.cpp index 0bedd5521..e8d5c498a 100644 --- a/es-app/src/views/gamelist/ISimpleGameListView.cpp +++ b/es-app/src/views/gamelist/ISimpleGameListView.cpp @@ -195,10 +195,12 @@ bool ISimpleGameListView::input(InputConfig* config, Input input) return true; } } - else if (config->isMappedTo("x", input)) { + else if (Settings::getInstance()->getBool("RandomAddButton") && + (config->isMappedTo("leftthumbstickclick", input) || + config->isMappedTo("rightthumbstickclick", input))) { if (mRoot->getSystem()->isGameSystem() && getCursor()->getType() != PLACEHOLDER) { stopListScrolling(); - // Go to random system game. + // Jump to a random game. NavigationSounds::getInstance()->playThemeNavigationSound(SCROLLSOUND); FileData* randomGame = getCursor()->getSystem()->getRandomGame(getCursor()); if (randomGame) diff --git a/es-core/src/Settings.cpp b/es-core/src/Settings.cpp index 3df09a059..0ed3518e0 100644 --- a/es-core/src/Settings.cpp +++ b/es-core/src/Settings.cpp @@ -133,6 +133,7 @@ void Settings::setDefaults() mBoolMap["FavoritesStar"] = { true, true }; mBoolMap["ListScrollOverlay"] = { false, false }; mBoolMap["FavoritesAddButton"] = { true, true }; + mBoolMap["RandomAddButton"] = { true, true }; mBoolMap["GamelistFilters"] = { true, true }; mBoolMap["QuickSystemSelect"] = { true, true }; mBoolMap["ShowHelpPrompts"] = { true, true };