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
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)