Mercurial > boomslang
diff gamelib/gamescreen.py @ 147:a039d3b81b3d
Deselect tools and get to the Mess.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Tue, 24 Aug 2010 23:16:23 +0200 |
parents | 29ba5456e8b3 |
children | a5a7bb2b4b9b |
line wrap: on
line diff
--- a/gamelib/gamescreen.py Tue Aug 24 23:11:13 2010 +0200 +++ b/gamelib/gamescreen.py Tue Aug 24 23:16:23 2010 +0200 @@ -34,7 +34,10 @@ surface.blit(item_image, rect, None, BLEND_ADD) def click_item(self, item_no, event): - self.state.set_tool(self.state.inventory[item_no]) + if self.item_is_selected(item_no): + self.unselect() + else: + self.state.set_tool(self.state.inventory[item_no]) def item_is_selected(self, item_no): return self.state.tool is self.state.inventory[item_no]