Ejemplo n.º 1
0
 def paint(self, painter, option, widget):
     # Note that the additional painting done here does not affect the tooltip,
     # which still shows the original pixmap
     super().paint(painter, option, widget)
     if not self.unit.isReady or self.unit.isWounded:
         assert self.unit.owner is not None
         painter.fillRect(self.boundingRect(), QtGui.QColor(0, 0, 0, 100))
         if self.unit.isWounded:
             if UnitItem._wound is None:
                 size = self.size() * 0.8
                 UnitItem._wound = utils.getPixmap('mk/cards/wound.jpg', size=size)
             pixmap = UnitItem._wound
             point = self.boundingRect().center() - pixmap.rect().center()
             if self.unit.wounds == 1:
                 painter.drawPixmap(point, pixmap)
             else:
                 size = self.size() * 0.6
                 pixmap = utils.getPixmap('mk/cards/wound.jpg', size=size)
                 painter.drawPixmap(0, 0, pixmap)
                 point = self.boundingRect().bottomRight() - pixmap.rect().bottomRight()
                 painter.drawPixmap(point, pixmap)
             
         if not self.unit.isReady:
             token = UnitItem._getPlayerToken(self.unit.owner, self.size())
             painter.drawPixmap(self.boundingRect().center() - token.rect().center(), token)
Ejemplo n.º 2
0
    def paint(self, painter, option, widget):
        # Note that the additional painting done here does not affect the tooltip,
        # which still shows the original pixmap
        super().paint(painter, option, widget)
        if not self.unit.isReady or self.unit.isWounded:
            assert self.unit.owner is not None
            painter.fillRect(self.boundingRect(), QtGui.QColor(0, 0, 0, 100))
            if self.unit.isWounded:
                if UnitItem._wound is None:
                    size = self.size() * 0.8
                    UnitItem._wound = utils.getPixmap('mk/cards/wound.jpg',
                                                      size=size)
                pixmap = UnitItem._wound
                point = self.boundingRect().center() - pixmap.rect().center()
                if self.unit.wounds == 1:
                    painter.drawPixmap(point, pixmap)
                else:
                    size = self.size() * 0.6
                    pixmap = utils.getPixmap('mk/cards/wound.jpg', size=size)
                    painter.drawPixmap(0, 0, pixmap)
                    point = self.boundingRect().bottomRight() - pixmap.rect(
                    ).bottomRight()
                    painter.drawPixmap(point, pixmap)

            if not self.unit.isReady:
                token = UnitItem._getPlayerToken(self.unit.owner, self.size())
                painter.drawPixmap(
                    self.boundingRect().center() - token.rect().center(),
                    token)
Ejemplo n.º 3
0
 def __init__(self, player):
     super().__init__()
     self.player = player
     layout = QtWidgets.QHBoxLayout(self)
     
     toolTip = self.tr("Draw pile")
     label = QtWidgets.QLabel()
     label.setPixmap(utils.getPixmap('mk/draw_pile.png'))
     label.setToolTip(toolTip)
     layout.addWidget(label)
     self.drawPileLabel = QtWidgets.QLabel()
     self.drawPileLabel.setToolTip(toolTip)
     layout.addWidget(self.drawPileLabel)
     
     toolTip = self.tr("Hand cards")
     label = QtWidgets.QLabel()
     label.setPixmap(utils.getPixmap('mk/hand_cards.png'))
     label.setToolTip(toolTip)
     layout.addWidget(label)
     self.handCardLabel = QtWidgets.QLabel()
     self.handCardLabel.setToolTip(toolTip)
     layout.addWidget(self.handCardLabel)
     
     toolTip = self.tr("Discard pile")
     label = QtWidgets.QLabel()
     label.setPixmap(utils.getPixmap('mk/discard_pile.png'))
     label.setToolTip(toolTip)
     layout.addWidget(label)
     self.discardPileLabel = QtWidgets.QLabel()
     self.discardPileLabel.setToolTip(toolTip)
     layout.addWidget(self.discardPileLabel)
     
     player.cardCountChanged.connect(self._cardCountChanged)
     self._cardCountChanged() # initialize
Ejemplo n.º 4
0
 def getPixmap(cls, name, size=None, used=None): # pylint: disable=arguments-differ
     heroName = cls.hero.name.lower()
     if not name.startswith(heroName): # motivation skills are called 'norowas_motivation' etc.
         name = '{}_{}'.format(heroName, name)
     if used:
         name = 'gray/'+name
     return utils.getPixmap('mk/skills/{}.jpg'.format(name), size)
