Hook up shift glyph
authorStefano Rivera <stefano@rivera.za.net>
Sat, 17 May 2014 12:39:03 +0000 (14:39 +0200)
committerStefano Rivera <stefano@rivera.za.net>
Sat, 17 May 2014 12:39:03 +0000 (14:39 +0200)
naja/actions.py
naja/constants.py
naja/widgets/text.py

index 0ada21be372024131d2175ce54b92fce58933ddb..d73a66aae4ba0dfede3cbd60e1961531f9299146 100644 (file)
@@ -21,7 +21,8 @@ class LocationAction(object):
 
         if 'shift' in self.data:
             substitutions['shift'] = self.data['shift']
-            substitutions['direction'] = self.data['direction']
+            substitutions['shift_glyph'] = ('{SHIFT_%s}'
+                                            % self.data['direction'].upper())
         elif 'direction' in self.data:
             substitutions['rowcol'] = {
                 'NORTH': 'column',
@@ -101,8 +102,8 @@ class ToggleBits(LocationAction):
 
 
 class ShiftBits(LocationAction):
-    TEXT = "Barrel-shift player %(shift)s bits %(direction)s."
-    GLYPHS = (ACTION_GLYPHS.CHANGE_BOARD,)
+    TEXT = "Barrel-shift player bits %(shift_glyph)s %(shift)s."
+    GLYPHS = (ACTION_GLYPHS.SHIFT_LEFT,)
 
     def perform_action(self, board, location):
         shift = self.data['shift']
index 1205b0bc5bf7a1da2e94d878d51a1beea604936e..9ec9f384b41dfdc3c11d416d6c12665d10af24bb 100644 (file)
@@ -143,6 +143,8 @@ ACTION_GLYPHS = AttrDict({
     'WINTOKEN': 'glyphs/win.png',
     'MSB': 'glyphs/msb.png',
     'NOTHING': 'glyphs/do_nothing.png',
+    'SHIFT_LEFT': 'glyphs/shift_left.png',
+    'SHIFT_RIGHT': 'glyphs/shift_right.png',
 })
 
 TUNES = [
index 3df09488e3a170502426b79d7724b196d2d22c32..302d2370f3fdf7d85d11c88c754f57c3b9e72102 100644 (file)
@@ -22,6 +22,8 @@ MARKUP_MAP = {
     'BLUE': ('glyphs/key.png', PALETTE.BLUE),
     'CLOCKWISE': ('glyphs/clockwise.png', None),
     'ANTICLOCKWISE': ('glyphs/anticlockwise.png', None),
+    'SHIFT_LEFT': ('glyphs/shift_left.png', None),
+    'SHIFT_RIGHT': ('glyphs/shift_right.png', None),
 
     'HEALTH_NOCOLOUR': ('glyphs/health.png', None),
     'WINTOKEN_NOCOLOUR': ('glyphs/win.png', None),