mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Quitting a gauntlet match should abandon it (when not
using the "quit and save" option after a win). With this change, you can now properly edit your deck between gauntlet tries and have the effect be reflected in the next gauntlet.
This commit is contained in:
@@ -114,4 +114,10 @@ public class GauntletWinLose extends ControlWinLose {
|
|||||||
super.actionOnContinue();
|
super.actionOnContinue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionOnQuit() {
|
||||||
|
super.actionOnQuit();
|
||||||
|
controller.actionOnQuit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,4 +91,10 @@ public class GauntletWinLose extends ControlWinLose {
|
|||||||
super.actionOnContinue();
|
super.actionOnContinue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionOnQuit() {
|
||||||
|
super.actionOnQuit();
|
||||||
|
controller.actionOnQuit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ public final class GauntletData {
|
|||||||
|
|
||||||
/** Resets a gauntlet data to an unplayed state, then stamps and saves. */
|
/** Resets a gauntlet data to an unplayed state, then stamps and saves. */
|
||||||
public void reset() {
|
public void reset() {
|
||||||
|
userDeck = null;
|
||||||
completed = 0;
|
completed = 0;
|
||||||
stamp();
|
stamp();
|
||||||
eventRecords.clear();
|
eventRecords.clear();
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ import forge.model.FModel;
|
|||||||
import forge.player.GamePlayerUtil;
|
import forge.player.GamePlayerUtil;
|
||||||
|
|
||||||
public abstract class GauntletWinLoseController {
|
public abstract class GauntletWinLoseController {
|
||||||
|
private static final String SAVE_AND_QUIT = "Save and Quit";
|
||||||
|
|
||||||
private final IWinLoseView<? extends IButton> view;
|
private final IWinLoseView<? extends IButton> view;
|
||||||
private final GameView lastGame;
|
private final GameView lastGame;
|
||||||
|
|
||||||
@@ -127,6 +129,13 @@ public abstract class GauntletWinLoseController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final void actionOnQuit() {
|
||||||
|
if (!SAVE_AND_QUIT.equals(view.getBtnQuit().getText())) {
|
||||||
|
// Quitting mid-match abandons the gauntlet.
|
||||||
|
FModel.getGauntletData().reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected abstract void showOutcome(boolean isMatchOver, String message1, String message2, FSkinProp icon, List<String> lstEventNames, List<String> lstEventRecords, int len, int num);
|
protected abstract void showOutcome(boolean isMatchOver, String message1, String message2, FSkinProp icon, List<String> lstEventNames, List<String> lstEventRecords, int len, int num);
|
||||||
protected abstract void saveOptions();
|
protected abstract void saveOptions();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user