From 94498bb706a674709406a52f19dc0dcfc62b417f Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 31 Jan 2023 19:02:25 +0100 Subject: [PATCH] Fixed an issue where the gameselector element would include non-kid games while in kid UI mode. --- es-app/src/SystemData.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/es-app/src/SystemData.cpp b/es-app/src/SystemData.cpp index 2cbc60b74..6696c2245 100644 --- a/es-app/src/SystemData.cpp +++ b/es-app/src/SystemData.cpp @@ -1290,6 +1290,16 @@ FileData* SystemData::getRandomGame(const FileData* currentGame, bool gameSelect else { if (gameSelectorMode) { gameList = mRootFolder->getFilesRecursive(GAME, false, false); + if (Settings::getInstance()->getString("UIMode") == "kid") { + // Doing some extra work here instead of in FileData is OK as it's only needed + // for the rare combination of a gameselector being present while in kid mode. + for (auto it = gameList.begin(); it != gameList.end();) { + if (!(*it)->getKidgame()) + it = gameList.erase(it); + else + ++it; + } + } } else { gameList = ViewController::getInstance()