mirror of
https://github.com/correl/mage.git
synced 2025-04-13 01:01:11 -09:00
* Some minor changes to game end window.
This commit is contained in:
parent
537f7dd1ae
commit
bd56b074a0
3 changed files with 41 additions and 35 deletions
Mage.Client/src/main/java/mage/client/dialog
Mage.Common/src/main/java/mage/view
|
@ -233,6 +233,7 @@
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="txtDurationGame">
|
<Component class="javax.swing.JLabel" name="txtDurationGame">
|
||||||
<Properties>
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Duration Game"/>
|
||||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||||
<Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
|
<Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
|
||||||
<EtchetBorder/>
|
<EtchetBorder/>
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
*
|
*
|
||||||
* Created on Jul 31, 2013, 9:41:00 AM
|
* Created on Jul 31, 2013, 9:41:00 AM
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package mage.client.dialog;
|
package mage.client.dialog;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
|
@ -63,9 +62,11 @@ public class GameEndDialog extends MageDialog {
|
||||||
|
|
||||||
private final DateFormat df = DateFormat.getDateTimeInstance();
|
private final DateFormat df = DateFormat.getDateTimeInstance();
|
||||||
|
|
||||||
|
/**
|
||||||
/** Creates new form GameEndDialog
|
* Creates new form GameEndDialog
|
||||||
* @param gameEndView */
|
*
|
||||||
|
* @param gameEndView
|
||||||
|
*/
|
||||||
public GameEndDialog(GameEndView gameEndView) {
|
public GameEndDialog(GameEndView gameEndView) {
|
||||||
|
|
||||||
initComponents();
|
initComponents();
|
||||||
|
@ -90,15 +91,15 @@ public class GameEndDialog extends MageDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
// game duration
|
// game duration
|
||||||
txtDurationGame.setText(Format.getDuration(gameEndView.getStartTime(), gameEndView.getEndTime()));
|
txtDurationGame.setText(" " + Format.getDuration(gameEndView.getStartTime(), gameEndView.getEndTime()));
|
||||||
txtDurationGame.setToolTipText(new StringBuilder(df.format(gameEndView.getStartTime())).append(" - ").append(df.format(gameEndView.getEndTime())).toString());
|
txtDurationGame.setToolTipText(new StringBuilder(df.format(gameEndView.getStartTime())).append(" - ").append(df.format(gameEndView.getEndTime())).toString());
|
||||||
|
|
||||||
// match duration
|
// match duration
|
||||||
Calendar cal = Calendar.getInstance();
|
Calendar cal = Calendar.getInstance();
|
||||||
txtDurationMatch.setText(Format.getDuration(gameEndView.getMatchView().getStartTime(), cal.getTime()));
|
txtDurationMatch.setText(" " + Format.getDuration(gameEndView.getMatchView().getStartTime(), cal.getTime()));
|
||||||
txtDurationMatch.setToolTipText(new StringBuilder(df.format(gameEndView.getMatchView().getStartTime())).append(" - ").append(df.format(cal.getTime())).toString());
|
txtDurationMatch.setToolTipText(new StringBuilder(df.format(gameEndView.getMatchView().getStartTime())).append(" - ").append(df.format(cal.getTime())).toString());
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder(" ");
|
||||||
for (PlayerView player : gameEndView.getPlayers()) {
|
for (PlayerView player : gameEndView.getPlayers()) {
|
||||||
sb.append(player.getName()).append(" Life: ").append(player.getLife()).append(' ');
|
sb.append(player.getName()).append(" Life: ").append(player.getLife()).append(' ');
|
||||||
}
|
}
|
||||||
|
@ -146,10 +147,10 @@ public class GameEndDialog extends MageDialog {
|
||||||
this.setVisible(true);
|
this.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method is called from within the constructor to
|
/**
|
||||||
* initialize the form.
|
* This method is called from within the constructor to 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 always
|
||||||
* always regenerated by the Form Editor.
|
* regenerated by the Form Editor.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
@ -223,6 +224,7 @@ public class GameEndDialog extends MageDialog {
|
||||||
|
|
||||||
lblDurationGame.setText("Duration game:");
|
lblDurationGame.setText("Duration game:");
|
||||||
|
|
||||||
|
txtDurationGame.setText("Duration Game");
|
||||||
txtDurationGame.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
txtDurationGame.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||||
|
|
||||||
lblLife.setText("Life at end:");
|
lblLife.setText("Life at end:");
|
||||||
|
@ -290,7 +292,11 @@ public class GameEndDialog extends MageDialog {
|
||||||
tabPane.addTab("Statistics", tabStatistics);
|
tabPane.addTab("Statistics", tabStatistics);
|
||||||
|
|
||||||
btnOk.setText("OK");
|
btnOk.setText("OK");
|
||||||
btnOk.addActionListener(evt -> btnOkActionPerformed(evt));
|
btnOk.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
btnOkActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||||
getContentPane().setLayout(layout);
|
getContentPane().setLayout(layout);
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
*/
|
*/
|
||||||
package mage.view;
|
package mage.view;
|
||||||
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -79,11 +78,11 @@ public class GameEndView implements Serializable {
|
||||||
}
|
}
|
||||||
if (you != null) {
|
if (you != null) {
|
||||||
if (you.hasWon()) {
|
if (you.hasWon()) {
|
||||||
gameInfo = new StringBuilder("You won the game on turn ").append(game.getTurnNum()).append('.').toString();
|
gameInfo = "You won the game on turn " + game.getTurnNum() + ".";
|
||||||
} else if (winner > 0) {
|
} else if (winner > 0) {
|
||||||
gameInfo = new StringBuilder("You lost the game on turn ").append(game.getTurnNum()).append('.').toString();
|
gameInfo = "You lost the game on turn " + game.getTurnNum() + ".";
|
||||||
} else {
|
} else {
|
||||||
gameInfo = new StringBuilder("Game is a draw on Turn ").append(game.getTurnNum()).append('.').toString();
|
gameInfo = "Game is a draw on Turn " + game.getTurnNum() + ".";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
matchView = new MatchView(table);
|
matchView = new MatchView(table);
|
||||||
|
|
Loading…
Add table
Reference in a new issue