diff --git a/es-app/src/views/GamelistBase.cpp b/es-app/src/views/GamelistBase.cpp index 394102ad3..1372e6e45 100644 --- a/es-app/src/views/GamelistBase.cpp +++ b/es-app/src/views/GamelistBase.cpp @@ -571,48 +571,56 @@ void GamelistBase::populateList(const std::vector& files, FileData* f if (mTextList != nullptr) { TextListComponent::Entry textListEntry; + std::string indicators {mTextList->getIndicators()}; + if (!mFirstGameEntry && (*it)->getType() == GAME) mFirstGameEntry = (*it); - // Add a leading tick mark icon to the game name if it's part of the custom - // collection currently being edited. - if (isEditing && (*it)->getType() == GAME) { - if (CollectionSystemsManager::getInstance()->inCustomCollection( - editingCollection, (*it))) { - if (Settings::getInstance()->getBool("SpecialCharsASCII")) - inCollectionPrefix = "! "; - else - inCollectionPrefix = ViewController::TICKMARK_CHAR + " "; - } - else { - inCollectionPrefix = ""; - } - } - if ((*it)->getFavorite() && favoriteStar && - mRoot->getSystem()->getName() != "favorites") { - if (Settings::getInstance()->getBool("SpecialCharsASCII")) - name = inCollectionPrefix + "* " + (*it)->getName(); - else - name = inCollectionPrefix + ViewController::FAVORITE_CHAR + " " + - (*it)->getName(); - } - else if ((*it)->getType() == FOLDER && - mRoot->getSystem()->getName() != "collections") { - if (Settings::getInstance()->getBool("SpecialCharsASCII")) { - if ((*it)->metadata.get("folderlink") != "") - name = "> " + (*it)->getName(); - else - name = "# " + (*it)->getName(); - } - else { - if ((*it)->metadata.get("folderlink") != "") - name = ViewController::FOLDERLINK_CHAR + " " + (*it)->getName(); - else - name = ViewController::FOLDER_CHAR + " " + (*it)->getName(); - } + if (indicators == "none") { + name = (*it)->getName(); } else { - name = inCollectionPrefix + (*it)->getName(); + // Add a leading tick mark icon to the game name if it's part of the custom + // collection currently being edited. + if (isEditing && (*it)->getType() == GAME) { + if (CollectionSystemsManager::getInstance()->inCustomCollection( + editingCollection, (*it))) { + if (indicators == "ascii") + inCollectionPrefix = "! "; + else + inCollectionPrefix = ViewController::TICKMARK_CHAR + " "; + } + else { + inCollectionPrefix = ""; + } + } + + if ((*it)->getFavorite() && favoriteStar && + mRoot->getSystem()->getName() != "favorites") { + if (indicators == "ascii") + name = inCollectionPrefix + "* " + (*it)->getName(); + else + name = inCollectionPrefix + ViewController::FAVORITE_CHAR + " " + + (*it)->getName(); + } + else if ((*it)->getType() == FOLDER && + mRoot->getSystem()->getName() != "collections") { + if (indicators == "ascii") { + if ((*it)->metadata.get("folderlink") != "") + name = "> " + (*it)->getName(); + else + name = "# " + (*it)->getName(); + } + else { + if ((*it)->metadata.get("folderlink") != "") + name = ViewController::FOLDERLINK_CHAR + " " + (*it)->getName(); + else + name = ViewController::FOLDER_CHAR + " " + (*it)->getName(); + } + } + else { + name = inCollectionPrefix + (*it)->getName(); + } } color = (*it)->getType() == FOLDER; textListEntry.name = name; diff --git a/es-core/src/ThemeData.cpp b/es-core/src/ThemeData.cpp index c08bf2cdc..e7fcbf32d 100644 --- a/es-core/src/ThemeData.cpp +++ b/es-core/src/ThemeData.cpp @@ -289,6 +289,7 @@ std::map> {"letterCase", STRING}, {"forceUppercase", BOOLEAN}, // For backward compatibility with legacy themes. {"lineSpacing", FLOAT}, + {"indicators", STRING}, {"zIndex", FLOAT}}}, {"gameselector", {{"selection", STRING}, diff --git a/es-core/src/components/primary/TextListComponent.h b/es-core/src/components/primary/TextListComponent.h index 825d61b52..f6b3fdbe1 100644 --- a/es-core/src/components/primary/TextListComponent.h +++ b/es-core/src/components/primary/TextListComponent.h @@ -118,6 +118,7 @@ public: void setSelectedColor(unsigned int color) { mSelectedColor = color; } void setColor(unsigned int id, unsigned int color) { mColors[id] = color; } void setLineSpacing(float lineSpacing) { mLineSpacing = lineSpacing; } + const std::string& getIndicators() const { return mIndicators; } protected: void onScroll() override @@ -161,6 +162,7 @@ private: ImageComponent mSelectorImage; std::shared_ptr mFont; + std::string mIndicators; bool mUppercase; bool mLowercase; bool mCapitalize; @@ -190,6 +192,7 @@ TextListComponent::TextListComponent() , mAlignment {PrimaryAlignment::ALIGN_CENTER} , mHorizontalMargin {0.0f} , mFont {Font::get(FONT_SIZE_MEDIUM)} + , mIndicators {"symbols"} , mUppercase {false} , mLowercase {false} , mCapitalize {false} @@ -587,8 +590,8 @@ void TextListComponent::applyTheme(const std::shared_ptr& theme, if (elem->has("selectorHeight")) setSelectorHeight(elem->get("selectorHeight") * Renderer::getScreenHeight()); if (elem->has("selectorOffsetY")) { - float scale = this->mParent ? this->mParent->getSize().y : - static_cast(Renderer::getScreenHeight()); + float scale {this->mParent ? this->mParent->getSize().y : + static_cast(Renderer::getScreenHeight())}; setSelectorOffsetY(elem->get("selectorOffsetY") * scale); } else { @@ -596,8 +599,21 @@ void TextListComponent::applyTheme(const std::shared_ptr& theme, } } + if (elem->has("indicators")) { + std::string indicators {elem->get("indicators")}; + if (indicators == "symbols" || indicators == "ascii" || indicators == "none") { + mIndicators = indicators; + } + else { + mIndicators = "symbols"; + LOG(LogWarning) << "TextListComponent: Invalid theme configuration, property " + " defined as \"" + << indicators << "\""; + } + } + if (elem->has("selectorImagePath")) { - std::string path = elem->get("selectorImagePath"); + std::string path {elem->get("selectorImagePath")}; bool tile = elem->has("selectorImageTile") && elem->get("selectorImageTile"); mSelectorImage.setImage(path, tile); mSelectorImage.setSize(mSize.x, mSelectorHeight);