mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 17:58:01 +00:00
add flash indicator for desktop
This commit is contained in:
@@ -125,6 +125,7 @@ public class CardFaceSymbols {
|
|||||||
MANA_IMAGES.put("doublestrike", FSkin.getImage(FSkinProp.IMG_ABILITY_DOUBLE_STRIKE));
|
MANA_IMAGES.put("doublestrike", FSkin.getImage(FSkinProp.IMG_ABILITY_DOUBLE_STRIKE));
|
||||||
MANA_IMAGES.put("firststrike", FSkin.getImage(FSkinProp.IMG_ABILITY_FIRST_STRIKE));
|
MANA_IMAGES.put("firststrike", FSkin.getImage(FSkinProp.IMG_ABILITY_FIRST_STRIKE));
|
||||||
MANA_IMAGES.put("fear", FSkin.getImage(FSkinProp.IMG_ABILITY_FEAR));
|
MANA_IMAGES.put("fear", FSkin.getImage(FSkinProp.IMG_ABILITY_FEAR));
|
||||||
|
MANA_IMAGES.put("flash", FSkin.getImage(FSkinProp.IMG_ABILITY_FLASH));
|
||||||
MANA_IMAGES.put("flying", FSkin.getImage(FSkinProp.IMG_ABILITY_FLYING));
|
MANA_IMAGES.put("flying", FSkin.getImage(FSkinProp.IMG_ABILITY_FLYING));
|
||||||
MANA_IMAGES.put("hexproof", FSkin.getImage(FSkinProp.IMG_ABILITY_HEXPROOF));
|
MANA_IMAGES.put("hexproof", FSkin.getImage(FSkinProp.IMG_ABILITY_HEXPROOF));
|
||||||
MANA_IMAGES.put("indestructible", FSkin.getImage(FSkinProp.IMG_ABILITY_INDESTRUCTIBLE));
|
MANA_IMAGES.put("indestructible", FSkin.getImage(FSkinProp.IMG_ABILITY_INDESTRUCTIBLE));
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
private boolean isAnimationPanel;
|
private boolean isAnimationPanel;
|
||||||
private int cardXOffset, cardYOffset, cardWidth, cardHeight;
|
private int cardXOffset, cardYOffset, cardWidth, cardHeight;
|
||||||
private boolean isSelected;
|
private boolean isSelected;
|
||||||
|
private boolean hasFlash;
|
||||||
private CachedCardImage cachedImage;
|
private CachedCardImage cachedImage;
|
||||||
|
|
||||||
private static Font smallCounterFont;
|
private static Font smallCounterFont;
|
||||||
@@ -285,6 +286,13 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
g2d.fillRoundRect(cardXOffset - n, (cardYOffset - n) + offset, cardWidth + (n * 2), cardHeight + (n * 2), cornerSize + n , cornerSize + n);
|
g2d.fillRoundRect(cardXOffset - n, (cardYOffset - n) + offset, cardWidth + (n * 2), cardHeight + (n * 2), cornerSize + n , cornerSize + n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//card with flash..
|
||||||
|
if (hasFlash) {
|
||||||
|
g2d.setColor(Color.cyan);
|
||||||
|
final int n = Math.max(1, Math.round(cardWidth * CardPanel.SELECTED_BORDER_SIZE));
|
||||||
|
g2d.fillRoundRect(cardXOffset - n, (cardYOffset - n) + offset, cardWidth + (n * 2), cardHeight + (n * 2), cornerSize + n , cornerSize + n);
|
||||||
|
}
|
||||||
|
|
||||||
// Black fill - (will become an outline for white bordered cards)
|
// Black fill - (will become an outline for white bordered cards)
|
||||||
g2d.setColor(Color.black);
|
g2d.setColor(Color.black);
|
||||||
g2d.fillRoundRect(cardXOffset, cardYOffset + offset, cardWidth, cardHeight, cornerSize, cornerSize);
|
g2d.fillRoundRect(cardXOffset, cardYOffset + offset, cardWidth, cardHeight, cornerSize, cornerSize);
|
||||||
@@ -512,6 +520,7 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
int abiX = cardXOffset + (cardWidth / 2) + (cardWidth / 3);
|
int abiX = cardXOffset + (cardWidth / 2) + (cardWidth / 3);
|
||||||
int abiSpace = (cardWidth / 7);
|
int abiSpace = (cardWidth / 7);
|
||||||
int abiY = cardWidth < 200 ? cardYOffset + 25 : cardYOffset + 50;
|
int abiY = cardWidth < 200 ? cardYOffset + 25 : cardYOffset + 50;
|
||||||
|
hasFlash = false;
|
||||||
if (ZoneType.Battlefield.equals(card.getZone()) && showAbilityIcons()){
|
if (ZoneType.Battlefield.equals(card.getZone()) && showAbilityIcons()){
|
||||||
if (card.getCurrentState().hasFlying()) {
|
if (card.getCurrentState().hasFlying()) {
|
||||||
CardFaceSymbols.drawAbilitySymbol("flying", g, abiX, abiY, abiScale, abiScale);
|
CardFaceSymbols.drawAbilitySymbol("flying", g, abiX, abiY, abiScale, abiScale);
|
||||||
@@ -681,6 +690,17 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
abiY += abiSpace;
|
abiY += abiSpace;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (!ZoneType.Battlefield.equals(card.getZone()) && showAbilityIcons()){
|
||||||
|
String keywordKey = card.getCurrentState().getKeywordKey();
|
||||||
|
String abilityText = card.getCurrentState().getAbilityText();
|
||||||
|
if ((keywordKey.indexOf("Flash") != -1)
|
||||||
|
|| ((abilityText.indexOf("May be played by") != -1)
|
||||||
|
&& (abilityText.indexOf("and as though it has flash") != -1))){
|
||||||
|
if (keywordKey.indexOf("Flashback") == -1) {
|
||||||
|
hasFlash = true;
|
||||||
|
CardFaceSymbols.drawAbilitySymbol("flash", g, cardXOffset + (cardWidth / 2) + (cardWidth / 3), cardWidth < 200 ? cardYOffset + 25 : cardYOffset + 50, cardWidth / 7, cardWidth / 7);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user