- Added a toggleable option "Display Tokens on a Separate Row" that controls whether tokens are displayed on their own row or on the same row as other cards. Defaults to "on a separate row" for compliance with previous behavior (and at least until this mode is tested better).

This commit is contained in:
Agetian
2015-05-17 06:23:05 +00:00
parent 1393212cec
commit ce924fafe1
4 changed files with 28 additions and 1 deletions

View File

@@ -115,6 +115,7 @@ public enum CSubmenuPreferences implements ICDoc {
lstControls.add(Pair.of(view.getCbCompactPrompt(), FPref.UI_COMPACT_PROMPT));
lstControls.add(Pair.of(view.getCbHideReminderText(), FPref.UI_HIDE_REMINDER_TEXT));
lstControls.add(Pair.of(view.getCbOpenPacksIndiv(), FPref.UI_OPEN_PACKS_INDIV));
lstControls.add(Pair.of(view.getCbTokensInSeparateRow(), FPref.UI_TOKENS_IN_SEPARATE_ROW));
lstControls.add(Pair.of(view.getCbStackCreatures(), FPref.UI_STACK_CREATURES));
lstControls.add(Pair.of(view.getCbManaLostPrompt(), FPref.UI_MANA_LOST_PROMPT));

View File

@@ -96,6 +96,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
private final JCheckBox cbCompactPrompt = new OptionsCheckBox("Compact Prompt");
private final JCheckBox cbHideReminderText = new OptionsCheckBox("Hide Reminder Text");
private final JCheckBox cbOpenPacksIndiv = new OptionsCheckBox("Open Packs Individually");
private final JCheckBox cbTokensInSeparateRow = new OptionsCheckBox("Display Tokens on a Separate Row");
private final JCheckBox cbStackCreatures = new OptionsCheckBox("Stack Creatures");
private final Map<FPref, KeyboardShortcutField> shortcutFields = new HashMap<FPref, KeyboardShortcutField>();
@@ -236,6 +237,9 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
pnlPrefs.add(cbOpenPacksIndiv, regularConstraints);
pnlPrefs.add(new NoteLabel("When opening Fat Packs and Booster Boxes, booster packs will be opened and displayed one at a time."), regularConstraints);
pnlPrefs.add(cbTokensInSeparateRow, regularConstraints);
pnlPrefs.add(new NoteLabel("Displays tokens in a separate row on the battlefield below the non-token creatures."), regularConstraints);
pnlPrefs.add(cbStackCreatures, regularConstraints);
pnlPrefs.add(new NoteLabel("Stacks identical creatures on the battlefield like lands, artifacts, and enchantments."), regularConstraints);
@@ -568,6 +572,10 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
return cbOpenPacksIndiv;
}
public final JCheckBox getCbTokensInSeparateRow() {
return cbTokensInSeparateRow;
}
public final JCheckBox getCbStackCreatures() {
return cbStackCreatures;
}

View File

@@ -32,6 +32,8 @@ import forge.game.card.CardView;
import forge.game.card.CardView.CardStateView;
import forge.game.player.PlayerView;
import forge.game.zone.ZoneType;
import forge.model.FModel;
import forge.properties.ForgePreferences;
import forge.screens.match.CMatchUI;
import forge.toolbox.FScrollPane;
import forge.toolbox.MouseTriggerEvent;
@@ -73,12 +75,15 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
private final PlayerView model;
private final ZoneType zone;
private boolean makeTokenRow = true;
public PlayArea(final CMatchUI matchUI, final FScrollPane scrollPane, final boolean mirror, final PlayerView player, final ZoneType zone) {
super(matchUI, scrollPane);
this.setBackground(Color.white);
this.mirror = mirror;
this.model = player;
this.zone = zone;
this.makeTokenRow = FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_TOKENS_IN_SEPARATE_ROW);
}
private final CardStackRow collectAllLands() {
@@ -263,6 +268,18 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
final CardStackRow creatures = new CardStackRow(this.getCardPanels(), RowType.CreatureNonToken);
final CardStackRow others = new CardStackRow(this.getCardPanels(), RowType.Other);
if (!makeTokenRow) {
for (CardStack s : tokens) {
if (!s.isEmpty()) {
if (s.get(0).getCard().getCurrentState().isCreature()) {
creatures.add(s);
} else {
others.add(s);
}
}
}
tokens.clear();
}
/*if (FModel.getPreferences().getPrefBoolean(FPref.UI_STACK_CREATURES) && !collectedCreatures.isEmpty()) {
creatures = collectedCreatures;

View File

@@ -77,6 +77,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
UI_CLOSE_ACTION ("NONE"),
UI_MANA_LOST_PROMPT ("false"), // Prompt on losing mana when passing priority
UI_PAUSE_WHILE_MINIMIZED("false"),
UI_TOKENS_IN_SEPARATE_ROW("true"), // Display tokens on their own battlefield row.
UI_FOR_TOUCHSCREN("false"),