From 2b82770e43329f09d3a6ae2435dd184384f2b35a Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 20 Sep 2020 12:36:51 +0200 Subject: [PATCH] Fixed an issue where the quick selector couldn't find out if a game was a favorite. --- es-app/src/guis/GuiGamelistOptions.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/es-app/src/guis/GuiGamelistOptions.cpp b/es-app/src/guis/GuiGamelistOptions.cpp index 58b992e01..3e9bae9fa 100644 --- a/es-app/src/guis/GuiGamelistOptions.cpp +++ b/es-app/src/guis/GuiGamelistOptions.cpp @@ -69,8 +69,15 @@ GuiGamelistOptions::GuiGamelistOptions( mCurrentFirstCharacter = FOLDER_CHAR; } else { - if (mFavoritesSorting && file->getFavorite() && - mFirstLetterIndex.front() == FAVORITE_CHAR) + // Check if the currently selected game is a favorite. + bool isFavorite = false; + if (mFirstLetterIndex.size() == 1 && mFirstLetterIndex.front() == FAVORITE_CHAR) + isFavorite = true; + else if (mFirstLetterIndex.size() > 1 && (mFirstLetterIndex.front() == FAVORITE_CHAR || + mFirstLetterIndex[1] == FAVORITE_CHAR)) + isFavorite = true; + + if (mFavoritesSorting && file->getFavorite() && isFavorite) mCurrentFirstCharacter = FAVORITE_CHAR; else mCurrentFirstCharacter = toupper(file->getSortName().front());