Added mana info for lands in hand and on battlefield.
parent
c3d6fc3538
commit
d4c0053bb6
|
@ -19,6 +19,7 @@ Release 1.7
|
|||
===========
|
||||
|
||||
- new splash screen created by Epiko
|
||||
- added mana info for lands in hand and on battlefield
|
||||
|
||||
Release 1.6 (January 2, 2011)
|
||||
===========
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 376 B |
|
@ -100,6 +100,7 @@ public class IconImages {
|
|||
public static final ImageIcon STRIKE=loadIcon("strike.png");
|
||||
public static final ImageIcon DEATHTOUCH=loadIcon("deathtouch.png");
|
||||
|
||||
public static final ImageIcon ANY_MANA=loadIcon("anymana.gif");
|
||||
public static final ImageIcon TAPPED=loadSymbolIcon("tapped.gif");
|
||||
public static final ImageIcon ONE=loadSymbolIcon("big_one.gif");
|
||||
public static final ImageIcon BLACK=loadSymbolIcon("big_black.gif");
|
||||
|
|
|
@ -114,6 +114,7 @@ public class TestGameBuilder {
|
|||
addToLibrary(opponent,"Island",10);
|
||||
addToGraveyard(player,"Mogg Fanatic",2);
|
||||
addToGraveyard(opponent,"Island",2);
|
||||
addToHand(player,"Vivid Creek",1);
|
||||
addToHand(player,"Bellowing Tanglewurm",1);
|
||||
addToHand(player,"Skullclamp",2);
|
||||
|
||||
|
@ -123,6 +124,7 @@ public class TestGameBuilder {
|
|||
createPermanent(game,player,"Spiritmonger",false,1);
|
||||
createPermanent(game,player,"Lingering Tormentor",false,1);
|
||||
createPermanent(game,player,"Rupture Spire",false,8);
|
||||
createPermanent(game,player,"Celestial Colonnade",false,1);
|
||||
createPermanent(game,opponent,"Bottle Gnomes",false,1);
|
||||
createPermanent(game,opponent,"Llanowar Elves",false,1);
|
||||
createPermanent(game,opponent,"Fume Spitter",false,1);
|
||||
|
|
|
@ -150,11 +150,13 @@ public class ImageCardListViewer extends JPanel implements ChoiceViewer {
|
|||
final int y2=point.y+CARD_HEIGHT;
|
||||
g.drawImage(image,x1,y1,x2,y2,0,0,DefaultCardImagesProvider.CARD_WIDTH,DefaultCardImagesProvider.CARD_HEIGHT,this);
|
||||
if (showInfo) {
|
||||
if (!cardDefinition.isLand()) {
|
||||
if (cardDefinition.isLand()) {
|
||||
ImageDrawingUtils.drawManaInfo(g,this,cardDefinition,x1+1,y2-17);
|
||||
} else {
|
||||
ImageDrawingUtils.drawCostInfo(g,this,cardDefinition.getCost(),x1,x2-1,y1+2);
|
||||
}
|
||||
if (cardDefinition.isCreature()) {
|
||||
ImageDrawingUtils.drawAbilityInfo(g,this,cardDefinition.getAbilityFlags(),x1+1,y2-17);
|
||||
ImageDrawingUtils.drawAbilityInfo(g,this,cardDefinition.getAbilityFlags(),x1+2,y2-18);
|
||||
final String pt=cardDefinition.getPower()+"/"+cardDefinition.getToughness();
|
||||
final int ptWidth=metrics.stringWidth(pt);
|
||||
ImageDrawingUtils.drawCreatureInfo(g,metrics,pt,ptWidth,null,x2-ptWidth-4,y2-18,false);
|
||||
|
|
|
@ -4,12 +4,15 @@ import java.awt.Color;
|
|||
import java.awt.FontMetrics;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.image.ImageObserver;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
|
||||
import magic.data.IconImages;
|
||||
import magic.model.MagicAbility;
|
||||
import magic.model.MagicCardDefinition;
|
||||
import magic.model.MagicColor;
|
||||
import magic.model.MagicManaCost;
|
||||
import magic.ui.widget.FontsAndBorders;
|
||||
|
||||
|
@ -27,7 +30,30 @@ public class ImageDrawingUtils {
|
|||
x+=16;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static int drawManaInfo(final Graphics g,final ImageObserver observer,final MagicCardDefinition cardDefinition,int ax,int ay) {
|
||||
|
||||
final List<ImageIcon> icons=new ArrayList<ImageIcon>();
|
||||
for (final MagicColor color : MagicColor.values()) {
|
||||
|
||||
if (cardDefinition.getManaSource(color)>0) {
|
||||
icons.add(color.getManaType().getIcon(true));
|
||||
}
|
||||
}
|
||||
if (icons.size()==MagicColor.NR_COLORS) {
|
||||
icons.clear();
|
||||
icons.add(IconImages.ANY_MANA);
|
||||
}
|
||||
if (!icons.isEmpty()) {
|
||||
for (final ImageIcon icon : icons) {
|
||||
|
||||
g.drawImage(icon.getImage(),ax,ay,observer);
|
||||
ax+=16;
|
||||
}
|
||||
}
|
||||
return ax;
|
||||
}
|
||||
|
||||
public static int drawAbilityInfo(final Graphics g,final ImageObserver observer,final long abilityFlags,int ax,int ay) {
|
||||
|
||||
if (MagicAbility.Flying.hasAbility(abilityFlags)) {
|
||||
|
@ -63,5 +89,5 @@ public class ImageDrawingUtils {
|
|||
g.setColor(Color.RED);
|
||||
g.drawString(damage,dx,flip?y+14:y+28);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -233,6 +233,9 @@ public class ImagePermanentViewer extends JPanel {
|
|||
}
|
||||
ax=ImageDrawingUtils.drawAbilityInfo(g,this, abilityFlags,ax,ay);
|
||||
}
|
||||
if (permanentInfo.cardDefinition.isLand()) {
|
||||
ax=ImageDrawingUtils.drawManaInfo(g,this,permanentInfo.cardDefinition,ax,ay);
|
||||
}
|
||||
|
||||
final String pt=linkedInfo.powerToughness;
|
||||
if (!pt.isEmpty()) {
|
||||
|
|
Loading…
Reference in New Issue