- Mobile Forge: allow using A as alpha strike and E as end turn (unmodified with Ctrl) when running on desktop; bound to Ctrl+A / Ctrl+E on mobile (not sure what the rationale was, but probably to avoid skipping things when typing in something from on-screen keyboard? I decided not to touch it).

- Added an option to disallow using Esc as a shortcut for passing until end of turn, like in desktop forge (mostly relevant when used on desktop, but could also prevent misclicking the Esc-bound button accidentally on mobile).
This commit is contained in:
Agetian
2017-07-13 09:43:54 +00:00
parent d7ea4cdf6a
commit b12380a772
2 changed files with 14 additions and 4 deletions

View File

@@ -16,6 +16,7 @@ import com.google.common.collect.Maps;
import forge.Forge;
import forge.Forge.KeyInputAdapter;
import forge.Graphics;
import forge.GuiBase;
import forge.animation.AbilityEffect;
import forge.assets.FSkinColor;
import forge.assets.FSkinColor.Colors;
@@ -367,17 +368,22 @@ public class MatchScreen extends FScreen {
}
return getActivePrompt().getBtnCancel().trigger(); //trigger Cancel if can't trigger OK
case Keys.ESCAPE:
if (!FModel.getPreferences().getPrefBoolean(FPref.UI_ALLOW_ESC_TO_END_TURN)) {
if (getActivePrompt().getBtnCancel().getText().equals("End Turn")) {
return false;
}
}
return getActivePrompt().getBtnCancel().trigger(); //otherwise trigger Cancel
case Keys.BACK:
return true; //suppress Back button so it's not bumped when trying to press OK or Cancel buttons
case Keys.A: //alpha strike on Ctrl+A
if (KeyInputAdapter.isCtrlKeyDown()) {
case Keys.A: //alpha strike on Ctrl+A on Android, A when running on desktop
if (KeyInputAdapter.isCtrlKeyDown() || GuiBase.getInterface().isRunningOnDesktop()) {
getGameController().alphaStrike();
return true;
}
break;
case Keys.E: //end turn on Ctrl+E
if (KeyInputAdapter.isCtrlKeyDown()) {
case Keys.E: //end turn on Ctrl+E on Android, E when running on desktop
if (KeyInputAdapter.isCtrlKeyDown() || GuiBase.getInterface().isRunningOnDesktop()) {
getGameController().passPriorityUntilEndOfTurn();
return true;
}

View File

@@ -135,6 +135,10 @@ public class SettingsPage extends TabPage<SettingsScreen> {
"Defines the granularity level of auto-yields (yield to each unique ability or to each unique card).",
new String[]{ForgeConstants.AUTO_YIELD_PER_ABILITY, ForgeConstants.AUTO_YIELD_PER_CARD}),
1);
lstSettings.addItem(new BooleanSetting(FPref.UI_ALLOW_ESC_TO_END_TURN,
"Use Escape Key To End Turn",
"Allows to use Esc keyboard shortcut to end turn prematurely"),
1);
//Random Deck Generation
lstSettings.addItem(new BooleanSetting(FPref.DECKGEN_NOSMALL,