Commit 5e3ece98 authored by mercury233's avatar mercury233 Committed by GitHub

update (#2151)

place cards which are activating or target in first when selecting cards
parent 99c86f43
...@@ -212,8 +212,14 @@ bool ClientCard::client_card_sort(ClientCard* c1, ClientCard* c2) { ...@@ -212,8 +212,14 @@ bool ClientCard::client_card_sort(ClientCard* c1, ClientCard* c2) {
return c1->overlayTarget->sequence < c2->overlayTarget->sequence; return c1->overlayTarget->sequence < c2->overlayTarget->sequence;
else return c1->sequence < c2->sequence; else return c1->sequence < c2->sequence;
else { else {
if(c1->location & 0x71) if(c1->location & (LOCATION_DECK | LOCATION_GRAVE | LOCATION_REMOVED | LOCATION_EXTRA)) {
for(size_t i = 0; i < mainGame->dField.chains.size(); ++i) {
auto chit = mainGame->dField.chains[i];
if(c1 == chit.chain_card || chit.target.find(c1) != chit.target.end())
return true;
}
return c1->sequence > c2->sequence; return c1->sequence > c2->sequence;
}
else else
return c1->sequence < c2->sequence; return c1->sequence < c2->sequence;
} }
......
...@@ -424,6 +424,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -424,6 +424,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame->wCardSelect->setText(dataManager.GetSysString(568)); mainGame->wCardSelect->setText(dataManager.GetSysString(568));
list_command = COMMAND_OPERATION; list_command = COMMAND_OPERATION;
} }
std::sort(selectable_cards.begin(), selectable_cards.end(), ClientCard::client_card_sort);
ShowSelectCard(true, true); ShowSelectCard(true, true);
} }
break; break;
...@@ -580,6 +581,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -580,6 +581,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
} }
} }
list_command = COMMAND_LIST; list_command = COMMAND_LIST;
std::sort(selectable_cards.begin(), selectable_cards.end(), ClientCard::client_card_sort);
ShowSelectCard(true); ShowSelectCard(true);
break; break;
} }
......
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