forked from External/mage
[card.plugin] now cards displayed on hand and stack (some stuff still needs to be updated). PLEASE DO REBUILD PLUGIN IF U USE mage-card-plugins.jar.
This commit is contained in:
parent
06b7e63843
commit
63d8231928
13 changed files with 168 additions and 62 deletions
|
|
@ -10,11 +10,12 @@ import java.util.logging.Logger;
|
|||
|
||||
import javax.swing.JComponent;
|
||||
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardDimensions;
|
||||
import mage.cards.MageCard;
|
||||
import mage.cards.MagePermanent;
|
||||
import mage.cards.action.impl.EmptyCallback;
|
||||
import mage.client.cards.BigCard;
|
||||
import mage.client.cards.Card;
|
||||
import mage.client.cards.Permanent;
|
||||
import mage.client.plugins.MagePlugins;
|
||||
import mage.client.util.Config;
|
||||
|
|
@ -25,10 +26,10 @@ import mage.interfaces.plugin.CardPlugin;
|
|||
import mage.interfaces.plugin.CounterPlugin;
|
||||
import mage.interfaces.plugin.ThemePlugin;
|
||||
import mage.util.Logging;
|
||||
import mage.view.CardView;
|
||||
import mage.view.PermanentView;
|
||||
import net.xeoh.plugins.base.PluginManager;
|
||||
import net.xeoh.plugins.base.impl.PluginManagerFactory;
|
||||
import net.xeoh.plugins.base.util.PluginManagerUtil;
|
||||
|
||||
|
||||
public class Plugins implements MagePlugins {
|
||||
|
|
@ -73,7 +74,7 @@ public class Plugins implements MagePlugins {
|
|||
}
|
||||
|
||||
@Override
|
||||
public MagePermanent getMagePermanent(final PermanentView card, BigCard bigCard, CardDimensions dimension, final UUID gameId) {
|
||||
public MagePermanent getMagePermanent(PermanentView card, BigCard bigCard, CardDimensions dimension, UUID gameId) {
|
||||
if (cardPlugin != null) {
|
||||
return cardPlugin.getMagePermanent(card, dimension, gameId, emptyCallback);
|
||||
} else {
|
||||
|
|
@ -81,6 +82,15 @@ public class Plugins implements MagePlugins {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MageCard getMageCard(CardView card, BigCard bigCard, CardDimensions dimension, UUID gameId) {
|
||||
if (cardPlugin != null) {
|
||||
return cardPlugin.getMageCard(card, dimension, gameId, emptyCallback);
|
||||
} else {
|
||||
return new Card(card, bigCard, Config.dimensions, gameId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCardPluginLoaded() {
|
||||
return this.cardPlugin != null;
|
||||
|
|
@ -92,7 +102,7 @@ public class Plugins implements MagePlugins {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void downloadImage(Set<Card> allCards) {
|
||||
public void downloadImage(Set<mage.cards.Card> allCards) {
|
||||
if (this.cardPlugin != null) this.cardPlugin.downloadImages(allCards);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue