mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
Fixed transform animation.
This commit is contained in:
parent
3e195a521d
commit
06b83d8a5e
1 changed files with 17 additions and 16 deletions
|
|
@ -845,29 +845,30 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
||||||
this.transformed = transformed;
|
this.transformed = transformed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toggleTransformed() {
|
public void toggleTransformed() {
|
||||||
this.transformed = !this.transformed;
|
this.transformed = !this.transformed;
|
||||||
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));
|
||||||
this.gameCard = this.temporary;
|
if (!isPermanent) { // use only for custom transformation (when pressing day-night button)
|
||||||
this.temporary = null;
|
this.gameCard = this.temporary;
|
||||||
if (!isPermanent) {
|
this.temporary = null;
|
||||||
update(this.gameCard);
|
update(this.gameCard);
|
||||||
}
|
}
|
||||||
updateImage();
|
updateImage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue