From: Simon Cross Date: Sat, 17 May 2014 18:35:33 +0000 (+0200) Subject: Make action.GLYPHS a function, action.get_glyphs. X-Git-Tag: 0.1~45 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=5635cf88255f76a98c932580f98bf30513275653;p=naja.git Make action.GLYPHS a function, action.get_glyphs. --- 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()