Filtered non-games are now included in the GamelistInfo field.

This commit is contained in:
Leon Styhre 2020-11-08 19:04:43 +01:00
parent 3aa10177cf
commit 162d893ea0
6 changed files with 28 additions and 7 deletions

View file

@ -70,7 +70,7 @@ It's possible to manually set a specific gamelist view style in the UI settings
In additions to the styles just described, there is a **Grid** view style as well, but as of version 1.0.0 this is very limited and not recommended. Future versions of EmulationStation may update this style to a more useful state. In additions to the styles just described, there is a **Grid** view style as well, but as of version 1.0.0 this is very limited and not recommended. Future versions of EmulationStation may update this style to a more useful state.
If the theme supports it, there's a gamelist information field displayed in the gamelist view, showing the number of games for the system (total and favorites) as well as a folder icon if a folder has been entered. When applying any filters to the gamelist, the game counter is replaced with the amount of games filtered (as in 'filtered / total games'). This functionality is specific to EmulationStation Desktop Edition so older themes will not support this. If the theme supports it, there's a gamelist information field displayed in the gamelist view, showing the number of games for the system (total and favorites) as well as a folder icon if a folder has been entered. When applying any filters to the gamelist, the game counter is replaced with the amount of games filtered, as in 'filtered / total games', e.g. '19 / 77'. If there are game entries in the filter result that are marked not to be counted as games, the number of such files will be indicated like 'filtered + filtered non-games / total games', for example '23 + 4 / 77' indicating 23 normal games, 4 non-games out of a total of 77. Due to this approach it's theoretically possible that the combined filtered game amount exceeds the number of counted games in the collection, for instance '69 + 11 / 77'. This is not considered a bug and is so by design. This gamelist information field functionality is specific to EmulationStation Desktop Edition so older themes will not support this.
## Help system ## Help system

View file

@ -358,8 +358,13 @@ void DetailedGameListView::updateInfoPanel()
gamelistInfoString = "\uF07C "; gamelistInfoString = "\uF07C ";
if (mIsFiltered) { if (mIsFiltered) {
if (mFilteredGameCountAll == mFilteredGameCount)
gamelistInfoString += "\uF0b0 " + std::to_string(mFilteredGameCount) + " / " + gamelistInfoString += "\uF0b0 " + std::to_string(mFilteredGameCount) + " / " +
std::to_string(mGameCount); std::to_string(mGameCount);
else
gamelistInfoString += "\uF0b0 " + std::to_string(mFilteredGameCount) + " + " +
std::to_string(mFilteredGameCountAll - mFilteredGameCount) + " / " +
std::to_string(mGameCount);
} }
else { else {
gamelistInfoString += "\uF11b " + std::to_string(mGameCount); gamelistInfoString += "\uF11b " + std::to_string(mGameCount);

View file

@ -446,8 +446,13 @@ void GridGameListView::updateInfoPanel()
std::string gamelistInfoString; std::string gamelistInfoString;
if (mIsFiltered) { if (mIsFiltered) {
if (mFilteredGameCountAll == mFilteredGameCount)
gamelistInfoString += "\uF0b0 " + std::to_string(mFilteredGameCount) + " / " + gamelistInfoString += "\uF0b0 " + std::to_string(mFilteredGameCount) + " / " +
std::to_string(mGameCount); std::to_string(mGameCount);
else
gamelistInfoString += "\uF0b0 " + std::to_string(mFilteredGameCount) + " + " +
std::to_string(mFilteredGameCountAll - mFilteredGameCount) + " / " +
std::to_string(mGameCount);
} }
else { else {
gamelistInfoString += "\uF11b " + std::to_string(mGameCount); gamelistInfoString += "\uF11b " + std::to_string(mGameCount);

View file

@ -370,10 +370,15 @@ void ISimpleGameListView::generateGamelistInfo(const std::vector<FileData*>& fil
mGameCount = gameCount.first + gameCount.second; mGameCount = gameCount.first + gameCount.second;
mFavoritesGameCount = gameCount.second; mFavoritesGameCount = gameCount.second;
mFilteredGameCount = 0; mFilteredGameCount = 0;
mFilteredGameCountAll = 0;
if (idx->isFiltered()) { if (idx->isFiltered()) {
mIsFiltered = true; mIsFiltered = true;
mFilteredGameCount = mRoot->getFilesRecursive(GAME, true, false).size(); mFilteredGameCount = mRoot->getFilesRecursive(GAME, true, false).size();
// Also count the games that are set to not be counted as games, as the filter may
// apply to such entries as well and this will be indicated with a separate '+ XX'
// in the GamelistInfo field.
mFilteredGameCountAll = mRoot->getFilesRecursive(GAME, true, true).size();
} }
if (files.size() > 0 && files.front()->getParent() != mRoot) if (files.size() > 0 && files.front()->getParent() != mRoot)

View file

@ -55,6 +55,7 @@ protected:
unsigned int mGameCount; unsigned int mGameCount;
unsigned int mFavoritesGameCount; unsigned int mFavoritesGameCount;
unsigned int mFilteredGameCount; unsigned int mFilteredGameCount;
unsigned int mFilteredGameCountAll;
bool mIsFiltered; bool mIsFiltered;
bool mIsFolder; bool mIsFolder;
}; };

View file

@ -401,8 +401,13 @@ void VideoGameListView::updateInfoPanel()
gamelistInfoString = "\uF07C "; gamelistInfoString = "\uF07C ";
if (mIsFiltered) { if (mIsFiltered) {
if (mFilteredGameCountAll == mFilteredGameCount)
gamelistInfoString += "\uF0b0 " + std::to_string(mFilteredGameCount) + " / " + gamelistInfoString += "\uF0b0 " + std::to_string(mFilteredGameCount) + " / " +
std::to_string(mGameCount); std::to_string(mGameCount);
else
gamelistInfoString += "\uF0b0 " + std::to_string(mFilteredGameCount) + " + " +
std::to_string(mFilteredGameCountAll - mFilteredGameCount) + " / " +
std::to_string(mGameCount);
} }
else { else {
gamelistInfoString += "\uF11b " + std::to_string(mGameCount); gamelistInfoString += "\uF11b " + std::to_string(mGameCount);