mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
* Planechase: fixed not working plane hint in game logs (now you can see popup with full plane description);
This commit is contained in:
parent
75334141d9
commit
39b56d525a
1 changed files with 14 additions and 5 deletions
|
@ -6,9 +6,11 @@ import mage.client.MageFrame;
|
|||
import mage.client.dialog.PreferencesDialog;
|
||||
import mage.client.util.gui.GuiDisplayUtil;
|
||||
import mage.components.CardInfoPane;
|
||||
import mage.game.command.Plane;
|
||||
import mage.util.CardUtil;
|
||||
import mage.utils.ThreadUtils;
|
||||
import mage.view.CardView;
|
||||
import mage.view.PlaneView;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.HyperlinkEvent.EventType;
|
||||
|
@ -75,17 +77,24 @@ public class ColorPane extends JEditorPane {
|
|||
if (!alternativeName.isEmpty()) {
|
||||
cardName = alternativeName;
|
||||
}
|
||||
|
||||
CardInfo card = CardRepository.instance.findCard(cardName);
|
||||
try {
|
||||
final Component container = MageFrame.getUI().getComponent(MageComponents.POPUP_CONTAINER);
|
||||
if (e.getEventType() == EventType.EXITED) {
|
||||
setPopupVisibility(container, false);
|
||||
}
|
||||
if (e.getEventType() == EventType.ENTERED && card != null) {
|
||||
if (e.getEventType() == EventType.ENTERED) {
|
||||
CardInfoPane cardInfoPane = (CardInfoPane) MageFrame.getUI().getComponent(MageComponents.CARD_INFO_PANE);
|
||||
cardInfoPane.setCard(new CardView(card.getMockCard()), container);
|
||||
setPopupVisibility(container, true);
|
||||
|
||||
// card
|
||||
CardInfo card = CardRepository.instance.findCard(cardName);
|
||||
Plane plane = Plane.createPlaneByFullName(cardName);
|
||||
if (card != null) {
|
||||
cardInfoPane.setCard(new CardView(card.getMockCard()), container);
|
||||
setPopupVisibility(container, true);
|
||||
} else if (plane != null) {
|
||||
cardInfoPane.setCard(new CardView(new PlaneView(plane)), container);
|
||||
setPopupVisibility(container, true);
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException e1) {
|
||||
e1.printStackTrace();
|
||||
|
|
Loading…
Reference in a new issue