mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
Added menu options to disable the favorite star markings.
This commit is contained in:
parent
d01be2ecba
commit
01cf401d8f
|
@ -620,6 +620,9 @@ Whether to place all folders on top of the gamelists. If done so, the folders wi
|
||||||
|
|
||||||
Whether to sort your favorite games above your other games in the gamelists.
|
Whether to sort your favorite games above your other games in the gamelists.
|
||||||
|
|
||||||
|
**Add star markings to favorite games**
|
||||||
|
With this setting enabled, there is a star symbol added at the beginning of the game name in the gamelist views. It's strongly recommended to keep this setting enabled if the option to sort favorite games above non-favorites has been enabled. If not, favorite games would be sorted on top of the gamelist with no visual indication that they are favorites, which would be very confusing.
|
||||||
|
|
||||||
**Gamelist filters**
|
**Gamelist filters**
|
||||||
|
|
||||||
Activating or deactivating the ability to filter your gamelists. Can normally be left on.
|
Activating or deactivating the ability to filter your gamelists. Can normally be left on.
|
||||||
|
@ -756,7 +759,11 @@ This lets you create a completely custom collection with a name that you choose.
|
||||||
|
|
||||||
**Sort favorites on top for custom collections**
|
**Sort favorites on top for custom collections**
|
||||||
|
|
||||||
Whether to sort your favorite games above your other games. This is disabled by default, as for collections you normally want to be able to mix all games regardless of whether they are favorites or not.
|
Whether to sort your favorite games above your other games. This is disabled by default, as for collections you probably want to be able to mix all games regardless of whether they are favorites or not.
|
||||||
|
|
||||||
|
**Display star markings for custom collections**
|
||||||
|
|
||||||
|
With this option enabled, there is a star marking added to each favorite game name. It works identically to the setting 'Add star markings to favorite games' but is applied specifically to custom collections. It's disabled by default.
|
||||||
|
|
||||||
**Group unthemed custom collections**
|
**Group unthemed custom collections**
|
||||||
|
|
||||||
|
|
|
@ -760,27 +760,51 @@ FileData* CollectionSystemManager::updateCollectionFolderMetadata(SystemData* sy
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gameCount > 0) {
|
if (gameCount > 0) {
|
||||||
switch (gameCount) {
|
if (Settings::getInstance()->getBool("CollectionShowSystemInfo")) {
|
||||||
case 1:
|
switch (gameCount) {
|
||||||
desc = "This collection contains 1 game: '" + gamesList[0]->metadata.get("name") +
|
case 1:
|
||||||
" [" + gamesList[0]->getSourceFileData()->getSystem()->getName() + "]'.";
|
desc = "This collection contains 1 game: '" +
|
||||||
break;
|
gamesList[0]->metadata.get("name") + " [" +
|
||||||
case 2:
|
gamesList[0]->getSourceFileData()->getSystem()->getName() + "]'.";
|
||||||
desc = "This collection contains 2 games: '" + gamesList[0]->metadata.get("name") +
|
break;
|
||||||
" [" + gamesList[0]->getSourceFileData()->getSystem()->getName() +
|
case 2:
|
||||||
"]' and '" + gamesList[1]->metadata.get("name") + " [" +
|
desc = "This collection contains 2 games: '" +
|
||||||
gamesList[1]->getSourceFileData()->getSystem()->getName() + "]'.";
|
gamesList[0]->metadata.get("name") + " [" +
|
||||||
break;
|
gamesList[0]->getSourceFileData()->getSystem()->getName() +
|
||||||
default:
|
"]' and '" + gamesList[1]->metadata.get("name") + " [" +
|
||||||
desc = "This collection contains " + std::to_string(gameCount) +
|
gamesList[1]->getSourceFileData()->getSystem()->getName() + "]'.";
|
||||||
" games: '" + gamesList[0]->metadata.get("name") +
|
break;
|
||||||
" [" + gamesList[0]->getSourceFileData()->getSystem()->getName() +
|
default:
|
||||||
"]', '" + gamesList[1]->metadata.get("name") + " [" +
|
desc = "This collection contains " + std::to_string(gameCount) +
|
||||||
gamesList[1]->getSourceFileData()->getSystem()->getName() + "]' and '" +
|
" games: '" + gamesList[0]->metadata.get("name") +
|
||||||
gamesList[2]->metadata.get("name") + " [" +
|
" [" + gamesList[0]->getSourceFileData()->getSystem()->getName() +
|
||||||
gamesList[2]->getSourceFileData()->getSystem()->getName() + "]'";
|
"]', '" + gamesList[1]->metadata.get("name") + " [" +
|
||||||
desc += (gameCount == 3 ? "." : ", among others.");
|
gamesList[1]->getSourceFileData()->getSystem()->getName() + "]' and '" +
|
||||||
break;
|
gamesList[2]->metadata.get("name") + " [" +
|
||||||
|
gamesList[2]->getSourceFileData()->getSystem()->getName() + "]'";
|
||||||
|
desc += (gameCount == 3 ? "." : ", among others.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
switch (gameCount) {
|
||||||
|
case 1:
|
||||||
|
desc = "This collection contains 1 game: '" +
|
||||||
|
gamesList[0]->metadata.get("name") + " '.";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
desc = "This collection contains 2 games: '" +
|
||||||
|
gamesList[0]->metadata.get("name") +
|
||||||
|
"' and '" + gamesList[1]->metadata.get("name") + "'.";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
desc = "This collection contains " + std::to_string(gameCount) +
|
||||||
|
" games: '" + gamesList[0]->metadata.get("name") +
|
||||||
|
"', '" + gamesList[1]->metadata.get("name") + "' and '" +
|
||||||
|
gamesList[2]->metadata.get("name") + "'";
|
||||||
|
desc += (gameCount == 3 ? "." : ", among others.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,10 @@ void GuiCollectionSystemsOptions::initializeMenu()
|
||||||
sortFavFirstCustomSwitch->setState(Settings::getInstance()->getBool("FavFirstCustom"));
|
sortFavFirstCustomSwitch->setState(Settings::getInstance()->getBool("FavFirstCustom"));
|
||||||
mMenu.addWithLabel("SORT FAVORITES ON TOP FOR CUSTOM COLLECTIONS", sortFavFirstCustomSwitch);
|
mMenu.addWithLabel("SORT FAVORITES ON TOP FOR CUSTOM COLLECTIONS", sortFavFirstCustomSwitch);
|
||||||
|
|
||||||
|
favoriteStarCustomSwitch = std::make_shared<SwitchComponent>(mWindow);
|
||||||
|
favoriteStarCustomSwitch->setState(Settings::getInstance()->getBool("FavStarCustom"));
|
||||||
|
mMenu.addWithLabel("DISPLAY STAR MARKINGS FOR CUSTOM COLLECTIONS", favoriteStarCustomSwitch);
|
||||||
|
|
||||||
bundleCustomCollections = std::make_shared<SwitchComponent>(mWindow);
|
bundleCustomCollections = std::make_shared<SwitchComponent>(mWindow);
|
||||||
bundleCustomCollections->setState(Settings::getInstance()->
|
bundleCustomCollections->setState(Settings::getInstance()->
|
||||||
getBool("UseCustomCollectionsSystem"));
|
getBool("UseCustomCollectionsSystem"));
|
||||||
|
@ -199,12 +203,14 @@ void GuiCollectionSystemsOptions::applySettings()
|
||||||
std::string prevCustom = Settings::getInstance()->getString("CollectionSystemsCustom");
|
std::string prevCustom = Settings::getInstance()->getString("CollectionSystemsCustom");
|
||||||
bool outSort = sortFavFirstCustomSwitch->getState();
|
bool outSort = sortFavFirstCustomSwitch->getState();
|
||||||
bool prevSort = Settings::getInstance()->getBool("FavFirstCustom");
|
bool prevSort = Settings::getInstance()->getBool("FavFirstCustom");
|
||||||
|
bool outFavStar = favoriteStarCustomSwitch->getState();
|
||||||
|
bool prevFavStar = Settings::getInstance()->getBool("FavStarCustom");
|
||||||
bool outBundle = bundleCustomCollections->getState();
|
bool outBundle = bundleCustomCollections->getState();
|
||||||
bool prevBundle = Settings::getInstance()->getBool("UseCustomCollectionsSystem");
|
bool prevBundle = Settings::getInstance()->getBool("UseCustomCollectionsSystem");
|
||||||
bool prevShow = Settings::getInstance()->getBool("CollectionShowSystemInfo");
|
bool prevShow = Settings::getInstance()->getBool("CollectionShowSystemInfo");
|
||||||
bool outShow = toggleSystemNameInCollections->getState();
|
bool outShow = toggleSystemNameInCollections->getState();
|
||||||
bool needUpdateSettings = prevAuto != outAuto || prevCustom != outCustom || outSort !=
|
bool needUpdateSettings = prevAuto != outAuto || prevCustom != outCustom || outSort !=
|
||||||
prevSort || outBundle != prevBundle || prevShow != outShow ;
|
prevSort || outFavStar != prevFavStar || outBundle != prevBundle || prevShow != outShow;
|
||||||
|
|
||||||
if (needUpdateSettings)
|
if (needUpdateSettings)
|
||||||
updateSettings(outAuto, outCustom);
|
updateSettings(outAuto, outCustom);
|
||||||
|
@ -218,6 +224,7 @@ void GuiCollectionSystemsOptions::updateSettings(std::string newAutoSettings,
|
||||||
Settings::getInstance()->setString("CollectionSystemsAuto", newAutoSettings);
|
Settings::getInstance()->setString("CollectionSystemsAuto", newAutoSettings);
|
||||||
Settings::getInstance()->setString("CollectionSystemsCustom", newCustomSettings);
|
Settings::getInstance()->setString("CollectionSystemsCustom", newCustomSettings);
|
||||||
Settings::getInstance()->setBool("FavFirstCustom", sortFavFirstCustomSwitch->getState());
|
Settings::getInstance()->setBool("FavFirstCustom", sortFavFirstCustomSwitch->getState());
|
||||||
|
Settings::getInstance()->setBool("FavStarCustom", favoriteStarCustomSwitch->getState());
|
||||||
Settings::getInstance()->setBool("UseCustomCollectionsSystem",
|
Settings::getInstance()->setBool("UseCustomCollectionsSystem",
|
||||||
bundleCustomCollections->getState());
|
bundleCustomCollections->getState());
|
||||||
Settings::getInstance()->setBool("CollectionShowSystemInfo",
|
Settings::getInstance()->setBool("CollectionShowSystemInfo",
|
||||||
|
@ -227,6 +234,7 @@ void GuiCollectionSystemsOptions::updateSettings(std::string newAutoSettings,
|
||||||
CollectionSystemManager::get()->updateSystemsList();
|
CollectionSystemManager::get()->updateSystemsList();
|
||||||
ViewController::get()->goToStart();
|
ViewController::get()->goToStart();
|
||||||
ViewController::get()->reloadAll();
|
ViewController::get()->reloadAll();
|
||||||
|
mWindow->invalidateCachedBackground();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GuiCollectionSystemsOptions::input(InputConfig* config, Input input)
|
bool GuiCollectionSystemsOptions::input(InputConfig* config, Input input)
|
||||||
|
|
|
@ -40,6 +40,7 @@ private:
|
||||||
std::shared_ptr<OptionListComponent<std::string>> customOptionList;
|
std::shared_ptr<OptionListComponent<std::string>> customOptionList;
|
||||||
std::shared_ptr<SwitchComponent> bundleCustomCollections;
|
std::shared_ptr<SwitchComponent> bundleCustomCollections;
|
||||||
std::shared_ptr<SwitchComponent> sortFavFirstCustomSwitch;
|
std::shared_ptr<SwitchComponent> sortFavFirstCustomSwitch;
|
||||||
|
std::shared_ptr<SwitchComponent> favoriteStarCustomSwitch;
|
||||||
std::shared_ptr<SwitchComponent> toggleSystemNameInCollections;
|
std::shared_ptr<SwitchComponent> toggleSystemNameInCollections;
|
||||||
MenuComponent mMenu;
|
MenuComponent mMenu;
|
||||||
SystemData* mSystem;
|
SystemData* mSystem;
|
||||||
|
|
|
@ -482,6 +482,17 @@ void GuiMenu::openUISettings()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Enable gamelist star markings for favorite games.
|
||||||
|
auto favorites_stars = std::make_shared<SwitchComponent>(mWindow);
|
||||||
|
favorites_stars->setState(Settings::getInstance()->getBool("FavoritesStar"));
|
||||||
|
s->addWithLabel("ADD STAR MARKINGS TO FAVORITE GAMES", favorites_stars);
|
||||||
|
s->addSaveFunc([favorites_stars] {
|
||||||
|
if (Settings::getInstance()->getBool("FavoritesStar") != favorites_stars->getState()) {
|
||||||
|
Settings::getInstance()->setBool("FavoritesStar", favorites_stars->getState());
|
||||||
|
ViewController::get()->reloadAll();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Enable filters (ForceDisableFilters).
|
// Enable filters (ForceDisableFilters).
|
||||||
auto enable_filter = std::make_shared<SwitchComponent>(mWindow);
|
auto enable_filter = std::make_shared<SwitchComponent>(mWindow);
|
||||||
enable_filter->setState(!Settings::getInstance()->getBool("ForceDisableFilters"));
|
enable_filter->setState(!Settings::getInstance()->getBool("ForceDisableFilters"));
|
||||||
|
|
|
@ -52,6 +52,16 @@ void BasicGameListView::onFileChanged(FileData* file, FileChangeType change)
|
||||||
void BasicGameListView::populateList(const std::vector<FileData*>& files)
|
void BasicGameListView::populateList(const std::vector<FileData*>& files)
|
||||||
{
|
{
|
||||||
firstGameEntry = nullptr;
|
firstGameEntry = nullptr;
|
||||||
|
bool favoriteStar = true;
|
||||||
|
|
||||||
|
// Read the settings that control whether a unicode star character should be added
|
||||||
|
// as a prefix to the game name.
|
||||||
|
if (files.size() > 0) {
|
||||||
|
if (files.front()->getSystem()->isCustomCollection())
|
||||||
|
favoriteStar = Settings::getInstance()->getBool("FavStarCustom");
|
||||||
|
else
|
||||||
|
favoriteStar = Settings::getInstance()->getBool("FavoritesStar");
|
||||||
|
}
|
||||||
|
|
||||||
mList.clear();
|
mList.clear();
|
||||||
mHeaderText.setText(mRoot->getSystem()->getFullName());
|
mHeaderText.setText(mRoot->getSystem()->getFullName());
|
||||||
|
@ -60,7 +70,7 @@ void BasicGameListView::populateList(const std::vector<FileData*>& files)
|
||||||
if (!firstGameEntry && (*it)->getType() == GAME)
|
if (!firstGameEntry && (*it)->getType() == GAME)
|
||||||
firstGameEntry = (*it);
|
firstGameEntry = (*it);
|
||||||
|
|
||||||
if ((*it)->getFavorite() &&
|
if ((*it)->getFavorite() && favoriteStar &&
|
||||||
mRoot->getSystem()->getName() != "favorites") {
|
mRoot->getSystem()->getName() != "favorites") {
|
||||||
mList.add(FAVORITE_CHAR + " " + (*it)->getName(),
|
mList.add(FAVORITE_CHAR + " " + (*it)->getName(),
|
||||||
*it, ((*it)->getType() == FOLDER));
|
*it, ((*it)->getType() == FOLDER));
|
||||||
|
|
|
@ -91,6 +91,7 @@ void Settings::setDefaults()
|
||||||
mBoolMap["GamelistVideoScanlines"] = true;
|
mBoolMap["GamelistVideoScanlines"] = true;
|
||||||
mBoolMap["FoldersOnTop"] = true;
|
mBoolMap["FoldersOnTop"] = true;
|
||||||
mBoolMap["FavoritesFirst"] = true;
|
mBoolMap["FavoritesFirst"] = true;
|
||||||
|
mBoolMap["FavoritesStar"] = true;
|
||||||
mBoolMap["ForceDisableFilters"] = false;
|
mBoolMap["ForceDisableFilters"] = false;
|
||||||
mBoolMap["QuickSystemSelect"] = true;
|
mBoolMap["QuickSystemSelect"] = true;
|
||||||
mBoolMap["ShowHelpPrompts"] = true;
|
mBoolMap["ShowHelpPrompts"] = true;
|
||||||
|
@ -151,6 +152,7 @@ void Settings::setDefaults()
|
||||||
mStringMap["CollectionSystemsCustom"] = "";
|
mStringMap["CollectionSystemsCustom"] = "";
|
||||||
mBoolMap["UseCustomCollectionsSystem"] = true;
|
mBoolMap["UseCustomCollectionsSystem"] = true;
|
||||||
mBoolMap["FavFirstCustom"] = false;
|
mBoolMap["FavFirstCustom"] = false;
|
||||||
|
mBoolMap["FavStarCustom"] = false;
|
||||||
mBoolMap["CollectionShowSystemInfo"] = true;
|
mBoolMap["CollectionShowSystemInfo"] = true;
|
||||||
|
|
||||||
// Scraper.
|
// Scraper.
|
||||||
|
|
Loading…
Reference in a new issue