mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Enabled historic/casual formats as starting pools for quest mode on desktop
This commit is contained in:
@@ -90,6 +90,24 @@ public enum CSubmenuQuestData implements ICDoc {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
view.getBtnSelectFormat().setCommand(new UiCommand() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
final DialogChooseFormats dialog = new DialogChooseFormats();
|
||||||
|
dialog.setOkCallback(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
customFormatCodes.clear();
|
||||||
|
Set<String> sets = new HashSet<String>();
|
||||||
|
for(GameFormat format:dialog.getSelectedFormats()){
|
||||||
|
sets.addAll(format.getAllowedSetCodes());
|
||||||
|
}
|
||||||
|
customFormatCodes.addAll(sets);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
view.getBtnPrizeCustomFormat().setCommand(new UiCommand() {
|
view.getBtnPrizeCustomFormat().setCommand(new UiCommand() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -104,6 +122,24 @@ public enum CSubmenuQuestData implements ICDoc {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
view.getBtnPrizeSelectFormat().setCommand(new UiCommand() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
final DialogChooseFormats dialog = new DialogChooseFormats();
|
||||||
|
dialog.setOkCallback(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
customPrizeFormatCodes.clear();
|
||||||
|
Set<String> sets = new HashSet<String>();
|
||||||
|
for(GameFormat format:dialog.getSelectedFormats()){
|
||||||
|
sets.addAll(format.getAllowedSetCodes());
|
||||||
|
}
|
||||||
|
customPrizeFormatCodes.addAll(sets);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
view.getBtnPreferredColors().setCommand(new UiCommand() {
|
view.getBtnPreferredColors().setCommand(new UiCommand() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -197,10 +233,11 @@ public enum CSubmenuQuestData implements ICDoc {
|
|||||||
|
|
||||||
if (worldFormat == null) {
|
if (worldFormat == null) {
|
||||||
switch(view.getStartingPoolType()) {
|
switch(view.getStartingPoolType()) {
|
||||||
case Rotating:
|
case Sanctioned:
|
||||||
fmtStartPool = view.getRotatingFormat();
|
fmtStartPool = view.getRotatingFormat();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Casual:
|
||||||
case CustomFormat:
|
case CustomFormat:
|
||||||
if (customFormatCodes.isEmpty()) {
|
if (customFormatCodes.isEmpty()) {
|
||||||
if (!FOptionPane.showConfirmDialog("You have defined a custom format that doesn't contain any sets.\nThis will start a game without restriction.\n\nContinue?")) {
|
if (!FOptionPane.showConfirmDialog("You have defined a custom format that doesn't contain any sets.\nThis will start a game without restriction.\n\nContinue?")) {
|
||||||
@@ -257,6 +294,7 @@ public enum CSubmenuQuestData implements ICDoc {
|
|||||||
case Complete:
|
case Complete:
|
||||||
fmtPrizes = null;
|
fmtPrizes = null;
|
||||||
break;
|
break;
|
||||||
|
case Casual:
|
||||||
case CustomFormat:
|
case CustomFormat:
|
||||||
if (customPrizeFormatCodes.isEmpty()) {
|
if (customPrizeFormatCodes.isEmpty()) {
|
||||||
if (!FOptionPane.showConfirmDialog("You have defined custom format as containing no sets.\nThis will choose all editions without restriction as prizes.\n\nContinue?")) {
|
if (!FOptionPane.showConfirmDialog("You have defined custom format as containing no sets.\nThis will choose all editions without restriction as prizes.\n\nContinue?")) {
|
||||||
@@ -265,7 +303,7 @@ public enum CSubmenuQuestData implements ICDoc {
|
|||||||
}
|
}
|
||||||
fmtPrizes = customPrizeFormatCodes.isEmpty() ? null : new GameFormat("Custom Prizes", customPrizeFormatCodes, null); // chosen sets and no banned cards
|
fmtPrizes = customPrizeFormatCodes.isEmpty() ? null : new GameFormat("Custom Prizes", customPrizeFormatCodes, null); // chosen sets and no banned cards
|
||||||
break;
|
break;
|
||||||
case Rotating:
|
case Sanctioned:
|
||||||
fmtPrizes = view.getPrizedRotatingFormat();
|
fmtPrizes = view.getPrizedRotatingFormat();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -82,6 +82,8 @@ public enum VSubmenuQuestData implements IVSubmenu<CSubmenuQuestData> {
|
|||||||
private final FComboBoxWrapper<Deck> cbxCustomDeck = new FComboBoxWrapper<>();
|
private final FComboBoxWrapper<Deck> cbxCustomDeck = new FComboBoxWrapper<>();
|
||||||
|
|
||||||
private final FLabel btnDefineCustomFormat = new FLabel.Builder().opaque(true).hoverable(true).text("Define custom format").build();
|
private final FLabel btnDefineCustomFormat = new FLabel.Builder().opaque(true).hoverable(true).text("Define custom format").build();
|
||||||
|
private final FLabel btnSelectFormat = new FLabel.Builder().opaque(true).hoverable(true).text("Select format").build();
|
||||||
|
|
||||||
|
|
||||||
private final FCheckBox boxCompleteSet = new FCheckBox("Start with all cards in selected sets");
|
private final FCheckBox boxCompleteSet = new FCheckBox("Start with all cards in selected sets");
|
||||||
private final FCheckBox boxAllowDuplicates = new FCheckBox("Allow duplicate cards");
|
private final FCheckBox boxAllowDuplicates = new FCheckBox("Allow duplicate cards");
|
||||||
@@ -91,6 +93,8 @@ public enum VSubmenuQuestData implements IVSubmenu<CSubmenuQuestData> {
|
|||||||
|
|
||||||
private final FLabel btnPrizeDefineCustomFormat = new FLabel.Builder().opaque(true).hoverable(true).text("Define custom format").build();
|
private final FLabel btnPrizeDefineCustomFormat = new FLabel.Builder().opaque(true).hoverable(true).text("Define custom format").build();
|
||||||
|
|
||||||
|
private final FLabel btnPrizeSelectFormat = new FLabel.Builder().opaque(true).hoverable(true).text("Select format").build();
|
||||||
|
|
||||||
private final FLabel lblPrizedCards = new FLabel.Builder().text("Prized cards:").build();
|
private final FLabel lblPrizedCards = new FLabel.Builder().text("Prized cards:").build();
|
||||||
private final FComboBoxWrapper<Object> cbxPrizedCards = new FComboBoxWrapper<>();
|
private final FComboBoxWrapper<Object> cbxPrizedCards = new FComboBoxWrapper<>();
|
||||||
|
|
||||||
@@ -116,10 +120,11 @@ public enum VSubmenuQuestData implements IVSubmenu<CSubmenuQuestData> {
|
|||||||
lblPreconDeck.setVisible(newVal == StartingPoolType.Precon);
|
lblPreconDeck.setVisible(newVal == StartingPoolType.Precon);
|
||||||
cbxPreconDeck.setVisible(newVal == StartingPoolType.Precon);
|
cbxPreconDeck.setVisible(newVal == StartingPoolType.Precon);
|
||||||
|
|
||||||
lblFormat.setVisible(newVal == StartingPoolType.Rotating);
|
lblFormat.setVisible(newVal == StartingPoolType.Sanctioned);
|
||||||
cbxFormat.setVisible(newVal == StartingPoolType.Rotating);
|
cbxFormat.setVisible(newVal == StartingPoolType.Sanctioned);
|
||||||
|
|
||||||
btnDefineCustomFormat.setVisible(newVal == StartingPoolType.CustomFormat);
|
btnDefineCustomFormat.setVisible(newVal == StartingPoolType.CustomFormat);
|
||||||
|
btnSelectFormat.setVisible(newVal == StartingPoolType.Casual);
|
||||||
|
|
||||||
|
|
||||||
final boolean usesDeckList = newVal == StartingPoolType.SealedDeck || newVal == StartingPoolType.DraftDeck || newVal == StartingPoolType.Cube;
|
final boolean usesDeckList = newVal == StartingPoolType.SealedDeck || newVal == StartingPoolType.DraftDeck || newVal == StartingPoolType.Cube;
|
||||||
@@ -152,9 +157,10 @@ public enum VSubmenuQuestData implements IVSubmenu<CSubmenuQuestData> {
|
|||||||
lblPrizeUnrestricted.setVisible(newVal == StartingPoolType.Complete);
|
lblPrizeUnrestricted.setVisible(newVal == StartingPoolType.Complete);
|
||||||
cboAllowUnlocks.setVisible(newVal != StartingPoolType.Complete);
|
cboAllowUnlocks.setVisible(newVal != StartingPoolType.Complete);
|
||||||
|
|
||||||
lblPrizeFormat.setVisible(newVal == StartingPoolType.Rotating);
|
lblPrizeFormat.setVisible(newVal == StartingPoolType.Sanctioned);
|
||||||
cbxPrizeFormat.setVisible(newVal == StartingPoolType.Rotating);
|
cbxPrizeFormat.setVisible(newVal == StartingPoolType.Sanctioned);
|
||||||
btnPrizeDefineCustomFormat.setVisible(newVal == StartingPoolType.CustomFormat);
|
btnPrizeDefineCustomFormat.setVisible(newVal == StartingPoolType.CustomFormat);
|
||||||
|
btnPrizeSelectFormat.setVisible(newVal == StartingPoolType.Casual);
|
||||||
lblPrizeSameAsStarting.setVisible(newVal == null);
|
lblPrizeSameAsStarting.setVisible(newVal == null);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -200,7 +206,8 @@ public enum VSubmenuQuestData implements IVSubmenu<CSubmenuQuestData> {
|
|||||||
boxAllowDuplicates.setToolTipText("When your starting pool is generated, duplicates of cards may be included.");
|
boxAllowDuplicates.setToolTipText("When your starting pool is generated, duplicates of cards may be included.");
|
||||||
|
|
||||||
cbxStartingPool.addItem(StartingPoolType.Complete);
|
cbxStartingPool.addItem(StartingPoolType.Complete);
|
||||||
cbxStartingPool.addItem(StartingPoolType.Rotating);
|
cbxStartingPool.addItem(StartingPoolType.Sanctioned);
|
||||||
|
cbxStartingPool.addItem(StartingPoolType.Casual);
|
||||||
cbxStartingPool.addItem(StartingPoolType.CustomFormat);
|
cbxStartingPool.addItem(StartingPoolType.CustomFormat);
|
||||||
cbxStartingPool.addItem(StartingPoolType.Precon);
|
cbxStartingPool.addItem(StartingPoolType.Precon);
|
||||||
cbxStartingPool.addItem(StartingPoolType.DraftDeck);
|
cbxStartingPool.addItem(StartingPoolType.DraftDeck);
|
||||||
@@ -214,7 +221,8 @@ public enum VSubmenuQuestData implements IVSubmenu<CSubmenuQuestData> {
|
|||||||
|
|
||||||
cbxPrizedCards.addItem("Same as starting pool");
|
cbxPrizedCards.addItem("Same as starting pool");
|
||||||
cbxPrizedCards.addItem(StartingPoolType.Complete);
|
cbxPrizedCards.addItem(StartingPoolType.Complete);
|
||||||
cbxPrizedCards.addItem(StartingPoolType.Rotating);
|
cbxPrizedCards.addItem(StartingPoolType.Sanctioned);
|
||||||
|
cbxPrizedCards.addItem(StartingPoolType.Casual);
|
||||||
cbxPrizedCards.addItem(StartingPoolType.CustomFormat);
|
cbxPrizedCards.addItem(StartingPoolType.CustomFormat);
|
||||||
cbxPrizedCards.addActionListener(alPrizesPool);
|
cbxPrizedCards.addActionListener(alPrizesPool);
|
||||||
|
|
||||||
@@ -311,6 +319,7 @@ public enum VSubmenuQuestData implements IVSubmenu<CSubmenuQuestData> {
|
|||||||
cbxFormat.addTo(pnlRestrictions, constraints + cboWidthStart + " cell 1 1");
|
cbxFormat.addTo(pnlRestrictions, constraints + cboWidthStart + " cell 1 1");
|
||||||
|
|
||||||
pnlRestrictions.add(btnDefineCustomFormat, btnStartingCustomFormatWidth + constraints + hidemode + " cell 1 1");
|
pnlRestrictions.add(btnDefineCustomFormat, btnStartingCustomFormatWidth + constraints + hidemode + " cell 1 1");
|
||||||
|
pnlRestrictions.add(btnSelectFormat, btnStartingCustomFormatWidth + constraints + hidemode + " cell 1 1");
|
||||||
|
|
||||||
pnlRestrictions.add(boxAllowDuplicates, "h 15px!, cell 1 2");
|
pnlRestrictions.add(boxAllowDuplicates, "h 15px!, cell 1 2");
|
||||||
pnlRestrictions.add(boxCompleteSet, "h 15px!, cell 1 3");
|
pnlRestrictions.add(boxCompleteSet, "h 15px!, cell 1 3");
|
||||||
@@ -325,6 +334,7 @@ public enum VSubmenuQuestData implements IVSubmenu<CSubmenuQuestData> {
|
|||||||
pnlRestrictions.add(lblPrizeFormat, constraints + hidemode + "cell 0 6");
|
pnlRestrictions.add(lblPrizeFormat, constraints + hidemode + "cell 0 6");
|
||||||
cbxPrizeFormat.addTo(pnlRestrictions, constraints + cboWidthStart + "cell 1 6"); // , skip 1
|
cbxPrizeFormat.addTo(pnlRestrictions, constraints + cboWidthStart + "cell 1 6"); // , skip 1
|
||||||
pnlRestrictions.add(btnPrizeDefineCustomFormat, btnStartingCustomFormatWidth + constraints + hidemode + "cell 1 6");
|
pnlRestrictions.add(btnPrizeDefineCustomFormat, btnStartingCustomFormatWidth + constraints + hidemode + "cell 1 6");
|
||||||
|
pnlRestrictions.add(btnPrizeSelectFormat, btnStartingCustomFormatWidth + constraints + hidemode + "cell 1 6");
|
||||||
pnlRestrictions.add(lblPrizeSameAsStarting, constraints + hidemode + "cell 1 6");
|
pnlRestrictions.add(lblPrizeSameAsStarting, constraints + hidemode + "cell 1 6");
|
||||||
pnlRestrictions.add(lblPrizeUnrestricted, constraints + hidemode + "cell 1 6");
|
pnlRestrictions.add(lblPrizeUnrestricted, constraints + hidemode + "cell 1 6");
|
||||||
|
|
||||||
@@ -498,9 +508,23 @@ public enum VSubmenuQuestData implements IVSubmenu<CSubmenuQuestData> {
|
|||||||
return cbxPrizeFormat.getSelectedItem();
|
return cbxPrizeFormat.getSelectedItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GameFormat getCasualFormat() {
|
||||||
|
return cbxFormat.getSelectedItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
public GameFormat getPrizedCasualFormat() {
|
||||||
|
return cbxPrizeFormat.getSelectedItem();
|
||||||
|
}
|
||||||
|
|
||||||
public FLabel getBtnCustomFormat() {
|
public FLabel getBtnCustomFormat() {
|
||||||
return btnDefineCustomFormat;
|
return btnDefineCustomFormat;
|
||||||
}
|
}
|
||||||
|
public FLabel getBtnSelectFormat() {
|
||||||
|
return btnSelectFormat;
|
||||||
|
}
|
||||||
|
public FLabel getBtnPrizeSelectFormat() {
|
||||||
|
return btnPrizeSelectFormat;
|
||||||
|
}
|
||||||
public FLabel getBtnPrizeCustomFormat() {
|
public FLabel getBtnPrizeCustomFormat() {
|
||||||
return btnPrizeDefineCustomFormat;
|
return btnPrizeDefineCustomFormat;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ public class NewQuestScreen extends FScreen {
|
|||||||
super(null, NewGameMenu.getMenu());
|
super(null, NewGameMenu.getMenu());
|
||||||
|
|
||||||
cbxStartingPool.addItem(StartingPoolType.Complete);
|
cbxStartingPool.addItem(StartingPoolType.Complete);
|
||||||
cbxStartingPool.addItem(StartingPoolType.Rotating);
|
cbxStartingPool.addItem(StartingPoolType.Sanctioned);
|
||||||
cbxStartingPool.addItem(StartingPoolType.CustomFormat);
|
cbxStartingPool.addItem(StartingPoolType.CustomFormat);
|
||||||
cbxStartingPool.addItem(StartingPoolType.Precon);
|
cbxStartingPool.addItem(StartingPoolType.Precon);
|
||||||
cbxStartingPool.addItem(StartingPoolType.DraftDeck);
|
cbxStartingPool.addItem(StartingPoolType.DraftDeck);
|
||||||
@@ -199,7 +199,7 @@ public class NewQuestScreen extends FScreen {
|
|||||||
|
|
||||||
cbxPrizedCards.addItem("Same as starting pool");
|
cbxPrizedCards.addItem("Same as starting pool");
|
||||||
cbxPrizedCards.addItem(StartingPoolType.Complete);
|
cbxPrizedCards.addItem(StartingPoolType.Complete);
|
||||||
cbxPrizedCards.addItem(StartingPoolType.Rotating);
|
cbxPrizedCards.addItem(StartingPoolType.Sanctioned);
|
||||||
cbxPrizedCards.addItem(StartingPoolType.CustomFormat);
|
cbxPrizedCards.addItem(StartingPoolType.CustomFormat);
|
||||||
cbxPrizedCards.setChangedHandler(new FEventHandler() {
|
cbxPrizedCards.setChangedHandler(new FEventHandler() {
|
||||||
@Override
|
@Override
|
||||||
@@ -331,8 +331,8 @@ public class NewQuestScreen extends FScreen {
|
|||||||
lblPreconDeck.setVisible(newVal == StartingPoolType.Precon);
|
lblPreconDeck.setVisible(newVal == StartingPoolType.Precon);
|
||||||
cbxPreconDeck.setVisible(newVal == StartingPoolType.Precon);
|
cbxPreconDeck.setVisible(newVal == StartingPoolType.Precon);
|
||||||
|
|
||||||
lblFormat.setVisible(newVal == StartingPoolType.Rotating);
|
lblFormat.setVisible(newVal == StartingPoolType.Sanctioned);
|
||||||
cbxFormat.setVisible(newVal == StartingPoolType.Rotating);
|
cbxFormat.setVisible(newVal == StartingPoolType.Sanctioned);
|
||||||
|
|
||||||
btnDefineCustomFormat.setVisible(newVal == StartingPoolType.CustomFormat);
|
btnDefineCustomFormat.setVisible(newVal == StartingPoolType.CustomFormat);
|
||||||
|
|
||||||
@@ -370,8 +370,8 @@ public class NewQuestScreen extends FScreen {
|
|||||||
lblPrizeUnrestricted.setVisible(newVal == StartingPoolType.Complete);
|
lblPrizeUnrestricted.setVisible(newVal == StartingPoolType.Complete);
|
||||||
cbAllowUnlocks.setVisible(newVal != StartingPoolType.Complete);
|
cbAllowUnlocks.setVisible(newVal != StartingPoolType.Complete);
|
||||||
|
|
||||||
lblPrizeFormat.setVisible(newVal == StartingPoolType.Rotating);
|
lblPrizeFormat.setVisible(newVal == StartingPoolType.Sanctioned);
|
||||||
cbxPrizeFormat.setVisible(newVal == StartingPoolType.Rotating);
|
cbxPrizeFormat.setVisible(newVal == StartingPoolType.Sanctioned);
|
||||||
btnPrizeDefineCustomFormat.setVisible(newVal == StartingPoolType.CustomFormat);
|
btnPrizeDefineCustomFormat.setVisible(newVal == StartingPoolType.CustomFormat);
|
||||||
lblPrizeSameAsStarting.setVisible(newVal == null);
|
lblPrizeSameAsStarting.setVisible(newVal == null);
|
||||||
|
|
||||||
@@ -505,7 +505,7 @@ public class NewQuestScreen extends FScreen {
|
|||||||
|
|
||||||
if (worldFormat == null) {
|
if (worldFormat == null) {
|
||||||
switch(getStartingPoolType()) {
|
switch(getStartingPoolType()) {
|
||||||
case Rotating:
|
case Sanctioned:
|
||||||
fmtStartPool = getRotatingFormat();
|
fmtStartPool = getRotatingFormat();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -578,7 +578,7 @@ public class NewQuestScreen extends FScreen {
|
|||||||
}
|
}
|
||||||
fmtPrizes = customPrizeFormatCodes.isEmpty() ? null : new GameFormat("Custom Prizes", customPrizeFormatCodes, null); // chosen sets and no banned cards
|
fmtPrizes = customPrizeFormatCodes.isEmpty() ? null : new GameFormat("Custom Prizes", customPrizeFormatCodes, null); // chosen sets and no banned cards
|
||||||
break;
|
break;
|
||||||
case Rotating:
|
case Sanctioned:
|
||||||
fmtPrizes = getPrizedRotatingFormat();
|
fmtPrizes = getPrizedRotatingFormat();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ package forge.quest;
|
|||||||
|
|
||||||
public enum StartingPoolType {
|
public enum StartingPoolType {
|
||||||
Complete("Unrestricted"),
|
Complete("Unrestricted"),
|
||||||
Rotating("Defined format"),
|
Sanctioned("Sanctioned format"),
|
||||||
|
Casual("Casual/Historic format"),
|
||||||
CustomFormat("Custom format"),
|
CustomFormat("Custom format"),
|
||||||
Precon("Event or starter deck"),
|
Precon("Event or starter deck"),
|
||||||
SealedDeck("My sealed deck"),
|
SealedDeck("My sealed deck"),
|
||||||
|
|||||||
Reference in New Issue
Block a user