mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
latest
This commit is contained in:
parent
ee760de985
commit
1e292afb69
11 changed files with 69 additions and 65 deletions
|
|
@ -25,8 +25,8 @@
|
||||||
<Layout>
|
<Layout>
|
||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="desktopPane" alignment="0" pref="1066" max="32767" attributes="0"/>
|
<Component id="desktopPane" alignment="0" pref="1144" max="32767" attributes="0"/>
|
||||||
<Component id="mageToolbar" alignment="0" pref="1066" max="32767" attributes="0"/>
|
<Component id="mageToolbar" alignment="0" pref="1144" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<Component id="mageToolbar" min="-2" pref="25" max="-2" attributes="0"/>
|
<Component id="mageToolbar" min="-2" pref="25" max="-2" attributes="0"/>
|
||||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||||
<Component id="desktopPane" pref="840" max="32767" attributes="0"/>
|
<Component id="desktopPane" pref="880" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
|
|
@ -182,7 +182,7 @@
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="lblStatus">
|
<Component class="javax.swing.JLabel" name="lblStatus">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Not connected"/>
|
<Property name="text" type="java.lang.String" value="Not connected "/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<AuxValues>
|
<AuxValues>
|
||||||
<AuxValue name="JavaCodeGenerator_AddingCodePre" type="java.lang.String" value="mageToolbar.add(Box.createHorizontalGlue());"/>
|
<AuxValue name="JavaCodeGenerator_AddingCodePre" type="java.lang.String" value="mageToolbar.add(Box.createHorizontalGlue());"/>
|
||||||
|
|
|
||||||
|
|
@ -117,11 +117,11 @@ public class MageFrame extends javax.swing.JFrame {
|
||||||
this.gamePane.watchGame(gameId);
|
this.gamePane.watchGame(gameId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void replayGame(UUID gameId) {
|
public void replayGame() {
|
||||||
this.tablesPane.hideTables();
|
this.tablesPane.hideTables();
|
||||||
this.tablesPane.setVisible(false);
|
this.tablesPane.setVisible(false);
|
||||||
this.gamePane.setVisible(true);
|
this.gamePane.setVisible(true);
|
||||||
this.gamePane.replayGame(gameId);
|
this.gamePane.replayGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method is called from within the constructor to
|
/** This method is called from within the constructor to
|
||||||
|
|
@ -242,7 +242,7 @@ public class MageFrame extends javax.swing.JFrame {
|
||||||
});
|
});
|
||||||
mageToolbar.add(btnExit);
|
mageToolbar.add(btnExit);
|
||||||
|
|
||||||
lblStatus.setText("Not connected");
|
lblStatus.setText("Not connected ");
|
||||||
mageToolbar.add(Box.createHorizontalGlue());
|
mageToolbar.add(Box.createHorizontalGlue());
|
||||||
mageToolbar.add(lblStatus);
|
mageToolbar.add(lblStatus);
|
||||||
|
|
||||||
|
|
@ -250,15 +250,15 @@ public class MageFrame extends javax.swing.JFrame {
|
||||||
getContentPane().setLayout(layout);
|
getContentPane().setLayout(layout);
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 1066, Short.MAX_VALUE)
|
.addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 1144, Short.MAX_VALUE)
|
||||||
.addComponent(mageToolbar, javax.swing.GroupLayout.DEFAULT_SIZE, 1066, Short.MAX_VALUE)
|
.addComponent(mageToolbar, javax.swing.GroupLayout.DEFAULT_SIZE, 1144, Short.MAX_VALUE)
|
||||||
);
|
);
|
||||||
layout.setVerticalGroup(
|
layout.setVerticalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addComponent(mageToolbar, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(mageToolbar, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addGap(0, 0, 0)
|
.addGap(0, 0, 0)
|
||||||
.addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 840, Short.MAX_VALUE))
|
.addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 880, Short.MAX_VALUE))
|
||||||
);
|
);
|
||||||
|
|
||||||
pack();
|
pack();
|
||||||
|
|
|
||||||
|
|
@ -166,14 +166,14 @@ public class Card extends javax.swing.JPanel implements MouseMotionListener, Mou
|
||||||
|
|
||||||
protected String getText(String cardType) {
|
protected String getText(String cardType) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(card.getName()).append("\n");
|
sb.append(card.getName());
|
||||||
if (card.getManaCost().size() > 0) {
|
if (card.getManaCost().size() > 0) {
|
||||||
sb.append(card.getManaCost()).append("\n");
|
sb.append("\n").append(card.getManaCost());
|
||||||
}
|
}
|
||||||
sb.append(cardType).append("\n");
|
sb.append("\n").append(cardType);
|
||||||
sb.append(card.getColor().toString()).append("\n");
|
sb.append("\n").append(card.getColor().toString());
|
||||||
for (String rule: getRules()) {
|
for (String rule: getRules()) {
|
||||||
sb.append(rule).append("\n");
|
sb.append("\n").append(rule);
|
||||||
}
|
}
|
||||||
if (card.getCardTypes().contains(CardType.CREATURE)) {
|
if (card.getCardTypes().contains(CardType.CREATURE)) {
|
||||||
sb.append(card.getPower()).append("/").append(card.getToughness());
|
sb.append(card.getPower()).append("/").append(card.getToughness());
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,11 @@ public class ChatPanel extends javax.swing.JPanel {
|
||||||
txtConversation.setCaretPosition(txtConversation.getText().length() - 1);
|
txtConversation.setCaretPosition(txtConversation.getText().length() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clear() {
|
||||||
|
this.txtConversation.selectAll();
|
||||||
|
this.txtConversation.replaceSelection("");
|
||||||
|
}
|
||||||
|
|
||||||
/** This method is called from within the constructor to
|
/** This method is called from within the constructor to
|
||||||
* initialize the form.
|
* initialize the form.
|
||||||
* WARNING: Do NOT modify this code. The content of this method is
|
* WARNING: Do NOT modify this code. The content of this method is
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="player2Panel" min="-2" max="-2" attributes="0"/>
|
<Component id="player2Panel" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace pref="22" max="32767" attributes="0"/>
|
<EmptySpace pref="26" max="32767" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<Component id="btnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="btnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="btnOK" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="btnOK" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
|
|
||||||
|
|
@ -64,13 +64,6 @@ public class NewTableDialog extends MageDialog {
|
||||||
public NewTableDialog() {
|
public NewTableDialog() {
|
||||||
initComponents();
|
initComponents();
|
||||||
this.player2Panel.setVisible(false);
|
this.player2Panel.setVisible(false);
|
||||||
//for testing only
|
|
||||||
// this.player1Panel.setPlayerName("human");
|
|
||||||
// this.player2Panel.setPlayerName("computer");
|
|
||||||
// //this.cbPlayer2Type.setSelectedItem(PlayerType.COMPUTER);
|
|
||||||
// this.player2Panel.setVisible(true);
|
|
||||||
// this.player1Panel.setDeckFile("test.dck");
|
|
||||||
// this.player2Panel.setDeckFile("test.dck");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -206,31 +199,20 @@ public class NewTableDialog extends MageDialog {
|
||||||
List<String> playerTypes = new ArrayList<String>();
|
List<String> playerTypes = new ArrayList<String>();
|
||||||
playerTypes.add("Human");
|
playerTypes.add("Human");
|
||||||
playerTypes.add((String) this.cbPlayer2Type.getSelectedItem());
|
playerTypes.add((String) this.cbPlayer2Type.getSelectedItem());
|
||||||
table = session.createTable(
|
table = session.createTable(roomId, (String)this.cbGameType.getSelectedItem(), (String)this.cbDeckType.getSelectedItem(), playerTypes);
|
||||||
roomId,
|
if (session.joinTable(roomId, table.getTableId(), 0, this.player1Panel.getPlayerName(), DeckCardLists.load(this.player1Panel.getDeckFile()))) {
|
||||||
(String)this.cbGameType.getSelectedItem(),
|
|
||||||
(String)this.cbDeckType.getSelectedItem(),
|
|
||||||
playerTypes
|
|
||||||
);
|
|
||||||
if (session.joinTable(
|
|
||||||
roomId,
|
|
||||||
table.getTableId(),
|
|
||||||
0,
|
|
||||||
this.player1Panel.getPlayerName(),
|
|
||||||
DeckCardLists.load(this.player1Panel.getDeckFile())
|
|
||||||
)) {
|
|
||||||
if (!this.cbPlayer2Type.getSelectedItem().equals("Human")) {
|
if (!this.cbPlayer2Type.getSelectedItem().equals("Human")) {
|
||||||
if (session.joinTable(
|
if (session.joinTable(roomId, table.getTableId(), 1, this.player2Panel.getPlayerName(), DeckCardLists.load(this.player2Panel.getDeckFile()))) {
|
||||||
roomId,
|
|
||||||
table.getTableId(),
|
|
||||||
1,
|
|
||||||
this.player2Panel.getPlayerName(),
|
|
||||||
DeckCardLists.load(this.player2Panel.getDeckFile())
|
|
||||||
)) {
|
|
||||||
this.setVisible(false);
|
this.setVisible(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Error joining table.", "Error", JOptionPane.ERROR_MESSAGE);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
this.setVisible(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Error joining table.", "Error", JOptionPane.ERROR_MESSAGE);
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
handleError(ex);
|
handleError(ex);
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,8 @@ public class GamePane extends MagePane {
|
||||||
gamePanel.watchGame(gameId);
|
gamePanel.watchGame(gameId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void replayGame(UUID gameId) {
|
public void replayGame() {
|
||||||
gamePanel.replayGame(gameId);
|
gamePanel.replayGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method is called from within the constructor to
|
/** This method is called from within the constructor to
|
||||||
|
|
|
||||||
|
|
@ -36,9 +36,14 @@
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Container class="javax.swing.JSplitPane" name="jSplitPane1">
|
<Container class="javax.swing.JSplitPane" name="jSplitPane1">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="dividerLocation" type="int" value="1000"/>
|
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||||
|
<Border info="null"/>
|
||||||
|
</Property>
|
||||||
<Property name="dividerSize" type="int" value="3"/>
|
<Property name="dividerSize" type="int" value="3"/>
|
||||||
<Property name="resizeWeight" type="double" value="1.0"/>
|
<Property name="resizeWeight" type="double" value="1.0"/>
|
||||||
|
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[26, 48]"/>
|
||||||
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
|
|
||||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
|
||||||
|
|
@ -58,7 +63,7 @@
|
||||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="pnlHand" max="32767" attributes="0"/>
|
<Component id="pnlHand" max="32767" attributes="0"/>
|
||||||
<Component id="pnlBattlefield" alignment="0" pref="739" max="32767" attributes="0"/>
|
<Component id="pnlBattlefield" alignment="0" pref="665" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
@ -66,7 +71,7 @@
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="1" attributes="0">
|
<Group type="102" alignment="1" attributes="0">
|
||||||
<Component id="pnlBattlefield" pref="632" max="32767" attributes="0"/>
|
<Component id="pnlBattlefield" pref="634" max="32767" attributes="0"/>
|
||||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||||
<Component id="pnlHand" min="-2" max="-2" attributes="0"/>
|
<Component id="pnlHand" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
@ -158,7 +163,7 @@
|
||||||
<Component id="stack" min="-2" pref="209" max="-2" attributes="0"/>
|
<Component id="stack" min="-2" pref="209" max="-2" attributes="0"/>
|
||||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||||
<Component id="bigCard" min="-2" max="-2" attributes="0"/>
|
<Component id="bigCard" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
<EmptySpace pref="8" max="32767" attributes="0"/>
|
||||||
<Component id="pnlReplay" min="-2" max="-2" attributes="0"/>
|
<Component id="pnlReplay" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
|
@ -394,7 +399,7 @@
|
||||||
<Layout>
|
<Layout>
|
||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="hand" alignment="1" pref="735" max="32767" attributes="0"/>
|
<Component id="hand" alignment="1" pref="661" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
|
|
@ -418,6 +423,11 @@
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Container>
|
</Container>
|
||||||
<Component class="mage.client.chat.ChatPanel" name="chatPanel">
|
<Component class="mage.client.chat.ChatPanel" name="chatPanel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[100, 48]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
<Constraints>
|
<Constraints>
|
||||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
|
||||||
<JSplitPaneConstraints position="right"/>
|
<JSplitPaneConstraints position="right"/>
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,7 @@ public class GamePanel extends javax.swing.JPanel {
|
||||||
this.pnlReplay.setVisible(false);
|
this.pnlReplay.setVisible(false);
|
||||||
this.btnStopWatching.setVisible(false);
|
this.btnStopWatching.setVisible(false);
|
||||||
this.setVisible(true);
|
this.setVisible(true);
|
||||||
|
this.chatPanel.clear();
|
||||||
this.chatPanel.connect(session.getGameChatId(gameId));
|
this.chatPanel.connect(session.getGameChatId(gameId));
|
||||||
if (!session.joinGame(gameId))
|
if (!session.joinGame(gameId))
|
||||||
hideGame();
|
hideGame();
|
||||||
|
|
@ -102,22 +103,25 @@ public class GamePanel extends javax.swing.JPanel {
|
||||||
this.feedbackPanel.clear();
|
this.feedbackPanel.clear();
|
||||||
this.btnConcede.setVisible(false);
|
this.btnConcede.setVisible(false);
|
||||||
this.btnStopWatching.setVisible(true);
|
this.btnStopWatching.setVisible(true);
|
||||||
|
this.btnCheat.setVisible(false);
|
||||||
this.pnlReplay.setVisible(false);
|
this.pnlReplay.setVisible(false);
|
||||||
this.setVisible(true);
|
this.setVisible(true);
|
||||||
|
this.chatPanel.clear();
|
||||||
this.chatPanel.connect(session.getGameChatId(gameId));
|
this.chatPanel.connect(session.getGameChatId(gameId));
|
||||||
if (!session.watchGame(gameId))
|
if (!session.watchGame(gameId))
|
||||||
hideGame();
|
hideGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void replayGame(UUID gameId) {
|
public synchronized void replayGame() {
|
||||||
this.gameId = gameId;
|
|
||||||
session = MageFrame.getSession();
|
session = MageFrame.getSession();
|
||||||
session.setGame(this);
|
session.setGame(this);
|
||||||
this.feedbackPanel.clear();
|
this.feedbackPanel.clear();
|
||||||
this.btnConcede.setVisible(false);
|
this.btnConcede.setVisible(false);
|
||||||
this.btnStopWatching.setVisible(false);
|
this.btnStopWatching.setVisible(false);
|
||||||
|
this.btnCheat.setVisible(false);
|
||||||
this.pnlReplay.setVisible(true);
|
this.pnlReplay.setVisible(true);
|
||||||
this.setVisible(true);
|
this.setVisible(true);
|
||||||
|
this.chatPanel.clear();
|
||||||
if (!session.replayGame())
|
if (!session.replayGame())
|
||||||
hideGame();
|
hideGame();
|
||||||
}
|
}
|
||||||
|
|
@ -132,6 +136,7 @@ public class GamePanel extends javax.swing.JPanel {
|
||||||
|
|
||||||
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.PALETTE_LAYER);
|
MageFrame.getDesktop().add(combat, JLayeredPane.PALETTE_LAYER);
|
||||||
this.players.clear();
|
this.players.clear();
|
||||||
this.pnlBattlefield.removeAll();
|
this.pnlBattlefield.removeAll();
|
||||||
|
|
@ -169,7 +174,6 @@ public class GamePanel extends javax.swing.JPanel {
|
||||||
}
|
}
|
||||||
if (game.getCombat().size() > 0) {
|
if (game.getCombat().size() > 0) {
|
||||||
combat.showDialog(game.getCombat());
|
combat.showDialog(game.getCombat());
|
||||||
combat.setLocation(300, 200);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
combat.hideDialog();
|
combat.hideDialog();
|
||||||
|
|
@ -230,7 +234,7 @@ public class GamePanel extends javax.swing.JPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void pickAbility(AbilityPickerView choices) {
|
public void pickAbility(AbilityPickerView choices) {
|
||||||
this.abilityPicker.show(choices, MouseInfo.getPointerInfo().getLocation());
|
this.abilityPicker.show(choices, MageFrame.getDesktop().getMousePosition());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void revealCards(String name, CardsView cards) {
|
public void revealCards(String name, CardsView cards) {
|
||||||
|
|
@ -297,9 +301,10 @@ public class GamePanel extends javax.swing.JPanel {
|
||||||
pnlBattlefield = new javax.swing.JPanel();
|
pnlBattlefield = new javax.swing.JPanel();
|
||||||
chatPanel = new mage.client.chat.ChatPanel();
|
chatPanel = new mage.client.chat.ChatPanel();
|
||||||
|
|
||||||
jSplitPane1.setDividerLocation(1000);
|
jSplitPane1.setBorder(null);
|
||||||
jSplitPane1.setDividerSize(3);
|
jSplitPane1.setDividerSize(3);
|
||||||
jSplitPane1.setResizeWeight(1.0);
|
jSplitPane1.setResizeWeight(1.0);
|
||||||
|
jSplitPane1.setMinimumSize(new java.awt.Dimension(26, 48));
|
||||||
|
|
||||||
pnlGameInfo.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
pnlGameInfo.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||||
|
|
||||||
|
|
@ -467,7 +472,7 @@ public class GamePanel extends javax.swing.JPanel {
|
||||||
.addComponent(stack, javax.swing.GroupLayout.PREFERRED_SIZE, 209, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(stack, javax.swing.GroupLayout.PREFERRED_SIZE, 209, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addGap(0, 0, 0)
|
.addGap(0, 0, 0)
|
||||||
.addComponent(bigCard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(bigCard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
|
||||||
.addComponent(pnlReplay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(pnlReplay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(pnlGameInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addGroup(pnlGameInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
|
@ -482,7 +487,7 @@ public class GamePanel extends javax.swing.JPanel {
|
||||||
pnlHand.setLayout(pnlHandLayout);
|
pnlHand.setLayout(pnlHandLayout);
|
||||||
pnlHandLayout.setHorizontalGroup(
|
pnlHandLayout.setHorizontalGroup(
|
||||||
pnlHandLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
pnlHandLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(hand, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 735, Short.MAX_VALUE)
|
.addComponent(hand, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 661, Short.MAX_VALUE)
|
||||||
);
|
);
|
||||||
pnlHandLayout.setVerticalGroup(
|
pnlHandLayout.setVerticalGroup(
|
||||||
pnlHandLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
pnlHandLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
|
@ -500,18 +505,20 @@ public class GamePanel extends javax.swing.JPanel {
|
||||||
.addGap(0, 0, 0)
|
.addGap(0, 0, 0)
|
||||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(pnlHand, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.addComponent(pnlHand, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.addComponent(pnlBattlefield, javax.swing.GroupLayout.DEFAULT_SIZE, 739, Short.MAX_VALUE)))
|
.addComponent(pnlBattlefield, javax.swing.GroupLayout.DEFAULT_SIZE, 665, Short.MAX_VALUE)))
|
||||||
);
|
);
|
||||||
jPanel3Layout.setVerticalGroup(
|
jPanel3Layout.setVerticalGroup(
|
||||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
|
||||||
.addComponent(pnlBattlefield, javax.swing.GroupLayout.DEFAULT_SIZE, 632, Short.MAX_VALUE)
|
.addComponent(pnlBattlefield, javax.swing.GroupLayout.DEFAULT_SIZE, 634, Short.MAX_VALUE)
|
||||||
.addGap(0, 0, 0)
|
.addGap(0, 0, 0)
|
||||||
.addComponent(pnlHand, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
.addComponent(pnlHand, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
.addComponent(pnlGameInfo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.addComponent(pnlGameInfo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
);
|
);
|
||||||
|
|
||||||
jSplitPane1.setLeftComponent(jPanel3);
|
jSplitPane1.setLeftComponent(jPanel3);
|
||||||
|
|
||||||
|
chatPanel.setMinimumSize(new java.awt.Dimension(100, 48));
|
||||||
jSplitPane1.setRightComponent(chatPanel);
|
jSplitPane1.setRightComponent(chatPanel);
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ public class Client implements CallbackClient {
|
||||||
gameStarted(data[0], data[1]);
|
gameStarted(data[0], data[1]);
|
||||||
}
|
}
|
||||||
else if (callback.getMethod().equals("replayGame")) {
|
else if (callback.getMethod().equals("replayGame")) {
|
||||||
replayGame((UUID) callback.getData());
|
replayGame();
|
||||||
}
|
}
|
||||||
else if (callback.getMethod().equals("watchGame")) {
|
else if (callback.getMethod().equals("watchGame")) {
|
||||||
watchGame((UUID) callback.getData());
|
watchGame((UUID) callback.getData());
|
||||||
|
|
@ -158,9 +158,9 @@ public class Client implements CallbackClient {
|
||||||
logger.info("Watching game " + gameId);
|
logger.info("Watching game " + gameId);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void replayGame(UUID gameId) {
|
protected void replayGame() {
|
||||||
frame.replayGame(gameId);
|
frame.replayGame();
|
||||||
logger.info("Replaying game " + gameId);
|
logger.info("Replaying game");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ public class Session {
|
||||||
gameTypes = server.getGameTypes();
|
gameTypes = server.getGameTypes();
|
||||||
deckTypes = server.getDeckTypes();
|
deckTypes = server.getDeckTypes();
|
||||||
logger.info("Connected to RMI server at " + serverName + ":" + port);
|
logger.info("Connected to RMI server at " + serverName + ":" + port);
|
||||||
frame.setStatusText("Connected to " + serverName + ":" + port);
|
frame.setStatusText("Connected to " + serverName + ":" + port + " ");
|
||||||
frame.enableButtons();
|
frame.enableButtons();
|
||||||
} catch (MageException ex) {
|
} catch (MageException ex) {
|
||||||
Logger.getLogger(Session.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(Session.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
|
@ -115,7 +115,7 @@ public class Session {
|
||||||
} catch (MageException ex) {
|
} catch (MageException ex) {
|
||||||
logger.log(Level.SEVERE, "Error disconnecting ...", ex);
|
logger.log(Level.SEVERE, "Error disconnecting ...", ex);
|
||||||
}
|
}
|
||||||
frame.setStatusText("Not connected");
|
frame.setStatusText("Not connected ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue