mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Added an option "Randomize card art in generated card pools" (enabled by default). When enabled, generates cards with different art in generated limited mode pools (sealed, booster draft, quest). When disabled, generates a certain predefined amount (30 for draft/sealed, 10 for quest shop) of lands, all with the same art. However, the art index will be randomized at every generation, thus still leaving some room for art randomization.
- Tweaked case of letters in some option names for consistency.
This commit is contained in:
@@ -37,7 +37,9 @@ import forge.gui.toolbox.itemmanager.views.SColumnUtil;
|
||||
import forge.item.PaperCard;
|
||||
import forge.limited.BoosterDraft;
|
||||
import forge.limited.IBoosterDraft;
|
||||
import forge.properties.ForgePreferences.FPref;
|
||||
import forge.util.ItemPool;
|
||||
import forge.util.MyRandom;
|
||||
|
||||
/**
|
||||
* Updates the deck editor UI as necessary draft selection mode.
|
||||
@@ -159,8 +161,12 @@ public class CEditorDraftingProcess extends ACEditorBase<PaperCard, DeckGroup> {
|
||||
for(String landName : MagicColor.Constant.BASIC_LANDS) {
|
||||
final int numArt = Singletons.getMagicDb().getCommonCards().getArtCount(landName, landSet);
|
||||
|
||||
for (int i = 0; i < numArt; i++) {
|
||||
deck.get(DeckSection.Sideboard).add(landName, landSet, i, numArt > 1 ? landsCount : 30);
|
||||
if (Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_RANDOM_ART_POOLS)) {
|
||||
for (int i = 0; i < numArt; i++) {
|
||||
deck.get(DeckSection.Sideboard).add(landName, landSet, i, numArt > 1 ? landsCount : 30);
|
||||
}
|
||||
} else {
|
||||
deck.get(DeckSection.Sideboard).add(landName, landSet, numArt > 1 ? MyRandom.getRandom().nextInt(numArt) : 0, 30);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ import forge.limited.SealedCardPoolGenerator;
|
||||
import forge.limited.SealedDeckBuilder;
|
||||
import forge.properties.ForgePreferences.FPref;
|
||||
import forge.util.ItemPool;
|
||||
import forge.util.MyRandom;
|
||||
import forge.util.storage.IStorage;
|
||||
|
||||
/**
|
||||
@@ -176,8 +177,12 @@ public enum CSubmenuSealed implements ICDoc {
|
||||
for (final String element : MagicColor.Constant.BASIC_LANDS) {
|
||||
final int numArt = Singletons.getMagicDb().getCommonCards().getArtCount(element, sd.getLandSetCode());
|
||||
|
||||
for (int i = 0; i < numArt; i++) {
|
||||
deck.get(DeckSection.Sideboard).add(element, sd.getLandSetCode(), i, numArt > 1 ? landsCount : 30);
|
||||
if (Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_RANDOM_ART_POOLS)) {
|
||||
for (int i = 0; i < numArt; i++) {
|
||||
deck.get(DeckSection.Sideboard).add(element, sd.getLandSetCode(), i, numArt > 1 ? landsCount : 30);
|
||||
}
|
||||
} else {
|
||||
deck.get(DeckSection.Sideboard).add(element, sd.getLandSetCode(), numArt > 1 ? MyRandom.getRandom().nextInt(numArt) : 0, 30);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ public enum CSubmenuPreferences implements ICDoc {
|
||||
lstControls.add(Pair.of(view.getCbAnte(), FPref.UI_ANTE));
|
||||
lstControls.add(Pair.of(view.getCbManaBurn(), FPref.UI_MANABURN));
|
||||
lstControls.add(Pair.of(view.getCbScaleLarger(), FPref.UI_SCALE_LARGER));
|
||||
lstControls.add(Pair.of(view.getCbRandomArtPools(), FPref.UI_RANDOM_ART_POOLS));
|
||||
lstControls.add(Pair.of(view.getCbEnforceDeckLegality(), FPref.ENFORCE_DECK_LEGALITY));
|
||||
lstControls.add(Pair.of(view.getCbCloneImgSource(), FPref.UI_CLONE_MODE_SOURCE));
|
||||
lstControls.add(Pair.of(view.getCbRemoveSmall(), FPref.DECKGEN_NOSMALL));
|
||||
|
||||
@@ -76,12 +76,13 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
private final JCheckBox cbManaBurn = new OptionsCheckBox("Mana Burn");
|
||||
private final JCheckBox cbDevMode = new OptionsCheckBox("Developer Mode");
|
||||
private final JCheckBox cbEnforceDeckLegality = new OptionsCheckBox("Deck Conformance");
|
||||
private final JCheckBox cbCloneImgSource = new OptionsCheckBox("Clones use original card art");
|
||||
private final JCheckBox cbCloneImgSource = new OptionsCheckBox("Clones Use Original Card Art");
|
||||
private final JCheckBox cbScaleLarger = new OptionsCheckBox("Scale Image Larger");
|
||||
private final JCheckBox cbRandomFoil = new OptionsCheckBox("Random Foil");
|
||||
private final JCheckBox cbRandomArtPools = new OptionsCheckBox("Randomize Card Art in Generated Card Pools");
|
||||
private final JCheckBox cbEnableSounds = new OptionsCheckBox("Enable Sounds");
|
||||
private final JCheckBox cbAltSoundSystem = new OptionsCheckBox("Use Alternate Sound System");
|
||||
private final JCheckBox cbUiForTouchScreen = new OptionsCheckBox("Enchance UI for touchscreens");
|
||||
private final JCheckBox cbUiForTouchScreen = new OptionsCheckBox("Enchance UI for Touchscreens");
|
||||
private final JCheckBox cbCompactMainMenu = new OptionsCheckBox("Use Compact Main Sidebar Menu");
|
||||
private final JCheckBox cbUseThemes = new OptionsCheckBox("Enable Themes");
|
||||
private final JCheckBox cbPromptFreeBlocks = new OptionsCheckBox("Free Block Handling");
|
||||
@@ -192,6 +193,9 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
pnlPrefs.add(cbScaleLarger, regularConstraints);
|
||||
pnlPrefs.add(new NoteLabel("Allows card pictures to be expanded larger than their original size."), regularConstraints);
|
||||
|
||||
pnlPrefs.add(cbRandomArtPools, regularConstraints);
|
||||
pnlPrefs.add(new NoteLabel("Generates cards with random art in generated limited mode card pools."), regularConstraints);
|
||||
|
||||
pnlPrefs.add(cbUiForTouchScreen, regularConstraints);
|
||||
pnlPrefs.add(new NoteLabel("Increases some UI elements to provide a better experience on touchscreen devices. (Needs restart)"), regularConstraints);
|
||||
|
||||
@@ -441,6 +445,11 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
return cbScaleLarger;
|
||||
}
|
||||
|
||||
/** @return {@link javax.swing.JCheckBox} */
|
||||
public JCheckBox getCbRandomArtPools() {
|
||||
return cbScaleLarger;
|
||||
}
|
||||
|
||||
/** @return {@link javax.swing.JCheckBox} */
|
||||
public JCheckBox getCbDevMode() {
|
||||
return cbDevMode;
|
||||
|
||||
@@ -57,6 +57,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
|
||||
UI_HIDE_REMINDER_TEXT ("false"),
|
||||
UI_UPLOAD_DRAFT ("false"),
|
||||
UI_SCALE_LARGER ("true"),
|
||||
UI_RANDOM_ART_POOLS ("true"),
|
||||
UI_COMPACT_PROMPT ("false"),
|
||||
UI_STACK_CARD_VIEW ("false"),
|
||||
UI_CARD_SIZE ("small"),
|
||||
|
||||
@@ -47,6 +47,7 @@ import forge.item.InventoryItem;
|
||||
import forge.item.SealedProduct;
|
||||
import forge.item.PreconDeck;
|
||||
import forge.item.TournamentPack;
|
||||
import forge.properties.ForgePreferences.FPref;
|
||||
import forge.quest.bazaar.QuestItemType;
|
||||
import forge.quest.data.GameFormatQuest;
|
||||
import forge.quest.data.QuestAssets;
|
||||
@@ -125,10 +126,15 @@ public final class QuestUtilCards {
|
||||
|
||||
for (String landName : MagicColor.Constant.BASIC_LANDS) {
|
||||
int artCount = db.getArtCount(landName, landCode);
|
||||
int[] artGroups = MyRandom.splitIntoRandomGroups(nBasic, artCount);
|
||||
|
||||
for (int i=0; i<artGroups.length; i++) {
|
||||
pool.add(db.getCard(landName, landCode, i), artGroups[i]);
|
||||
if (Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_RANDOM_ART_POOLS)) {
|
||||
int[] artGroups = MyRandom.splitIntoRandomGroups(nBasic, artCount);
|
||||
|
||||
for (int i=0; i<artGroups.length; i++) {
|
||||
pool.add(db.getCard(landName, landCode, i), artGroups[i]);
|
||||
}
|
||||
} else {
|
||||
pool.add(db.getCard(landName, landCode, artCount > 1 ? MyRandom.getRandom().nextInt(artCount) : 0), nBasic);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user