mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
...
This commit is contained in:
parent
9e925a7723
commit
0f69569491
6 changed files with 25 additions and 6 deletions
|
@ -3,6 +3,9 @@
|
|||
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JInternalFrameFormInfo">
|
||||
<Properties>
|
||||
<Property name="resizable" type="boolean" value="true"/>
|
||||
<Property name="normalBounds" type="java.awt.Rectangle" editor="org.netbeans.beaninfo.editors.RectangleEditor">
|
||||
<Rectangle value="[400, 200, 410, 307]"/>
|
||||
</Property>
|
||||
<Property name="visible" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
<SyntheticProperties>
|
||||
|
|
|
@ -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();
|
||||
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());
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -64,7 +64,6 @@ public class AbilityPicker extends JPopupMenu implements PopupMenuListener {
|
|||
for (Entry<UUID, String> 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) {
|
||||
|
|
|
@ -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("");
|
||||
}
|
||||
|
||||
|
|
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue