Issue 147 - Explain reason for victory/win/lose/loss/defeat before closing battlefield window

- delays dispose() on the battlefield screen until button clicks in Gui_WinLose
This commit is contained in:
Rob Cashwalker
2011-08-28 15:44:45 +00:00
parent fc95a74ada
commit c2d45c557f
2 changed files with 19 additions and 3 deletions

View File

@@ -636,8 +636,10 @@ public class GameAction {
if (checkEndGameSate()) {
AllZone.getDisplay().savePrefs();
frame.dispose();
new Gui_WinLose( AllZone.getMatchState(), AllZone.getQuestData(), AllZone.getQuestAssignment() );
frame.setEnabled(false);
//frame.dispose();
Gui_WinLose gwl = new Gui_WinLose( AllZone.getMatchState(), AllZone.getQuestData(), AllZone.getQuestAssignment() );
gwl.setAlwaysOnTop(true);
return;
}

View File

@@ -166,10 +166,14 @@ public class Gui_WinLose extends JFrame implements NewConstants {
* @param e a {@link java.awt.event.ActionEvent} object.
*/
void continueButton_actionPerformed(ActionEvent e) {
// issue 147 - keep battlefield up following win/loss
JFrame frame = (JFrame) AllZone.getDisplay();
frame.dispose();
//open up "Game" screen
PrepareForNextRound();
AllZone.getDisplay().setVisible(true);
frame.setEnabled(true);
dispose();
}
@@ -205,9 +209,14 @@ public class Gui_WinLose extends JFrame implements NewConstants {
* @param e a {@link java.awt.event.ActionEvent} object.
*/
void restartButton_actionPerformed(ActionEvent e) {
// issue 147 - keep battlefield up following win/loss
JFrame frame = (JFrame) AllZone.getDisplay();
frame.dispose();
model.match.reset();
PrepareForNextRound();
AllZone.getDisplay().setVisible(true);
frame.setEnabled(true);
dispose();
}
@@ -324,6 +333,11 @@ public class Gui_WinLose extends JFrame implements NewConstants {
* @param e a {@link java.awt.event.ActionEvent} object.
*/
void quitButton_actionPerformed(ActionEvent e) {
// issue 147 - keep battlefield up following win/loss
JFrame frame = (JFrame) AllZone.getDisplay();
frame.dispose();
frame.setEnabled(true);
//are we on a quest?
if (AllZone.getQuestData() == null) {
new OldGuiNewGame();