+
+ def handle_event(self, ev):
+ if PlayerMoved.matches(ev):
+ self.set_position(self.state.player.position)
+ return False
+
+ if self.state.gameboard.player_mode == MOVE:
+ return super(InfoAreaWidget, self).handle_event(ev)
+ if ev.type == pgl.KEYDOWN:
+ if ev.key in KEYS.SELECT:
+ 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
+ if ev.key in KEYS.UP:
+ if self.chosen > 0:
+ self.chosen -= 1
+ InvalidateTheWorld.post()
+ return True
+ if ev.key in KEYS.DOWN:
+ if self.chosen + 1 < len(self.card.actions):
+ self.chosen += 1
+ InvalidateTheWorld.post()
+ return True
+ return super(InfoAreaWidget, self).handle_event(ev)