diff --git a/Mage.Client/plugins/mage-theme-plugin.jar b/Mage.Client/plugins/mage-theme-plugin.jar index 74ba967134..e001a6a9de 100644 Binary files a/Mage.Client/plugins/mage-theme-plugin.jar and b/Mage.Client/plugins/mage-theme-plugin.jar differ diff --git a/Mage.Client/src/main/java/mage/client/cards/Cards.java b/Mage.Client/src/main/java/mage/client/cards/Cards.java index 1d6ae6130e..b69511a034 100644 --- a/Mage.Client/src/main/java/mage/client/cards/Cards.java +++ b/Mage.Client/src/main/java/mage/client/cards/Cards.java @@ -34,18 +34,14 @@ package mage.client.cards; -import java.awt.Color; import java.awt.Component; import java.awt.Dimension; -import java.awt.event.MouseListener; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import java.util.UUID; -import javax.swing.BorderFactory; - import mage.cards.CardDimensions; import mage.cards.MageCard; import mage.client.plugins.adapters.MageMouseAdapter; @@ -98,11 +94,8 @@ public class Cards extends javax.swing.JPanel { synchronized (this) { if (!mouseHandlingEnabled) { mouseHandlingEnabled = true; - //cardArea.addMouseListener(new MageMouseAdapter(this, gameId)); - //cardArea.addMouseMotionListener(new MageMouseMotionAdapter(this, bigCard)); jScrollPane1.addMouseListener(new MageMouseAdapter(cardArea, gameId)); jScrollPane1.addMouseMotionListener(new MageMouseMotionAdapter(cardArea, bigCard)); - //addMouseListener(new MageMouseAdapter(this, gameId)); } } } @@ -122,9 +115,6 @@ public class Cards extends javax.swing.JPanel { MageCard cardImg = Plugins.getInstance().getMageCard(card, bigCard, Config.dimensions, gameId); cards.put(card.getId(), cardImg); cardArea.add(cardImg); - /*if (Plugins.getInstance().isCardPluginLoaded()) { - cardImg.setBorder(BorderFactory.createLineBorder(Color.red)); - }*/ } private void removeCard(UUID cardId) { @@ -134,7 +124,7 @@ public class Cards extends javax.swing.JPanel { cardArea.remove(comp); } } else if (comp instanceof MageCard) { - if (((MageCard)comp).getOriginal().equals(cardId)) { + if (((MageCard)comp).getOriginal().getId().equals(cardId)) { cardArea.remove(comp); } } @@ -152,7 +142,6 @@ public class Cards extends javax.swing.JPanel { } } - /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is diff --git a/Mage.Client/src/main/java/mage/client/game/GamePanel.java b/Mage.Client/src/main/java/mage/client/game/GamePanel.java index ef6f24d855..57cf1a19f5 100644 --- a/Mage.Client/src/main/java/mage/client/game/GamePanel.java +++ b/Mage.Client/src/main/java/mage/client/game/GamePanel.java @@ -282,7 +282,15 @@ public class GamePanel extends javax.swing.JPanel { this.txtPriority.setText(game.getPriorityPlayerName()); this.txtTurn.setText(Integer.toString(game.getTurn())); for (PlayerView player: game.getPlayers()) { - players.get(player.getPlayerId()).update(player); + if (player != null) { + if (players.containsKey(player.getPlayerId())) { + players.get(player.getPlayerId()).update(player); + } else { + logger.warning("Couldn't find player."); + } + } else { + logger.warning("Player object is null."); + } } this.stack.loadCards(game.getStack(), bigCard, gameId); diff --git a/Mage.Client/src/main/java/mage/client/plugins/MagePlugins.java b/Mage.Client/src/main/java/mage/client/plugins/MagePlugins.java index 9207495a7b..ca03345187 100644 --- a/Mage.Client/src/main/java/mage/client/plugins/MagePlugins.java +++ b/Mage.Client/src/main/java/mage/client/plugins/MagePlugins.java @@ -28,5 +28,5 @@ public interface MagePlugins { void sortPermanents(Map<String, JComponent> ui, Collection<MagePermanent> permanents); void downloadImage(Set<Card> allCards); int getGamesPlayed(); - int addGamesPlayed(); + void addGamesPlayed(); } diff --git a/Mage.Client/src/main/java/mage/client/plugins/impl/Plugins.java b/Mage.Client/src/main/java/mage/client/plugins/impl/Plugins.java index 64b639d819..b50c9024d7 100644 --- a/Mage.Client/src/main/java/mage/client/plugins/impl/Plugins.java +++ b/Mage.Client/src/main/java/mage/client/plugins/impl/Plugins.java @@ -122,7 +122,7 @@ public class Plugins implements MagePlugins { } @Override - public int addGamesPlayed() { + public void addGamesPlayed() { if (this.counterPlugin != null) { synchronized(Plugins.class) { try { @@ -133,7 +133,6 @@ public class Plugins implements MagePlugins { } } } - return 0; } @Override diff --git a/Mage.Common/src/mage/view/CardView.java b/Mage.Common/src/mage/view/CardView.java index 80415d0331..4ca40d1994 100644 --- a/Mage.Common/src/mage/view/CardView.java +++ b/Mage.Common/src/mage/view/CardView.java @@ -220,4 +220,9 @@ public class CardView implements Serializable { public List<UUID> getTargets() { return targets; } + + @Override + public String toString() { + return getName() + " [" + getId() + "]"; + } }