Fix bug in chooseEntitiesforEffect in Mobile GUI

This commit is contained in:
Peter F. Patel-Schneider
2019-01-20 21:16:34 -05:00
parent 264744645e
commit 94064a2a13
3 changed files with 5 additions and 3 deletions

View File

@@ -517,7 +517,9 @@ public class MatchController extends AbstractGuiGame {
@Override
public List<GameEntityView> chooseEntitiesForEffect(String title, List<? extends GameEntityView> optionList, int min, int max, DelayedReveal delayedReveal) {
return SGuiChoose.order(title, "Selected", min, max, (List<GameEntityView>) optionList, null);
final int m1 = max >= 0 ? optionList.size() - max : -1;
final int m2 = min >= 0 ? optionList.size() - min : -1;
return SGuiChoose.order(title, "Selected", m1, m2, (List<GameEntityView>) optionList, null);
}
@Override

View File

@@ -244,8 +244,8 @@ public class GuiChoose {
}
public static <T> void many(final String title, final String topCaption, int min, int max, final List<T> sourceChoices, CardView referenceCard, final Callback<List<T>> callback) {
int m2 = min >= 0 ? sourceChoices.size() - min : -1;
int m1 = max >= 0 ? sourceChoices.size() - max : -1;
int m2 = min >= 0 ? sourceChoices.size() - min : -1;
order(title, topCaption, m1, m2, sourceChoices, null, referenceCard, callback);
}