Ejemplo n.º 5
0
    def updateItem(self):
        self.prepareGeometryChange()

        for item in self.childItems():
            self.scene().removeItem(item)
            self.tokenItems.clear()
            self.shieldItems.clear()

        for token in self.site.tokens:
            item = TokenItem(token)
            self.tokenItems.append(item)
            item.setParentItem(self)

        tooltip = ''
        for tokenItem in self.tokenItems:
            tooltip += utils.html(tokenItem.token.pixmap())
        self.setToolTip(tooltip)


        for i, player in enumerate(self.site.shieldTokens()):
            pixmap = utils.getPixmap('mk/players/shield_{}.png'.format(player.hero.name.lower()))
            item = QtWidgets.QGraphicsPixmapItem(pixmap)
            # to make sure that the site below remains visible, we do not center the token vertically
            halfWidth = pixmap.width()/2
            item.setOffset((i - 1) * halfWidth, 0)
            item.setParentItem(self)
Ejemplo n.º 6
0
 def setIndex(self, index):
     """Set the number of the current card."""
     self.index = index % len(CARDS[self.category])
     self.label.setPixmap(utils.getPixmap(CARDS[self.category][self.index]))
     self.indexLabel.setText(
         self.tr("{} / {}").format(self.index + 1,
                                   len(CARDS[self.category])))
Ejemplo n.º 7
0
 def pixmap(self, size=None):
     """Return a pixmap containing the tactic card."""
     if self is Tactic.none:
         return None
     else:
         name = '{}{}.jpg'.format('d' if self.value <= 6 else 'n',
                                  self.value)
         return utils.getPixmap('mk/cards/tactics/' + name, size)
Ejemplo n.º 8
0
 def _getPlayerToken(player, size):
     if player not in UnitItem._playerTokens:
         size = size.width() * 0.65
         size = QtCore.QSize(size, size)
         token = utils.getPixmap('mk/players/level_token_back_{}.png'
                                 .format(player.hero.name.lower()),
                                 size=size)
         UnitItem._playerTokens[player] = token
     return UnitItem._playerTokens[player]
Ejemplo n.º 9
0
 def _getPlayerToken(player, size):
     if player not in UnitItem._playerTokens:
         size = size.width() * 0.65
         size = QtCore.QSize(size, size)
         token = utils.getPixmap(
             'mk/players/level_token_back_{}.png'.format(
                 player.hero.name.lower()),
             size=size)
         UnitItem._playerTokens[player] = token
     return UnitItem._playerTokens[player]
Ejemplo n.º 10
0
 def __init__(self, match):
     super().__init__()
     self.match = match
     self.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
                                              QtWidgets.QSizePolicy.Fixed))
     self._pixmaps = {
        color: utils.getPixmap('mk/mana/die_{}.png'.format(color.name))
                        .scaled(self.SIZE, self.SIZE, Qt.KeepAspectRatio, Qt.SmoothTransformation)
             for color in Mana
     }
     self.match.source.changed.connect(self._sourceChanged)
     self._sourceChanged() # initialize
Ejemplo n.º 11
0
 def __init__(self, player):
     super().__init__()
     layout = QtWidgets.QGridLayout(self)
     layout.setVerticalSpacing(0)
     
     iconLabel = QtWidgets.QLabel()
     iconLabel.setPixmap(utils.getPixmap('mk/fame_icon.png'))
     layout.addWidget(iconLabel, 0, 0)
     self.fameLabel = QtWidgets.QLabel()
     layout.addWidget(self.fameLabel, 0, 1)
     
     iconLabel = QtWidgets.QLabel()
     iconLabel.setPixmap(utils.getPixmap('mk/reputation_icon.png'))
     layout.addWidget(iconLabel, 1, 0)
     self.reputationLabel = QtWidgets.QLabel()
     layout.addWidget(self.reputationLabel, 1, 1)
     
     player.fameChanged.connect(self.setFame)
     player.reputationChanged.connect(self.setReputation)
     self.setFame(player.fame)
     self.setReputation(player.reputation)
Ejemplo n.º 12
0
 def setTactic(self, tactic):
     """Set the tactic displayed in this widget."""
     if not tactic.flipped:
         pixmap = toolTipPixmap = tactic.pixmap()
     else:
         toolTipPixmap = tactic.pixmap()
         pixmap = utils.getPixmap('mk/cards/tactics/{}_back.jpg'.format(tactic.roundType.name))
     
     # TODO: Implement tactic.manaDie and tactic.cardCount
         
     self.setToolTip(utils.html(toolTipPixmap) if toolTipPixmap is not None else None)
     self.setPixmap(utils.scalePixmap(pixmap, self.SIZE))
