New PauperArchetypeCardGen DeckType added and UI updated for desktop/mobile

This commit is contained in:
Valerio Maggio
2023-05-20 13:59:29 +01:00
parent f03a8049cd
commit 2049a3dce4
11 changed files with 54 additions and 33 deletions

View File

@@ -9,6 +9,7 @@ import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import forge.game.GameFormat;
import forge.util.MyRandom;
import org.apache.commons.lang3.StringUtils;
@@ -146,7 +147,7 @@ public class FDeckChooser extends FScreen {
&& selectedDeckType != DeckType.PIONEER_CARDGEN_DECK && selectedDeckType != DeckType.HISTORIC_CARDGEN_DECK
&& selectedDeckType != DeckType.MODERN_CARDGEN_DECK && selectedDeckType != DeckType.LEGACY_CARDGEN_DECK
&& selectedDeckType != DeckType.VINTAGE_CARDGEN_DECK && selectedDeckType != DeckType.MODERN_COLOR_DECK
&& selectedDeckType != DeckType.PAUPER_COLOR_DECK
&& selectedDeckType != DeckType.PAUPER_CARDGEN_DECK && selectedDeckType != DeckType.PAUPER_COLOR_DECK
&& selectedDeckType != DeckType.COLOR_DECK && selectedDeckType != DeckType.THEME_DECK
&& selectedDeckType != DeckType.RANDOM_COMMANDER_DECK && selectedDeckType != DeckType.RANDOM_CARDGEN_COMMANDER_DECK) {
FDeckViewer.show(getDeck(), false, DeckType.DRAFT_DECK.equals(selectedDeckType));
@@ -180,6 +181,9 @@ public class FDeckChooser extends FScreen {
else if (selectedDeckType == DeckType.VINTAGE_CARDGEN_DECK){
DeckgenUtil.randomSelect(lstDecks);
}
else if (selectedDeckType == DeckType.PAUPER_CARDGEN_DECK){
DeckgenUtil.randomSelect(lstDecks);
}
else {
int size = 0;
try {
@@ -327,6 +331,7 @@ public class FDeckChooser extends FScreen {
case HISTORIC_CARDGEN_DECK:
case LEGACY_CARDGEN_DECK:
case VINTAGE_CARDGEN_DECK:
case PAUPER_CARDGEN_DECK:
case MODERN_COLOR_DECK:
case THEME_DECK:
case RANDOM_DECK:
@@ -551,11 +556,12 @@ public class FDeckChooser extends FScreen {
cmbDeckTypes.addItem(DeckType.THEME_DECK);
if(FModel.isdeckGenMatrixLoaded()) {
cmbDeckTypes.addItem(DeckType.STANDARD_CARDGEN_DECK);
cmbDeckTypes.addItem(DeckType.PIONEER_CARDGEN_DECK);
cmbDeckTypes.addItem(DeckType.HISTORIC_CARDGEN_DECK);
cmbDeckTypes.addItem(DeckType.MODERN_CARDGEN_DECK);
cmbDeckTypes.addItem(DeckType.PAUPER_CARDGEN_DECK);
cmbDeckTypes.addItem(DeckType.LEGACY_CARDGEN_DECK);
cmbDeckTypes.addItem(DeckType.VINTAGE_CARDGEN_DECK);
cmbDeckTypes.addItem(DeckType.PIONEER_CARDGEN_DECK);
cmbDeckTypes.addItem(DeckType.HISTORIC_CARDGEN_DECK);
}
cmbDeckTypes.addItem(DeckType.NET_DECK);
cmbDeckTypes.addItem(DeckType.NET_ARCHIVE_STANDARD_DECK);
@@ -942,50 +948,37 @@ public class FDeckChooser extends FScreen {
break;
case STANDARD_CARDGEN_DECK:
maxSelections = 1;
pool= new ArrayList<>();
if(FModel.isdeckGenMatrixLoaded()) {
pool = ArchetypeDeckGenerator.getMatrixDecks(FModel.getFormats().getStandard(), isAi);
}
pool = getCardGenDeckPool(FModel.getFormats().getStandard());
config = ItemManagerConfig.STRING_ONLY;
break;
case PIONEER_CARDGEN_DECK:
maxSelections = 1;
pool= new ArrayList<>();
if(FModel.isdeckGenMatrixLoaded()) {
pool = ArchetypeDeckGenerator.getMatrixDecks(FModel.getFormats().getPioneer(), isAi);
}
pool = getCardGenDeckPool(FModel.getFormats().getPioneer());
config = ItemManagerConfig.STRING_ONLY;
break;
case HISTORIC_CARDGEN_DECK:
maxSelections = 1;
pool= new ArrayList<>();
if(FModel.isdeckGenMatrixLoaded()) {
pool = ArchetypeDeckGenerator.getMatrixDecks(FModel.getFormats().getHistoric(), isAi);
}
pool = getCardGenDeckPool(FModel.getFormats().getHistoric());
config = ItemManagerConfig.STRING_ONLY;
break;
case MODERN_CARDGEN_DECK:
maxSelections = 1;
pool= new ArrayList<>();
if(FModel.isdeckGenMatrixLoaded()) {
pool = ArchetypeDeckGenerator.getMatrixDecks(FModel.getFormats().getModern(), isAi);
}
pool = getCardGenDeckPool(FModel.getFormats().getModern());
config = ItemManagerConfig.STRING_ONLY;
break;
case LEGACY_CARDGEN_DECK:
maxSelections = 1;
pool= new ArrayList<>();
if(FModel.isdeckGenMatrixLoaded()) {
pool = ArchetypeDeckGenerator.getMatrixDecks(FModel.getFormats().get("Legacy"), isAi);
}
pool = getCardGenDeckPool(FModel.getFormats().get("Legacy"));
config = ItemManagerConfig.STRING_ONLY;
break;
case VINTAGE_CARDGEN_DECK:
maxSelections = 1;
pool= new ArrayList<>();
if(FModel.isdeckGenMatrixLoaded()) {
pool = ArchetypeDeckGenerator.getMatrixDecks(FModel.getFormats().get("Vintage"), isAi);
}
pool = getCardGenDeckPool(FModel.getFormats().get("Vintage"));
config = ItemManagerConfig.STRING_ONLY;
break;
case PAUPER_CARDGEN_DECK:
maxSelections = 1;
pool = getCardGenDeckPool(FModel.getFormats().getPauper());
config = ItemManagerConfig.STRING_ONLY;
break;
case MODERN_COLOR_DECK:
@@ -1148,6 +1141,13 @@ public class FDeckChooser extends FScreen {
}
}
private Iterable<DeckProxy> getCardGenDeckPool(GameFormat format) {
Iterable<DeckProxy> pool = new ArrayList<>();
if(FModel.isdeckGenMatrixLoaded())
pool = ArchetypeDeckGenerator.getMatrixDecks(format, isAi);
return pool;
}
@Override
protected void doLayout(float startY, float width, float height) {
float x = PADDING;
@@ -1430,6 +1430,7 @@ public class FDeckChooser extends FScreen {
DeckType.MODERN_CARDGEN_DECK,
DeckType.LEGACY_CARDGEN_DECK,
DeckType.VINTAGE_CARDGEN_DECK,
DeckType.PAUPER_CARDGEN_DECK,
DeckType.THEME_DECK,
DeckType.NET_DECK,
DeckType.NET_ARCHIVE_STANDARD_DECK,
@@ -1448,6 +1449,7 @@ public class FDeckChooser extends FScreen {
deckTypes.remove(DeckType.MODERN_CARDGEN_DECK);
deckTypes.remove(DeckType.LEGACY_CARDGEN_DECK);
deckTypes.remove(DeckType.VINTAGE_CARDGEN_DECK);
deckTypes.remove(DeckType.PAUPER_CARDGEN_DECK);
}
ListChooser<DeckType> chooser = new ListChooser<>(

View File

@@ -547,6 +547,7 @@ public abstract class LobbyScreen extends LaunchScreen implements ILobbyView {
case MODERN_CARDGEN_DECK:
case LEGACY_CARDGEN_DECK:
case VINTAGE_CARDGEN_DECK:
case PAUPER_CARDGEN_DECK:
case COLOR_DECK:
case STANDARD_COLOR_DECK:
case MODERN_COLOR_DECK:

View File

@@ -128,6 +128,7 @@ public class NewGauntletScreen extends LaunchScreen {
DeckType.MODERN_CARDGEN_DECK,
DeckType.LEGACY_CARDGEN_DECK,
DeckType.VINTAGE_CARDGEN_DECK,
DeckType.PAUPER_CARDGEN_DECK,
DeckType.THEME_DECK), null, new Callback<List<DeckType>>() {
@Override
public void run(final List<DeckType> allowedDeckTypes) {