Fix for multiple winlose dialogs in quest mode

This commit is contained in:
Maxmtg
2011-09-11 23:31:26 +00:00
parent 70f19ea0c7
commit 9224bf2758

View File

@@ -48,6 +48,9 @@ import javax.swing.JOptionPane;
*/ */
public class GameAction { public class GameAction {
/** This variable prevents WinLose dialog from popping several times, ie on each state effect check after a win.*/
private boolean canShowWinLose = true;
/** /**
* <p>resetActivationsPerTurn.</p> * <p>resetActivationsPerTurn.</p>
*/ */
@@ -642,13 +645,14 @@ public class GameAction {
return; return;
} }
if (checkEndGameSate()) { if (canShowWinLose && checkEndGameSate()) {
AllZone.getDisplay().savePrefs(); AllZone.getDisplay().savePrefs();
frame.setEnabled(false); frame.setEnabled(false);
//frame.dispose(); //frame.dispose();
Gui_WinLose gwl = new Gui_WinLose(AllZone.getMatchState(), AllZone.getQuestData(), AllZone.getQuestAssignment()); Gui_WinLose gwl = new Gui_WinLose(AllZone.getMatchState(), AllZone.getQuestData(), AllZone.getQuestAssignment());
//gwl.setAlwaysOnTop(true); //gwl.setAlwaysOnTop(true);
gwl.toFront(); gwl.toFront();
canShowWinLose = false;
return; return;
} }
@@ -1109,6 +1113,7 @@ public class GameAction {
Constant.Quest.fantasyQuest[0] = false; Constant.Quest.fantasyQuest[0] = false;
AllZone.newGameCleanup(); AllZone.newGameCleanup();
canShowWinLose = true;
forge.card.trigger.Trigger.resetIDs(); forge.card.trigger.Trigger.resetIDs();