From 6c176929bd2a3c4877eee6d0e3e9e92189004a9b Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Sat, 17 May 2014 14:39:03 +0200 Subject: [PATCH] Hook up shift glyph --- naja/actions.py | 7 ++++--- naja/constants.py | 2 ++ naja/widgets/text.py | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/naja/actions.py b/naja/actions.py index 0ada21b..d73a66a 100644 --- a/naja/actions.py +++ b/naja/actions.py @@ -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'] diff --git a/naja/constants.py b/naja/constants.py index 1205b0b..9ec9f38 100644 --- a/naja/constants.py +++ b/naja/constants.py @@ -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 = [ diff --git a/naja/widgets/text.py b/naja/widgets/text.py index 3df0948..302d237 100644 --- a/naja/widgets/text.py +++ b/naja/widgets/text.py @@ -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), -- 2.34.1