mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Allow player to start quest with cards defined in a cube. (uniqueness ignored)
This commit is contained in:
@@ -177,16 +177,9 @@ public enum CSubmenuQuestData implements ICDoc {
|
|||||||
fmtStartPool = customFormatCodes.isEmpty() ? null : new GameFormatQuest("Custom", customFormatCodes, null); // chosen sets and no banend cards
|
fmtStartPool = customFormatCodes.isEmpty() ? null : new GameFormatQuest("Custom", customFormatCodes, null); // chosen sets and no banend cards
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SealedDeck:
|
|
||||||
dckStartPool = view.getSelectedDeck();
|
|
||||||
if (null == dckStartPool) {
|
|
||||||
|
|
||||||
JOptionPane.showMessageDialog(null, "You have not selected a deck to start", "Cannot start a quest", JOptionPane.ERROR_MESSAGE);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DraftDeck:
|
case DraftDeck:
|
||||||
|
case SealedDeck:
|
||||||
|
case Cube:
|
||||||
dckStartPool = view.getSelectedDeck();
|
dckStartPool = view.getSelectedDeck();
|
||||||
if (null == dckStartPool) {
|
if (null == dckStartPool) {
|
||||||
|
|
||||||
|
|||||||
@@ -131,15 +131,24 @@ public enum VSubmenuQuestData implements IVSubmenu<CSubmenuQuestData> {
|
|||||||
|
|
||||||
btnDefineCustomFormat.setVisible(newVal == StartingPoolType.CustomFormat);
|
btnDefineCustomFormat.setVisible(newVal == StartingPoolType.CustomFormat);
|
||||||
|
|
||||||
lblCustomDeck.setVisible(newVal == StartingPoolType.SealedDeck || newVal == StartingPoolType.DraftDeck);
|
|
||||||
cbxCustomDeck.setVisible(newVal == StartingPoolType.SealedDeck || newVal == StartingPoolType.DraftDeck);
|
|
||||||
|
|
||||||
if (newVal == StartingPoolType.SealedDeck || newVal == StartingPoolType.DraftDeck) {
|
boolean usesDeckList = newVal == StartingPoolType.SealedDeck || newVal == StartingPoolType.DraftDeck || newVal == StartingPoolType.Cube;
|
||||||
|
lblCustomDeck.setVisible(usesDeckList);
|
||||||
|
cbxCustomDeck.setVisible(usesDeckList);
|
||||||
|
|
||||||
|
if (usesDeckList) {
|
||||||
cbxCustomDeck.removeAllItems();
|
cbxCustomDeck.removeAllItems();
|
||||||
CardCollections decks = Singletons.getModel().getDecks();
|
CardCollections decks = Singletons.getModel().getDecks();
|
||||||
IStorage<DeckGroup> storage = newVal == StartingPoolType.SealedDeck ? decks.getSealed() : decks.getDraft();
|
switch(newVal) {
|
||||||
for (DeckGroup d : storage) {
|
case SealedDeck:
|
||||||
cbxCustomDeck.addItem(d.getHumanDeck());
|
for (DeckGroup d : decks.getSealed()) { cbxCustomDeck.addItem(d.getHumanDeck()); }
|
||||||
|
break;
|
||||||
|
case DraftDeck:
|
||||||
|
for (DeckGroup d : decks.getDraft()) { cbxCustomDeck.addItem(d.getHumanDeck()); }
|
||||||
|
break;
|
||||||
|
case Cube:
|
||||||
|
for (Deck d : decks.getCubes()) { cbxCustomDeck.addItem(d); }
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -208,6 +217,7 @@ public enum VSubmenuQuestData implements IVSubmenu<CSubmenuQuestData> {
|
|||||||
cbxStartingPool.addItem(StartingPoolType.Precon);
|
cbxStartingPool.addItem(StartingPoolType.Precon);
|
||||||
cbxStartingPool.addItem(StartingPoolType.DraftDeck);
|
cbxStartingPool.addItem(StartingPoolType.DraftDeck);
|
||||||
cbxStartingPool.addItem(StartingPoolType.SealedDeck);
|
cbxStartingPool.addItem(StartingPoolType.SealedDeck);
|
||||||
|
cbxStartingPool.addItem(StartingPoolType.Cube);
|
||||||
cbxStartingPool.addActionListener(alStartingPool);
|
cbxStartingPool.addActionListener(alStartingPool);
|
||||||
|
|
||||||
// initial adjustment
|
// initial adjustment
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ public enum StartingPoolType {
|
|||||||
CustomFormat("Custom format"),
|
CustomFormat("Custom format"),
|
||||||
Precon("Event or starter deck"),
|
Precon("Event or starter deck"),
|
||||||
SealedDeck("My sealed deck"),
|
SealedDeck("My sealed deck"),
|
||||||
DraftDeck("My draft deck");
|
DraftDeck("My draft deck"),
|
||||||
|
Cube("Predefined cube");
|
||||||
|
|
||||||
private final String caption;
|
private final String caption;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user