mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
ensure that popupContainer gets closed with game ends
This commit is contained in:
parent
9a2b9de6eb
commit
7f93ddbf80
2 changed files with 9 additions and 1 deletions
|
|
@ -34,6 +34,7 @@
|
||||||
|
|
||||||
package mage.client.game;
|
package mage.client.game;
|
||||||
|
|
||||||
|
import java.util.logging.Level;
|
||||||
import mage.Constants;
|
import mage.Constants;
|
||||||
import mage.client.MageFrame;
|
import mage.client.MageFrame;
|
||||||
import mage.client.cards.Cards;
|
import mage.client.cards.Cards;
|
||||||
|
|
@ -60,6 +61,7 @@ import java.awt.event.MouseEvent;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.prefs.Preferences;
|
import java.util.prefs.Preferences;
|
||||||
|
import mage.client.components.MageComponents;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -164,6 +166,12 @@ public class GamePanel extends javax.swing.JPanel {
|
||||||
for (ShowCardsDialog reveal: revealed.values()) {
|
for (ShowCardsDialog reveal: revealed.values()) {
|
||||||
reveal.hideDialog();
|
reveal.hideDialog();
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
Component popupContainer = MageFrame.getUI().getComponent(MageComponents.POPUP_CONTAINER);
|
||||||
|
popupContainer.setVisible(false);
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
logger.fatal("popupContainer error:", ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void showGame(UUID gameId, UUID playerId) {
|
public synchronized void showGame(UUID gameId, UUID playerId) {
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ public class MageActionCallback implements ActionCallback {
|
||||||
public void run() {
|
public void run() {
|
||||||
ThreadUtils.sleep(700);
|
ThreadUtils.sleep(700);
|
||||||
|
|
||||||
if (!popupCard.equals(data.card)) {
|
if (popupCard == null || !popupCard.equals(data.card)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue