From 5635cf88255f76a98c932580f98bf30513275653 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sat, 17 May 2014 20:35:33 +0200 Subject: [PATCH] Make action.GLYPHS a function, action.get_glyphs. --- naja/actions.py | 3 +++ naja/widgets/info_area.py | 2 +- naja/widgets/tile.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/naja/actions.py b/naja/actions.py index 6f03358..5f28235 100644 --- a/naja/actions.py +++ b/naja/actions.py @@ -16,6 +16,9 @@ class LocationAction(object): self.required_bits = required_bits self.data = data + def get_glyphs(self): + return self.GLYPHS + def get_text(self, location=None): substitutions = self.data.copy() diff --git a/naja/widgets/info_area.py b/naja/widgets/info_area.py index 50164ea..40dcdc0 100644 --- a/naja/widgets/info_area.py +++ b/naja/widgets/info_area.py @@ -148,7 +148,7 @@ class InfoAreaWidget(Widget): else: glyphs_x_offset = INFO_LEFT_PADDING - for glyph in action.GLYPHS: + for glyph in action.get_glyphs(): img = resources.get_image( glyph, transforms=(EIGHT_BIT, blender(PALETTE.GREY))) self.surface.blit(img, (glyphs_x_offset, glyphs_y_offset - 4)) diff --git a/naja/widgets/tile.py b/naja/widgets/tile.py index cf6f04c..e925674 100644 --- a/naja/widgets/tile.py +++ b/naja/widgets/tile.py @@ -117,7 +117,7 @@ class TileWidget(Widget): def _prepare_action(self, action, y_offset): x_offset = self._prepare_lock(action, y_offset) if self.board_pos != self.state.player.position: - for glyph in action.GLYPHS: + for glyph in action.get_glyphs(): img = resources.get_image(glyph, transforms=(EIGHT_BIT,)) self.surface.blit(img, (x_offset, y_offset + 4)) x_offset += img.get_width() -- 2.34.1