# HG changeset patch # User Neil Muller # Date 1282978631 -7200 # Node ID a0d66c0f5a8981c53998c167cd0759407c58ef76 # Parent 00eb7ea2b7eadd305b3568d269cbbdd78f963a8e Add toggle thing rects option diff -r 00eb7ea2b7ea -r a0d66c0f5a89 tools/rect_drawer.py --- a/tools/rect_drawer.py Sat Aug 28 08:56:12 2010 +0200 +++ b/tools/rect_drawer.py Sat Aug 28 08:57:11 2010 +0200 @@ -91,12 +91,27 @@ self.offset = (-self.state.current_scene.OFFSET[0], - self.state.current_scene.OFFSET[1]) self.draw_rects = True self.draw_things = True + self.draw_thing_rects = True self.draw_images = True self.draw_toolbar = True def toggle_things(self): self.draw_things = not self.draw_things + def toggle_thing_rects(self): + self.draw_thing_rects = not self.draw_thing_rects + if self.state.current_detail: + scene = self.state.current_detail + else: + scene = self.state.current_scene + for thing in scene.things.itervalues(): + if not self.draw_thing_rects: + if not hasattr(thing, 'old_colour'): + thing.old_colour = thing._interact_hilight_color + thing._interact_hilight_color = None + else: + thing._interact_hilight_color = thing.old_colour + def toggle_images(self): self.draw_images = not self.draw_images @@ -303,11 +318,13 @@ app.add(print_rects) toggle_things = make_button("Toggle Things", image.toggle_things, 335) app.add(toggle_things) - toggle_images = make_button("Toggle Images", image.toggle_images, 370) + toggle_thing_rects = make_button("Toggle Thing Rects", image.toggle_thing_rects, 370) + app.add(toggle_thing_rects) + toggle_images = make_button("Toggle Images", image.toggle_images, 405) app.add(toggle_images) - toggle_rects = make_button("Toggle Rects", image.toggle_rects, 405) + toggle_rects = make_button("Toggle Rects", image.toggle_rects, 440) app.add(toggle_rects) - toggle_toolbar = make_button("Toggle Toolbar", image.toggle_toolbar, 440) + toggle_toolbar = make_button("Toggle Toolbar", image.toggle_toolbar, 475) app.add(toggle_toolbar) quit_but = make_button("Quit", app.quit, 565) app.add(quit_but)