diff --git a/megamek/src/megamek/client/ui/swing/ClientGUI.java b/megamek/src/megamek/client/ui/swing/ClientGUI.java index f28e416d3da..8e169968e9f 100644 --- a/megamek/src/megamek/client/ui/swing/ClientGUI.java +++ b/megamek/src/megamek/client/ui/swing/ClientGUI.java @@ -286,6 +286,9 @@ public class ClientGUI extends JPanel implements BoardViewListener, private MiniReportDisplay miniReportDisplay; private MiniReportDisplayDialog miniReportDisplayDialog; + /** Boolean indicating whether client should be disconnected without a pop-up warning **/ + private boolean disconnectQuietly = false; + /** * The JPanel containing the main display area. */ @@ -433,6 +436,10 @@ public void setPlayerListDialog(final PlayerListDialog playerListDialog) { this.playerListDialog = playerListDialog; } + public void setDisconnectQuietly(boolean quietly) { + disconnectQuietly = quietly; + } + /** * Try to load the "bing" sound clip. */ @@ -2259,8 +2266,10 @@ public void gamePlayerChange(GamePlayerChangeEvent evt) { @Override public void gamePlayerDisconnected(GamePlayerDisconnectedEvent evt) { - doAlertDialog(Messages.getString("ClientGUI.Disconnected.message"), - Messages.getString("ClientGUI.Disconnected.title"), JOptionPane.ERROR_MESSAGE); + if(!disconnectQuietly) { + doAlertDialog(Messages.getString("ClientGUI.Disconnected.message"), + Messages.getString("ClientGUI.Disconnected.title"), JOptionPane.ERROR_MESSAGE); + } frame.setVisible(false); die(); }