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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user