Commit a0bc43bc authored by 独孤朲's avatar 独孤朲 Committed by GitHub

Merge pull request #1780 from mercury233/patch-2

list exact match first in search result
parents c6b0ede5 97c6213f
...@@ -902,6 +902,15 @@ void DeckBuilder::SortList() { ...@@ -902,6 +902,15 @@ void DeckBuilder::SortList() {
std::sort(results.begin(), results.end(), ClientCard::deck_sort_name); std::sort(results.begin(), results.end(), ClientCard::deck_sort_name);
break; break;
} }
const wchar_t* pstr = mainGame->ebCardName->getText();
for (size_t i = 0, pos = 0; i < results.size(); ++i){
code_pointer ptr = results[i];
if (wcscmp(pstr, dataManager.GetName(ptr->first))==0) {
results.insert(results.begin() + pos, ptr);
results.erase(results.begin() + i + 1);
pos++;
}
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment