Skip to content

Commit

Permalink
* GUI: fixed auto-generated names for AI in new tournament dialog;
Browse files Browse the repository at this point in the history
  • Loading branch information
JayDi85 committed Jul 10, 2020
1 parent 1cf57e0 commit ac0bb71
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@


/*
* NewPlayerPanel.java
*
* Created on 15-Dec-2009, 10:09:46 PM
*/
package mage.client.table;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private void initComponents() {
private void cbPlayerTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbPlayerTypeActionPerformed
if (getPlayerType() != PlayerType.HUMAN) {
this.newPlayerPanel.setVisible(true);
this.newPlayerPanel.setPlayerName("Computer " + this.lblPlayerNum.getText().charAt(this.lblPlayerNum.getText().length() - 1));
this.newPlayerPanel.setPlayerName(ClientDefaultSettings.computerName + " " + this.lblPlayerNum.getText().charAt(this.lblPlayerNum.getText().length() - 1));
}
else {
this.newPlayerPanel.setVisible(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import mage.cards.decks.DeckCardLists;
import mage.client.SessionHandler;
import mage.client.util.ClientDefaultSettings;
import mage.players.PlayerType;

import javax.swing.*;
Expand Down Expand Up @@ -136,9 +137,9 @@ private void initComponents() {
private void cbPlayerTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbPlayerTypeActionPerformed
if (this.cbPlayerType.getSelectedItem() != PlayerType.HUMAN) {
this.pnlPlayerName.setVisible(true);
if (this.txtPlayerName.getText().isEmpty()) {
this.txtPlayerName.setText("Computer " + this.lblPlayerNum.getText());
}
this.txtPlayerName.setText(ClientDefaultSettings.computerName + " " + this.lblPlayerNum.getText().charAt(this.lblPlayerNum.getText().length() - 1));
this.txtPlayerName.setEditable(false);
this.txtPlayerName.setEnabled(false);
} else {
this.pnlPlayerName.setVisible(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public final class ClientDefaultSettings {
handScalingFactor = 1.3;
deckPath = "";
otherPlayerIndex = "1"; // combobox default, example: 0: Human, 1: Computer - mad, 2: Computer - Draft Bot
computerName = "computer";
computerName = "Computer";
dimensions = new CardDimensions(cardScalingFactor);
dimensionsEnlarged = new CardDimensions(cardScalingFactorEnlarged);
}
Expand Down

0 comments on commit ac0bb71

Please sign in to comment.