From: Jeremy Thurgood Date: Wed, 14 May 2014 11:50:04 +0000 (+0200) Subject: Hacky card bits display. X-Git-Tag: 0.1~308 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=d9f031952493664849860837041f99b4252f7509;p=naja.git Hacky card bits display. --- diff --git a/naja/widgets/info_area.py b/naja/widgets/info_area.py index 3e9152a..c46c93d 100644 --- a/naja/widgets/info_area.py +++ b/naja/widgets/info_area.py @@ -44,6 +44,14 @@ class InfoAreaWidget(Widget): colour=(255, 255, 255)) title.render(self.surface) y_offset = title.surface.get_rect().height + 8 + + # TODO: Make this better. + bits_text = ''.join('1' if bit in self.card.bitwise_operand else '0' + for bit in reversed(range(8))) + card_bits = TextWidget((0, y_offset), bits_text, colour=(255, 255, 0)) + card_bits.render(self.surface) + y_offset += card_bits.surface.get_rect().height + 8 + for choice, action in enumerate(self.card.actions): y_offset = self.prepare_action(choice, action, y_offset) # We cheat horribly for layout reasons