1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Small fixes to search mapobject feature:

- Trim overly long names to prevent incorrect item display
- Use getLocaleName() for proper locale-aware to_lower conversion
- Implement scoring-based sorting for better search match ranking
- Remove Boost dependency: replace with std::string::find() and rfind()
This commit is contained in:
MichalZr6
2025-03-11 22:35:46 +01:00
parent 2973a769df
commit 5363424451
6 changed files with 134 additions and 75 deletions

View File

@@ -241,7 +241,7 @@ void CSpellWindow::processSpells()
mySpells.reserve(LIBRARY->spellh->objects.size());
for(auto const & spell : LIBRARY->spellh->objects)
{
bool searchTextFound = !searchBox || TextOperations::textSearchSimilar(searchBox->getText(), spell->getNameTranslated());
bool searchTextFound = !searchBox || TextOperations::textSearchSimilarityScore(searchBox->getText(), spell->getNameTranslated()) < 100;
if(onSpellSelect)
{