mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Fix message for choosing booster or card
This commit is contained in:
@@ -46,6 +46,7 @@ import forge.planarconquest.ConquestPlaneData.RegionData;
|
|||||||
import forge.planarconquest.ConquestPreferences.CQPref;
|
import forge.planarconquest.ConquestPreferences.CQPref;
|
||||||
import forge.player.GamePlayerUtil;
|
import forge.player.GamePlayerUtil;
|
||||||
import forge.properties.ForgePreferences.FPref;
|
import forge.properties.ForgePreferences.FPref;
|
||||||
|
import forge.quest.BoosterUtils;
|
||||||
import forge.util.Aggregates;
|
import forge.util.Aggregates;
|
||||||
import forge.util.Lang;
|
import forge.util.Lang;
|
||||||
import forge.util.gui.SGuiChoose;
|
import forge.util.gui.SGuiChoose;
|
||||||
@@ -266,10 +267,11 @@ public class ConquestController {
|
|||||||
public void run() {
|
public void run() {
|
||||||
awardWinStreakBonus(view);
|
awardWinStreakBonus(view);
|
||||||
|
|
||||||
if (SOptionPane.showConfirmDialog("Choose one \u2014\n\n" +
|
String[] options = {"Booster", "Card"};
|
||||||
"\u2022 Booster: open a random booster pack with at least one new card\n\n" +
|
if (SOptionPane.showOptionDialog("Choose one \u2014\n\n" +
|
||||||
"\u2022 Card: choose a card from your opponent's deck",
|
"\u2022 Open a random booster pack\n" +
|
||||||
"Spoils of Victory", "Booster", "Card")) {
|
"\u2022 Choose a card from your opponent's deck",
|
||||||
|
"Spoils of Victory", null, options) == 0) {
|
||||||
awardBooster(view);
|
awardBooster(view);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -288,6 +290,7 @@ public class ConquestController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BoosterUtils.sort(cards);
|
||||||
PaperCard card = SGuiChoose.one("Choose a card from your opponent's deck", cards);
|
PaperCard card = SGuiChoose.one("Choose a card from your opponent's deck", cards);
|
||||||
model.getCollection().add(card);
|
model.getCollection().add(card);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
// The BoosterPack generates cards for the Card Pool in Quest Mode
|
// The BoosterPack generates cards for the Card Pool in Quest Mode
|
||||||
@@ -332,4 +333,26 @@ public final class BoosterUtils {
|
|||||||
|
|
||||||
return rewards;
|
return rewards;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void sort(List<PaperCard> cards) {
|
||||||
|
//sort cards alphabetically so colors appear together and rares appear on top
|
||||||
|
Collections.sort(cards, new Comparator<PaperCard>() {
|
||||||
|
@Override
|
||||||
|
public int compare(PaperCard c1, PaperCard c2) {
|
||||||
|
return c1.getName().compareTo(c2.getName());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Collections.sort(cards, new Comparator<PaperCard>() {
|
||||||
|
@Override
|
||||||
|
public int compare(PaperCard c1, PaperCard c2) {
|
||||||
|
return c1.getRules().getColor().compareTo(c2.getRules().getColor());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Collections.sort(cards, new Comparator<PaperCard>() {
|
||||||
|
@Override
|
||||||
|
public int compare(PaperCard c1, PaperCard c2) {
|
||||||
|
return c2.getRarity().compareTo(c1.getRarity());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
@@ -552,25 +551,7 @@ public class QuestWinLoseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cardsWon != null) {
|
if (cardsWon != null) {
|
||||||
//sort cards alphabetically so colors appear together and rares appear on top
|
BoosterUtils.sort(cardsWon);
|
||||||
Collections.sort(cardsWon, new Comparator<PaperCard>() {
|
|
||||||
@Override
|
|
||||||
public int compare(PaperCard c1, PaperCard c2) {
|
|
||||||
return c1.getName().compareTo(c2.getName());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Collections.sort(cardsWon, new Comparator<PaperCard>() {
|
|
||||||
@Override
|
|
||||||
public int compare(PaperCard c1, PaperCard c2) {
|
|
||||||
return c1.getRules().getColor().compareTo(c2.getRules().getColor());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Collections.sort(cardsWon, new Comparator<PaperCard>() {
|
|
||||||
@Override
|
|
||||||
public int compare(PaperCard c1, PaperCard c2) {
|
|
||||||
return c2.getRarity().compareTo(c1.getRarity());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
view.showCards(title, cardsWon);
|
view.showCards(title, cardsWon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user