mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
- 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:
@@ -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.getCbStackCreatures(), FPref.UI_STACK_CREATURES));
|
||||
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));
|
||||
|
||||
|
||||
@@ -80,6 +80,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
private final JCheckBox cbPromptFreeBlocks = new OptionsCheckBox("Free Block Handling");
|
||||
private final JCheckBox cbPauseWhileMinimized = new OptionsCheckBox("Pause While Minimized");
|
||||
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 cbOpenPacksIndiv = new OptionsCheckBox("Open Packs Individually");
|
||||
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(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
|
||||
pnlPrefs.add(new SectionLabel("Random Deck Generation"), sectionConstraints);
|
||||
|
||||
@@ -578,6 +582,10 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
return cbCompactPrompt;
|
||||
}
|
||||
|
||||
public final JCheckBox getCbEscapeEndsTurn() {
|
||||
return cbEscapeEndsTurn;
|
||||
}
|
||||
|
||||
public final JCheckBox getCbHideReminderText() {
|
||||
return cbHideReminderText;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class VPrompt implements IVDoc<CPrompt> {
|
||||
public void keyPressed(final KeyEvent e) {
|
||||
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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_DISPLAY_CURRENT_COLORS("Never"),
|
||||
UI_FILTER_LANDS_BY_COLOR_IDENTITY("true"),
|
||||
UI_ALLOW_ESC_TO_END_TURN ("false"),
|
||||
|
||||
UI_FOR_TOUCHSCREN("false"),
|
||||
|
||||
@@ -168,7 +169,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
|
||||
SHORTCUT_SHOWTARGETING ("84"),
|
||||
SHORTCUT_AUTOYIELD_ALWAYS_YES ("89"),
|
||||
SHORTCUT_AUTOYIELD_ALWAYS_NO ("78");
|
||||
|
||||
|
||||
private final String strDefaultVal;
|
||||
|
||||
private FPref(final String s0) {
|
||||
|
||||
Reference in New Issue
Block a user