X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=naja%2Fwidgets%2Ftile.py;h=344a924ae27b0dcb99546b6e38d02a77b82aaa92;hb=db18631120e34670b9f8be526f5b7d5938e1d7fc;hp=5417dcf3ba3e4e8960c829d76dc8e7c4353a09cf;hpb=2a3de29aeb0e924ee03ce864222d7228e02a506e;p=naja.git diff --git a/naja/widgets/tile.py b/naja/widgets/tile.py index 5417dcf..344a924 100644 --- a/naja/widgets/tile.py +++ b/naja/widgets/tile.py @@ -6,6 +6,7 @@ from naja.constants import ( from naja.resources import resources from naja.resources.mutators import EIGHT_BIT, blender from naja.widgets.base import Widget +from naja.widgets.text import TextBoxWidget BIT_MAP = { @@ -74,6 +75,15 @@ class TileWidget(Widget): for action in card.actions: y_offset = self._prepare_action(action, y_offset) + if card.replacement_time is not None: + timestr = str(card.replacement_time) + if len(timestr) > 1: + timestr = '+' + countdown_text = TextBoxWidget( + (TILE_SIZE[0] - 24, 4), timestr, padding=2, + colour=PALETTE.PINK, bg_colour=PALETTE.DARK_RED) + countdown_text.render(self.surface) + def _prepare_lock(self, action, y_offset): if not action.required_bits: return 4