# HG changeset patch # User Neil Muller # Date 1282689164 -7200 # Node ID ef4da30f0f381a96246202ae3085744900545149 # Parent 7a21a594ad57ddc0a51f30527dcb06b840904263 Make hand activate on mouse down, like inventory diff -r 7a21a594ad57 -r ef4da30f0f38 gamelib/hand.py --- a/gamelib/hand.py Wed Aug 25 00:14:55 2010 +0200 +++ b/gamelib/hand.py Wed Aug 25 00:32:44 2010 +0200 @@ -2,19 +2,21 @@ from constants import BUTTON_SIZE -from albow.controls import ImageButton +from albow.controls import Image from albow.resource import get_image -from albow.utils import frame_rect -from pygame.color import Color from pygame.rect import Rect -class HandButton(ImageButton): +class HandButton(Image): """The fancy hand button for the widget""" def __init__(self, action): # FIXME: Yes, please. this_image = get_image('items', 'hand.png') - ImageButton.__init__(self, image=this_image, action=action) + Image.__init__(self, image=this_image) + self.action = action self.set_rect(Rect(0, 0, BUTTON_SIZE, BUTTON_SIZE)) + def mouse_down(self, event): + self.action() +