diff --git a/es-app/src/views/gamelist/BasicGameListView.cpp b/es-app/src/views/gamelist/BasicGameListView.cpp index fba7106ca..fd65339af 100644 --- a/es-app/src/views/gamelist/BasicGameListView.cpp +++ b/es-app/src/views/gamelist/BasicGameListView.cpp @@ -266,7 +266,14 @@ std::vector BasicGameListView::getHelpPrompts() prompts.push_back(HelpPrompt("select", "options")); if (mRoot->getSystem()->isGameSystem()) prompts.push_back(HelpPrompt("x", "random")); - if (mRoot->getSystem()->isGameSystem() && !UIModeController::getInstance()->isUIModeKid() && + + if (mRoot->getSystem()->getThemeFolder() == "custom-collections" && + !CollectionSystemsManager::get()->isEditing() && mCursorStack.empty() && + ViewController::get()->getState().viewing == ViewController::GAME_LIST) { + prompts.push_back(HelpPrompt("y", "JUMP TO GAME")); + } + else if (mRoot->getSystem()->isGameSystem() && + !UIModeController::getInstance()->isUIModeKid() && !UIModeController::getInstance()->isUIModeKiosk() && (Settings::getInstance()->getBool("FavoritesAddButton") || CollectionSystemsManager::get()->isEditing())) { diff --git a/es-app/src/views/gamelist/DetailedGameListView.cpp b/es-app/src/views/gamelist/DetailedGameListView.cpp index b513c4277..f1d0719ef 100644 --- a/es-app/src/views/gamelist/DetailedGameListView.cpp +++ b/es-app/src/views/gamelist/DetailedGameListView.cpp @@ -329,12 +329,12 @@ void DetailedGameListView::updateInfoPanel() // the first of these so that we can display its game media. if (file->getSystem()->isCustomCollection() && file->getPath() == file->getSystem()->getName()) { - FileData* randomGame = CollectionSystemsManager::get()-> + mRandomGame = CollectionSystemsManager::get()-> updateCollectionFolderMetadata(file->getSystem()); - if (randomGame) { - mThumbnail.setImage(randomGame->getThumbnailPath()); - mMarquee.setImage(randomGame->getMarqueePath()); - mImage.setImage(randomGame->getImagePath()); + if (mRandomGame) { + mThumbnail.setImage(mRandomGame->getThumbnailPath()); + mMarquee.setImage(mRandomGame->getMarqueePath()); + mImage.setImage(mRandomGame->getImagePath()); } else { mThumbnail.setImage(""); diff --git a/es-app/src/views/gamelist/ISimpleGameListView.cpp b/es-app/src/views/gamelist/ISimpleGameListView.cpp index 755fcc531..5973f53ac 100644 --- a/es-app/src/views/gamelist/ISimpleGameListView.cpp +++ b/es-app/src/views/gamelist/ISimpleGameListView.cpp @@ -26,7 +26,8 @@ ISimpleGameListView::ISimpleGameListView( : IGameListView(window, root), mHeaderText(window), mHeaderImage(window), - mBackground(window) + mBackground(window), + mRandomGame(nullptr) { mHeaderText.setText("Logo Text"); mHeaderText.setSize(mSize.x(), 0); @@ -137,6 +138,8 @@ bool ISimpleGameListView::input(InputConfig* config, Input input) if (!newCursor) newCursor = getCursor(); setCursor(newCursor); + if (mRoot->getSystem()->getThemeFolder() == "custom-collections") + updateHelpPrompts(); } } @@ -153,6 +156,8 @@ bool ISimpleGameListView::input(InputConfig* config, Input input) setCursor(mCursorStack.top()); if (mCursorStack.size() > 0) mCursorStack.pop(); + if (mRoot->getSystem()->getThemeFolder() == "custom-collections") + updateHelpPrompts(); } else { NavigationSounds::getInstance()->playThemeNavigationSound(BACKSOUND); @@ -199,6 +204,17 @@ bool ISimpleGameListView::input(InputConfig* config, Input input) return true; } } + else if (config->isMappedTo("y", input) && + mRoot->getSystem()->getThemeFolder() == "custom-collections" && + !CollectionSystemsManager::get()->isEditing() && + mCursorStack.empty() && ViewController::get()->getState().viewing == + ViewController::GAME_LIST) { + // Jump to the randomly selected game. + if (mRandomGame) { + setCursor(mRandomGame); + updateHelpPrompts(); + } + } else if (config->isMappedTo("y", input) && !Settings::getInstance()->getBool("FavoritesAddButton") && !CollectionSystemsManager::get()->isEditing()) { @@ -226,7 +242,8 @@ bool ISimpleGameListView::input(InputConfig* config, Input input) if (getCursor()->getType() == FOLDER && foldersOnTop == true) foldersOnTop = !getCursor()->getParent()->getOnlyFoldersFlag(); - if (mRoot->getSystem()->isCustomCollection()) + if (mRoot->getSystem()->isCustomCollection() || + mRoot->getSystem()->getThemeFolder() == "custom-collections") favoritesSorting = Settings::getInstance()->getBool("FavFirstCustom"); else favoritesSorting = Settings::getInstance()->getBool("FavoritesFirst"); diff --git a/es-app/src/views/gamelist/ISimpleGameListView.h b/es-app/src/views/gamelist/ISimpleGameListView.h index ae3c37e5e..0cdcbce12 100644 --- a/es-app/src/views/gamelist/ISimpleGameListView.h +++ b/es-app/src/views/gamelist/ISimpleGameListView.h @@ -57,6 +57,8 @@ protected: std::vector mThemeExtras; std::stack mCursorStack; std::vector mCursorStackHistory; + // This game is randomly selected in the grouped custom collections view. + FileData* mRandomGame; std::vector mFirstLetterIndex; diff --git a/es-app/src/views/gamelist/VideoGameListView.cpp b/es-app/src/views/gamelist/VideoGameListView.cpp index 96dd397c7..55f909e00 100644 --- a/es-app/src/views/gamelist/VideoGameListView.cpp +++ b/es-app/src/views/gamelist/VideoGameListView.cpp @@ -355,12 +355,12 @@ void VideoGameListView::updateInfoPanel() // the first of these so that we can display its game media. if (file->getSystem()->isCustomCollection() && file->getPath() == file->getSystem()->getName()) { - FileData* randomGame = CollectionSystemsManager::get()-> + mRandomGame = CollectionSystemsManager::get()-> updateCollectionFolderMetadata(file->getSystem()); - if (randomGame) { - mThumbnail.setImage(randomGame->getThumbnailPath()); - mMarquee.setImage(randomGame->getMarqueePath()); - mVideo->setImage(randomGame->getImagePath()); + if (mRandomGame) { + mThumbnail.setImage(mRandomGame->getThumbnailPath()); + mMarquee.setImage(mRandomGame->getMarqueePath()); + mVideo->setImage(mRandomGame->getImagePath()); // Always stop the video before setting a new video as it will otherwise continue // to play if it has the same path (i.e. it is the same physical video file) as // the previously set video. @@ -368,7 +368,7 @@ void VideoGameListView::updateInfoPanel() // file inside, or as in this case, when entering a custom collection. mVideo->onHide(); - if (!mVideo->setVideo(randomGame->getVideoPath())) + if (!mVideo->setVideo(mRandomGame->getVideoPath())) mVideo->setDefaultVideo(); } else {