- Adding a preference to control whether the Escape key can be used in desktop Forge as an alternative "end turn" shortcut (for players who prefer the old behavior). It is disabled by default.

This commit is contained in:
Agetian
2017-01-06 19:52:42 +00:00
parent 8554b22ac0
commit 9a75816ef2
4 changed files with 12 additions and 2 deletions

View File

@@ -114,6 +114,7 @@ public enum CSubmenuPreferences implements ICDoc {
lstControls.add(Pair.of(view.getCbTokensInSeparateRow(), FPref.UI_TOKENS_IN_SEPARATE_ROW)); 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.getCbStackCreatures(), FPref.UI_STACK_CREATURES));
lstControls.add(Pair.of(view.getCbManaLostPrompt(), FPref.UI_MANA_LOST_PROMPT)); lstControls.add(Pair.of(view.getCbManaLostPrompt(), FPref.UI_MANA_LOST_PROMPT));
lstControls.add(Pair.of(view.getCbEscapeEndsTurn(), FPref.UI_ALLOW_ESC_TO_END_TURN));
lstControls.add(Pair.of(view.getCbFilterLandsByColorId(), FPref.UI_FILTER_LANDS_BY_COLOR_IDENTITY)); lstControls.add(Pair.of(view.getCbFilterLandsByColorId(), FPref.UI_FILTER_LANDS_BY_COLOR_IDENTITY));

View File

@@ -80,6 +80,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
private final JCheckBox cbPromptFreeBlocks = new OptionsCheckBox("Free Block Handling"); private final JCheckBox cbPromptFreeBlocks = new OptionsCheckBox("Free Block Handling");
private final JCheckBox cbPauseWhileMinimized = new OptionsCheckBox("Pause While Minimized"); private final JCheckBox cbPauseWhileMinimized = new OptionsCheckBox("Pause While Minimized");
private final JCheckBox cbCompactPrompt = new OptionsCheckBox("Compact Prompt"); private final JCheckBox cbCompactPrompt = new OptionsCheckBox("Compact Prompt");
private final JCheckBox cbEscapeEndsTurn = new OptionsCheckBox("Use Escape Key to End Turn");
private final JCheckBox cbHideReminderText = new OptionsCheckBox("Hide Reminder Text"); private final JCheckBox cbHideReminderText = new OptionsCheckBox("Hide Reminder Text");
private final JCheckBox cbOpenPacksIndiv = new OptionsCheckBox("Open Packs Individually"); private final JCheckBox cbOpenPacksIndiv = new OptionsCheckBox("Open Packs Individually");
private final JCheckBox cbTokensInSeparateRow = new OptionsCheckBox("Display Tokens in a Separate Row"); private final JCheckBox cbTokensInSeparateRow = new OptionsCheckBox("Display Tokens in a Separate Row");
@@ -162,6 +163,9 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
pnlPrefs.add(cbPauseWhileMinimized, regularConstraints); pnlPrefs.add(cbPauseWhileMinimized, regularConstraints);
pnlPrefs.add(new NoteLabel("When enabled, Forge pauses when minimized (primarily for AI vs AI)."), regularConstraints); pnlPrefs.add(new NoteLabel("When enabled, Forge pauses when minimized (primarily for AI vs AI)."), regularConstraints);
pnlPrefs.add(cbEscapeEndsTurn, regularConstraints);
pnlPrefs.add(new NoteLabel("When enabled, Escape key functions as an alternative shortcut to end the current turn."), regularConstraints);
// Deck building options // Deck building options
pnlPrefs.add(new SectionLabel("Random Deck Generation"), sectionConstraints); pnlPrefs.add(new SectionLabel("Random Deck Generation"), sectionConstraints);
@@ -578,6 +582,10 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
return cbCompactPrompt; return cbCompactPrompt;
} }
public final JCheckBox getCbEscapeEndsTurn() {
return cbEscapeEndsTurn;
}
public final JCheckBox getCbHideReminderText() { public final JCheckBox getCbHideReminderText() {
return cbHideReminderText; return cbHideReminderText;
} }

View File

@@ -58,7 +58,7 @@ public class VPrompt implements IVDoc<CPrompt> {
public void keyPressed(final KeyEvent e) { public void keyPressed(final KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
if (btnCancel.isEnabled()) { if (btnCancel.isEnabled()) {
if (!btnCancel.getText().equals("End Turn")) { if (FModel.getPreferences().getPrefBoolean(FPref.UI_ALLOW_ESC_TO_END_TURN) || !btnCancel.getText().equals("End Turn")) {
btnCancel.doClick(); btnCancel.doClick();
} }
} }

View File

@@ -82,6 +82,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
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_CURRENT_COLORS("Never"), UI_DISPLAY_CURRENT_COLORS("Never"),
UI_FILTER_LANDS_BY_COLOR_IDENTITY("true"), UI_FILTER_LANDS_BY_COLOR_IDENTITY("true"),
UI_ALLOW_ESC_TO_END_TURN ("false"),
UI_FOR_TOUCHSCREN("false"), UI_FOR_TOUCHSCREN("false"),
@@ -168,7 +169,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
SHORTCUT_SHOWTARGETING ("84"), SHORTCUT_SHOWTARGETING ("84"),
SHORTCUT_AUTOYIELD_ALWAYS_YES ("89"), SHORTCUT_AUTOYIELD_ALWAYS_YES ("89"),
SHORTCUT_AUTOYIELD_ALWAYS_NO ("78"); SHORTCUT_AUTOYIELD_ALWAYS_NO ("78");
private final String strDefaultVal; private final String strDefaultVal;
private FPref(final String s0) { private FPref(final String s0) {