diff --git a/forge-gui-desktop/src/main/java/forge/screens/home/settings/CSubmenuPreferences.java b/forge-gui-desktop/src/main/java/forge/screens/home/settings/CSubmenuPreferences.java index bb4b92ab28a..05d154fd107 100644 --- a/forge-gui-desktop/src/main/java/forge/screens/home/settings/CSubmenuPreferences.java +++ b/forge-gui-desktop/src/main/java/forge/screens/home/settings/CSubmenuPreferences.java @@ -301,7 +301,8 @@ public enum CSubmenuPreferences implements ICDoc { private void initializeColorIdentityCombobox() { final String[] elems = {ForgeConstants.DISP_COLOR_IDENT_NEVER, ForgeConstants.DISP_COLOR_IDENT_CHANGED, - ForgeConstants.DISP_COLOR_IDENT_MULTICOLOR, ForgeConstants.DISP_COLOR_IDENT_ALWAYS}; + ForgeConstants.DISP_COLOR_IDENT_MULTICOLOR, ForgeConstants.DISP_COLOR_IDENT_MULTI_OR_CHANGED, + ForgeConstants.DISP_COLOR_IDENT_ALWAYS}; final FPref userSetting = FPref.UI_DISPLAY_COLOR_IDENTITY; final FComboBoxPanel panel = this.view.getDisplayColorIdentity(); final FComboBox comboBox = createComboBox(elems, userSetting); diff --git a/forge-gui-mobile/src/forge/screens/settings/SettingsPage.java b/forge-gui-mobile/src/forge/screens/settings/SettingsPage.java index d4da2e94131..957ab39c479 100644 --- a/forge-gui-mobile/src/forge/screens/settings/SettingsPage.java +++ b/forge-gui-mobile/src/forge/screens/settings/SettingsPage.java @@ -168,7 +168,8 @@ public class SettingsPage extends TabPage { "Displays the color identity of cards in the card detail information panel.", new String[]{ ForgeConstants.DISP_COLOR_IDENT_NEVER, ForgeConstants.DISP_COLOR_IDENT_MULTICOLOR, - ForgeConstants.DISP_COLOR_IDENT_CHANGED, ForgeConstants.DISP_COLOR_IDENT_ALWAYS}), + ForgeConstants.DISP_COLOR_IDENT_CHANGED, ForgeConstants.DISP_COLOR_IDENT_MULTI_OR_CHANGED, + ForgeConstants.DISP_COLOR_IDENT_ALWAYS}), 4); //Card Overlays diff --git a/forge-gui/CHANGES.txt b/forge-gui/CHANGES.txt index 76863d7dccc..fe73e65ccc6 100644 --- a/forge-gui/CHANGES.txt +++ b/forge-gui/CHANGES.txt @@ -37,11 +37,12 @@ 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), to "Changed" (which displays color identity of all cards whose color identity has been altered compared to its -"pristine" state) or "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 most cards display -with the gold border. The option is currently found under "Graphic Options" for -both versions of Forge. +"pristine" state), to "Multicolor" (which only displays color identity of cards +that are currently of two or more colors) or to "Multi+Changed" (which displays +color identity of all multicolor cards and also of all cards the identity of +which has changed). This might help with effects such as Painter's Servant which +add colors to cards and which make most 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 - diff --git a/forge-gui/src/main/java/forge/card/CardDetailUtil.java b/forge-gui/src/main/java/forge/card/CardDetailUtil.java index f031ecb422e..6448b58dd60 100644 --- a/forge-gui/src/main/java/forge/card/CardDetailUtil.java +++ b/forge-gui/src/main/java/forge/card/CardDetailUtil.java @@ -239,14 +239,22 @@ public class CardDetailUtil { public static String formatCardColorIdentity(final CardStateView state) { final String colorIdentMode = FModel.getPreferences().getPref(ForgePreferences.FPref.UI_DISPLAY_COLOR_IDENTITY); - final CardView card = state.getCard(); boolean showIdentity = false; String colorIdent = ""; + // do not show identity for temp effect cards, emblems and the like + if (state.getType().hasSubtype("Effect")) { + return ""; + } + if (!colorIdentMode.equals(ForgeConstants.DISP_COLOR_IDENT_NEVER)) { + final CardView card = state.getCard(); + boolean isMulticolor = state.getColors().countColors() > 1; + boolean isChanged = false; colorIdent = getColorIdentity(state); - if (colorIdentMode.equals(ForgeConstants.DISP_COLOR_IDENT_CHANGED)) { + // do not waste CPU cycles on this if the mode does not involve checking for changed color identity + if (colorIdentMode.equals(ForgeConstants.DISP_COLOR_IDENT_CHANGED) || colorIdentMode.equals(ForgeConstants.DISP_COLOR_IDENT_MULTI_OR_CHANGED)) { String origIdent = ""; PaperCard origPaperCard = null; Card origCard = null; @@ -267,17 +275,14 @@ public class CardDetailUtil { } catch(Exception ex) { System.err.println("Unexpected behavior: card " + card.getName() + "[" + card.getId() + "] tripped an exception when trying to process color identity."); } - showIdentity = !colorIdent.equals(origIdent); - } else if (colorIdentMode.equals(ForgeConstants.DISP_COLOR_IDENT_MULTICOLOR)) { - final int numColors = state.getColors().countColors(); - showIdentity = numColors > 1; - } else if (colorIdentMode.equals(ForgeConstants.DISP_COLOR_IDENT_ALWAYS)) { - showIdentity = true; + isChanged = !colorIdent.equals(origIdent); } - // do not show identity for temp effect cards, emblems and the like - if (state.getType().hasSubtype("Effect")) { - showIdentity = false; + if ((colorIdentMode.equals(ForgeConstants.DISP_COLOR_IDENT_MULTICOLOR) && isMulticolor) || + (colorIdentMode.equals(ForgeConstants.DISP_COLOR_IDENT_CHANGED) && isChanged) || + (colorIdentMode.equals(ForgeConstants.DISP_COLOR_IDENT_MULTI_OR_CHANGED) && (isChanged || isMulticolor)) || + (colorIdentMode.equals(ForgeConstants.DISP_COLOR_IDENT_ALWAYS))) { + showIdentity = true; } } diff --git a/forge-gui/src/main/java/forge/properties/ForgeConstants.java b/forge-gui/src/main/java/forge/properties/ForgeConstants.java index ccb27dc7a8c..08fb5b86b26 100644 --- a/forge-gui/src/main/java/forge/properties/ForgeConstants.java +++ b/forge-gui/src/main/java/forge/properties/ForgeConstants.java @@ -182,6 +182,7 @@ public final class ForgeConstants { public static final String DISP_COLOR_IDENT_ALWAYS = "Always"; public static final String DISP_COLOR_IDENT_CHANGED = "Changed"; public static final String DISP_COLOR_IDENT_MULTICOLOR = "Multicolor"; + public static final String DISP_COLOR_IDENT_MULTI_OR_CHANGED = "Multi+Changed"; public static final String DISP_COLOR_IDENT_NEVER = "Never"; }