- Added an option to display color identity of cards in the card detail panel (details in CHANGES.txt).

This commit is contained in:
Agetian
2015-06-01 20:04:38 +00:00
parent df213262ec
commit 21323a4f72
6 changed files with 64 additions and 0 deletions

View File

@@ -172,6 +172,7 @@ public enum CSubmenuPreferences implements ICDoc {
initializeGameLogVerbosityComboBox();
initializeCloseActionComboBox();
initializeAiProfilesComboBox();
initializeColorIdentityCombobox();
initializePlayerNameButton();
}
@@ -298,6 +299,15 @@ public enum CSubmenuPreferences implements ICDoc {
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) {
final FComboBox<E> comboBox = new FComboBox<>(items);
addComboBoxListener(comboBox, setting);

View File

@@ -89,6 +89,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
private final FComboBoxPanel<GameLogEntryType> cbpGameLogEntryType = new FComboBoxPanel<>("Game Log Verbosity:");
private final FComboBoxPanel<CloseAction> cbpCloseAction = new FComboBoxPanel<>("Close Action:");
private final FComboBoxPanel<String> cbpAiProfiles = new FComboBoxPanel<>("AI Personality:");
private final FComboBoxPanel<String> cbpDisplayColorIdentity = new FComboBoxPanel<>("Display Color Identity:");
/**
* Constructor.
@@ -224,6 +225,9 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
pnlPrefs.add(cbStackCreatures, 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
pnlPrefs.add(new SectionLabel("Sound Options"), sectionConstraints + ", gaptop 2%");
@@ -494,6 +498,10 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
return cbpGameLogEntryType;
}
public FComboBoxPanel<String> getDisplayColorIdentity() {
return cbpDisplayColorIdentity;
}
public FComboBoxPanel<CloseAction> getCloseActionComboBoxPanel() {
return cbpCloseAction;
}