mirror of
https://github.com/correl/mage.git
synced 2024-11-14 11:09:31 +00:00
Code cleanup (removed outdated client's config.properties settings)
This commit is contained in:
parent
3510ac0957
commit
b56587a383
22 changed files with 92 additions and 175 deletions
|
@ -1,18 +0,0 @@
|
||||||
server-name=localhost
|
|
||||||
port=17171
|
|
||||||
remote-server=mage-server
|
|
||||||
cards-resource-path=/home/loki/.wine/drive_c/Program Files/Wizards of the Coast/Magic Online/Graphics/Cards/
|
|
||||||
symbols-resource-path=/home/loki/.wine/drive_c/Program Files/Wizards of the Coast/Magic Online/Graphics/Chat/chat_graphic_typingicon_
|
|
||||||
resource-path=/home/loki/.wine/drive_c/Program Files/Wizards of the Coast/Magic Online/Graphics/Cards/Pics/
|
|
||||||
#cards-resource-path=resources/images/cards/
|
|
||||||
#symbols-resource-path=resources/images/symbols/
|
|
||||||
#resource-path=resources/images/
|
|
||||||
card-scaling-factor=0.4
|
|
||||||
card-scaling-factor-enlarged=0.5
|
|
||||||
hand-scaling-factor=1.3
|
|
||||||
|
|
||||||
# parameters for debugging and testing faster
|
|
||||||
default-deck-path=C:\\Users\\836D~1\\AppData\\Local\\Temp\\tempDeck1577fd51-f098-420e-8794-c22d2c0602d99142449166006085381.dck
|
|
||||||
# 0: Human,1: Computer - mad, 2: Computer - Draft Bot
|
|
||||||
default-other-player-index=1
|
|
||||||
default-computer-name=computer
|
|
|
@ -1,14 +0,0 @@
|
||||||
server-name=localhost
|
|
||||||
port=17171
|
|
||||||
remote-server=mage-server
|
|
||||||
cards-resource-path=resources/images/cards/
|
|
||||||
symbols-resource-path=resources/images/symbols/
|
|
||||||
resource-path=resources/images/
|
|
||||||
|
|
||||||
card-scaling-factor=0.4
|
|
||||||
card-scaling-factor-enlarged=0.5
|
|
||||||
hand-scaling-factor=1.3
|
|
||||||
|
|
||||||
# 0: Human,1: Computer - mad, 2: Computer - Draft Bot
|
|
||||||
default-other-player-index=1
|
|
||||||
default-computer-name=computer
|
|
|
@ -17,7 +17,7 @@ Extact the client and the server to separate folders.
|
||||||
To play a game you can either connect to a server or start your own server. To
|
To play a game you can either connect to a server or start your own server. To
|
||||||
connect to a server you will need to know the server name or IP address and the port.
|
connect to a server you will need to know the server name or IP address and the port.
|
||||||
To start a server run the startServer.bat command. If you want to use a different
|
To start a server run the startServer.bat command. If you want to use a different
|
||||||
port or change the timeout setting then modify the config.properties file in the
|
port or change the timeout setting then modify the config.xml file in the
|
||||||
config folder.
|
config folder.
|
||||||
|
|
||||||
To launch the client run the startClient.bat command. Click on the connect button on
|
To launch the client run the startClient.bat command. Click on the connect button on
|
||||||
|
|
|
@ -1315,7 +1315,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
if (startPort > 0) {
|
if (startPort > 0) {
|
||||||
instance.currentConnection.setPort(startPort);
|
instance.currentConnection.setPort(startPort);
|
||||||
} else {
|
} else {
|
||||||
instance.currentConnection.setPort(MagePreferences.getServerPortWithDefault(Config.port));
|
instance.currentConnection.setPort(MagePreferences.getServerPortWithDefault(ClientDefaultSettings.port));
|
||||||
}
|
}
|
||||||
PreferencesDialog.setProxyInformation(instance.currentConnection);
|
PreferencesDialog.setProxyInformation(instance.currentConnection);
|
||||||
instance.currentConnection.setPassword(startPassword);
|
instance.currentConnection.setPassword(startPassword);
|
||||||
|
|
|
@ -7,7 +7,7 @@ import mage.cards.TextPopup;
|
||||||
import mage.cards.action.ActionCallback;
|
import mage.cards.action.ActionCallback;
|
||||||
import mage.client.MageFrame;
|
import mage.client.MageFrame;
|
||||||
import mage.client.game.PlayAreaPanel;
|
import mage.client.game.PlayAreaPanel;
|
||||||
import mage.client.util.Config;
|
import mage.client.util.ClientDefaultSettings;
|
||||||
import mage.client.util.DefaultActionCallback;
|
import mage.client.util.DefaultActionCallback;
|
||||||
import mage.client.util.ImageHelper;
|
import mage.client.util.ImageHelper;
|
||||||
import mage.client.util.gui.ArrowBuilder;
|
import mage.client.util.gui.ArrowBuilder;
|
||||||
|
@ -68,7 +68,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis
|
||||||
this.gameId = gameId;
|
this.gameId = gameId;
|
||||||
this.card = card;
|
this.card = card;
|
||||||
this.bigCard = bigCard;
|
this.bigCard = bigCard;
|
||||||
small = new BufferedImage(Config.dimensions.getFrameWidth(), Config.dimensions.getFrameHeight(), BufferedImage.TYPE_INT_RGB);
|
small = new BufferedImage(ClientDefaultSettings.dimensions.getFrameWidth(), ClientDefaultSettings.dimensions.getFrameHeight(), BufferedImage.TYPE_INT_RGB);
|
||||||
backgroundName = getBackgroundName();
|
backgroundName = getBackgroundName();
|
||||||
background = ImageHelper.getBackground(card, backgroundName);
|
background = ImageHelper.getBackground(card, backgroundName);
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis
|
||||||
|
|
||||||
gSmall.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
gSmall.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||||
gSmall.setColor(Color.BLACK);
|
gSmall.setColor(Color.BLACK);
|
||||||
gSmall.drawImage(ImageHelper.scaleImage(image, Config.dimensions.getFrameWidth(), Config.dimensions.getFrameHeight()), 0, 0, this);
|
gSmall.drawImage(ImageHelper.scaleImage(image, ClientDefaultSettings.dimensions.getFrameWidth(), ClientDefaultSettings.dimensions.getFrameHeight()), 0, 0, this);
|
||||||
|
|
||||||
gImage.setFont(new Font("Arial", Font.PLAIN, NAME_FONT_MAX_SIZE));
|
gImage.setFont(new Font("Arial", Font.PLAIN, NAME_FONT_MAX_SIZE));
|
||||||
gImage.drawString(card.getName() + "TEST", CONTENT_MAX_XOFFSET, NAME_MAX_YOFFSET);
|
gImage.drawString(card.getName() + "TEST", CONTENT_MAX_XOFFSET, NAME_MAX_YOFFSET);
|
||||||
|
@ -136,16 +136,16 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis
|
||||||
|
|
||||||
gImage.dispose();
|
gImage.dispose();
|
||||||
|
|
||||||
gSmall.setFont(new Font("Arial", Font.PLAIN, Config.dimensions.getNameFontSize()));
|
gSmall.setFont(new Font("Arial", Font.PLAIN, ClientDefaultSettings.dimensions.getNameFontSize()));
|
||||||
gSmall.drawString(card.getName() + "TEST2", Config.dimensions.getContentXOffset(), Config.dimensions.getNameYOffset());
|
gSmall.drawString(card.getName() + "TEST2", ClientDefaultSettings.dimensions.getContentXOffset(), ClientDefaultSettings.dimensions.getNameYOffset());
|
||||||
if (card.isCreature()) {
|
if (card.isCreature()) {
|
||||||
gSmall.drawString(card.getPower() + "/-/" + card.getToughness(), Config.dimensions.getPowBoxTextLeft(), Config.dimensions.getPowBoxTextTop());
|
gSmall.drawString(card.getPower() + "/-/" + card.getToughness(), ClientDefaultSettings.dimensions.getPowBoxTextLeft(), ClientDefaultSettings.dimensions.getPowBoxTextTop());
|
||||||
} else if (card.isPlanesWalker()) {
|
} else if (card.isPlanesWalker()) {
|
||||||
gSmall.drawString(card.getLoyalty(), Config.dimensions.getPowBoxTextLeft(), Config.dimensions.getPowBoxTextTop());
|
gSmall.drawString(card.getLoyalty(), ClientDefaultSettings.dimensions.getPowBoxTextLeft(), ClientDefaultSettings.dimensions.getPowBoxTextTop());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!card.getCardTypes().isEmpty()) {
|
if (!card.getCardTypes().isEmpty()) {
|
||||||
gSmall.drawString(cardType, Config.dimensions.getContentXOffset(), Config.dimensions.getTypeYOffset());
|
gSmall.drawString(cardType, ClientDefaultSettings.dimensions.getContentXOffset(), ClientDefaultSettings.dimensions.getTypeYOffset());
|
||||||
}
|
}
|
||||||
drawText();
|
drawText();
|
||||||
|
|
||||||
|
@ -346,11 +346,11 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis
|
||||||
tooltipPopup.hide();
|
tooltipPopup.hide();
|
||||||
}
|
}
|
||||||
PopupFactory factory = PopupFactory.getSharedInstance();
|
PopupFactory factory = PopupFactory.getSharedInstance();
|
||||||
tooltipPopup = factory.getPopup(this, tooltipText, (int) this.getLocationOnScreen().getX() + Config.dimensions.getFrameWidth(), (int) this.getLocationOnScreen().getY() + 40);
|
tooltipPopup = factory.getPopup(this, tooltipText, (int) this.getLocationOnScreen().getX() + ClientDefaultSettings.dimensions.getFrameWidth(), (int) this.getLocationOnScreen().getY() + 40);
|
||||||
tooltipPopup.show();
|
tooltipPopup.show();
|
||||||
//hack to get tooltipPopup to resize to fit text
|
//hack to get tooltipPopup to resize to fit text
|
||||||
tooltipPopup.hide();
|
tooltipPopup.hide();
|
||||||
tooltipPopup = factory.getPopup(this, tooltipText, (int) this.getLocationOnScreen().getX() + Config.dimensions.getFrameWidth(), (int) this.getLocationOnScreen().getY() + 40);
|
tooltipPopup = factory.getPopup(this, tooltipText, (int) this.getLocationOnScreen().getX() + ClientDefaultSettings.dimensions.getFrameWidth(), (int) this.getLocationOnScreen().getY() + 40);
|
||||||
tooltipPopup.show();
|
tooltipPopup.show();
|
||||||
tooltipShowing = true;
|
tooltipShowing = true;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
import mage.client.dialog.PreferencesDialog;
|
import mage.client.dialog.PreferencesDialog;
|
||||||
import mage.client.plugins.impl.Plugins;
|
import mage.client.plugins.impl.Plugins;
|
||||||
import mage.client.util.CardsViewUtil;
|
import mage.client.util.CardsViewUtil;
|
||||||
import mage.client.util.Config;
|
import mage.client.util.ClientDefaultSettings;
|
||||||
import mage.client.util.GUISizeHelper;
|
import mage.client.util.GUISizeHelper;
|
||||||
import mage.view.*;
|
import mage.view.*;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
@ -212,7 +212,7 @@
|
||||||
|
|
||||||
private Dimension getCardDimension() {
|
private Dimension getCardDimension() {
|
||||||
if (cardDimension == null) {
|
if (cardDimension == null) {
|
||||||
cardDimension = new Dimension(Config.dimensions.getFrameWidth(), Config.dimensions.getFrameHeight());
|
cardDimension = new Dimension(ClientDefaultSettings.dimensions.getFrameWidth(), ClientDefaultSettings.dimensions.getFrameHeight());
|
||||||
}
|
}
|
||||||
return cardDimension;
|
return cardDimension;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ package mage.client.cards;
|
||||||
import mage.cards.CardDimensions;
|
import mage.cards.CardDimensions;
|
||||||
import mage.cards.MagePermanent;
|
import mage.cards.MagePermanent;
|
||||||
import mage.cards.Sets;
|
import mage.cards.Sets;
|
||||||
import mage.client.util.Config;
|
import mage.client.util.ClientDefaultSettings;
|
||||||
import mage.client.util.TransformedImageCache;
|
import mage.client.util.TransformedImageCache;
|
||||||
import mage.view.CounterView;
|
import mage.view.CounterView;
|
||||||
import mage.view.PermanentView;
|
import mage.view.PermanentView;
|
||||||
|
@ -49,7 +49,7 @@ public class Permanent extends Card {
|
||||||
super(permanent, bigCard, dimensions, gameId);
|
super(permanent, bigCard, dimensions, gameId);
|
||||||
this.setSize(this.getPreferredSize());
|
this.setSize(this.getPreferredSize());
|
||||||
this.permanent = permanent;
|
this.permanent = permanent;
|
||||||
tappedImage = new BufferedImage(Config.dimensions.getFrameHeight(), Config.dimensions.getFrameWidth(), BufferedImage.TYPE_INT_RGB);
|
tappedImage = new BufferedImage(ClientDefaultSettings.dimensions.getFrameHeight(), ClientDefaultSettings.dimensions.getFrameWidth(), BufferedImage.TYPE_INT_RGB);
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID getPermanentId() {
|
public UUID getPermanentId() {
|
||||||
|
@ -173,10 +173,10 @@ public class Permanent extends Card {
|
||||||
g2.setColor(Color.BLACK);
|
g2.setColor(Color.BLACK);
|
||||||
}
|
}
|
||||||
if (permanent.isTapped()) {
|
if (permanent.isTapped()) {
|
||||||
g2.drawRect(0, 0, Config.dimensions.getFrameHeight() - 1, Config.dimensions.getFrameWidth() - 1);
|
g2.drawRect(0, 0, ClientDefaultSettings.dimensions.getFrameHeight() - 1, ClientDefaultSettings.dimensions.getFrameWidth() - 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
g2.drawRect(0, 0, Config.dimensions.getFrameWidth() - 1, Config.dimensions.getFrameHeight() - 1);
|
g2.drawRect(0, 0, ClientDefaultSettings.dimensions.getFrameWidth() - 1, ClientDefaultSettings.dimensions.getFrameHeight() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -206,10 +206,10 @@ public class Permanent extends Card {
|
||||||
@Override
|
@Override
|
||||||
public Dimension getPreferredSize() {
|
public Dimension getPreferredSize() {
|
||||||
if (permanent != null && permanent.isTapped()) {
|
if (permanent != null && permanent.isTapped()) {
|
||||||
return new Dimension(Config.dimensions.getFrameHeight(), Config.dimensions.getFrameWidth());
|
return new Dimension(ClientDefaultSettings.dimensions.getFrameHeight(), ClientDefaultSettings.dimensions.getFrameWidth());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return new Dimension(Config.dimensions.getFrameWidth(), Config.dimensions.getFrameHeight());
|
return new Dimension(ClientDefaultSettings.dimensions.getFrameWidth(), ClientDefaultSettings.dimensions.getFrameHeight());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ public class Permanent extends Card {
|
||||||
tooltipPopup.hide();
|
tooltipPopup.hide();
|
||||||
}
|
}
|
||||||
PopupFactory factory = PopupFactory.getSharedInstance();
|
PopupFactory factory = PopupFactory.getSharedInstance();
|
||||||
int x = (int) this.getLocationOnScreen().getX() + (permanent.isTapped()? Config.dimensions.getFrameHeight() : Config.dimensions.getFrameWidth());
|
int x = (int) this.getLocationOnScreen().getX() + (permanent.isTapped()? ClientDefaultSettings.dimensions.getFrameHeight() : ClientDefaultSettings.dimensions.getFrameWidth());
|
||||||
int y = (int) this.getLocationOnScreen().getY() + 40;
|
int y = (int) this.getLocationOnScreen().getY() + 40;
|
||||||
tooltipPopup = factory.getPopup(this, tooltipText, x, y);
|
tooltipPopup = factory.getPopup(this, tooltipText, x, y);
|
||||||
tooltipPopup.show();
|
tooltipPopup.show();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package mage.client.components.ext.dlg;
|
package mage.client.components.ext.dlg;
|
||||||
|
|
||||||
import mage.client.components.ImageButton;
|
import mage.client.components.ImageButton;
|
||||||
import mage.client.util.Config;
|
import mage.client.util.ClientDefaultSettings;
|
||||||
import org.jdesktop.swingx.JXPanel;
|
import org.jdesktop.swingx.JXPanel;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
@ -71,7 +71,7 @@ public abstract class IDialogPanel extends JXPanel {
|
||||||
|
|
||||||
protected Dimension getCardDimension() {
|
protected Dimension getCardDimension() {
|
||||||
if (cardDimension == null) {
|
if (cardDimension == null) {
|
||||||
cardDimension = new Dimension(Config.dimensions.getFrameWidth(), Config.dimensions.getFrameHeight());
|
cardDimension = new Dimension(ClientDefaultSettings.dimensions.getFrameWidth(), ClientDefaultSettings.dimensions.getFrameHeight());
|
||||||
}
|
}
|
||||||
return cardDimension;
|
return cardDimension;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import mage.client.cards.BigCard;
|
||||||
import mage.client.components.HoverButton;
|
import mage.client.components.HoverButton;
|
||||||
import mage.client.dialog.PreferencesDialog;
|
import mage.client.dialog.PreferencesDialog;
|
||||||
import mage.client.plugins.impl.Plugins;
|
import mage.client.plugins.impl.Plugins;
|
||||||
import mage.client.util.Config;
|
import mage.client.util.ClientDefaultSettings;
|
||||||
import mage.client.util.ImageHelper;
|
import mage.client.util.ImageHelper;
|
||||||
import mage.client.util.NaturalOrderCardNumberComparator;
|
import mage.client.util.NaturalOrderCardNumberComparator;
|
||||||
import mage.client.util.audio.AudioManager;
|
import mage.client.util.audio.AudioManager;
|
||||||
|
@ -405,7 +405,7 @@ public class MageBook extends JComponent {
|
||||||
|
|
||||||
private void addCard(CardView card, BigCard bigCard, UUID gameId, Rectangle rectangle) {
|
private void addCard(CardView card, BigCard bigCard, UUID gameId, Rectangle rectangle) {
|
||||||
if (cardDimension == null) {
|
if (cardDimension == null) {
|
||||||
cardDimension = new Dimension(Config.dimensions.getFrameWidth(), Config.dimensions.getFrameHeight());
|
cardDimension = new Dimension(ClientDefaultSettings.dimensions.getFrameWidth(), ClientDefaultSettings.dimensions.getFrameHeight());
|
||||||
}
|
}
|
||||||
final MageCard cardImg = Plugins.instance.getMageCard(card, bigCard, cardDimension, gameId, true, true, PreferencesDialog.getRenderMode(), true);
|
final MageCard cardImg = Plugins.instance.getMageCard(card, bigCard, cardDimension, gameId, true, true, PreferencesDialog.getRenderMode(), true);
|
||||||
cardImg.setBounds(rectangle);
|
cardImg.setBounds(rectangle);
|
||||||
|
@ -442,7 +442,7 @@ public class MageBook extends JComponent {
|
||||||
|
|
||||||
private void addToken(Token token, BigCard bigCard, UUID gameId, Rectangle rectangle) {
|
private void addToken(Token token, BigCard bigCard, UUID gameId, Rectangle rectangle) {
|
||||||
if (cardDimension == null) {
|
if (cardDimension == null) {
|
||||||
cardDimension = new Dimension(Config.dimensions.getFrameWidth(), Config.dimensions.getFrameHeight());
|
cardDimension = new Dimension(ClientDefaultSettings.dimensions.getFrameWidth(), ClientDefaultSettings.dimensions.getFrameHeight());
|
||||||
}
|
}
|
||||||
PermanentToken newToken = new PermanentToken(token, null, token.getOriginalExpansionSetCode(), null);
|
PermanentToken newToken = new PermanentToken(token, null, token.getOriginalExpansionSetCode(), null);
|
||||||
newToken.removeSummoningSickness();
|
newToken.removeSummoningSickness();
|
||||||
|
|
|
@ -7,7 +7,7 @@ import mage.client.cards.ICardGrid;
|
||||||
import mage.client.deckeditor.SortSetting;
|
import mage.client.deckeditor.SortSetting;
|
||||||
import mage.client.plugins.impl.Plugins;
|
import mage.client.plugins.impl.Plugins;
|
||||||
import mage.client.util.ClientEventType;
|
import mage.client.util.ClientEventType;
|
||||||
import mage.client.util.Config;
|
import mage.client.util.ClientDefaultSettings;
|
||||||
import mage.client.util.Event;
|
import mage.client.util.Event;
|
||||||
import mage.client.util.Listener;
|
import mage.client.util.Listener;
|
||||||
import mage.client.util.gui.GuiDisplayUtil;
|
import mage.client.util.gui.GuiDisplayUtil;
|
||||||
|
@ -249,8 +249,8 @@ public class TableModel extends AbstractTableModel implements ICardGrid {
|
||||||
|
|
||||||
private void addCard(CardView card, BigCard bigCard, UUID gameId) {
|
private void addCard(CardView card, BigCard bigCard, UUID gameId) {
|
||||||
if (cardDimension == null) {
|
if (cardDimension == null) {
|
||||||
cardDimension = new Dimension(Config.dimensions.getFrameWidth(),
|
cardDimension = new Dimension(ClientDefaultSettings.dimensions.getFrameWidth(),
|
||||||
Config.dimensions.getFrameHeight());
|
ClientDefaultSettings.dimensions.getFrameHeight());
|
||||||
}
|
}
|
||||||
cards.put(card.getId(), card);
|
cards.put(card.getId(), card);
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import mage.choices.ChoiceImpl;
|
||||||
import mage.client.MageFrame;
|
import mage.client.MageFrame;
|
||||||
import mage.client.SessionHandler;
|
import mage.client.SessionHandler;
|
||||||
import mage.client.preference.MagePreferences;
|
import mage.client.preference.MagePreferences;
|
||||||
import mage.client.util.Config;
|
import mage.client.util.ClientDefaultSettings;
|
||||||
import mage.client.util.gui.countryBox.CountryItemEditor;
|
import mage.client.util.gui.countryBox.CountryItemEditor;
|
||||||
import mage.client.util.sets.ConstructedFormats;
|
import mage.client.util.sets.ConstructedFormats;
|
||||||
import mage.remote.Connection;
|
import mage.remote.Connection;
|
||||||
|
@ -59,9 +59,9 @@ public class ConnectDialog extends MageDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showDialog() {
|
public void showDialog() {
|
||||||
String serverAddress = MagePreferences.getServerAddressWithDefault(Config.serverName);
|
String serverAddress = MagePreferences.getServerAddressWithDefault(ClientDefaultSettings.serverName);
|
||||||
this.txtServer.setText(serverAddress);
|
this.txtServer.setText(serverAddress);
|
||||||
this.txtPort.setText(Integer.toString(MagePreferences.getServerPortWithDefault(Config.port)));
|
this.txtPort.setText(Integer.toString(MagePreferences.getServerPortWithDefault(ClientDefaultSettings.port)));
|
||||||
this.txtUserName.setText(MagePreferences.getUserName(serverAddress));
|
this.txtUserName.setText(MagePreferences.getUserName(serverAddress));
|
||||||
this.txtPassword.setText(MagePreferences.getPassword(serverAddress));
|
this.txtPassword.setText(MagePreferences.getPassword(serverAddress));
|
||||||
this.chkAutoConnect.setSelected(Boolean.parseBoolean(MageFrame.getPreferences().get(KEY_CONNECT_AUTO_CONNECT, "false")));
|
this.chkAutoConnect.setSelected(Boolean.parseBoolean(MageFrame.getPreferences().get(KEY_CONNECT_AUTO_CONNECT, "false")));
|
||||||
|
@ -512,9 +512,9 @@ public class ConnectDialog extends MageDialog {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// txtPassword is not checked here, because authentication might be disabled by the server config.
|
// txtPassword is not checked here, because authentication might be disabled by the server config.
|
||||||
if (Integer.valueOf(txtPort.getText()) < 1 || Integer.valueOf(txtPort.getText()) > 65535) {
|
if (Integer.parseInt(txtPort.getText()) < 1 || Integer.parseInt(txtPort.getText()) > 65535) {
|
||||||
JOptionPane.showMessageDialog(rootPane, "Invalid port number");
|
JOptionPane.showMessageDialog(rootPane, "Invalid port number");
|
||||||
txtPort.setText(Integer.toString(MagePreferences.getServerPortWithDefault(Config.port)));
|
txtPort.setText(Integer.toString(MagePreferences.getServerPortWithDefault(ClientDefaultSettings.port)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -522,7 +522,7 @@ public class ConnectDialog extends MageDialog {
|
||||||
try {
|
try {
|
||||||
connection = new Connection();
|
connection = new Connection();
|
||||||
connection.setHost(this.txtServer.getText().trim());
|
connection.setHost(this.txtServer.getText().trim());
|
||||||
connection.setPort(Integer.valueOf(this.txtPort.getText().trim()));
|
connection.setPort(Integer.parseInt(this.txtPort.getText().trim()));
|
||||||
connection.setUsername(this.txtUserName.getText().trim());
|
connection.setUsername(this.txtUserName.getText().trim());
|
||||||
connection.setPassword(String.valueOf(this.txtPassword.getPassword()).trim());
|
connection.setPassword(String.valueOf(this.txtPassword.getPassword()).trim());
|
||||||
connection.setForceDBComparison(this.chkForceUpdateDB.isSelected() || RepositoryUtil.isDatabaseEmpty());
|
connection.setForceDBComparison(this.chkForceUpdateDB.isSelected() || RepositoryUtil.isDatabaseEmpty());
|
||||||
|
|
|
@ -4,7 +4,7 @@ import mage.client.MageFrame;
|
||||||
import mage.client.SessionHandler;
|
import mage.client.SessionHandler;
|
||||||
import mage.client.components.KeyBindButton;
|
import mage.client.components.KeyBindButton;
|
||||||
import mage.client.util.CardLanguage;
|
import mage.client.util.CardLanguage;
|
||||||
import mage.client.util.Config;
|
import mage.client.util.ClientDefaultSettings;
|
||||||
import mage.client.util.GUISizeHelper;
|
import mage.client.util.GUISizeHelper;
|
||||||
import mage.client.util.ImageHelper;
|
import mage.client.util.ImageHelper;
|
||||||
import mage.client.util.gui.BufferedImageBuilder;
|
import mage.client.util.gui.BufferedImageBuilder;
|
||||||
|
@ -3475,8 +3475,8 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
private static void loadProxySettings(Preferences prefs) {
|
private static void loadProxySettings(Preferences prefs) {
|
||||||
dialog.cbProxyType.setSelectedItem(Connection.ProxyType.valueOf(MageFrame.getPreferences().get(KEY_PROXY_TYPE, "NONE").toUpperCase(Locale.ENGLISH)));
|
dialog.cbProxyType.setSelectedItem(Connection.ProxyType.valueOf(MageFrame.getPreferences().get(KEY_PROXY_TYPE, "NONE").toUpperCase(Locale.ENGLISH)));
|
||||||
|
|
||||||
load(prefs, dialog.txtProxyServer, KEY_PROXY_ADDRESS, Config.serverName);
|
load(prefs, dialog.txtProxyServer, KEY_PROXY_ADDRESS, ClientDefaultSettings.serverName);
|
||||||
load(prefs, dialog.txtProxyPort, KEY_PROXY_PORT, Integer.toString(Config.port));
|
load(prefs, dialog.txtProxyPort, KEY_PROXY_PORT, Integer.toString(ClientDefaultSettings.port));
|
||||||
load(prefs, dialog.txtProxyUserName, KEY_PROXY_USERNAME, "");
|
load(prefs, dialog.txtProxyUserName, KEY_PROXY_USERNAME, "");
|
||||||
load(prefs, dialog.rememberPswd, KEY_PROXY_REMEMBER, "true", "false");
|
load(prefs, dialog.rememberPswd, KEY_PROXY_REMEMBER, "true", "false");
|
||||||
if (dialog.rememberPswd.isSelected()) {
|
if (dialog.rememberPswd.isSelected()) {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
import mage.client.cards.Permanent;
|
import mage.client.cards.Permanent;
|
||||||
import mage.client.dialog.PreferencesDialog;
|
import mage.client.dialog.PreferencesDialog;
|
||||||
import mage.client.plugins.impl.Plugins;
|
import mage.client.plugins.impl.Plugins;
|
||||||
import mage.client.util.Config;
|
import mage.client.util.ClientDefaultSettings;
|
||||||
import mage.client.util.GUISizeHelper;
|
import mage.client.util.GUISizeHelper;
|
||||||
import mage.client.util.audio.AudioManager;
|
import mage.client.util.audio.AudioManager;
|
||||||
import mage.client.util.layout.CardLayoutStrategy;
|
import mage.client.util.layout.CardLayoutStrategy;
|
||||||
|
@ -226,7 +226,7 @@
|
||||||
|
|
||||||
private void addPermanent(PermanentView permanent, final int count) {
|
private void addPermanent(PermanentView permanent, final int count) {
|
||||||
if (cardDimension == null) {
|
if (cardDimension == null) {
|
||||||
cardDimension = new Dimension(Config.dimensions.getFrameWidth(), Config.dimensions.getFrameHeight());
|
cardDimension = new Dimension(ClientDefaultSettings.dimensions.getFrameWidth(), ClientDefaultSettings.dimensions.getFrameHeight());
|
||||||
}
|
}
|
||||||
final MagePermanent perm = Plugins.instance.getMagePermanent(permanent, bigCard, cardDimension, gameId, true, PreferencesDialog.getRenderMode(), true);
|
final MagePermanent perm = Plugins.instance.getMagePermanent(permanent, bigCard, cardDimension, gameId, true, PreferencesDialog.getRenderMode(), true);
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import mage.client.cards.Permanent;
|
||||||
import mage.client.dialog.PreferencesDialog;
|
import mage.client.dialog.PreferencesDialog;
|
||||||
import mage.client.plugins.MagePlugins;
|
import mage.client.plugins.MagePlugins;
|
||||||
import mage.client.plugins.adapters.MageActionCallback;
|
import mage.client.plugins.adapters.MageActionCallback;
|
||||||
import mage.client.util.Config;
|
import mage.client.util.ClientDefaultSettings;
|
||||||
import mage.interfaces.PluginException;
|
import mage.interfaces.PluginException;
|
||||||
import mage.interfaces.plugin.CardPlugin;
|
import mage.interfaces.plugin.CardPlugin;
|
||||||
import mage.interfaces.plugin.CounterPlugin;
|
import mage.interfaces.plugin.CounterPlugin;
|
||||||
|
@ -99,7 +99,7 @@ public enum Plugins implements MagePlugins {
|
||||||
mageActionCallback.setCardPreviewComponent(bigCard);
|
mageActionCallback.setCardPreviewComponent(bigCard);
|
||||||
return cardPlugin.getMagePermanent(card, dimension, gameId, mageActionCallback, false, !MageFrame.isLite() && loadImage, renderMode, needFullPermanentRender);
|
return cardPlugin.getMagePermanent(card, dimension, gameId, mageActionCallback, false, !MageFrame.isLite() && loadImage, renderMode, needFullPermanentRender);
|
||||||
} else {
|
} else {
|
||||||
return new Permanent(card, bigCard, Config.dimensions, gameId);
|
return new Permanent(card, bigCard, ClientDefaultSettings.dimensions, gameId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ public enum Plugins implements MagePlugins {
|
||||||
}
|
}
|
||||||
return cardPlugin.getMageCard(card, dimension, gameId, mageActionCallback, false, !MageFrame.isLite() && loadImage, renderMode, needFullPermanentRender);
|
return cardPlugin.getMageCard(card, dimension, gameId, mageActionCallback, false, !MageFrame.isLite() && loadImage, renderMode, needFullPermanentRender);
|
||||||
} else {
|
} else {
|
||||||
return new Card(card, bigCard, Config.dimensions, gameId);
|
return new Card(card, bigCard, ClientDefaultSettings.dimensions, gameId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ package mage.client.preference;
|
||||||
|
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import mage.client.MageFrame;
|
import mage.client.MageFrame;
|
||||||
import mage.client.util.Config;
|
import mage.client.util.ClientDefaultSettings;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.prefs.BackingStoreException;
|
import java.util.prefs.BackingStoreException;
|
||||||
|
@ -144,8 +144,8 @@ public final class MagePreferences {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void saveLastServer() {
|
public static void saveLastServer() {
|
||||||
lastServerAddress = getServerAddressWithDefault(Config.serverName);
|
lastServerAddress = getServerAddressWithDefault(ClientDefaultSettings.serverName);
|
||||||
lastServerPort = getServerPortWithDefault(Config.port);
|
lastServerPort = getServerPortWithDefault(ClientDefaultSettings.port);
|
||||||
lastServerUser = getUserName(lastServerAddress);
|
lastServerUser = getUserName(lastServerAddress);
|
||||||
lastServerPassword = getPassword(lastServerAddress);
|
lastServerPassword = getPassword(lastServerAddress);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,14 +9,12 @@ package mage.client.table;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Locale;
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.filechooser.FileFilter;
|
|
||||||
|
|
||||||
import mage.cards.decks.DeckFileFilter;
|
import mage.cards.decks.DeckFileFilter;
|
||||||
import mage.client.MageFrame;
|
import mage.client.MageFrame;
|
||||||
import mage.client.deck.generator.DeckGenerator;
|
import mage.client.deck.generator.DeckGenerator;
|
||||||
import mage.client.util.Config;
|
import mage.client.util.ClientDefaultSettings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -36,14 +34,10 @@ public class NewPlayerPanel extends javax.swing.JPanel {
|
||||||
fcSelectDeck.addChoosableFileFilter(new DeckFileFilter("dck", "XMage's deck files (*.dck)"));
|
fcSelectDeck.addChoosableFileFilter(new DeckFileFilter("dck", "XMage's deck files (*.dck)"));
|
||||||
String deckPath = MageFrame.getPreferences().get("defaultDeckPath", "");
|
String deckPath = MageFrame.getPreferences().get("defaultDeckPath", "");
|
||||||
if (deckPath.isEmpty()) {
|
if (deckPath.isEmpty()) {
|
||||||
if (Config.defaultDeckPath != null) {
|
deckPath = ClientDefaultSettings.deckPath;
|
||||||
deckPath = Config.defaultDeckPath;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.txtPlayerDeck.setText(deckPath);
|
this.txtPlayerDeck.setText(deckPath);
|
||||||
if (Config.defaultComputerName != null) {
|
this.txtPlayerName.setText(ClientDefaultSettings.computerName);
|
||||||
this.txtPlayerName.setText(Config.defaultComputerName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPlayerName(String playerName) {
|
public void setPlayerName(String playerName) {
|
||||||
|
|
|
@ -10,7 +10,7 @@ package mage.client.table;
|
||||||
|
|
||||||
import mage.cards.decks.importer.DeckImporter;
|
import mage.cards.decks.importer.DeckImporter;
|
||||||
import mage.client.SessionHandler;
|
import mage.client.SessionHandler;
|
||||||
import mage.client.util.Config;
|
import mage.client.util.ClientDefaultSettings;
|
||||||
import mage.client.util.Event;
|
import mage.client.util.Event;
|
||||||
import mage.client.util.Listener;
|
import mage.client.util.Listener;
|
||||||
import mage.players.PlayerType;
|
import mage.players.PlayerType;
|
||||||
|
@ -38,11 +38,11 @@ public class TablePlayerPanel extends javax.swing.JPanel {
|
||||||
public void init(int playerNum, PlayerType playerType) {
|
public void init(int playerNum, PlayerType playerType) {
|
||||||
cbPlayerType.setModel(new DefaultComboBoxModel(SessionHandler.getPlayerTypes()));
|
cbPlayerType.setModel(new DefaultComboBoxModel(SessionHandler.getPlayerTypes()));
|
||||||
this.lblPlayerNum.setText("Player " + playerNum);
|
this.lblPlayerNum.setText("Player " + playerNum);
|
||||||
if (Config.defaultOtherPlayerIndex != null) {
|
if (ClientDefaultSettings.otherPlayerIndex != null) {
|
||||||
if (Integer.valueOf(Config.defaultOtherPlayerIndex) >= cbPlayerType.getItemCount()) {
|
Integer index = Integer.parseInt(ClientDefaultSettings.otherPlayerIndex);
|
||||||
|
if (index >= cbPlayerType.getItemCount()) {
|
||||||
cbPlayerType.setSelectedIndex(cbPlayerType.getItemCount() - 1);
|
cbPlayerType.setSelectedIndex(cbPlayerType.getItemCount() - 1);
|
||||||
} else {
|
} else {
|
||||||
Integer index = Integer.parseInt(Config.defaultOtherPlayerIndex);
|
|
||||||
cbPlayerType.setSelectedIndex(index);
|
cbPlayerType.setSelectedIndex(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ package mage.client.unusedFiles;
|
||||||
//package mage.client.game;
|
//package mage.client.game;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.client.cards.BigCard;
|
import mage.client.cards.BigCard;
|
||||||
import mage.client.util.Config;
|
import mage.client.util.ClientDefaultSettings;
|
||||||
import mage.client.util.GUISizeHelper;
|
import mage.client.util.GUISizeHelper;
|
||||||
import mage.view.CombatGroupView;
|
import mage.view.CombatGroupView;
|
||||||
|
|
||||||
|
@ -61,9 +61,9 @@ public class CombatGroup extends javax.swing.JPanel {
|
||||||
attackers = new mage.client.cards.Cards();
|
attackers = new mage.client.cards.Cards();
|
||||||
lblDefender = new javax.swing.JLabel();
|
lblDefender = new javax.swing.JLabel();
|
||||||
|
|
||||||
blockers.setPreferredSize(new java.awt.Dimension(Config.dimensions.getFrameWidth() + 8, Config.dimensions.getFrameHeight() + 25));
|
blockers.setPreferredSize(new java.awt.Dimension(ClientDefaultSettings.dimensions.getFrameWidth() + 8, ClientDefaultSettings.dimensions.getFrameHeight() + 25));
|
||||||
|
|
||||||
attackers.setPreferredSize(new java.awt.Dimension(Config.dimensions.getFrameWidth() + 8, Config.dimensions.getFrameHeight() + 25));
|
attackers.setPreferredSize(new java.awt.Dimension(ClientDefaultSettings.dimensions.getFrameWidth() + 8, ClientDefaultSettings.dimensions.getFrameHeight() + 25));
|
||||||
|
|
||||||
lblDefender.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
lblDefender.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||||
lblDefender.setText("Defender");
|
lblDefender.setText("Defender");
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
package mage.client.util;
|
||||||
|
|
||||||
|
import mage.cards.CardDimensions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author JayDi85
|
||||||
|
*/
|
||||||
|
public final class ClientDefaultSettings {
|
||||||
|
|
||||||
|
public static final String serverName;
|
||||||
|
public static final int port;
|
||||||
|
public static final double cardScalingFactor;
|
||||||
|
public static final double cardScalingFactorEnlarged;
|
||||||
|
public static final double handScalingFactor;
|
||||||
|
public static final CardDimensions dimensions;
|
||||||
|
public static final CardDimensions dimensionsEnlarged;
|
||||||
|
|
||||||
|
public static final String deckPath;
|
||||||
|
public static final String otherPlayerIndex;
|
||||||
|
public static final String computerName;
|
||||||
|
|
||||||
|
static {
|
||||||
|
// default values
|
||||||
|
serverName = "localhost";
|
||||||
|
port = 17171;
|
||||||
|
cardScalingFactor = 0.4;
|
||||||
|
cardScalingFactorEnlarged = 0.5;
|
||||||
|
handScalingFactor = 1.3;
|
||||||
|
deckPath = "";
|
||||||
|
otherPlayerIndex = "1"; // combobox default, example: 0: Human, 1: Computer - mad, 2: Computer - Draft Bot
|
||||||
|
computerName = "computer";
|
||||||
|
dimensions = new CardDimensions(cardScalingFactor);
|
||||||
|
dimensionsEnlarged = new CardDimensions(cardScalingFactorEnlarged);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,73 +0,0 @@
|
||||||
package mage.client.util;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Properties;
|
|
||||||
import mage.cards.CardDimensions;
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author BetaSteward_at_googlemail.com
|
|
||||||
*/
|
|
||||||
public final class Config {
|
|
||||||
|
|
||||||
// TODO: Remove this class completely
|
|
||||||
private static final Logger logger = Logger.getLogger(Config.class);
|
|
||||||
|
|
||||||
public static final String remoteServer;
|
|
||||||
public static final String serverName;
|
|
||||||
public static final int port;
|
|
||||||
public static final double cardScalingFactor;
|
|
||||||
public static final double cardScalingFactorEnlarged;
|
|
||||||
public static final double handScalingFactor;
|
|
||||||
public static final CardDimensions dimensions;
|
|
||||||
public static final CardDimensions dimensionsEnlarged;
|
|
||||||
|
|
||||||
public static final String defaultGameType;
|
|
||||||
public static final String defaultDeckPath;
|
|
||||||
public static final String defaultOtherPlayerIndex;
|
|
||||||
public static final String defaultComputerName;
|
|
||||||
|
|
||||||
static {
|
|
||||||
Properties p = new Properties();
|
|
||||||
boolean fileFound = true;
|
|
||||||
try (FileInputStream fis = new FileInputStream(new File("config/config.properties"))) {
|
|
||||||
p.load(fis);
|
|
||||||
} catch (IOException ex) {
|
|
||||||
fileFound = false;
|
|
||||||
}
|
|
||||||
if (fileFound) {
|
|
||||||
serverName = p.getProperty("server-name");
|
|
||||||
port = Integer.parseInt(p.getProperty("port"));
|
|
||||||
remoteServer = p.getProperty("remote-server");
|
|
||||||
cardScalingFactor = Double.valueOf(p.getProperty("card-scaling-factor"));
|
|
||||||
cardScalingFactorEnlarged = Double.valueOf(p.getProperty("card-scaling-factor-enlarged"));
|
|
||||||
handScalingFactor = Double.valueOf(p.getProperty("hand-scaling-factor"));
|
|
||||||
defaultGameType = p.getProperty("default-game-type", "Human");
|
|
||||||
defaultDeckPath = p.getProperty("default-deck-path");
|
|
||||||
defaultOtherPlayerIndex = p.getProperty("default-other-player-index");
|
|
||||||
defaultComputerName = p.getProperty("default-computer-name");
|
|
||||||
|
|
||||||
dimensions = new CardDimensions(cardScalingFactor);
|
|
||||||
dimensionsEnlarged = new CardDimensions(cardScalingFactorEnlarged);
|
|
||||||
} else { // Take some default valies for netbeans design view
|
|
||||||
serverName = "localhost";
|
|
||||||
port = 17171;
|
|
||||||
remoteServer = "mage-server";
|
|
||||||
cardScalingFactor = 0.4;
|
|
||||||
cardScalingFactorEnlarged = 0.5;
|
|
||||||
handScalingFactor = 1.3;
|
|
||||||
defaultGameType = p.getProperty("default-game-type", "Human");
|
|
||||||
defaultDeckPath = "";
|
|
||||||
defaultOtherPlayerIndex = "1";
|
|
||||||
defaultComputerName = "AI Computer";
|
|
||||||
|
|
||||||
dimensions = new CardDimensions(cardScalingFactor);
|
|
||||||
dimensionsEnlarged = new CardDimensions(cardScalingFactorEnlarged);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
server-name=localhost
|
|
||||||
port=17171
|
|
||||||
remote-server=mage-server
|
|
||||||
cards-resource-path=resources/images/cards/
|
|
||||||
symbols-resource-path=resources/images/symbols/
|
|
||||||
resource-path=resources/images/
|
|
||||||
card-scaling-factor=0.4
|
|
|
@ -17,7 +17,7 @@ Extact the client and the server to separate folders.
|
||||||
To play a game you can either connect to a server or start your own server. To
|
To play a game you can either connect to a server or start your own server. To
|
||||||
connect to a server you will need to know the server name or IP address and the port.
|
connect to a server you will need to know the server name or IP address and the port.
|
||||||
To start a server run the startServer.bat command. If you want to use a different
|
To start a server run the startServer.bat command. If you want to use a different
|
||||||
port or change the timeout setting then modify the config.properties file in the
|
port or change the timeout setting then modify the config.xml file in the
|
||||||
config folder.
|
config folder.
|
||||||
|
|
||||||
To launch the client run the startClient.bat command. Click on the connect button on
|
To launch the client run the startClient.bat command. Click on the connect button on
|
||||||
|
|
Loading…
Reference in a new issue