mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +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.dialog.PreferencesDialog;
|
||||||
import mage.client.util.gui.GuiDisplayUtil;
|
import mage.client.util.gui.GuiDisplayUtil;
|
||||||
import mage.components.CardInfoPane;
|
import mage.components.CardInfoPane;
|
||||||
|
import mage.game.command.Plane;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
import mage.utils.ThreadUtils;
|
import mage.utils.ThreadUtils;
|
||||||
import mage.view.CardView;
|
import mage.view.CardView;
|
||||||
|
import mage.view.PlaneView;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.event.HyperlinkEvent.EventType;
|
import javax.swing.event.HyperlinkEvent.EventType;
|
||||||
|
@ -75,17 +77,24 @@ public class ColorPane extends JEditorPane {
|
||||||
if (!alternativeName.isEmpty()) {
|
if (!alternativeName.isEmpty()) {
|
||||||
cardName = alternativeName;
|
cardName = alternativeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
CardInfo card = CardRepository.instance.findCard(cardName);
|
|
||||||
try {
|
try {
|
||||||
final Component container = MageFrame.getUI().getComponent(MageComponents.POPUP_CONTAINER);
|
final Component container = MageFrame.getUI().getComponent(MageComponents.POPUP_CONTAINER);
|
||||||
if (e.getEventType() == EventType.EXITED) {
|
if (e.getEventType() == EventType.EXITED) {
|
||||||
setPopupVisibility(container, false);
|
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 cardInfoPane = (CardInfoPane) MageFrame.getUI().getComponent(MageComponents.CARD_INFO_PANE);
|
||||||
|
|
||||||
|
// card
|
||||||
|
CardInfo card = CardRepository.instance.findCard(cardName);
|
||||||
|
Plane plane = Plane.createPlaneByFullName(cardName);
|
||||||
|
if (card != null) {
|
||||||
cardInfoPane.setCard(new CardView(card.getMockCard()), container);
|
cardInfoPane.setCard(new CardView(card.getMockCard()), container);
|
||||||
setPopupVisibility(container, true);
|
setPopupVisibility(container, true);
|
||||||
|
} else if (plane != null) {
|
||||||
|
cardInfoPane.setCard(new CardView(new PlaneView(plane)), container);
|
||||||
|
setPopupVisibility(container, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (InterruptedException e1) {
|
} catch (InterruptedException e1) {
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
|
|
Loading…
Reference in a new issue