From 86f033b7a6f02cb2c3f12f39c751b88b926f0e6c Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 09 Jul 2008 21:58:55 +0000 Subject: Menus now work --- (limited to 'tools.py') diff --git a/tools.py b/tools.py index 7f3ef64..c20fdb8 100644 --- a/tools.py +++ b/tools.py @@ -36,9 +36,10 @@ class Tool(object): self.game.setTool("destroy") elif event.key == K_m: self.game.setTool("magicpen") - elif event.type == USEREVENT: - # for switching tools - self.game.setTool(event.action) + elif event.type == USEREVENT: + if hasattr(event,"action"): + if self.game.tools.has_key(event.action): self.game.setTool(event.action) + else: # let the subclasses know that no events were handled yet return False -- cgit v0.9.1