+ y_offset = (
+ INFO_SIZE[1] - hint.surface.get_rect().height - INFO_LEFT_PADDING
+ - 2)
+ self.surface.blit(hint.surface, (INFO_LEFT_PADDING, y_offset))
+
+ def prepare_action(self, choice, action, y_offset):
+ x_offset = INFO_LEFT_PADDING
+ glyphs_x_offset = 0
+ glyphs_y_offset = y_offset
+ y_offset += ACTION_TEXT_OFFSET
+ action_viable = action.check_available(self.state.player)
+ text_colour = PALETTE.BLACK if action_viable else PALETTE.GREY
+
+ text = TextBoxWidget(
+ (x_offset, y_offset), action.get_text(self.card),
+ box_width=(INFO_SIZE[0] - 16), fontsize=28, colour=text_colour)
+ text.render(self.surface)
+
+ border_colour = None
+ if choice == self.chosen:
+ border_colour = PALETTE.GREEN if action_viable else PALETTE.ORANGE
+ if border_colour:
+ bottom = y_offset + text.surface.get_rect().height
+ right = text.surface.get_rect().width + x_offset
+ pygame.draw.lines(self.surface, border_colour, True,
+ [(x_offset, y_offset), (right, y_offset),
+ (right, bottom), (x_offset, bottom)], 4)