mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
Now if there is big image (card.plugin), rules box is not displayed.
This commit is contained in:
parent
3b9b92ed0b
commit
502b21fddb
5 changed files with 15 additions and 8 deletions
|
|
@ -56,10 +56,6 @@ public class BigCard extends javax.swing.JPanel {
|
|||
public BigCard() {
|
||||
initComponents();
|
||||
}
|
||||
|
||||
public void removeTextComponent() {
|
||||
remove(this.scrollPane);
|
||||
}
|
||||
|
||||
public void setCard(UUID cardId, Image image, List<String> strings) {
|
||||
if (this.cardId == null || !this.cardId.equals(cardId)) {
|
||||
|
|
@ -92,6 +88,18 @@ public class BigCard extends javax.swing.JPanel {
|
|||
graphics.drawImage(bigImage, 0, 0, this);
|
||||
super.paintComponent(graphics);
|
||||
}
|
||||
|
||||
public void removeTextComponent() {
|
||||
remove(this.scrollPane);
|
||||
}
|
||||
|
||||
public void hideTextComponent() {
|
||||
this.scrollPane.setVisible(false);
|
||||
}
|
||||
|
||||
public void showTextComponent() {
|
||||
this.scrollPane.setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
/** This method is called from within the constructor to
|
||||
|
|
|
|||
|
|
@ -345,6 +345,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis
|
|||
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent arg0) {
|
||||
this.bigCard.showTextComponent();
|
||||
this.bigCard.setCard(card.getId(), image, getRules());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -89,9 +89,6 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane implements Compon
|
|||
public void init(UUID gameId, BigCard bigCard) {
|
||||
this.gameId = gameId;
|
||||
this.bigCard = bigCard;
|
||||
/*if (Plugins.getInstance().isCardPluginLoaded()) {
|
||||
bigCard.removeTextComponent();
|
||||
}*/
|
||||
addMouseListener(new MageMouseAdapter(this, gameId));
|
||||
addMouseMotionListener(new MageMouseMotionAdapter(this, bigCard));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ public class MageMouseMotionAdapter extends MouseMotionAdapter {
|
|||
if (image != null && image instanceof BufferedImage) {
|
||||
image = ImageHelper.getResizedImage((BufferedImage) image, bigCard.getWidth(), bigCard.getHeight());
|
||||
bigCard.setCard(card.getOriginal().getId(), image, card.getOriginal().getRules());
|
||||
bigCard.hideTextComponent();
|
||||
} else {
|
||||
//TODO: add description panel
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue