From 58e6af597a2b18c96368c7d226a84128a296b787 Mon Sep 17 00:00:00 2001 From: Wendel Voigt Date: Wed, 25 Mar 2020 11:09:31 -0500 Subject: [PATCH] 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. --- src/domdiv/cards.py | 4 ++-- src/domdiv/draw.py | 4 ++-- src/domdiv/main.py | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/domdiv/cards.py b/src/domdiv/cards.py index fc467e2..ac748e8 100644 --- a/src/domdiv/cards.py +++ b/src/domdiv/cards.py @@ -190,9 +190,9 @@ class Card(object): self.potcost = other.potcost self.debtcost = other.debtcost - def setImage(self): + def setImage(self, use_set_icon=False): setImage = None - if self.image is not None: + if not use_set_icon and self.image is not None: setImage = self.image else: if self.cardset_tag in Card.sets: diff --git a/src/domdiv/draw.py b/src/domdiv/draw.py index 69c8a09..2c864e0 100644 --- a/src/domdiv/draw.py +++ b/src/domdiv/draw.py @@ -1255,7 +1255,7 @@ class DividerDrawer(object): self.canvas.drawCentredString(item.tabWidth - 10, textHeight + 2, setText) textInsetRight = 15 else: - setImage = card.setImage() + setImage = card.setImage(self.options.use_set_icon) if setImage and "tab" in self.options.set_icon: setImageHeight = 3 + card.getType().getTabTextHeightOffset() @@ -1419,7 +1419,7 @@ class DividerDrawer(object): Image_x_right = item.cardWidth - 4 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: Image_x_right -= 16 self.drawSetIcon( diff --git a/src/domdiv/main.py b/src/domdiv/main.py index 7630067..5bdac54 100644 --- a/src/domdiv/main.py +++ b/src/domdiv/main.py @@ -328,6 +328,12 @@ def parse_opts(cmdline_args=None): dest="use_text_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 group_expansion = parser.add_argument_group(