Fix for #247 Promo Card Icons (#307)

Added --use-set-icon option to force cards with unique icons to instead use their standard set icon.
This commit is contained in:
Wendel Voigt 2020-03-25 11:09:31 -05:00 committed by GitHub
parent a566ec308b
commit 58e6af597a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View File

@ -190,9 +190,9 @@ class Card(object):
self.potcost = other.potcost self.potcost = other.potcost
self.debtcost = other.debtcost self.debtcost = other.debtcost
def setImage(self): def setImage(self, use_set_icon=False):
setImage = None setImage = None
if self.image is not None: if not use_set_icon and self.image is not None:
setImage = self.image setImage = self.image
else: else:
if self.cardset_tag in Card.sets: if self.cardset_tag in Card.sets:

View File

@ -1255,7 +1255,7 @@ class DividerDrawer(object):
self.canvas.drawCentredString(item.tabWidth - 10, textHeight + 2, setText) self.canvas.drawCentredString(item.tabWidth - 10, textHeight + 2, setText)
textInsetRight = 15 textInsetRight = 15
else: else:
setImage = card.setImage() setImage = card.setImage(self.options.use_set_icon)
if setImage and "tab" in self.options.set_icon: if setImage and "tab" in self.options.set_icon:
setImageHeight = 3 + card.getType().getTabTextHeightOffset() setImageHeight = 3 + card.getType().getTabTextHeightOffset()
@ -1419,7 +1419,7 @@ class DividerDrawer(object):
Image_x_right = item.cardWidth - 4 Image_x_right = item.cardWidth - 4
if "body-top" in self.options.set_icon and not card.isExpansion(): if "body-top" in self.options.set_icon and not card.isExpansion():
setImage = card.setImage() setImage = card.setImage(self.options.use_set_icon)
if setImage: if setImage:
Image_x_right -= 16 Image_x_right -= 16
self.drawSetIcon( self.drawSetIcon(

View File

@ -328,6 +328,12 @@ def parse_opts(cmdline_args=None):
dest="use_text_set_icon", dest="use_text_set_icon",
help="Use text/letters to represent a card's set instead of the set icon.", help="Use text/letters to represent a card's set instead of the set icon.",
) )
group_tab.add_argument(
"--use-set-icon",
action="store_true",
dest="use_set_icon",
help="Use set icon instead of a card icon. Applies to Promo cards.",
)
# Expanion Dividers # Expanion Dividers
group_expansion = parser.add_argument_group( group_expansion = parser.add_argument_group(