mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
[UI] CardPanel code clean up
This commit is contained in:
parent
eed8881e51
commit
118196c8c3
1 changed files with 3 additions and 29 deletions
|
@ -403,20 +403,15 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
||||||
g2d.setComposite(composite);
|
g2d.setComposite(composite);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO:uncomment
|
if (!hasImage) {
|
||||||
if (!hasImage /*&& gameCard.getTableID() > 0*/) {
|
|
||||||
g2d.setColor(new Color(30, 200, 200, 120));
|
g2d.setColor(new Color(30, 200, 200, 120));
|
||||||
} else {
|
} else {
|
||||||
g2d.setColor(new Color(0, 0, 0, 200));
|
g2d.setColor(new Color(0, 0, 0, 200));
|
||||||
}
|
}
|
||||||
|
|
||||||
//for debug repainting
|
|
||||||
//g2d.setColor(new Color(MyRandom.random.nextInt(255),MyRandom.random.nextInt(255),MyRandom.random.nextInt(255),150));
|
|
||||||
int cornerSize = Math.max(4, Math.round(cardWidth * ROUNDED_CORNER_SIZE));
|
int cornerSize = Math.max(4, Math.round(cardWidth * ROUNDED_CORNER_SIZE));
|
||||||
g2d.fillRoundRect(cardXOffset, cardYOffset, cardWidth, cardHeight, cornerSize, cornerSize);
|
g2d.fillRoundRect(cardXOffset, cardYOffset, cardWidth, cardHeight, cornerSize, cornerSize);
|
||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
//g2d.setColor(new Color(0,250,0,200));
|
|
||||||
//g2d.setColor(new Color(200, 120, 40, 200));
|
|
||||||
g2d.setColor(Color.green);
|
g2d.setColor(Color.green);
|
||||||
g2d.fillRoundRect(cardXOffset + 1, cardYOffset + 1, cardWidth - 2, cardHeight - 2, cornerSize, cornerSize);
|
g2d.fillRoundRect(cardXOffset + 1, cardYOffset + 1, cardWidth - 2, cardHeight - 2, cornerSize, cornerSize);
|
||||||
}
|
}
|
||||||
|
@ -426,35 +421,14 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
||||||
g2d.fillRoundRect(cardXOffset + 1, cardYOffset + 1, cardWidth - 2, cardHeight - 2, cornerSize, cornerSize);
|
g2d.fillRoundRect(cardXOffset + 1, cardYOffset + 1, cardWidth - 2, cardHeight - 2, cornerSize, cornerSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//g2d.setColor(new Color(200, 120, 40, 200));
|
||||||
|
|
||||||
//TODO:uncomment
|
//TODO:uncomment
|
||||||
/*
|
/*
|
||||||
if (gameCard.isAttacking()) {
|
if (gameCard.isAttacking()) {
|
||||||
g2d.setColor(new Color(200,10,10,200));
|
g2d.setColor(new Color(200,10,10,200));
|
||||||
g2d.fillRoundRect(cardXOffset+1, cardYOffset+1, cardWidth-2, cardHeight-2, cornerSize, cornerSize);
|
g2d.fillRoundRect(cardXOffset+1, cardYOffset+1, cardWidth-2, cardHeight-2, cornerSize, cornerSize);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
/*if (isSelected) {
|
|
||||||
g2d.setColor(Color.green);
|
|
||||||
int offset = gameCard.isTapped() ? 1 : 0;
|
|
||||||
for (int i = 1, n = Math.max(1, Math.round(cardWidth * SELECTED_BORDER_SIZE)); i <= n; i++)
|
|
||||||
g2d.drawRoundRect(cardXOffset - i, cardYOffset - i + offset, cardWidth + i * 2 - 1, cardHeight + i * 2 - 1,
|
|
||||||
cornerSize, cornerSize);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
//for debugging
|
|
||||||
// REMOVEME
|
|
||||||
/*
|
|
||||||
Point component = getLocation();
|
|
||||||
|
|
||||||
int cx = getCardX() + component.x;
|
|
||||||
int cy = getCardY() + component.y;
|
|
||||||
int cw = getCardWidth();
|
|
||||||
int ch = getCardHeight();
|
|
||||||
|
|
||||||
g2d.setColor(Color.white);
|
|
||||||
g2d.drawRect(getCardX() - component.x, getCardY() - component.y, cw, ch);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue