From 2a2c593dd86d3e030c58d95814942118a6c3b273 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 1 Nov 2014 01:57:26 +0100 Subject: [PATCH] * Fixed a bug that changing player type started unwanted cascading change loop that needed longer time to resolve. --- .../main/java/mage/client/dialog/NewTournamentDialog.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java index 4c9fdfbdee..af82f4168a 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java @@ -80,6 +80,8 @@ public class NewTournamentDialog extends MageDialog { private final int CONSTRUCTION_TIME_MIN = 6; private final int CONSTRUCTION_TIME_MAX = 30; + private boolean automaticChange = false; + /** Creates new form NewTournamentDialog */ public NewTournamentDialog() { initComponents(); @@ -728,7 +730,9 @@ public class NewTournamentDialog extends MageDialog { panel.getPlayerType().addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { - playerActionPerformed(evt); + if (!automaticChange) { + playerActionPerformed(evt); + } } }); } @@ -740,6 +744,7 @@ public class NewTournamentDialog extends MageDialog { private void playerActionPerformed(java.awt.event.ActionEvent evt) { boolean start = false; int selectedIndex = 0; + automaticChange = true; for (TournamentPlayerPanel player: players) { if (!start) { if (evt.getSource().equals(player.getPlayerType())) { @@ -751,6 +756,7 @@ public class NewTournamentDialog extends MageDialog { player.getPlayerType().setSelectedIndex(selectedIndex); } } + automaticChange = false; }