mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- Added an option to display color identity of cards in the card detail panel (details in CHANGES.txt).
This commit is contained in:
@@ -172,6 +172,7 @@ public enum CSubmenuPreferences implements ICDoc {
|
|||||||
initializeGameLogVerbosityComboBox();
|
initializeGameLogVerbosityComboBox();
|
||||||
initializeCloseActionComboBox();
|
initializeCloseActionComboBox();
|
||||||
initializeAiProfilesComboBox();
|
initializeAiProfilesComboBox();
|
||||||
|
initializeColorIdentityCombobox();
|
||||||
initializePlayerNameButton();
|
initializePlayerNameButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,6 +299,15 @@ public enum CSubmenuPreferences implements ICDoc {
|
|||||||
panel.setComboBox(comboBox, selectedItem);
|
panel.setComboBox(comboBox, selectedItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initializeColorIdentityCombobox() {
|
||||||
|
final String[] elems = {"Never", "Only Multicolor", "Always"};
|
||||||
|
final FPref userSetting = FPref.UI_DISPLAY_COLOR_IDENTITY;
|
||||||
|
final FComboBoxPanel<String> panel = this.view.getDisplayColorIdentity();
|
||||||
|
final FComboBox<String> comboBox = createComboBox(elems, userSetting);
|
||||||
|
final String selectedItem = this.prefs.getPref(userSetting);
|
||||||
|
panel.setComboBox(comboBox, selectedItem);
|
||||||
|
}
|
||||||
|
|
||||||
private <E> FComboBox<E> createComboBox(final E[] items, final ForgePreferences.FPref setting) {
|
private <E> FComboBox<E> createComboBox(final E[] items, final ForgePreferences.FPref setting) {
|
||||||
final FComboBox<E> comboBox = new FComboBox<>(items);
|
final FComboBox<E> comboBox = new FComboBox<>(items);
|
||||||
addComboBoxListener(comboBox, setting);
|
addComboBoxListener(comboBox, setting);
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
|||||||
private final FComboBoxPanel<GameLogEntryType> cbpGameLogEntryType = new FComboBoxPanel<>("Game Log Verbosity:");
|
private final FComboBoxPanel<GameLogEntryType> cbpGameLogEntryType = new FComboBoxPanel<>("Game Log Verbosity:");
|
||||||
private final FComboBoxPanel<CloseAction> cbpCloseAction = new FComboBoxPanel<>("Close Action:");
|
private final FComboBoxPanel<CloseAction> cbpCloseAction = new FComboBoxPanel<>("Close Action:");
|
||||||
private final FComboBoxPanel<String> cbpAiProfiles = new FComboBoxPanel<>("AI Personality:");
|
private final FComboBoxPanel<String> cbpAiProfiles = new FComboBoxPanel<>("AI Personality:");
|
||||||
|
private final FComboBoxPanel<String> cbpDisplayColorIdentity = new FComboBoxPanel<>("Display Color Identity:");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
@@ -224,6 +225,9 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
|||||||
pnlPrefs.add(cbStackCreatures, regularConstraints);
|
pnlPrefs.add(cbStackCreatures, regularConstraints);
|
||||||
pnlPrefs.add(new NoteLabel("Stacks identical creatures on the battlefield like lands, artifacts, and enchantments."), regularConstraints);
|
pnlPrefs.add(new NoteLabel("Stacks identical creatures on the battlefield like lands, artifacts, and enchantments."), regularConstraints);
|
||||||
|
|
||||||
|
pnlPrefs.add(cbpDisplayColorIdentity, "w 80%!, gap 10% 0 0 10px, span 2 1");
|
||||||
|
pnlPrefs.add(new NoteLabel("Displays the color identity of cards in the card detail information panel."), regularConstraints);
|
||||||
|
|
||||||
// Sound options
|
// Sound options
|
||||||
pnlPrefs.add(new SectionLabel("Sound Options"), sectionConstraints + ", gaptop 2%");
|
pnlPrefs.add(new SectionLabel("Sound Options"), sectionConstraints + ", gaptop 2%");
|
||||||
|
|
||||||
@@ -494,6 +498,10 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
|||||||
return cbpGameLogEntryType;
|
return cbpGameLogEntryType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FComboBoxPanel<String> getDisplayColorIdentity() {
|
||||||
|
return cbpDisplayColorIdentity;
|
||||||
|
}
|
||||||
|
|
||||||
public FComboBoxPanel<CloseAction> getCloseActionComboBoxPanel() {
|
public FComboBoxPanel<CloseAction> getCloseActionComboBoxPanel() {
|
||||||
return cbpCloseAction;
|
return cbpCloseAction;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,6 +162,11 @@ public class SettingsPage extends TabPage<SettingsScreen> {
|
|||||||
"Show Match Background",
|
"Show Match Background",
|
||||||
"Show match background image on battlefield, otherwise background texture shown instead."),
|
"Show match background image on battlefield, otherwise background texture shown instead."),
|
||||||
4);
|
4);
|
||||||
|
lstSettings.addItem(new CustomSelectSetting(FPref.UI_DISPLAY_COLOR_IDENTITY,
|
||||||
|
"Display Color Identity",
|
||||||
|
"Displays the color identity of cards in the card detail information panel.",
|
||||||
|
new String[]{"Never", "Only Multicolor", "Always"}),
|
||||||
|
4);
|
||||||
|
|
||||||
//Card Overlays
|
//Card Overlays
|
||||||
lstSettings.addItem(new BooleanSetting(FPref.UI_SHOW_CARD_OVERLAYS,
|
lstSettings.addItem(new BooleanSetting(FPref.UI_SHOW_CARD_OVERLAYS,
|
||||||
|
|||||||
@@ -31,6 +31,17 @@ The interface has received several small changes.
|
|||||||
The command zone panels have been removed.
|
The command zone panels have been removed.
|
||||||
|
|
||||||
|
|
||||||
|
- Display Color Identity -
|
||||||
|
There's a new option "Display Color Identity" in both desktop and mobile Forge
|
||||||
|
that allows you to display the current color identity of cards. It's disabled
|
||||||
|
by default (set to "Never") but can be toggled to "Always" (which displays color
|
||||||
|
identity for all cards, even mono-color) or to "Only Multicolor" (which only
|
||||||
|
displays color identity of cards that are currently of two or more colors). This
|
||||||
|
might help with effects such as Painter's Servant which add colors to cards and
|
||||||
|
which make all cards display with the gold border. The option is currently found
|
||||||
|
under "Graphic Options" for both versions of Forge.
|
||||||
|
|
||||||
|
|
||||||
- Display tokens on the same row as other cards / on their own row -
|
- Display tokens on the same row as other cards / on their own row -
|
||||||
By default the game now displays tokens on the same row as non-token cards (and
|
By default the game now displays tokens on the same row as non-token cards (and
|
||||||
to the right of them), which makes the game use the battlefield space more
|
to the right of them), which makes the game use the battlefield space more
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ import forge.game.card.CounterType;
|
|||||||
import forge.item.InventoryItemFromSet;
|
import forge.item.InventoryItemFromSet;
|
||||||
import forge.item.PreconDeck;
|
import forge.item.PreconDeck;
|
||||||
import forge.item.SealedProduct;
|
import forge.item.SealedProduct;
|
||||||
|
import forge.model.FModel;
|
||||||
|
import forge.properties.ForgePreferences;
|
||||||
import forge.util.Lang;
|
import forge.util.Lang;
|
||||||
|
|
||||||
public class CardDetailUtil {
|
public class CardDetailUtil {
|
||||||
@@ -153,6 +155,19 @@ public class CardDetailUtil {
|
|||||||
return borderColors;
|
return borderColors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getColorIdentity(final CardStateView c) {
|
||||||
|
ColorSet identity = c.getColors();
|
||||||
|
String strIdentity = "";
|
||||||
|
|
||||||
|
if (identity.hasWhite()) { strIdentity += "{W}"; }
|
||||||
|
if (identity.hasBlue()) { strIdentity += "{U}"; }
|
||||||
|
if (identity.hasBlack()) { strIdentity += "{B}"; }
|
||||||
|
if (identity.hasRed()) { strIdentity += "{R}"; }
|
||||||
|
if (identity.hasGreen()) { strIdentity += "{G}"; }
|
||||||
|
|
||||||
|
return strIdentity;
|
||||||
|
}
|
||||||
|
|
||||||
public static DetailColors getRarityColor(final CardRarity rarity) {
|
public static DetailColors getRarityColor(final CardRarity rarity) {
|
||||||
switch (rarity) {
|
switch (rarity) {
|
||||||
case Uncommon:
|
case Uncommon:
|
||||||
@@ -492,6 +507,20 @@ public class CardDetailUtil {
|
|||||||
area.append("Must block " + mustBlockThese);
|
area.append("Must block " + mustBlockThese);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//show card color identity if enabled
|
||||||
|
String colorIdentMode = FModel.getPreferences().getPref(ForgePreferences.FPref.UI_DISPLAY_COLOR_IDENTITY);
|
||||||
|
if (!colorIdentMode.equals("Never")) {
|
||||||
|
final String colorIdent = getColorIdentity(state);
|
||||||
|
final int numColors = state.getColors().countColors();
|
||||||
|
if (!colorIdentMode.equals("Only Multicolor") || numColors > 1) {
|
||||||
|
if (area.length() != 0) {
|
||||||
|
area.append("\n\n");
|
||||||
|
}
|
||||||
|
area.append("Color identity: ");
|
||||||
|
area.append(colorIdent.isEmpty() ? "colorless" : colorIdent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//show current storm count for storm cards
|
//show current storm count for storm cards
|
||||||
if (state.hasStorm()) {
|
if (state.hasStorm()) {
|
||||||
if (gameView != null) {
|
if (gameView != null) {
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
|
|||||||
UI_MANA_LOST_PROMPT ("false"), // Prompt on losing mana when passing priority
|
UI_MANA_LOST_PROMPT ("false"), // Prompt on losing mana when passing priority
|
||||||
UI_PAUSE_WHILE_MINIMIZED("false"),
|
UI_PAUSE_WHILE_MINIMIZED("false"),
|
||||||
UI_TOKENS_IN_SEPARATE_ROW("false"), // Display tokens in their own battlefield row.
|
UI_TOKENS_IN_SEPARATE_ROW("false"), // Display tokens in their own battlefield row.
|
||||||
|
UI_DISPLAY_COLOR_IDENTITY("Never"),
|
||||||
|
|
||||||
UI_FOR_TOUCHSCREN("false"),
|
UI_FOR_TOUCHSCREN("false"),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user