Hacky card bits display.
authorJeremy Thurgood <firxen@gmail.com>
Wed, 14 May 2014 11:50:04 +0000 (13:50 +0200)
committerJeremy Thurgood <firxen@gmail.com>
Wed, 14 May 2014 11:50:04 +0000 (13:50 +0200)
naja/widgets/info_area.py

index 3e9152a34cf3630f6b49ef214d52e533e9ddee64..c46c93da04a4b378e6a0739440034af3aa981915 100644 (file)
@@ -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