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">
|
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JInternalFrameFormInfo">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="resizable" type="boolean" value="true"/>
|
<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"/>
|
<Property name="visible" type="boolean" value="true"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<SyntheticProperties>
|
<SyntheticProperties>
|
||||||
|
|
|
@ -34,8 +34,11 @@
|
||||||
|
|
||||||
package mage.client.dialog;
|
package mage.client.dialog;
|
||||||
|
|
||||||
|
import java.beans.PropertyVetoException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
import mage.client.cards.BigCard;
|
import mage.client.cards.BigCard;
|
||||||
import mage.client.game.CombatGroup;
|
import mage.client.game.CombatGroup;
|
||||||
import mage.view.CombatGroupView;
|
import mage.view.CombatGroupView;
|
||||||
|
@ -48,6 +51,8 @@ public class CombatDialog extends MageDialog {
|
||||||
|
|
||||||
private UUID gameId;
|
private UUID gameId;
|
||||||
private BigCard bigCard;
|
private BigCard bigCard;
|
||||||
|
private int lastX = 500;
|
||||||
|
private int lastY = 300;
|
||||||
|
|
||||||
/** Creates new form CombatDialog */
|
/** Creates new form CombatDialog */
|
||||||
public CombatDialog() {
|
public CombatDialog() {
|
||||||
|
@ -70,13 +75,23 @@ public class CombatDialog extends MageDialog {
|
||||||
combatArea.add(combatGroup);
|
combatArea.add(combatGroup);
|
||||||
combatGroup.revalidate();
|
combatGroup.revalidate();
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
this.setSelected(true);
|
||||||
|
} catch (PropertyVetoException ex) {
|
||||||
|
Logger.getLogger(CombatDialog.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
}
|
||||||
pack();
|
pack();
|
||||||
this.revalidate();
|
this.revalidate();
|
||||||
this.repaint();
|
this.repaint();
|
||||||
|
if (!this.isVisible()) {
|
||||||
this.setVisible(true);
|
this.setVisible(true);
|
||||||
|
this.setLocation(lastX, lastY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hideDialog() {
|
public void hideDialog() {
|
||||||
|
this.lastX = this.getX();
|
||||||
|
this.lastY = this.getY();
|
||||||
this.setVisible(false);
|
this.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,6 +108,7 @@ public class CombatDialog extends MageDialog {
|
||||||
combatArea = new javax.swing.JPanel();
|
combatArea = new javax.swing.JPanel();
|
||||||
|
|
||||||
setResizable(true);
|
setResizable(true);
|
||||||
|
setNormalBounds(new java.awt.Rectangle(400, 200, 410, 307));
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
getContentPane().setLayout(new java.awt.BorderLayout());
|
getContentPane().setLayout(new java.awt.BorderLayout());
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class ExileZoneDialog extends MageDialog {
|
||||||
if (exile.size() > 0) {
|
if (exile.size() > 0) {
|
||||||
cards.loadCards(exile, bigCard, gameId);
|
cards.loadCards(exile, bigCard, gameId);
|
||||||
if (getParent() != MageFrame.getDesktop() || this.isClosed)
|
if (getParent() != MageFrame.getDesktop() || this.isClosed)
|
||||||
MageFrame.getDesktop().add(this, JLayeredPane.PALETTE_LAYER);
|
MageFrame.getDesktop().add(this, JLayeredPane.POPUP_LAYER);
|
||||||
try {
|
try {
|
||||||
this.setIcon(false);
|
this.setIcon(false);
|
||||||
} catch (PropertyVetoException ex) {
|
} catch (PropertyVetoException ex) {
|
||||||
|
|
|
@ -64,7 +64,6 @@ public class AbilityPicker extends JPopupMenu implements PopupMenuListener {
|
||||||
for (Entry<UUID, String> choice: choices.getChoices().entrySet()) {
|
for (Entry<UUID, String> choice: choices.getChoices().entrySet()) {
|
||||||
this.add(new AbilityPickerAction(choice.getKey(), choice.getValue()));
|
this.add(new AbilityPickerAction(choice.getKey(), choice.getValue()));
|
||||||
}
|
}
|
||||||
// this.setLocation(p);
|
|
||||||
this.show(MageFrame.getDesktop(), p.x, p.y);
|
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 class AbilityPickerAction extends AbstractAction {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
public AbilityPickerAction(UUID id, String choice) {
|
public AbilityPickerAction(UUID id, String choice) {
|
||||||
|
|
|
@ -117,6 +117,7 @@ public class FeedbackPanel extends javax.swing.JPanel {
|
||||||
stopModal();
|
stopModal();
|
||||||
this.btnLeft.setVisible(false);
|
this.btnLeft.setVisible(false);
|
||||||
this.btnRight.setVisible(false);
|
this.btnRight.setVisible(false);
|
||||||
|
this.btnSpecial.setVisible(false);
|
||||||
this.lblMessage.setText("");
|
this.lblMessage.setText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,13 +131,14 @@ public class GamePanel extends javax.swing.JPanel {
|
||||||
this.players.clear();
|
this.players.clear();
|
||||||
this.pnlBattlefield.removeAll();
|
this.pnlBattlefield.removeAll();
|
||||||
this.combat.hideDialog();
|
this.combat.hideDialog();
|
||||||
|
MageFrame.getDesktop().remove(combat);
|
||||||
this.setVisible(false);
|
this.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void init(GameView game) {
|
public synchronized void init(GameView game) {
|
||||||
combat.init(gameId, bigCard);
|
combat.init(gameId, bigCard);
|
||||||
combat.setLocation(300, 200);
|
MageFrame.getDesktop().add(combat, JLayeredPane.POPUP_LAYER);
|
||||||
MageFrame.getDesktop().add(combat, JLayeredPane.PALETTE_LAYER);
|
combat.setLocation(500, 300);
|
||||||
this.players.clear();
|
this.players.clear();
|
||||||
this.pnlBattlefield.removeAll();
|
this.pnlBattlefield.removeAll();
|
||||||
for (PlayerView player: game.getPlayers()) {
|
for (PlayerView player: game.getPlayers()) {
|
||||||
|
|
Loading…
Reference in a new issue