Fixed an issue where the gameselector element would include non-kid games while in kid UI mode.

This commit is contained in:
Leon Styhre 2023-01-31 19:02:25 +01:00
parent f5b4356444
commit 94498bb706

View file

@ -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()