Add preference to Hide Reminder Text

This commit is contained in:
drdev
2013-11-23 21:55:12 +00:00
parent 9e20af7603
commit daafa3f5c2
4 changed files with 17 additions and 6 deletions

View File

@@ -82,6 +82,7 @@ public enum CSubmenuPreferences implements ICDoc {
lstControls.add(Pair.of(view.getCbCompactMainMenu(), FPref.UI_COMPACT_MAIN_MENU));
lstControls.add(Pair.of(view.getCbUseThemes(), FPref.UI_THEMED_COMBOBOX));
lstControls.add(Pair.of(view.getCbPromptFreeBlocks(), FPref.MATCHPREF_PROMPT_FREE_BLOCKS));
lstControls.add(Pair.of(view.getCbHideReminderText(), FPref.UI_HIDE_REMINDER_TEXT));
for(final Pair<JCheckBox, FPref> kv : lstControls) {
kv.getKey().addItemListener(new ItemListener() {

View File

@@ -84,6 +84,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
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");
private final JCheckBox cbHideReminderText = new OptionsCheckBox("Hide Reminder Text");
private final Map<FPref, KeyboardShortcutField> shortcutFields = new HashMap<FPref, KeyboardShortcutField>();
@@ -175,7 +176,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
pnlPrefs.add(cbUseThemes, regularConstraints);
pnlPrefs.add(new NoteLabel("Currently only applies to UIManager-related theme settings. (RESTART REQUIRED)"), regularConstraints);
pnlPrefs.add(cbpCloseAction, "w 80%!, gap 10% 0 0 10px, span 2 1");
pnlPrefs.add(new NoteLabel("Changes what happens when clicking the X button in the upper right."), regularConstraints);
@@ -186,7 +187,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
pnlPrefs.add(new NoteLabel("Adds foiled effects to random cards."), regularConstraints);
pnlPrefs.add(cbRandomizeArt, regularConstraints);
pnlPrefs.add(new NoteLabel("Randomize the card art for cards in the human's deck"), regularConstraints);
pnlPrefs.add(new NoteLabel("Randomize the card art for cards in the human's deck."), regularConstraints);
pnlPrefs.add(cbScaleLarger, regularConstraints);
pnlPrefs.add(new NoteLabel("Allows card pictures to be expanded larger than their original size."), regularConstraints);
@@ -194,6 +195,9 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
pnlPrefs.add(cbUiForTouchScreen, regularConstraints);
pnlPrefs.add(new NoteLabel("Increases some UI elements to provide a better experience on touchscreen devices. (Needs restart)"), regularConstraints);
pnlPrefs.add(cbHideReminderText, regularConstraints);
pnlPrefs.add(new NoteLabel("Hide reminder text in Card Detail pane."), regularConstraints);
// Sound options
pnlPrefs.add(new SectionLabel("Sound Options"), sectionConstraints + ", gaptop 2%");
@@ -450,7 +454,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
public FComboBoxPanel<GameLogEntryType> getGameLogVerbosityComboBoxPanel() {
return cbpGameLogEntryType;
}
public FComboBoxPanel<CloseAction> getCloseActionComboBoxPanel() {
return cbpCloseAction;
}
@@ -484,6 +488,10 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
return cbUiForTouchScreen;
}
public final JCheckBox getCbHideReminderText() {
return cbHideReminderText;
}
/** @return {@link forge.gui.toolbox.FLabel} */
public FLabel getBtnReset() {
return btnReset;
@@ -507,7 +515,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
public final FLabel getBtnDeleteEditorUI() {
return btnDeleteEditorUI;
}
public final FLabel getBtnDeleteWorkshopUI() {
return btnDeleteWorkshopUI;
}

View File

@@ -1654,9 +1654,10 @@ public enum FSkin {
}
public static String encodeSymbols(String str) {
//format reminder text in italics
//format reminder text in italics (or hide if preference set)
String pattern = "\\((.+)\\)";
String replacement = "<i>\\($1\\)</i>"; //TODO: Consider setting to hide reminder text, in which case replace with "" here
String replacement = Singletons.getModel().getPreferences().getPrefBoolean(FPref.UI_HIDE_REMINDER_TEXT) ?
"" : "<i>\\($1\\)</i>";
str = str.replaceAll(pattern, replacement);
//format mana symbols to display as icons

View File

@@ -54,6 +54,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
UI_OVERLAY_CARD_POWER ("true"),
UI_OVERLAY_CARD_MANA_COST ("true"),
UI_OVERLAY_CARD_ID ("true"),
UI_HIDE_REMINDER_TEXT ("false"),
UI_UPLOAD_DRAFT ("false"),
UI_SCALE_LARGER ("true"),
UI_MAX_STACK ("3"),