Search in sources :

Example 6 with GamePane

use of mage.client.game.GamePane in project mage by magefree.

the class MageActionCallback method handleMouseMoveOverNewCard.

private void handleMouseMoveOverNewCard(TransferData data) {
    MageCard cardPanel = data.getComponent().getTopPanelRef();
    // Prevent to show tooltips from panes not in front
    MagePane topPane = MageFrame.getTopMost(null);
    if (topPane instanceof GamePane) {
        if (data.getGameId() != null && !((GamePane) topPane).getGameId().equals(data.getGameId())) {
            return;
        }
    }
    hideTooltipPopup();
    cancelTimeout();
    Component parentComponent = SwingUtilities.getRoot(cardPanel);
    if (parentComponent == null) {
        // virtual card (example: show card popup in non cards panel like PickChoiceDialog)
        parentComponent = MageFrame.getDesktop();
    }
    Point parentPoint = parentComponent.getLocationOnScreen();
    if (data.getLocationOnScreen() == null) {
        data.setLocationOnScreen(cardPanel.getCardLocationOnScreen().getCardPoint());
    }
    ArrowUtil.drawArrowsForTargets(data, parentPoint);
    ArrowUtil.drawArrowsForSource(data, parentPoint);
    ArrowUtil.drawArrowsForPairedCards(data, parentPoint);
    ArrowUtil.drawArrowsForBandedCards(data, parentPoint);
    ArrowUtil.drawArrowsForEnchantPlayers(data, parentPoint);
    tooltipCard = data.getCard();
    startCardHintPopup(data, parentComponent, parentPoint);
}
Also used : MagePane(mage.client.MagePane) MageCard(mage.cards.MageCard) GamePane(mage.client.game.GamePane)

Aggregations

GamePane (mage.client.game.GamePane)6 MageCard (mage.cards.MageCard)1 ActionCallback (mage.cards.action.ActionCallback)1 MagePane (mage.client.MagePane)1 DeckEditorPane (mage.client.deckeditor.DeckEditorPane)1 DraftPane (mage.client.draft.DraftPane)1 MageActionCallback (mage.client.plugins.adapters.MageActionCallback)1 TournamentPane (mage.client.tournament.TournamentPane)1