mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Code cleanup
This commit is contained in:
@@ -118,8 +118,8 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
* @param newCard
|
* @param newCard
|
||||||
* a {@link forge.game.card.Card} object.
|
* a {@link forge.game.card.Card} object.
|
||||||
*/
|
*/
|
||||||
public CardPanel(final Card newCard) {
|
public CardPanel(final Card card0) {
|
||||||
this.card = newCard;
|
this.card = card0;
|
||||||
|
|
||||||
this.setBackground(Color.black);
|
this.setBackground(Color.black);
|
||||||
this.setOpaque(false);
|
this.setOpaque(false);
|
||||||
@@ -128,8 +128,6 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
createPTOverlay();
|
createPTOverlay();
|
||||||
createCardIdOverlay();
|
createCardIdOverlay();
|
||||||
createScaleImagePanel();
|
createScaleImagePanel();
|
||||||
|
|
||||||
this.setCard(newCard);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createScaleImagePanel() {
|
private void createScaleImagePanel() {
|
||||||
@@ -355,12 +353,11 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
protected final void paintChildren(final Graphics g) {
|
protected final void paintChildren(final Graphics g) {
|
||||||
super.paintChildren(g);
|
super.paintChildren(g);
|
||||||
|
|
||||||
if (this.isAnimationPanel) {
|
if (this.isAnimationPanel || this.card == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (showCardManaCostOverlay() && this.cardWidth < 200) {
|
if (showCardManaCostOverlay() && this.cardWidth < 200) {
|
||||||
Card card = this.getCard();
|
|
||||||
boolean showSplitMana = card.isSplitCard() && card.getCurState() == CardCharacteristicName.Original;
|
boolean showSplitMana = card.isSplitCard() && card.getCurState() == CardCharacteristicName.Original;
|
||||||
if (!showSplitMana) {
|
if (!showSplitMana) {
|
||||||
drawManaCost(g, card.getManaCost(), 0);
|
drawManaCost(g, card.getManaCost(), 0);
|
||||||
@@ -370,11 +367,6 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Card card = this.getCard();
|
|
||||||
if (card == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int number = 0;
|
int number = 0;
|
||||||
for (final Integer i : card.getCounters().values()) {
|
for (final Integer i : card.getCounters().values()) {
|
||||||
number += i.intValue();
|
number += i.intValue();
|
||||||
@@ -396,7 +388,7 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
final int combatXSymbols = (this.cardXOffset + (this.cardWidth / 4)) - 16;
|
final int combatXSymbols = (this.cardXOffset + (this.cardWidth / 4)) - 16;
|
||||||
final int stateXSymbols = (this.cardXOffset + (this.cardWidth / 2)) - 16;
|
final int stateXSymbols = (this.cardXOffset + (this.cardWidth / 2)) - 16;
|
||||||
final int ySymbols = (this.cardYOffset + this.cardHeight) - (this.cardHeight / 8) - 16;
|
final int ySymbols = (this.cardYOffset + this.cardHeight) - (this.cardHeight / 8) - 16;
|
||||||
// int yOff = (cardHeight/4) + 2;
|
|
||||||
Combat combat = card.getGame().getCombat();
|
Combat combat = card.getGame().getCombat();
|
||||||
if (combat != null) {
|
if (combat != null) {
|
||||||
if (combat.isAttacking(card)) {
|
if (combat.isAttacking(card)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user