From 5815a22d0c0c821870431e51c6c17ee01a480bdc Mon Sep 17 00:00:00 2001 From: Agetian Date: Sat, 4 Feb 2017 05:28:20 +0000 Subject: [PATCH] - Pre-fill the macro sequence prompt with the last remembered sequence (to allow quick minor modifications if necessary). - Allow the user to "reset" the macro to step zero by initiating macro recording (Shift+R by default) and confirming the macro without any changes. --- .../src/main/java/forge/player/PlayerControllerHuman.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java b/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java index 6378f7cf445..9f3ee16ebc6 100644 --- a/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java +++ b/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java @@ -38,6 +38,7 @@ import forge.GuiBase; import forge.LobbyPlayer; import forge.achievement.AchievementCollection; import forge.ai.GameState; +import forge.assets.FSkinProp; import forge.card.CardDb; import forge.card.ColorSet; import forge.card.ICardFace; @@ -1974,6 +1975,7 @@ public class PlayerControllerHuman // "Actions" are stored as a pair of the "action" recipient (the entity // to "click") and a boolean representing whether the entity is a player. private final List> rememberedActions = new ArrayList<>(); + private String rememberedSequenceText = ""; @Override public void setRememberedActions() { @@ -2004,10 +2006,12 @@ public class PlayerControllerHuman // A more informative prompt would be useful, but the dialog seems to // like to clip text in long messages... final String prompt = "Enter a sequence (card IDs and/or \"opponent\"/\"me\"). (e.g. 7, opponent, 18)"; - String textSequence = getGui().showInputDialog(prompt, dialogTitle); + String textSequence = getGui().showInputDialog(prompt, dialogTitle, FSkinProp.ICO_QUEST_NOTES, rememberedSequenceText); if (textSequence == null || textSequence.trim().isEmpty()) { return; } + rememberedSequenceText = textSequence; + // Clean up input textSequence = textSequence.trim().toLowerCase().replaceAll("[@%]", ""); // Replace "opponent" and "me" with symbols to ease following replacements