X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=naja%2Fwidgets%2Finfo_area.py;h=ad31e68f9bee50974c71f661e0b58cf61fc0d957;hb=c8c4a15980bf4b49dd307e83d5e2b10a1fe7b28c;hp=a2956a0d139a4d1d1cd369fed03cccddf6769228;hpb=23bc655a89f4ac16e2b17a5f359192d1d9268648;p=naja.git diff --git a/naja/widgets/info_area.py b/naja/widgets/info_area.py index a2956a0..ad31e68 100644 --- a/naja/widgets/info_area.py +++ b/naja/widgets/info_area.py @@ -5,7 +5,7 @@ import pygame import pygame.locals as pgl from naja.constants import INFO_SIZE, EIGHT_BIT_SCALE, MOVE, ACT, KEYS -from naja.events import InvalidateTheWorld, PlayerMoved +from naja.events import PlayerMoved, finish_event from naja.resources import resources from naja.resources.mutators import EIGHT_BIT @@ -88,19 +88,16 @@ class InfoAreaWidget(Widget): action = self.card.actions[self.chosen] if not action.check_available(self.state.gameboard.player): print "BEEP!" - return True - action.perform_action(self.state.gameboard, self.card) - self.state.gameboard.change_mode() - InvalidateTheWorld.post() - return True + else: + action.perform_action(self.state.gameboard, self.card) + self.state.gameboard.change_mode() + return finish_event() if ev.key in KEYS.UP: if self.chosen > 0: self.chosen -= 1 - InvalidateTheWorld.post() - return True + return finish_event() if ev.key in KEYS.DOWN: if self.chosen + 1 < len(self.card.actions): self.chosen += 1 - InvalidateTheWorld.post() - return True + return finish_event() return super(InfoAreaWidget, self).handle_event(ev)