forked from External/mage
* new Table - Save and restore number and type of players.
This commit is contained in:
parent
17df6bfff0
commit
8ed26a1fe8
3 changed files with 37 additions and 5 deletions
|
|
@ -61,18 +61,22 @@ public class TablePlayerPanel extends javax.swing.JPanel {
|
|||
this.newPlayerPanel.setVisible(false);
|
||||
}
|
||||
|
||||
public void init(int playerNum) {
|
||||
public void init(int playerNum, String playerType) {
|
||||
session = MageFrame.getSession();
|
||||
cbPlayerType.setModel(new DefaultComboBoxModel(session.getPlayerTypes()));
|
||||
this.lblPlayerNum.setText("Player " + playerNum);
|
||||
if (Config.defaultOtherPlayerIndex != null) {
|
||||
if (Integer.valueOf(Config.defaultOtherPlayerIndex) >= cbPlayerType.getItemCount())
|
||||
if (Integer.valueOf(Config.defaultOtherPlayerIndex) >= cbPlayerType.getItemCount()) {
|
||||
cbPlayerType.setSelectedIndex(cbPlayerType.getItemCount() - 1);
|
||||
}
|
||||
else {
|
||||
Integer index = Integer.parseInt(Config.defaultOtherPlayerIndex);
|
||||
cbPlayerType.setSelectedIndex(index);
|
||||
}
|
||||
}
|
||||
if (playerType != null) {
|
||||
this.cbPlayerType.setSelectedItem(playerType);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean joinTable(UUID roomId, UUID tableId) throws FileNotFoundException, IOException, ClassNotFoundException {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue