Skip to content

Commit 612eb7d

Browse files
authored
sort cards whose names exactly match the search query (#3108)
1 parent 44fdefd commit 612eb7d

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

gframe/data_manager.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,5 +603,8 @@ bool DataManager::deck_sort_name(const CardDataC* p1, const CardDataC* p2) {
603603
return res < 0;
604604
return p1->code < p2->code;
605605
}
606+
bool DataManager::deck_sort_id(const CardDataC* p1, const CardDataC* p2) {
607+
return p1->code < p2->code;
608+
}
606609

607610
}

gframe/data_manager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ class DataManager {
139139
static bool deck_sort_atk(const CardDataC* l1, const CardDataC* l2);
140140
static bool deck_sort_def(const CardDataC* l1, const CardDataC* l2);
141141
static bool deck_sort_name(const CardDataC* l1, const CardDataC* l2);
142+
static bool deck_sort_id(const CardDataC* l1, const CardDataC* l2);
142143

143144
private:
144145
const wchar_t* GetMapString(const wstring_map& table, uint32_t code) const;

gframe/deck_con.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,6 +1639,7 @@ void DeckBuilder::SortList() {
16391639
++left;
16401640
}
16411641
}
1642+
std::sort(results.begin(), left, DataManager::deck_sort_id);
16421643
switch(mainGame->cbSortType->getSelected()) {
16431644
case 0:
16441645
std::sort(left, results.end(), DataManager::deck_sort_lv);

0 commit comments

Comments
 (0)