Ejemplo n.º 13
0
    def _getPixmap(self, id, name):
        if (id, name) in UnitItem._pixmapCache:
            return UnitItem._pixmapCache[(id, name)]

        if id == 'wound':
            size = self._size * (0.8 if name == 1 else 0.6)
            pixmap = utils.getPixmap('mk/cards/wound.jpg', size)
        elif id == 'token':
            size = self._size * 0.65
            pixmap = utils.getPixmap('mk/players/level_token_back_{}.png'.format(name), size)
        elif id == 'bonds_of_loyalty':
            size = self._size * 0.65
            pixmap = assets.getPixmap('bonds_of_loyalty', size)
        elif id == 'banner':
            size = self._size * 0.5
            pixmap = assets.getPixmap(name, size)
        elif id == 'bannerBackside':
            size = self._size * 0.5
            pixmap = utils.getPixmap('mk/deed_back_gray.jpg', size)

        UnitItem._pixmapCache[(id, name)] = pixmap
        return pixmap
Ejemplo n.º 14
0
 def __init__(self, match):
     super().__init__()
     self.match = match
     self.setSizePolicy(
         QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
                               QtWidgets.QSizePolicy.Fixed))
     self._pixmaps = {
         color:
         utils.getPixmap('mk/mana/die_{}.png'.format(color.name)).scaled(
             self.SIZE, self.SIZE, Qt.KeepAspectRatio,
             Qt.SmoothTransformation)
         for color in Mana
     }
     self.match.source.changed.connect(self._sourceChanged)
     self._sourceChanged()  # initialize
Ejemplo n.º 15
0
    def showOptionChoice(self, choices, titles):
        self._clearChoice()
        for i, choice in enumerate(choices):
            button = QtWidgets.QPushButton()
            if isinstance(choice, Mana):
                button.setIconSize(QtCore.QSize(24, 24))
                pixmap = utils.getPixmap('mk/mana/crystal_{}.png'.format(choice.name))
                button.setIcon(QtGui.QIcon(pixmap))
            else:
                if i < len(titles): # can temporarily be false when updating choices and titles
                    button.setText(titles[i])
            self.controls.append(button)
            self.layout.insertWidget(1 + i, button)
            button.clicked.connect(functools.partial(self._handleChoice, choice))

        self.setVisible(True)
Ejemplo n.º 16
0
 def __init__(self, person, coords):
     super().__init__()
     self.person = person
     self.coords = coords
     self.setPixmap(utils.getPixmap('mk/players/{}.png'.format(person.hero.name.lower())))
     if person.hero == Hero.Norowas:
         self.setOffset(-73, -180)
     elif person.hero == Hero.Arythea:
         self.setOffset(-43, -133)
     elif person.hero == Hero.Goldyx:
         self.setOffset(-85, -140)
     elif person.hero == Hero.Tovak:
         self.setOffset(-120, -90)
     else:
         assert False
     self.setPos(coords.center())
Ejemplo n.º 17
0
 def _update(self):
     self.prepareGeometryChange()
     for item in self.childItems():
         self.scene().removeItem(item)
         self._enemyItems.clear()
         
     for enemy in self.site.enemies:
         item = EnemyItem(enemy)
         self._enemyItems.append(item)
         item.setParentItem(self)
     
     if self.site.owner is not None:
         pixmap = utils.getPixmap('mk/players/shield_{}.png'.format(self.site.owner.hero.name.lower()))
         item = QtWidgets.QGraphicsPixmapItem(pixmap)
         # to make sure that the site below remains visible, we do not center the token vertically
         item.setOffset(-pixmap.width()/2, 0)
         item.setParentItem(self)
Ejemplo n.º 18
0
    def _update(self):
        self.prepareGeometryChange()
        for item in self.childItems():
            self.scene().removeItem(item)
            self._enemyItems.clear()

        for enemy in self.site.enemies:
            item = EnemyItem(enemy)
            self._enemyItems.append(item)
            item.setParentItem(self)

        if self.site.owner is not None:
            pixmap = utils.getPixmap('mk/players/shield_{}.png'.format(
                self.site.owner.hero.name.lower()))
            item = QtWidgets.QGraphicsPixmapItem(pixmap)
            # to make sure that the site below remains visible, we do not center the token vertically
            item.setOffset(-pixmap.width() / 2, 0)
            item.setParentItem(self)
