support cards with debt cost
doesn't support cards with coin and debt cost, but I don't need it that myself.
This commit is contained in:
parent
9e07f2d1f6
commit
cb86a48691
@ -98,12 +98,13 @@ class Card(object):
|
|||||||
return promoTextIcons[cardName.lower()]
|
return promoTextIcons[cardName.lower()]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def __init__(self, name, cardset, types, cost, description='', potcost=0, extra=''):
|
def __init__(self, name, cardset, types, cost, description='', potcost=0, debtcost=0, extra=''):
|
||||||
self.name = name.strip()
|
self.name = name.strip()
|
||||||
self.cardset = cardset.strip()
|
self.cardset = cardset.strip()
|
||||||
self.types = types
|
self.types = types
|
||||||
self.cost = cost
|
self.cost = cost
|
||||||
self.potcost = potcost
|
self.potcost = potcost
|
||||||
|
self.debtcost = debtcost
|
||||||
self.description = description
|
self.description = description
|
||||||
self.extra = extra
|
self.extra = extra
|
||||||
|
|
||||||
|
|||||||
@ -98,6 +98,9 @@ class DividerDrawer(object):
|
|||||||
replace = '<img src='"'%s/victory_emblem.png'"' width=%d height='"'120%%'"' valign='"'middle'"'/>' % (
|
replace = '<img src='"'%s/victory_emblem.png'"' width=%d height='"'120%%'"' valign='"'middle'"'/>' % (
|
||||||
path, fontsize * 1.5)
|
path, fontsize * 1.5)
|
||||||
text = re.sub('\<VP\>', replace, text)
|
text = re.sub('\<VP\>', replace, text)
|
||||||
|
replace = '<img src='"'%s/debt.png'"' width=%d height='"'105%%'"' valign='"'middle'"'/>' % (
|
||||||
|
path, fontsize * 1.2)
|
||||||
|
text = re.sub('Debt', replace, text)
|
||||||
return text
|
return text
|
||||||
|
|
||||||
def drawOutline(self, x, y, rightSide, isBack=False, isExpansionDivider=False):
|
def drawOutline(self, x, y, rightSide, isBack=False, isExpansionDivider=False):
|
||||||
@ -176,8 +179,16 @@ class DividerDrawer(object):
|
|||||||
potHeight = y - 3
|
potHeight = y - 3
|
||||||
potSize = 11
|
potSize = 11
|
||||||
|
|
||||||
|
if card.debtcost:
|
||||||
|
self.canvas.drawImage(os.path.join(self.options.data_path, 'images', 'debt.png'),
|
||||||
|
x, coinHeight, 16, 16, preserveAspectRatio=True,
|
||||||
|
mask=[255, 255, 255, 255, 255, 255])
|
||||||
|
self.canvas.setFillColorRGB(1, 1, 1)
|
||||||
|
cost = str(card.debtcost)
|
||||||
|
else:
|
||||||
self.canvas.drawImage(os.path.join(self.options.data_path, 'images', 'coin_small.png'),
|
self.canvas.drawImage(os.path.join(self.options.data_path, 'images', 'coin_small.png'),
|
||||||
x, coinHeight, 16, 16, preserveAspectRatio=True, mask='auto')
|
x, coinHeight, 16, 16, preserveAspectRatio=True, mask='auto')
|
||||||
|
cost = str(card.cost)
|
||||||
if card.potcost:
|
if card.potcost:
|
||||||
self.canvas.drawImage(os.path.join(self.options.data_path, 'images', 'potion.png'), x + 17,
|
self.canvas.drawImage(os.path.join(self.options.data_path, 'images', 'potion.png'), x + 17,
|
||||||
potHeight, potSize, potSize, preserveAspectRatio=True,
|
potHeight, potSize, potSize, preserveAspectRatio=True,
|
||||||
@ -185,8 +196,8 @@ class DividerDrawer(object):
|
|||||||
width += potSize
|
width += potSize
|
||||||
|
|
||||||
self.canvas.setFont(self.fontNameBold, 12)
|
self.canvas.setFont(self.fontNameBold, 12)
|
||||||
cost = str(card.cost)
|
|
||||||
self.canvas.drawCentredString(x + 8, costHeight, cost)
|
self.canvas.drawCentredString(x + 8, costHeight, cost)
|
||||||
|
self.canvas.setFillColorRGB(0, 0, 0)
|
||||||
return width
|
return width
|
||||||
|
|
||||||
def drawSetIcon(self, setImage, x, y):
|
def drawSetIcon(self, setImage, x, y):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user