diff options
author | Walter Bender <walter.bender@gmail.com> | 2011-12-05 15:36:40 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2011-12-05 15:36:40 (GMT) |
commit | bb359af22df915eb4fa17cbff76af0e6fc2a3d64 (patch) | |
tree | 0ffef8f7af41c1b2cf917d85fdfb3b6e0c8703cf | |
parent | ce437d9d633a783c678afa513277db60cca969e7 (diff) |
more checks on incompatible blocks
-rw-r--r-- | TurtleArt/tawindow.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py index dae617c..e890be2 100644 --- a/TurtleArt/tawindow.py +++ b/TurtleArt/tawindow.py @@ -1035,22 +1035,25 @@ class TurtleArtWindow(): # You cannot mix and match sensor blocks elif blk.name in ['sound', 'volume', 'pitch']: if len(self.block_list.get_similar_blocks( - 'block', ['resistance', 'voltage'])) > 0: + 'block', ['resistance', 'voltage', + 'resistance2', 'voltage2'])) > 0: self.showlabel('incompatible') return True - elif blk.name in ['resistance', 'voltage']: + elif blk.name in ['resistance', 'voltage', + 'resistance2', 'voltage2']: if len(self.block_list.get_similar_blocks( 'block', ['sound', 'volume', 'pitch'])) > 0: self.showlabel('incompatible') return True - if blk.name == 'resistance': + if blk.name in ['resistance', 'resistance2']: if len(self.block_list.get_similar_blocks( - 'block', 'voltage')) > 0: + 'block', ['voltage', 'voltage2'])) > 0: self.showlabel('incompatible') return True - elif blk.name == 'voltage': + elif blk.name in ['voltage', 'voltage2']: if len(self.block_list.get_similar_blocks( - 'block', 'resistance')) > 0: + 'block', ['resistance', + 'resistance2'])) > 0: self.showlabel('incompatible') return True blk.highlight() |