Fixed transform animation.

This commit is contained in:
magenoxx 2011-10-04 20:14:04 +04:00
parent 3e195a521d
commit 06b83d8a5e

View file

@ -851,20 +851,21 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
if (transformed) { if (transformed) {
BufferedImage night = ImageManagerImpl.getInstance().getNightImage(); BufferedImage night = ImageManagerImpl.getInstance().getNightImage();
dayNightButton.setIcon(new ImageIcon(night)); dayNightButton.setIcon(new ImageIcon(night));
this.temporary = this.gameCard;
if (this.gameCard.getSecondCardFace() == null) { if (this.gameCard.getSecondCardFace() == null) {
log.error("no second side for card to transform!");
return; return;
} }
if (!isPermanent) { if (!isPermanent) { // use only for custom transformation (when pressing day-night button)
this.temporary = this.gameCard;
update(this.gameCard.getSecondCardFace()); update(this.gameCard.getSecondCardFace());
} }
updateImage(); updateImage();
} else { } else {
BufferedImage day = ImageManagerImpl.getInstance().getDayImage(); BufferedImage day = ImageManagerImpl.getInstance().getDayImage();
dayNightButton.setIcon(new ImageIcon(day)); dayNightButton.setIcon(new ImageIcon(day));
if (!isPermanent) { // use only for custom transformation (when pressing day-night button)
this.gameCard = this.temporary; this.gameCard = this.temporary;
this.temporary = null; this.temporary = null;
if (!isPermanent) {
update(this.gameCard); update(this.gameCard);
} }
updateImage(); updateImage();