Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tawindow.py
diff options
context:
space:
mode:
authorWalter 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)
commitbb359af22df915eb4fa17cbff76af0e6fc2a3d64 (patch)
tree0ffef8f7af41c1b2cf917d85fdfb3b6e0c8703cf /TurtleArt/tawindow.py
parentce437d9d633a783c678afa513277db60cca969e7 (diff)
more checks on incompatible blocks
Diffstat (limited to 'TurtleArt/tawindow.py')
-rw-r--r--TurtleArt/tawindow.py15
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()