Ejemplo n.º 19
0
 def __init__(self, person, coords):
     super().__init__()
     self.person = person
     self.coords = coords
     self.setPixmap(
         utils.getPixmap('mk/players/{}.png'.format(
             person.hero.name.lower())))
     if person.hero == Hero.Norowas:
         self.setOffset(-73, -180)
     elif person.hero == Hero.Arythea:
         self.setOffset(-43, -133)
     elif person.hero == Hero.Goldyx:
         self.setOffset(-85, -140)
     elif person.hero == Hero.Tovak:
         self.setOffset(-120, -90)
     else:
         assert False
     self.setPos(coords.center())
Ejemplo n.º 20
0
    def __init__(self, parent, match):
        super().__init__(parent)
        self.match = match
        self.setBackgroundBrush(Qt.black)
        self.bgPixmap = utils.getPixmap('mk/fame_board.jpg')
        self.setSceneRect(QtCore.QRectF(0, 0, self.bgPixmap.width(), self.bgPixmap.height()))

        # Create shield tokens for each player
        self.fameItems = {}
        self.reputationItems = {}
        for player in match.players:
            self.fameItems[player] = ShieldTokenItem(player)
            self.addItem(self.fameItems[player])
            self.reputationItems[player] = ShieldTokenItem(player)
            self.addItem(self.reputationItems[player])
            player.fameChanged.connect(self.updateFame)
            player.reputationChanged.connect(self.updateReputation)

        self.updateFame()
        self.updateReputation()
Ejemplo n.º 21
0
    def __init__(self, parent, match):
        super().__init__(parent)
        self.match = match
        self.setBackgroundBrush(Qt.black)
        self.bgPixmap = utils.getPixmap('mk/fame_board.jpg')
        self.setSceneRect(
            QtCore.QRectF(0, 0, self.bgPixmap.width(), self.bgPixmap.height()))

        # Create shield tokens for each player
        self.fameItems = {}
        self.reputationItems = {}
        self.addItem
        for player in match.players:
            self.fameItems[player] = ShieldTokenItem(player)
            self.addItem(self.fameItems[player])
            self.reputationItems[player] = ShieldTokenItem(player)
            self.addItem(self.reputationItems[player])
            player.fameChanged.connect(self.updateFame)
            player.reputationChanged.connect(self.updateReputation)

        self.updateFame()
        self.updateReputation()
Ejemplo n.º 22
0
 def getPixmap(cls, name, size=None): # pylint: disable=arguments-differ
     return utils.getPixmap('mk/cards/artifacts/{}.jpg'.format(name), size)
Ejemplo n.º 23
0
 def __init__(self, player):
     super().__init__()
     pixmap = utils.getPixmap('mk/players/shield_{}.png'.format(player.hero.name.lower()))
     self.setPixmap(pixmap)
     self.setOffset(-pixmap.width()//2, -pixmap.height()//2)
Ejemplo n.º 24
0
 def pixmap(self):
     return utils.getPixmap('mk/cards/wound.jpg')
Ejemplo n.º 25
0
 def pixmap(self):
     return utils.getPixmap('mk/cards/artifacts/{}.jpg'.format(self.name))
Ejemplo n.º 26
0
 def pixmap(self):
     return utils.getPixmap('mk/cards/spells/{}.jpg'.format(self.name))
Ejemplo n.º 27
0
 def __init__(self, skill, size): # TODO: currently *skill* is just a string
     super().__init__(utils.getPixmap('mk/skills/'+skill+'.jpg'), size)
Ejemplo n.º 28
0
 def pixmap(self, size=None):
     from mageknight import utils
     return utils.getPixmap('mk/mana/die_{}.png'.format(self.name), size)
Ejemplo n.º 29
0
 def pixmap(self):
     """Return the pixmap of this tile."""
     return utils.getPixmap('mk/tiles/tile-{}.png'.format(self.id))
Ejemplo n.º 30
0
 def getPixmap(cls, name, size=None): # pylint: disable=arguments-differ
     path = 'mk/cards/{}/{}.jpg'.format('elite_units' if cls.isElite else 'regular_units', name) # pylint: disable=no-member
     return utils.getPixmap(path, size)
Ejemplo n.º 31
0
 def __init__(self, mana, size):
     pixmap = utils.getPixmap('mk/mana/{}_{}.png'.format(self.typeString, mana.name))
     super().__init__(pixmap, size)
     self.mana = mana
     self.setToolTip('')
Ejemplo n.º 32
0
 def getPixmap(cls, name, size=None): # pylint: disable=unused-argument, arguments-differ
     return utils.getPixmap('mk/cards/wound.jpg', size)
Ejemplo n.º 33
0
 def setIndex(self, index):
     """Set the number of the current card."""
     self.index = index % len(CARDS[self.category])
     self.label.setPixmap(utils.getPixmap(CARDS[self.category][self.index]))
     self.indexLabel.setText(self.tr("{} / {}").format(self.index+1, len(CARDS[self.category])))
Ejemplo n.º 34
0
    def __init__(self, match):
        super().__init__()
        self.match = match
        self.setBackgroundBrush(QtGui.QBrush(Qt.black))

        size = QtCore.QSize(107, 150)  # Maximum card image size is 365x514
        SPACING = 10

        # Advanced actions
        group1 = misc.VerticalGroup()
        group1.setPos(0, 0)
        self.addItem(group1)
        title = misc.Title(self.tr("Adv. Actions"))
        group1.addItem(title)
        drawCardPixmap = utils.getPixmap('mk/draw_card.png',
                                         size=QtCore.QSize(50, 40))
        drawItem = QtWidgets.QGraphicsPixmapItem(drawCardPixmap)
        group1.addItem(drawItem)
        self.advancedActions = stock.Stock(size)
        self.advancedActions.setColumnCount(1)
        group1.addItem(self.advancedActions)
        self.match.shop.advancedActionsChanged.connect(
            self._updateAdvancedActions)
        self._updateAdvancedActions()

        # Spells
        x = group1.sceneBoundingRect().right() + 2 * SPACING
        group2 = misc.VerticalGroup()
        group2.setPos(x, 0)
        self.addItem(group2)
        title = misc.Title(self.tr("Spells"))
        group2.addItem(title)
        drawItem = QtWidgets.QGraphicsPixmapItem(drawCardPixmap)
        group2.addItem(drawItem)
        self.spells = stock.Stock(size)
        self.spells.setColumnCount(1)
        group2.addItem(self.spells)
        self.match.shop.spellsChanged.connect(self._updateSpells)
        self._updateSpells()

        # Units
        x = group2.sceneBoundingRect().right() + 2 * SPACING
        group3 = misc.VerticalGroup(alignment=Qt.AlignLeft)
        group3.setPos(x, 0)
        self.addItem(group3)
        title = misc.Title(self.tr("Units"))
        group3.addItem(title)
        self.units = stock.Stock(size)
        self.units.setRowCount(2)
        group3.addItem(self.units)
        self.match.shop.unitsChanged.connect(self._updateUnits)
        self._updateUnits()

        # Monastery
        title = misc.Title(self.tr("Monastery Offer"))
        group3.addItem(title)
        self.monasteryOffer = stock.Stock(size)
        self.monasteryOffer.setRowCount(1)
        group3.addItem(self.monasteryOffer)
        self.match.shop.monasteryOfferChanged.connect(
            self._updateMonasteryOffer)
        self._updateMonasteryOffer()

        # Common Skill Offer
        y = max(group1.sceneBoundingRect().bottom(),
                group2.sceneBoundingRect().bottom(),
                group3.sceneBoundingRect().bottom())
        y += 2 * SPACING
        group4 = misc.VerticalGroup(alignment=Qt.AlignLeft)
        group4.setPos(0, y)
        self.addItem(group4)
        title = misc.Title(self.tr("Common Skill Offer"))
        group4.addItem(title)
        size = QtCore.QSize(76, 50)  # (maximum image size is 216x142)
        self.skills = stock.Stock(size)
        self.skills.setRowCount(2)
        group4.addItem(self.skills)
        self.match.shop.commonSkillOfferChanged.connect(
            self._updateCommonSkillOffer)
        self._updateCommonSkillOffer()
Ejemplo n.º 35
0
    def __init__(self, match):
        super().__init__()
        self.match = match
        self.setBackgroundBrush(QtGui.QBrush(Qt.black))
        
        size = QtCore.QSize(107, 150) # Maximum card image size is 365x514
        SPACING = 10
        
        # Advanced actions
        group1 = misc.VerticalGroup()
        group1.setPos(0, 0)
        self.addItem(group1)
        title = misc.Title(self.tr("Adv. Actions"))
        group1.addItem(title)
        drawCardPixmap = utils.getPixmap('mk/draw_card.png', size=QtCore.QSize(50, 40))
        drawItem = QtWidgets.QGraphicsPixmapItem(drawCardPixmap)
        group1.addItem(drawItem)
        self.advancedActions = stock.Stock(size)
        self.advancedActions.setColumnCount(1)
        group1.addItem(self.advancedActions)
        self.match.shop.advancedActionsChanged.connect(self._updateAdvancedActions)
        self._updateAdvancedActions()
        
        # Spells
        x = group1.sceneBoundingRect().right() + 2*SPACING
        group2 = misc.VerticalGroup()
        group2.setPos(x, 0)
        self.addItem(group2)
        title = misc.Title(self.tr("Spells"))
        group2.addItem(title)
        drawItem = QtWidgets.QGraphicsPixmapItem(drawCardPixmap)
        group2.addItem(drawItem)
        self.spells = stock.Stock(size)
        self.spells.setColumnCount(1)
        group2.addItem(self.spells)
        self.match.shop.spellsChanged.connect(self._updateSpells)
        self._updateSpells()

        # Units
        x = group2.sceneBoundingRect().right() + 2*SPACING
        group3 = misc.VerticalGroup(alignment=Qt.AlignLeft)
        group3.setPos(x, 0)
        self.addItem(group3)
        title = misc.Title(self.tr("Units"))
        group3.addItem(title)
        self.units = stock.Stock(size)
        self.units.setRowCount(2)
        group3.addItem(self.units)
        self.match.shop.unitsChanged.connect(self._updateUnits)
        self._updateUnits()
            
        # Monastery
        title = misc.Title(self.tr("Monastery Offer"))
        group3.addItem(title)
        self.monasteryOffer = stock.Stock(size)
        self.monasteryOffer.setRowCount(1)
        group3.addItem(self.monasteryOffer)
        self.match.shop.monasteryOfferChanged.connect(self._updateMonasteryOffer)
        self._updateMonasteryOffer()
        
        # Common Skill Offer
        y = max(group1.sceneBoundingRect().bottom(),
                group2.sceneBoundingRect().bottom(),
                group3.sceneBoundingRect().bottom())
        y += 2*SPACING
        group4 = misc.VerticalGroup(alignment=Qt.AlignLeft)
        group4.setPos(0, y)
        self.addItem(group4)
        title = misc.Title(self.tr("Common Skill Offer"))
        group4.addItem(title)
        size = QtCore.QSize(76, 50) # (maximum image size is 216x142)
        self.skills = stock.Stock(size)
        self.skills.setRowCount(2)
        group4.addItem(self.skills)
        self.match.shop.commonSkillOfferChanged.connect(self._updateCommonSkillOffer)
        self._updateCommonSkillOffer()
Ejemplo n.º 36
0
 def getPixmap(cls, name, size=None): # pylint: disable=arguments-differ
     path = 'mk/cards/{}/{}.jpg'.format('advanced_actions' if cls.isAdvanced else 'basic_actions', name) # pylint: disable=no-member
     return utils.getPixmap(path, size)
Ejemplo n.º 37
0
 def pixmap(self):
     """Return the pixmap of this unit's card."""
     return utils.getPixmap('mk/cards/{}/{}.jpg'
                            .format('elite_units' if self.isElite else 'regular_units', self.name))
Ejemplo n.º 38
0
 def __init__(self, skill,
              size):  # TODO: currently *skill* is just a string
     super().__init__(utils.getPixmap('mk/skills/' + skill + '.jpg'), size)
Ejemplo n.º 39
0
 def pixmap(self):
     return utils.getPixmap('mk/cards/{}/{}.jpg'
                         .format('advanced_actions' if self.isAdvanced else 'basic_actions', self.name))
Ejemplo n.º 40
0
 def __init__(self, player):
     super().__init__()
     pixmap = utils.getPixmap('mk/players/shield_{}.png'.format(
         player.hero.name.lower()))
     self.setPixmap(pixmap)
     self.setOffset(-pixmap.width() // 2, -pixmap.height() // 2)
Ejemplo n.º 41
0
 def backsidePixmap(cls, size=None):
     return utils.getPixmap('mk/skills/{}_back.jpg'.format(cls.hero.name.lower()), size)
Ejemplo n.º 42
0
 def pixmap(self):
     """Return the pixmap of this tile."""
     return utils.getPixmap('mk/tiles/tile-{}.png'.format(self.id))
Ejemplo n.º 43
0
 def __init__(self, color, size):
     pixmap = utils.getPixmap('mk/mana/die_{}.png'.format(color.name), size)
     super().__init__(pixmap)
     self.color = color