mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 20:32:06 -08:00
[card.plugin] unified mouse adapter. now tooltips should work.
This commit is contained in:
parent
fa99548105
commit
b501b10f9a
13 changed files with 205 additions and 57 deletions
|
|
@ -3,6 +3,8 @@ package mage.cards.action;
|
|||
import java.awt.event.MouseEvent;
|
||||
|
||||
public interface ActionCallback {
|
||||
void mouseClicked(MouseEvent e);
|
||||
void mouseMoved(MouseEvent e);
|
||||
void mouseClicked(MouseEvent e, TransferData data);
|
||||
void mouseMoved(MouseEvent e, TransferData data);
|
||||
void mouseEntered(MouseEvent e, TransferData data);
|
||||
void mouseExited(MouseEvent e);
|
||||
}
|
||||
|
|
|
|||
18
Mage.Common/src/mage/cards/action/TransferData.java
Normal file
18
Mage.Common/src/mage/cards/action/TransferData.java
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package mage.cards.action;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Point;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.cards.TextPopup;
|
||||
import mage.view.CardView;
|
||||
|
||||
public class TransferData {
|
||||
public Component component;
|
||||
public TextPopup popupText;
|
||||
public Point locationOnScreen;
|
||||
public int popupOffsetX;
|
||||
public int popupOffsetY;
|
||||
public UUID gameId;
|
||||
public CardView card;
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package mage.cards.action.impl;
|
|||
import java.awt.event.MouseEvent;
|
||||
|
||||
import mage.cards.action.ActionCallback;
|
||||
import mage.cards.action.TransferData;
|
||||
|
||||
/**
|
||||
* Callback that does nothing on any action
|
||||
|
|
@ -12,11 +13,19 @@ import mage.cards.action.ActionCallback;
|
|||
public class EmptyCallback implements ActionCallback {
|
||||
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
public void mouseMoved(MouseEvent e, TransferData data) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
public void mouseEntered(MouseEvent e, TransferData data) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e, TransferData data) {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,8 +96,6 @@ public class CardView implements Serializable {
|
|||
this.rarity = card.getRarity();
|
||||
this.expansionSetCode = card.getExpansionSetCode();
|
||||
}
|
||||
//TODO:remove me
|
||||
//System.out.println("**** CARD NUMBER **** : " + card.getCardNumber() + " : " + card.getName() + " : " + card.getExpansionSetCode());
|
||||
this.cardNumber = card.getCardNumber();
|
||||
|
||||
if (card instanceof Spell) {
|
||||
|
|
@ -109,7 +107,6 @@ public class CardView implements Serializable {
|
|||
for (UUID targetUUID : target.getTargets()) {
|
||||
if (this.targets == null) this.targets = new ArrayList<UUID>();
|
||||
this.targets.add(targetUUID);
|
||||
System.out.println("Added target: " + targetUUID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue