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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toggleTransformed() {
|
||||
this.transformed = !this.transformed;
|
||||
if (transformed) {
|
||||
BufferedImage night = ImageManagerImpl.getInstance().getNightImage();
|
||||
dayNightButton.setIcon(new ImageIcon(night));
|
||||
this.temporary = this.gameCard;
|
||||
@Override
|
||||
public void toggleTransformed() {
|
||||
this.transformed = !this.transformed;
|
||||
if (transformed) {
|
||||
BufferedImage night = ImageManagerImpl.getInstance().getNightImage();
|
||||
dayNightButton.setIcon(new ImageIcon(night));
|
||||
if (this.gameCard.getSecondCardFace() == null) {
|
||||
log.error("no second side for card to transform!");
|
||||
return;
|
||||
}
|
||||
if (!isPermanent) {
|
||||
if (!isPermanent) { // use only for custom transformation (when pressing day-night button)
|
||||
this.temporary = this.gameCard;
|
||||
update(this.gameCard.getSecondCardFace());
|
||||
}
|
||||
updateImage();
|
||||
} else {
|
||||
BufferedImage day = ImageManagerImpl.getInstance().getDayImage();
|
||||
dayNightButton.setIcon(new ImageIcon(day));
|
||||
this.gameCard = this.temporary;
|
||||
this.temporary = null;
|
||||
if (!isPermanent) {
|
||||
} else {
|
||||
BufferedImage day = ImageManagerImpl.getInstance().getDayImage();
|
||||
dayNightButton.setIcon(new ImageIcon(day));
|
||||
if (!isPermanent) { // use only for custom transformation (when pressing day-night button)
|
||||
this.gameCard = this.temporary;
|
||||
this.temporary = null;
|
||||
update(this.gameCard);
|
||||
}
|
||||
updateImage();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue