mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
* Draft - Show draft time and draft progress. Show game threads and ma games. Fixed a problem with AI player and password.
This commit is contained in:
parent
499b548a14
commit
bdd163080d
12 changed files with 78 additions and 19 deletions
|
|
@ -283,8 +283,8 @@ public class ChatPanel extends javax.swing.JPanel {
|
|||
// this.txtConversation.setBackground(new Color(0, 0, 0, 0));
|
||||
// this.txtConversation.setForeground(new Color(255, 255, 255));
|
||||
this.txtConversation.setSelectionColor(Color.LIGHT_GRAY);
|
||||
this.jScrollPaneTxt.setOpaque(false);
|
||||
this.jScrollPaneTxt.getViewport().setOpaque(false);
|
||||
this.jScrollPaneTxt.setOpaque(!chatType.equals(ChatType.TABLES));
|
||||
this.jScrollPaneTxt.getViewport().setOpaque(!chatType.equals(ChatType.TABLES));
|
||||
}
|
||||
|
||||
public void setSplitDividerLocation(int location) {
|
||||
|
|
@ -310,8 +310,11 @@ public class ChatPanel extends javax.swing.JPanel {
|
|||
this.players = roomUserInfo.getUsersView().toArray(new UsersView[0]);
|
||||
JTableHeader th = jTablePlayers.getTableHeader();
|
||||
TableColumnModel tcm = th.getColumnModel();
|
||||
tcm.getColumn(0).setHeaderValue(new StringBuilder("Players").append(" (").append(this.players.length).append(")").toString());
|
||||
tcm.getColumn(2).setHeaderValue(new StringBuilder("Games").append(" (").append(roomUserInfo.getNumberActiveGames()).append(")").toString());
|
||||
tcm.getColumn(0).setHeaderValue("Players (" + this.players.length + ")");
|
||||
tcm.getColumn(2).setHeaderValue(
|
||||
"Games (" + roomUserInfo.getNumberActiveGames() +
|
||||
(roomUserInfo.getNumberActiveGames() != roomUserInfo.getNumberGameThreads() ? " T:" + roomUserInfo.getNumberGameThreads():"") +
|
||||
" max: " + roomUserInfo.getNumberMaxGames() + ")");
|
||||
th.repaint();
|
||||
this.fireTableDataChanged();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,21 +212,26 @@
|
|||
<Component class="javax.swing.JLabel" name="lbTimeLimit">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Time Limit:"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="The time a player has for the whole match. If a player runs out of time during a game, he loses the complete match. "/>
|
||||
</Properties>
|
||||
<BindingProperties>
|
||||
<BindingProperty name="labelFor" source="cbTimeLimit" target="lbTimeLimit" targetPath="labelFor" updateStrategy="0" immediately="false"/>
|
||||
</BindingProperties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="cbTimeLimit">
|
||||
<Properties>
|
||||
<Property name="toolTipText" type="java.lang.String" value="The time a player has for the whole match. If a player runs out of time during a game, he loses the complete match. "/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblPassword">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Password:"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="Players have to enter the password to be able to join this table."/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="txtPassword">
|
||||
<Properties>
|
||||
<Property name="toolTipText" type="java.lang.String" value="Players have to enter this password to be able to enter the created table."/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="Players have to enter the password to be able to join this table."/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblTournamentType">
|
||||
|
|
@ -284,6 +289,9 @@
|
|||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnNumWins">
|
||||
<Properties>
|
||||
<Property name="toolTipText" type="java.lang.String" value="To win a match a player has to win this number of games."/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnNumWinsnumPlayersChanged"/>
|
||||
</Events>
|
||||
|
|
@ -311,9 +319,13 @@
|
|||
<Component class="javax.swing.JLabel" name="lblNumRounds">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Number of Swiss Rounds:"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<html>The number of rounds the swiss tournament has in total.<br>
The tournaments ends after that number of rounds or<br> 
if there are less than two players left in the tournament."/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnNumRounds">
|
||||
<Properties>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<html>The number of rounds the swiss tournament has in total.<br>
The tournaments ends after that number of rounds or<br> 
if there are less than two players left in the tournament."/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="spnNumRoundsnumPlayersChanged"/>
|
||||
</Events>
|
||||
|
|
@ -403,6 +415,7 @@
|
|||
<Component class="javax.swing.JCheckBox" name="cbAllowSpectators">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Allow spectators"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="Allow other players to watch the games of this table."/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblPlayer1">
|
||||
|
|
|
|||
|
|
@ -170,13 +170,17 @@ public class NewTournamentDialog extends MageDialog {
|
|||
lblName.setText("Name:");
|
||||
|
||||
lbTimeLimit.setText("Time Limit:");
|
||||
lbTimeLimit.setToolTipText("The time a player has for the whole match. If a player runs out of time during a game, he loses the complete match. ");
|
||||
|
||||
org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cbTimeLimit, org.jdesktop.beansbinding.ObjectProperty.create(), lbTimeLimit, org.jdesktop.beansbinding.BeanProperty.create("labelFor"));
|
||||
bindingGroup.addBinding(binding);
|
||||
|
||||
lblPassword.setText("Password:");
|
||||
cbTimeLimit.setToolTipText("The time a player has for the whole match. If a player runs out of time during a game, he loses the complete match. ");
|
||||
|
||||
txtPassword.setToolTipText("Players have to enter this password to be able to enter the created table.");
|
||||
lblPassword.setText("Password:");
|
||||
lblPassword.setToolTipText("Players have to enter the password to be able to join this table.");
|
||||
|
||||
txtPassword.setToolTipText("Players have to enter the password to be able to join this table.");
|
||||
|
||||
lblTournamentType.setText("Tournament Type:");
|
||||
|
||||
|
|
@ -205,6 +209,7 @@ public class NewTournamentDialog extends MageDialog {
|
|||
|
||||
lblNumWins.setText("Wins:");
|
||||
|
||||
spnNumWins.setToolTipText("To win a match a player has to win this number of games.");
|
||||
spnNumWins.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnNumWinsnumPlayersChanged(evt);
|
||||
|
|
@ -221,7 +226,9 @@ public class NewTournamentDialog extends MageDialog {
|
|||
});
|
||||
|
||||
lblNumRounds.setText("Number of Swiss Rounds:");
|
||||
lblNumRounds.setToolTipText("<html>The number of rounds the swiss tournament has in total.<br>\nThe tournaments ends after that number of rounds or<br> \nif there are less than two players left in the tournament.");
|
||||
|
||||
spnNumRounds.setToolTipText("<html>The number of rounds the swiss tournament has in total.<br>\nThe tournaments ends after that number of rounds or<br> \nif there are less than two players left in the tournament.");
|
||||
spnNumRounds.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
spnNumRoundsnumPlayersChanged(evt);
|
||||
|
|
@ -272,6 +279,7 @@ public class NewTournamentDialog extends MageDialog {
|
|||
);
|
||||
|
||||
cbAllowSpectators.setText("Allow spectators");
|
||||
cbAllowSpectators.setToolTipText("Allow other players to watch the games of this table.");
|
||||
|
||||
lblPlayer1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
|
||||
lblPlayer1.setText("Player 1 (You)");
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ import mage.remote.Session;
|
|||
import mage.view.MatchView;
|
||||
import mage.view.RoomUsersView;
|
||||
import mage.view.TableView;
|
||||
import mage.view.UsersView;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -213,18 +213,19 @@ public class TournamentPanel extends javax.swing.JPanel {
|
|||
}
|
||||
switch (tournament.getTournamentState()) {
|
||||
case "Constructing":
|
||||
String constructionTime = "";
|
||||
String timeLeft = "";
|
||||
if (tournament.getStepStartTime() != null) {
|
||||
constructionTime = Format.getDuration(tournament.getConstructionTime() - (tournament.getServerTime().getTime() - tournament.getStepStartTime().getTime())/1000);
|
||||
timeLeft = Format.getDuration(tournament.getConstructionTime() - (tournament.getServerTime().getTime() - tournament.getStepStartTime().getTime())/1000);
|
||||
}
|
||||
txtTournamentState.setText(new StringBuilder(tournament.getTournamentState()).append(" (").append(constructionTime).append(")").toString());
|
||||
txtTournamentState.setText(new StringBuilder(tournament.getTournamentState()).append(" (").append(timeLeft).append(")").toString());
|
||||
break;
|
||||
case "Dueling":
|
||||
String duelingTime = "";
|
||||
case "Drafting":
|
||||
String usedTime = "";
|
||||
if (tournament.getStepStartTime() != null) {
|
||||
duelingTime = Format.getDuration((tournament.getServerTime().getTime() - tournament.getStepStartTime().getTime())/1000);
|
||||
usedTime = Format.getDuration((tournament.getServerTime().getTime() - tournament.getStepStartTime().getTime())/1000);
|
||||
}
|
||||
txtTournamentState.setText(new StringBuilder(tournament.getTournamentState()).append(" (").append(duelingTime).append(")").toString());
|
||||
txtTournamentState.setText(tournament.getTournamentState() + " (" + usedTime + ") " + tournament.getRunningInfo());
|
||||
break;
|
||||
default:
|
||||
txtTournamentState.setText(tournament.getTournamentState());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue