Now with real glyphs
[naja.git] / naja / widgets / text.py
index 6501fd730e6dd3912f581282181ee0250f516a0d..5dac4e622952b6f3407df7f95e622cf8db1498aa 100644 (file)
@@ -13,6 +13,7 @@ MARKUP_MAP = {
     'SOUTH': ('glyphs/arrow_down.png', None),
     'EAST': ('glyphs/arrow_right.png', None),
     'WEST': ('glyphs/arrow_left.png', None),
+    'RETURN': ('glyphs/return.png', None),
     'HEALTH': ('glyphs/health.png', PALETTE.DARK_RED),
     'WINTOKEN': ('glyphs/win.png', PALETTE.DARK_OLIVE),
     'KEY': ('glyphs/key.png', None),
@@ -24,6 +25,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 +61,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 +174,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):