mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
GUI: improved choose creature type dialog - important creature types added to the start of the list and marked as my/opponent (closes #8478)
This commit is contained in:
parent
7b2e9b390c
commit
a974af3c61
41 changed files with 239 additions and 138 deletions
|
|
@ -105,12 +105,17 @@ public class PickChoiceDialog extends MageDialog {
|
|||
}
|
||||
}
|
||||
|
||||
// sorting
|
||||
// custom sorting
|
||||
if (choice.isSortEnabled()) {
|
||||
this.allItems.sort((o1, o2) -> {
|
||||
Integer n1 = choice.getSortData().get(o1.getKey());
|
||||
Integer n2 = choice.getSortData().get(o2.getKey());
|
||||
return Integer.compare(n1, n2);
|
||||
if (n1.equals(n2)) {
|
||||
// default sorting by value
|
||||
return o1.value.compareTo(o2.value);
|
||||
} else {
|
||||
return Integer.compare(n1, n2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue