projects
/
naja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Parameterised action text.
[naja.git]
/
naja
/
widgets
/
info_area.py
diff --git
a/naja/widgets/info_area.py
b/naja/widgets/info_area.py
index a2406746dea23cc1f85b0958ce4cc015e0f320d0..d7ad07de421d41a5879ee26322ed2d10dd0fd87e 100644
(file)
--- a/
naja/widgets/info_area.py
+++ b/
naja/widgets/info_area.py
@@
-76,14
+76,17
@@
class InfoAreaWidget(Widget):
self.surface.blit(img, (0, y_offset))
y_offset += 8
text = TextBoxWidget(
self.surface.blit(img, (0, y_offset))
y_offset += 8
text = TextBoxWidget(
- (12, y_offset), action.
TEXT
,
+ (12, y_offset), action.
get_text()
,
box_width=(INFO_SIZE[0] - 12) // EIGHT_BIT_SCALE,
fontsize=28)
text.render(self.surface)
# self.chosen may be None, in which case we don't draw the border.
if choice == self.chosen:
box_width=(INFO_SIZE[0] - 12) // EIGHT_BIT_SCALE,
fontsize=28)
text.render(self.surface)
# self.chosen may be None, in which case we don't draw the border.
if choice == self.chosen:
- colour = (255, 255, 0, 128)
+ if not action.check_available(self.state.player):
+ colour = (255, 0, 0, 255)
+ else:
+ colour = (255, 255, 0, 128)
bottom = y_offset + text.surface.get_rect().height
right = text.surface.get_rect().width + 12
pygame.draw.lines(self.surface, colour, True,
bottom = y_offset + text.surface.get_rect().height
right = text.surface.get_rect().width + 12
pygame.draw.lines(self.surface, colour, True,