Made game harder, beeeeeches.
[naja.git] / naja / widgets / text.py
index 6501fd730e6dd3912f581282181ee0250f516a0d..1cf15d0bcf4601c72d52eb81d871ecedf8b454ec 100644 (file)
@@ -24,6 +24,7 @@ MARKUP_MAP = {
     'ANTICLOCKWISE': ('glyphs/anticlockwise.png', None),
     'SHIFT_LEFT': ('glyphs/shift_left.png', None),
     'SHIFT_RIGHT': ('glyphs/shift_right.png', None),
+    'COUNTDOWN': ('glyphs/countdown_4.png', PALETTE.DARK_VIOLET),
 
     'HEALTH_NOCOLOUR': ('glyphs/health.png', None),
     'WINTOKEN_NOCOLOUR': ('glyphs/win.png', None),
@@ -59,7 +60,7 @@ class TextWidget(Widget):
         self.centre = centre
         self.centre_pos = pos
         self.border = border
-        self.border_colour = border_colour
+        self.border_colour = convert_colour(border_colour)
         self.padding = padding
 
     def render_line(self, text):
@@ -172,6 +173,8 @@ class TextBoxWidget(TextWidget):
             suffix = word[-1]
             word = word[:-1]
 
+        if not word:
+            return None
         if word[0] == '{' and word[-1] == '}':
             subwords = word[1:-1].split(',')
             if all(subword in MARKUP_MAP for subword in subwords):