- Added an attack symbol.

This commit is contained in:
jendave
2011-08-06 13:47:34 +00:00
parent 977ea87c64
commit 08dfda42f4
4 changed files with 9 additions and 1 deletions

1
.gitattributes vendored
View File

@@ -5743,6 +5743,7 @@ res/images/symbols-13/WU.png -text svneol=unset#image/png
res/images/symbols-13/X.png -text svneol=unset#image/png
res/images/symbols-13/Y.png -text svneol=unset#image/png
res/images/symbols-13/Z.png -text svneol=unset#image/png
res/images/symbols-13/attack.png -text svneol=unset#image/png
res/images/symbols-13/slash.png -text svneol=unset#image/png
res/lang/de.properties svneol=native#text/plain
res/lang/en.properties svneol=native#text/plain

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -185,6 +185,8 @@ public class CardPanel extends JPanel implements CardContainer{
int width = ManaSymbols.getWidth(gameCard.getManaCost());
ManaSymbols.draw(g, gameCard.getManaCost(), cardXOffset + cardWidth / 2 - width / 2, cardYOffset + cardHeight / 2);
}
if (showCastingCost && !isAnimationPanel && cardWidth < 200 && getCard().isAttacking() )
ManaSymbols.drawAttack(g, cardXOffset + cardWidth / 2 - 12, cardYOffset +1);
}
public void layout () {

View File

@@ -18,7 +18,7 @@ public class ManaSymbols {
static public void loadImages () {
String[] symbols = new String[] {"0", "1", "10", "11", "12", "15", "16", "2", "20", "2W", "2U", "2R", "2G", "2B", "3",
"4", "5", "6", "7", "8", "9", "B", "BG", "BR", "G", "GU", "GW", "R", "RG", "RW", "S", "T", "U", "UB",
"UR", "W", "WB", "WU", "X", "Y", "Z", "slash"};
"UR", "W", "WB", "WU", "X", "Y", "Z", "slash", "attack"};
for (String symbol : symbols)
manaImages.put(symbol, UI.getImageIcon("res/images/symbols-13/" + symbol + ".png").getImage());
}
@@ -38,6 +38,11 @@ public class ManaSymbols {
x += symbol.length() > 2 ? 10 : 14; // slash.png is only 10 pixels wide.
}
}
static public void drawAttack (Graphics g, int x, int y) {
Image image = manaImages.get("attack");
g.drawImage(image, x, y, null);
}
static public int getWidth (String manaCost) {
int width = 0;