From 0f69569491a9eb94ea830a18ae67f4c1318838b5 Mon Sep 17 00:00:00 2001 From: BetaSteward Date: Tue, 4 May 2010 02:20:45 +0000 Subject: [PATCH] ... --- .../src/mage/client/dialog/CombatDialog.form | 3 +++ .../src/mage/client/dialog/CombatDialog.java | 18 +++++++++++++++++- .../mage/client/dialog/ExileZoneDialog.java | 2 +- .../src/mage/client/game/AbilityPicker.java | 2 -- .../src/mage/client/game/FeedbackPanel.java | 1 + .../src/mage/client/game/GamePanel.java | 5 +++-- 6 files changed, 25 insertions(+), 6 deletions(-) diff --git a/Mage.Client/src/mage/client/dialog/CombatDialog.form b/Mage.Client/src/mage/client/dialog/CombatDialog.form index 4f40ab660c..805769116d 100644 --- a/Mage.Client/src/mage/client/dialog/CombatDialog.form +++ b/Mage.Client/src/mage/client/dialog/CombatDialog.form @@ -3,6 +3,9 @@
+ + + diff --git a/Mage.Client/src/mage/client/dialog/CombatDialog.java b/Mage.Client/src/mage/client/dialog/CombatDialog.java index a554333a8f..a9824f2185 100644 --- a/Mage.Client/src/mage/client/dialog/CombatDialog.java +++ b/Mage.Client/src/mage/client/dialog/CombatDialog.java @@ -34,8 +34,11 @@ package mage.client.dialog; +import java.beans.PropertyVetoException; import java.util.List; import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; import mage.client.cards.BigCard; import mage.client.game.CombatGroup; import mage.view.CombatGroupView; @@ -48,6 +51,8 @@ public class CombatDialog extends MageDialog { private UUID gameId; private BigCard bigCard; + private int lastX = 500; + private int lastY = 300; /** Creates new form CombatDialog */ public CombatDialog() { @@ -70,13 +75,23 @@ public class CombatDialog extends MageDialog { combatArea.add(combatGroup); combatGroup.revalidate(); } + try { + this.setSelected(true); + } catch (PropertyVetoException ex) { + Logger.getLogger(CombatDialog.class.getName()).log(Level.SEVERE, null, ex); + } pack(); this.revalidate(); this.repaint(); - this.setVisible(true); + if (!this.isVisible()) { + this.setVisible(true); + this.setLocation(lastX, lastY); + } } public void hideDialog() { + this.lastX = this.getX(); + this.lastY = this.getY(); this.setVisible(false); } @@ -93,6 +108,7 @@ public class CombatDialog extends MageDialog { combatArea = new javax.swing.JPanel(); setResizable(true); + setNormalBounds(new java.awt.Rectangle(400, 200, 410, 307)); setVisible(true); getContentPane().setLayout(new java.awt.BorderLayout()); diff --git a/Mage.Client/src/mage/client/dialog/ExileZoneDialog.java b/Mage.Client/src/mage/client/dialog/ExileZoneDialog.java index a6f342d27d..6526a57a69 100644 --- a/Mage.Client/src/mage/client/dialog/ExileZoneDialog.java +++ b/Mage.Client/src/mage/client/dialog/ExileZoneDialog.java @@ -60,7 +60,7 @@ public class ExileZoneDialog extends MageDialog { if (exile.size() > 0) { cards.loadCards(exile, bigCard, gameId); if (getParent() != MageFrame.getDesktop() || this.isClosed) - MageFrame.getDesktop().add(this, JLayeredPane.PALETTE_LAYER); + MageFrame.getDesktop().add(this, JLayeredPane.POPUP_LAYER); try { this.setIcon(false); } catch (PropertyVetoException ex) { diff --git a/Mage.Client/src/mage/client/game/AbilityPicker.java b/Mage.Client/src/mage/client/game/AbilityPicker.java index b19a456cef..552531ba3b 100644 --- a/Mage.Client/src/mage/client/game/AbilityPicker.java +++ b/Mage.Client/src/mage/client/game/AbilityPicker.java @@ -64,7 +64,6 @@ public class AbilityPicker extends JPopupMenu implements PopupMenuListener { for (Entry choice: choices.getChoices().entrySet()) { this.add(new AbilityPickerAction(choice.getKey(), choice.getValue())); } -// this.setLocation(p); this.show(MageFrame.getDesktop(), p.x, p.y); } @@ -81,7 +80,6 @@ public class AbilityPicker extends JPopupMenu implements PopupMenuListener { private class AbilityPickerAction extends AbstractAction { - private static final long serialVersionUID = 1L; private UUID id; public AbilityPickerAction(UUID id, String choice) { diff --git a/Mage.Client/src/mage/client/game/FeedbackPanel.java b/Mage.Client/src/mage/client/game/FeedbackPanel.java index 6311f41b9b..f73974e374 100644 --- a/Mage.Client/src/mage/client/game/FeedbackPanel.java +++ b/Mage.Client/src/mage/client/game/FeedbackPanel.java @@ -117,6 +117,7 @@ public class FeedbackPanel extends javax.swing.JPanel { stopModal(); this.btnLeft.setVisible(false); this.btnRight.setVisible(false); + this.btnSpecial.setVisible(false); this.lblMessage.setText(""); } diff --git a/Mage.Client/src/mage/client/game/GamePanel.java b/Mage.Client/src/mage/client/game/GamePanel.java index 8e3287d298..d444f38edc 100644 --- a/Mage.Client/src/mage/client/game/GamePanel.java +++ b/Mage.Client/src/mage/client/game/GamePanel.java @@ -131,13 +131,14 @@ public class GamePanel extends javax.swing.JPanel { this.players.clear(); this.pnlBattlefield.removeAll(); this.combat.hideDialog(); + MageFrame.getDesktop().remove(combat); this.setVisible(false); } public synchronized void init(GameView game) { combat.init(gameId, bigCard); - combat.setLocation(300, 200); - MageFrame.getDesktop().add(combat, JLayeredPane.PALETTE_LAYER); + MageFrame.getDesktop().add(combat, JLayeredPane.POPUP_LAYER); + combat.setLocation(500, 300); this.players.clear(); this.pnlBattlefield.removeAll(); for (PlayerView player: game.getPlayers()) {