jmoenig / Snap

a visual programming language inspired by Scratch
http://snap.berkeley.edu
GNU Affero General Public License v3.0
1.48k stars 740 forks source link

Sprite Watchers Aren't Updated when used inside a block #521

Closed cycomachead closed 10 years ago

cycomachead commented 10 years ago

See this project-- all variables are sprite vars. The first block executed will update most of them, but if you have watchers showing, then they aren't updated. (The variables themselves do appear to be updating).

Additionally, if you put a show inside of a block, the variable appears on the stage with correct state, but is labeled (temporary).

http://snap.berkeley.edu/snapsource/snap.html#present:Username=sraser88&ProjectName=BJC%20HW1%20Sean%20Raser%20

Edit: The ... Needs to be a part of the url...

jmoenig commented 10 years ago

it tells me the project doesn't exist...

cycomachead commented 10 years ago

Ugh, not sure what was going on... The url's been fixed.

jmoenig commented 10 years ago

Okay, I see it now. Thanks.

Strange. All the variables are clearly global, not sprite-only. It's only the watchers that don't get this. I wonder how this project was made...

jmoenig commented 10 years ago

found the bug! Now fixing it....

cycomachead commented 10 years ago

Strange. All the variables are clearly global, not sprite-only. It's only the watchers that don't get this. I wonder how this project was made...

Interesting... No idea for that part. This was just a teacher project I was grading.

found the bug! Now fixing it....

:+1:

jmoenig commented 10 years ago

Fix is ready...

Okay, I'll be (automatically) closing this issue with the fix I'm about to commit. With this fix applied the example project's watchers work as expected (for global variables). I'm also going to update the s.b.e site with the new version within the next hour.

You might want to tell people to flush their caches for the fix to work. The nice thing about the fix is that it also works with any saved projects, but only if no wrong watchers are already showing onstage. Therefore it might be best to manually delete all non-working (or wrongly labelled) watchers by dragging and dropping them onto the palette, and then to show them again using either the checkboxes next to their reporters, or by using their SHOW command.

jmoenig commented 10 years ago

No it also works online. Thanks for reporting this, @cycomachead !