The alternative emulator badges and filters are now disabled if the per-game setting has been disabled.

This commit is contained in:
Leon Styhre 2021-11-10 22:38:25 +01:00
parent 5d3ce8b92e
commit fd980d7e4a
3 changed files with 14 additions and 0 deletions

View file

@ -151,6 +151,11 @@ void GuiGamelistFilter::addFiltersToMenu()
it != decls.cend(); it++) {
FilterIndexType type = (*it).type; // Type of filter.
// Don't include the alternative emulators if the corresponding setting has been disabled.
if (type == ALTEMULATOR_FILTER &&
!Settings::getInstance()->getBool("AlternativeEmulatorPerGame"))
continue;
std::map<std::string, int>* allKeys = (*it).allIndexKeys;
bool exclusiveSelect = false;

View file

@ -1069,6 +1069,8 @@ void GuiMenu::openOtherOptions()
Settings::getInstance()->setBool("AlternativeEmulatorPerGame",
alternativeEmulatorPerGame->getState());
s->setNeedsSaving();
s->setNeedsReloading();
s->setInvalidateCachedBackground();
}
});

View file

@ -104,6 +104,13 @@ void BadgeComponent::setBadges(const std::vector<BadgeInfo>& badges)
[badge](FlexboxComponent::FlexboxItem item) { return item.label == badge.badgeType; });
if (it != mFlexboxItems.end()) {
// Don't show the alternative emulator badge if the corresponding setting has been
// disabled.
if (badge.badgeType == "altemulator" &&
!Settings::getInstance()->getBool("AlternativeEmulatorPerGame"))
continue;
it->visible = true;
if (badge.gameController != "" &&
badge.gameController != it->overlayImage.getTexture()->getTextureFilePath()) {