Merge pull request #2677 from Card-Forge/mulligan-bypass

Speed up London Mulligan when you just want to mulligan again.
This commit is contained in:
Anthony Calosa
2023-03-14 18:20:49 +08:00
committed by GitHub

View File

@@ -60,7 +60,7 @@ public class InputLondonMulligan extends InputSyncronizedBase {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
getController().getGui().updateButtons(getOwner(), localizer.getMessage("lblOk"), "", cardsLeft == 0, false, true); getController().getGui().updateButtons(getOwner(), localizer.getMessage("lblOk"), localizer.getMessage("lblAuto"), cardsLeft == 0, cardsLeft != 0, true);
sb.append(String.format(localizer.getMessage("lblReturnForLondon"), cardsLeft)); sb.append(String.format(localizer.getMessage("lblReturnForLondon"), cardsLeft));
@@ -79,6 +79,25 @@ public class InputLondonMulligan extends InputSyncronizedBase {
done(); done();
} }
@Override
protected final void onCancel() {
int cardsLeft = toReturn - selected.size();
int count = 0;
for(Card c : player.getZone(ZoneType.Hand).getCards()) {
if (selected.contains(c)) { continue; }
selected.add(c);
setCardHighlight(c, selected.contains(c));
count++;
if (cardsLeft == count) {
break;
}
}
onOk();
}
private void done() { private void done() {
resetCardHighlights(); resetCardHighlights();
getController().getGame().getView().updateIsMulligan(false); getController().getGame().getView().updateIsMulligan(false);