Search in sources :

Example 1 with DungeonView

use of mage.view.DungeonView in project mage by magefree.

the class PickChoiceDialog method choiceHintShow.

private void choiceHintShow(int modelIndex) {
    switch(choice.getHintType()) {
        case CARD:
        case CARD_DUNGEON:
            {
                // as popup card
                if (lastModelIndex != modelIndex) {
                    // new card
                    KeyValueItem item = (KeyValueItem) listChoices.getModel().getElementAt(modelIndex);
                    String cardName = item.getValue();
                    if (choice.getHintType() == ChoiceHintType.CARD) {
                        cardInfo.init(cardName, this.bigCard, this.gameId);
                    } else if (choice.getHintType() == ChoiceHintType.CARD_DUNGEON) {
                        CardView cardView = new CardView(new DungeonView(Dungeon.createDungeon(cardName)));
                        cardInfo.init(cardView, this.bigCard, this.gameId);
                    }
                    cardInfo.onMouseEntered(MouseInfo.getPointerInfo().getLocation());
                } else {
                    // old card
                    cardInfo.onMouseMoved(MouseInfo.getPointerInfo().getLocation());
                }
                lastModelIndex = modelIndex;
                break;
            }
        default:
        case TEXT:
            {
                // as popup text
                if (lastModelIndex != modelIndex) {
                    // new hint
                    listChoices.setToolTipText(null);
                    KeyValueItem item = (KeyValueItem) listChoices.getModel().getElementAt(modelIndex);
                    listChoices.setToolTipText(item.getValue());
                }
                lastModelIndex = modelIndex;
                break;
            }
    }
}
Also used : CardView(mage.view.CardView) DungeonView(mage.view.DungeonView)

Aggregations

CardView (mage.view.CardView)1 DungeonView (mage.view.DungeonView)1