Commit 97c6213f authored by mercury233's avatar mercury233 Committed by GitHub

list exact match first in search result

parent 1dc1e961
...@@ -883,6 +883,15 @@ void DeckBuilder::SortList() { ...@@ -883,6 +883,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