Paul Kaplan
0ec0ea6ef7
Add reorderTarget API to VM
2018-06-13 09:20:22 -04:00
kchadha
b4891bb0d5
Merge pull request #1226 from towerofnix/costumename-vm
...
Implement "costume name" block
2018-06-12 18:50:46 -04:00
Florrie
c24e34d4e3
Remove unused getCostumeName function
2018-06-12 19:32:29 -03:00
Florrie
24c6338302
Map costumeName -> costumenumbername [name]
...
...instead of mapping to a new obsolete/hidden block 'costumename'.
Thanks to @kchadha for helping with this!
2018-06-12 19:27:36 -03:00
Karishma Chadha
5086eced15
Position for block comments imported from 2.0 should be updated when receiving a create event from scratch-blocks.
2018-06-12 17:10:16 -04:00
Michael "Z" Goddard
728769ea24
do not enumerate Blocks._cache
...
Do not stringify or enumerate Blocks._cache items.
2018-06-12 14:21:40 -04:00
Michael "Z" Goddard
05291aa254
turn reporter tree into instruction sequence
...
Turn the reporter tree execute walks into a sequence of block
functions. After calling a block function store the reported value in
the arguments object its depending block will use.
- Set the reported value on the thread. There is only ever one "just"
reported value, which is read and stored elsewhere after being
reported.
2018-06-12 14:21:40 -04:00
Michael "Z" Goddard
e0ec1ad08f
add id to block execute cache data
2018-06-12 10:05:54 -04:00
Michael "Z" Goddard
d161251a9b
yield a thread loop or tick in event_broadcastandwait
...
- yield a thread loop or tick in looks_switchbackdroptoandwait
If all threads broadcastAndWait is watching are "waiting" for a future
frame, yield until the next tick so event_broadcastandwait also defers
to a future frame.
2018-06-12 10:02:28 -04:00
Paul Kaplan
418c3837c6
Merge pull request #1209 from technoboy10/bugfix/gh-1135-bubble-edge
...
Check that bubble bounds do not extend past stage boundaries
2018-06-11 12:14:53 -04:00
Connor Hudson
244ffb38c4
Merge pull request #1218 from technoboy10/bugfix/gh-1165-monitor-import
...
Fix importing hidden monitors from Scratch 2 projects
2018-06-11 10:27:45 -04:00
Eric Rosenbaum
78074ec575
Merge pull request #1222 from picklesrus/speech-extension-icons
...
Speech extension icons
2018-06-11 09:50:42 -04:00
Connor Hudson
38756e1022
Update code comments to address PR feedback
2018-06-11 08:37:25 -04:00
Florrie
404834018b
Implement costume name block
2018-06-09 21:34:21 -03:00
picklesrus
97b8ec83bd
Ignore lint for the icons
2018-06-08 14:45:13 -07:00
picklesrus
6184c3ba12
Replace icons with version downloaded from https://material.io/tools/icons/?style=baseline
2018-06-08 14:42:46 -07:00
Connor Hudson
78da15c09c
Remove blocks.mode reference
2018-06-08 17:04:52 -04:00
Connor Hudson
a6629628cd
Use monitor show/hide monitor functions, remove incorrect block property references
2018-06-08 16:00:12 -04:00
Connor Hudson
0e394fc873
Add monitor show/hide functions, changed remove monitor to delete state
2018-06-08 15:59:35 -04:00
Eric Rosenbaum
173fb6127c
Merge pull request #1214 from ericrosenbaum/feature/when-touching
...
Add when touching hat
2018-06-07 15:26:09 -04:00
Connor Hudson
2cb276c476
Consolidate some logic in requestAddMonitor and requestUpdateMonitor
2018-06-07 15:18:45 -04:00
kchadha
3a61cac384
Merge pull request #1217 from kchadha/comment-state-fixes
...
Comment state fixes
2018-06-07 14:31:43 -04:00
Eric Rosenbaum
db7c56e08b
Change function name and comment for clarity
2018-06-07 14:12:23 -04:00
Connor Hudson
99dc46ba80
Add x, y to changeBlock function again after change to merge logic
2018-06-07 11:27:10 -04:00
Connor Hudson
833c27ef21
Remove debug comments, tweak logic for monitor data merging
2018-06-07 11:24:55 -04:00
Karishma Chadha
6bc04c4bef
Let comment change event handler multitask.
2018-06-07 11:04:03 -04:00
Paul Kaplan
db3fca17bc
Merge pull request #1204 from paulkaplan/reorder-apis
...
Add methods for reordering costumes and sounds
2018-06-07 10:54:15 -04:00
Ray Schamp
7de83bea07
Merge pull request #1215 from picklesrus/speech-extension-audiocontext
...
Add webkitAudioContext if AudioContext does not exist. This might fix…
2018-06-07 10:53:45 -04:00
Karishma Chadha
7b55d8e7ab
Undo change that moves block comment relative to block move.
2018-06-07 10:18:34 -04:00
Connor Hudson
13bf932fbb
Remove unnecessary arguments to requestAddMonitor
2018-06-07 10:11:15 -04:00
Karishma Chadha
d99a082952
CommentChange events now store text changes in an object with property text, instead of just a string.
2018-06-07 10:09:38 -04:00
picklesrus
391f47d100
Add webkitAudioContext if AudioContext does not exist. This might fix the speech extension in safari, but it is tricky to tell since I am running into problems with permissions and localhost.
2018-06-06 16:49:46 -07:00
Paul Kaplan
28f425d53e
Set costume directly, no updates are needed
2018-06-06 17:29:48 -04:00
Connor Hudson
77dda04228
Set visible: false instead of deleting state in requestRemoveMonitor
...
This potentially has performance implications, to be investigated later.
2018-06-06 17:14:09 -04:00
Eric Rosenbaum
1a72512a62
Moving touchingObject into rendered target
2018-06-06 16:34:58 -04:00
Connor Hudson
0d0543810f
Properly capture all variable monitor values on add
2018-06-06 16:00:59 -04:00
Connor Hudson
18640d7ddc
use mergeWith in requestAddMonitor, requestUpdateMonitor
...
So undefined values don't overwrite defined ones
2018-06-06 15:54:12 -04:00
Paul Kaplan
bf2879ee0b
Fix incorrect clamping
2018-06-06 15:01:02 -04:00
Eric Rosenbaum
431d4bd66b
Add when touching hat
2018-06-06 13:39:23 -04:00
Paul Kaplan
0cd50fbb2c
Propagate the return value of reorder functions, update comments
2018-06-06 11:13:30 -04:00
Eric Rosenbaum
332e90e408
Merge pull request #1208 from ericrosenbaum/feature/increase-pen-size
...
Increase maximum pen size to 1200
2018-06-06 10:16:15 -04:00
Michael "Z" Goddard
0a006dc981
add Runtime.isWaitingThread
...
Add a Runtime Thread helper to check if a thread is in a state where it
will not change at least until next frame. This includes any state
where the thread is done, as that will not change either.
2018-06-06 10:16:05 -04:00
Michael "Z" Goddard
9311a274d5
add BlockUtility.yieldTick
2018-06-06 10:16:05 -04:00
Michael "Z" Goddard
84705fc463
replace new Promise(r => r()) with Promise.resolve
...
Promise.resolve is a Promise convenience method that creates a promise
resolved to a given argument like creating a promise with a function
that immediately calls the resolve function with the given value.
2018-06-06 09:53:45 -04:00
Paul Kaplan
d6d72f6fa7
Use utility function for clamping
2018-06-06 09:43:54 -04:00
Paul Kaplan
1ebb736a2a
Check specifically for number in optional property
2018-06-06 09:43:54 -04:00
Paul Kaplan
837703d4ac
Make reorder functions return if a change occurred.
...
Gotta get that testing coverage percent up :)
2018-06-06 09:43:54 -04:00
Paul Kaplan
e6ebc33e9e
Add sound and costume reordering methods and tests to top-level API
2018-06-06 09:43:54 -04:00
Paul Kaplan
d3fd3ff806
Add reorderSound and unit test to rendered-target
2018-06-06 09:43:54 -04:00
Paul Kaplan
5fd5b30ccf
Add reorderCostume method and unit test to rendered target
2018-06-06 09:43:54 -04:00
Paul Kaplan
9fce4d40d0
Fix bug with zero adding a costume/sound at index 0
2018-06-06 09:43:54 -04:00
Andrew Sliwinski
c2645f3da5
Merge pull request #1210 from thisandagain/feature/polly
...
Add initial working version of the Amazon Polly extension
2018-06-05 18:35:38 -04:00
Andrew Sliwinski
bccdef0674
Future-proof opcode and fix issues with copied comments
2018-06-05 18:32:02 -04:00
Andrew Sliwinski
55b1a794ce
Add initial working version of the Amazon Polly extension
2018-06-05 17:51:55 -04:00
kchadha
1f209ad4e0
Merge pull request #1191 from kchadha/comment-events
...
Persist comment state.
2018-06-05 16:53:57 -04:00
Paul Kaplan
a11d1be3fc
Fix comments
2018-06-05 16:08:14 -04:00
Eric Rosenbaum
23c7df5751
Max pen size 1200
2018-06-05 15:59:14 -04:00
Connor Hudson
25290e7f6a
Check that bubble bounds do not extend past stage boundaries
...
For when you can't flip the bubble, but need it to remain on-stage
2018-06-05 15:58:03 -04:00
Karishma Chadha
644fab0135
Track block comment movement when block moves.
2018-06-05 15:40:19 -04:00
Karishma Chadha
7c5a2ae8e0
Add check that block associated with comment actually exists.
2018-06-05 15:17:28 -04:00
Karishma Chadha
d58bb8bcfb
Clean up optRuntime checks in blocklyListen
2018-06-05 15:13:03 -04:00
Karishma Chadha
2171cb69d0
No need to floor workspace coordinates in vm runtime.
2018-06-05 15:12:25 -04:00
Paul Kaplan
3a697ae0ac
Add top-level API for getting and setting variable values
2018-06-05 10:46:06 -04:00
Paul Kaplan
7b2f606316
Fix an issue where variable lookup would error if stage did not exist.
2018-06-05 10:45:51 -04:00
Eric Rosenbaum
ca6a7f9311
Merge pull request #1199 from picklesrus/speech-extension-loginfo
...
Add some log info with more information about the speech match so we …
2018-06-04 16:35:58 -04:00
picklesrus
e668a210a0
Add some log info with more information about the speech match so we can debug better.
2018-06-04 13:17:34 -07:00
Kreg Hanning
9055706333
Add check for invalid symbol
2018-06-04 15:22:12 -04:00
Kreg Hanning
94464f0a52
Update microbit extension for latest firmware
2018-06-04 14:52:52 -04:00
Karishma Chadha
522706ccf8
Persist comment state.
2018-06-01 18:10:25 -04:00
Eric Rosenbaum
294801c1f3
Merge pull request #1184 from ericrosenbaum/bugfix/sound-blocks-yield
...
Set/change sound effect and volume blocks yield until the next tick
2018-06-01 13:19:50 -04:00
Eric Rosenbaum
2348d55f14
Use promises to yield
2018-05-31 17:09:47 -04:00
Paul Kaplan
ac91d8af65
Merge pull request #1180 from kchadha/parse-sb2-comments
...
Import Comments from 2.0 Projects
2018-05-31 16:51:22 -04:00
Eric Rosenbaum
46f885fc03
Sound effect and volume blocks request redraw
2018-05-31 16:47:40 -04:00
Karishma Chadha
537dc9bcd5
Addressing PR comments.
2018-05-31 16:33:42 -04:00
Michael "Z" Goddard
4ceeebb257
Use src/index as browser entry point
...
Use src/index.js as the entry by default in tools building scratch-vm
into a larger package. This saves file space by excluding extra webpack
boilerplate and may allow for deeper optimizations.
Depend on script dependencies for downstream webpack. For another
package to build in scratch-vm's dependencies without them already
being built into a consumed webpack build they need to be listed as
dependencies. This can benefit large projects that reuse the same
dependencies multiple times. Node will still use the main entry point
and its webpack build leaves the dependencies as external references so
it may reuse common modules in Node as well as in a build a browser
environment.
2018-05-31 16:32:46 -04:00
Eric Rosenbaum
c9842ec3dc
Merge pull request #1121 from picklesrus/speech-extension-checkin
...
Initial version of the speech extension. There is certainly still so…
2018-05-31 15:35:09 -04:00
picklesrus
968eeaf936
Fix missing comma from bad merge.
2018-05-31 12:14:55 -07:00
Eric Rosenbaum
3e43786ef6
Default to a random language
2018-05-31 11:48:37 -04:00
Karishma Chadha
acd728dc2b
No more xml differentiation for 'scratch' type of comments.
2018-05-30 21:18:45 -04:00
Karishma Chadha
f079eb4bbd
Don't serialize x and y for sb2 comments so that they can be auto positioned.
2018-05-30 21:18:45 -04:00
Karishma Chadha
b0aa288916
Add info about minimized state to comment xml.
2018-05-30 21:18:45 -04:00
Karishma Chadha
1639444a4d
Fix lint and tests.
2018-05-30 21:18:45 -04:00
Karishma Chadha
1401d54add
Parse SB2 comments and attach block comments to the blocks they belong to. Send comment xml on workspace update so they can be rendered.
2018-05-30 21:15:14 -04:00
picklesrus
3a5051646f
Now fuzzymatchResult is unused so remove it too.
2018-05-30 13:22:07 -07:00
picklesrus
bb408b8673
Remove some code that set the utterance to the fuzzy match result
2018-05-30 13:22:07 -07:00
picklesrus
e72ea04c10
Move the add event listener code to be in the same place where we call connect so there is only one place to do it.
2018-05-30 13:22:07 -07:00
picklesrus
ef142107a6
Remove the event listener for processing audio at the same time that we disconnect the script node. At this point we are closing the web socket and do not want to process more of the microphone data even if it is already in flight. Also add it back when we resume listening instead of just at init time.
2018-05-30 13:22:07 -07:00
picklesrus
ffced16b95
Fix a copy/paste comment error and initialize current_utterance differently
2018-05-30 13:22:07 -07:00
picklesrus
a2eee6a1dd
Change name of opcode to speech_ from speech.Plus, remove old comment.
2018-05-30 13:22:07 -07:00
picklesrus
adf5d0acfd
Add speech extension to the extension manager.
2018-05-30 13:22:07 -07:00
picklesrus
250570e0ed
Use arraybuffer-loader instead of buffer-loader to load the start and end sounds. The music extension switched to this a few days ago.
2018-05-30 13:20:38 -07:00
picklesrus
e7987a6a4c
Initial version of the speech extension. There is certainly still some stuff to figure out but the core of it is here.
2018-05-30 13:20:38 -07:00
Eric Rosenbaum
057e89b1e0
Merge pull request #1178 from picklesrus/translate-language-reporter-block
...
Add language reporter block to translate extension
2018-05-30 10:25:22 -04:00
picklesrus
123edcb913
remove stray space
2018-05-29 15:14:38 -07:00
picklesrus
e2f6dfd29f
- Update the reporter to return the human readable language.
...
- Remove the non-final icons and replace with a TODO.
- Add messages for the text in the blocks.
2018-05-29 15:06:38 -07:00
picklesrus
f615e9191a
Add language reporter block to translate extension
2018-05-28 11:58:17 -07:00
DD
7874ea9b1a
Allow rotation centers with zeros
2018-05-25 16:54:54 -04:00
kchadha
a85f641d25
Merge pull request #1148 from kchadha/stage-layering
...
Layer group ordering.
2018-05-25 09:10:05 -04:00
Chris Willis-Ford
b3db00fab7
Merge pull request #1154 from vincentbriglia/issue1552
...
Allow override of icons per block
2018-05-25 01:10:57 -07:00
Chris Willis-Ford
eae258cce6
Merge pull request #1153 from vincentbriglia/issue1551
...
Add option for Extensions to have different colour
2018-05-25 01:07:20 -07:00
DD Liu
13d277e7c8
Merge pull request #1164 from fsih/bgOffset
...
Always give backdrops a certain rotation center
2018-05-24 16:54:01 -04:00
Ray Schamp
3b49f45b9a
Merge pull request #1160 from Kenny2github/patch-1
...
Round (x position) and (y position) to 8 places
2018-05-24 13:58:16 -04:00
Paul Kaplan
02041c8218
Merge pull request #1163 from paulkaplan/username-stub
...
Add logged out version of username block
2018-05-24 13:29:47 -04:00
Eric Rosenbaum
b052205457
Merge pull request #1162 from ericrosenbaum/feature/emit-keyboard-events
...
Runtime emits key pressed event
2018-05-23 17:04:05 -04:00
Eric Rosenbaum
3cdc9765a8
Translation extension imports translated language names ( #1159 )
...
* wip
* wip
* Get viewer language code, and cleanup
* Revert "wip"
This reverts commit 6598738ed2
.
# Conflicts:
# src/extensions/scratch3_translate/index.js
2018-05-23 17:00:59 -04:00
DD Liu
10aa6979ed
Multiply by bitmap resolution
2018-05-23 14:18:22 -04:00
DD Liu
85689201ed
Always give backdrops a certain rotation center
2018-05-23 14:06:23 -04:00
Paul Kaplan
c5cc129821
Add logged out version of username block
2018-05-23 11:30:12 -04:00
Eric Rosenbaum
508ac91b82
Runtime emits key pressed event
2018-05-22 17:24:22 -04:00
Paul Kaplan
b7e40c9735
Merge pull request #1147 from paulkaplan/fix-say-hide
...
Fix say bug with show/hide
2018-05-22 14:49:50 -04:00
Ken
5af6887cfe
Round (x position) and (y position) to 8 places
2018-05-22 12:46:22 +08:00
DD Liu
8c0f5a71f0
Merge pull request #1149 from fsih/compatMode
...
Pass in argument to indicate compat mode
2018-05-21 15:03:27 -04:00
Karishma Chadha
5e40bfb7ee
No more explicit layer groups, and separate extension into video and pen.
2018-05-20 22:30:20 -04:00
Karishma Chadha
38875bc65c
Bubbles should be in the same layer as sprites. Other cleanup.
2018-05-20 19:49:42 -04:00
Karishma Chadha
64c8484066
Refactor so that layer group is optionally passed into createClone (and initDrawable) instead of isStage property getting stored on a sprite.
2018-05-18 10:11:59 -04:00
Vincent Briglia
0c8662bc23
Allow override of icons per block
2018-05-17 15:27:24 +02:00
Vincent Briglia
76ce7d6fe6
add option to override colours
2018-05-17 15:25:20 +02:00
Karishma Chadha
e2ce047fa1
Test and lint fixes.
2018-05-16 16:00:50 -04:00
Karishma Chadha
67b114b9c9
Layer group ordering.
2018-05-15 22:22:44 -04:00
Paul Kaplan
c18d5faafb
Make sure to set the bubble to blank when hiding
2018-05-15 14:38:42 -04:00
Kreg Hanning
82fd6f0d2f
Add micro:bit Scratch 3.0 extension ( #1113 )
...
* Add micro:bit Scratch 3.0 extension
* Fix lint errors in micro:bit extension
* Fix doc. Incorrect return type
* Check for valid pin in when pin connected block
* Drop mapping function
* Drop question mark from tilt hat block
* Generate list of symbols from object keys
* Trim display text block to max 20 characters
2018-05-14 13:52:49 -04:00
Eric Rosenbaum
846f212110
Merge pull request #1138 from picklesrus/develop-translate-changes
...
Update the format of the language menu to match the changes made to d…
2018-05-11 17:14:13 -04:00
Eric Rosenbaum
b5395fbc3e
Merge pull request #1140 from picklesrus/extension-manager-translate
...
Add translate extension to the extension manager.
2018-05-11 17:11:57 -04:00
DD
78e17b4842
Pass in argument to indicate compat mode
2018-05-11 14:24:07 -04:00
Ray Schamp
1934fd427a
Revert "Dynamically load music extension manifest"
2018-05-11 11:04:43 -04:00
picklesrus
37e5c638c1
Add translate extension to the extension manager.
2018-05-10 13:42:23 -07:00
picklesrus
720cc820cd
Update the format of the language menu to match the changes made to deal with translations. This allows the menu to pass through the maybeFormatMessage code correctly.
2018-05-10 13:20:24 -07:00
Eric Rosenbaum
bdda3bc2c9
Add extension id to toolbox category XML
2018-05-10 15:41:44 -04:00
Paul Kaplan
b7f3a06fa0
Merge pull request #1133 from paulkaplan/show-hide-vars
...
Add implementations for hiding and showing variables and lists.
2018-05-10 15:34:21 -04:00
Andrew Sliwinski
0b7aa6ddf6
Merge pull request #1136 from thisandagain/feature/localize
...
Add localization support to music and video sensing extensions
2018-05-10 15:27:37 -04:00
Andrew Sliwinski
3eefddcde2
Fix typo and add clarification to translation note
2018-05-10 15:25:55 -04:00
Andrew Sliwinski
d5705f6eae
Fix typo
2018-05-10 13:58:09 -04:00
DD Liu
5c003641f9
Merge pull request #1126 from fsih/fixQuirksOnLoadCostume
...
Run quirks mode fixes on costumes loaded from sb2s
2018-05-10 13:42:48 -04:00
Andrew Sliwinski
1995753e94
Add localization support to music and video sensing extensions
2018-05-10 13:41:41 -04:00
DD
589dd7d5e0
Attach the svg renderer instead of providing it in order to fix VM tests
2018-05-10 12:03:38 -04:00
DD
aae1e083bc
Switched textEncoder to costumeAsset.encodeTextData, and pass in version as an argument instead of in costume
2018-05-09 15:48:49 -04:00
Paul Kaplan
47e2264eba
Add opcodes for hiding and showing variables and lists.
...
Note: to get them back into the toolbox, we need to change that in blocks.
2018-05-09 14:25:15 -04:00
Paul Kaplan
f3404f4275
Merge pull request #1128 from paulkaplan/sb2-monitors
...
Import monitors from sb2 files.
2018-05-09 13:52:29 -04:00
Paul Kaplan
6c9ecd9065
Return a new copy of the list for monitors when changes occur
2018-05-09 13:42:53 -04:00
Paul Kaplan
7d0121bc44
Return lists as arrays if running for monitors.
...
This is a strange quirk of the way the list blocks work, they get joined into a string for interoperability within other other scratch blocks. But for monitors, we need it to stay an array.
2018-05-09 12:24:01 -04:00
Paul Kaplan
36a01cf0cb
Fix clearing monitor state
2018-05-09 12:06:24 -04:00
Paul Kaplan
6793349898
Do not stringify reported monitor values.
...
Consulted @fsih, should be fine since formatting is being handled in the GUI anyway.
2018-05-09 11:39:14 -04:00
Paul Kaplan
cc1314d289
Clear out monitor state on vm.clear
...
Fixes https://github.com/LLK/scratch-gui/issues/1848
2018-05-09 11:34:01 -04:00
Paul Kaplan
f01558b74e
Address comments from @kchada review
2018-05-09 11:08:49 -04:00
Paul Kaplan
9e372916a8
Add comment about sensing block id oddness
2018-05-09 10:52:00 -04:00
kchadha
cf8ad388de
Merge pull request #1122 from Kenny2github/develop
...
Handle random backdrop menu option
2018-05-09 10:12:05 -04:00
Kenny2github
8e9f9e0a30
Add one to index if random costume is current costume
2018-05-09 08:13:04 +08:00
DD
b9ce26918d
Fix review comments
2018-05-08 18:30:52 -04:00
Paul Kaplan
13dfef553e
Fix default value for monitor record
2018-05-08 17:30:39 -04:00
Paul Kaplan
26cfbfe588
Fix stage checking
2018-05-08 17:15:54 -04:00
Paul Kaplan
4713f47fb7
Import monitors from sb2 files.
...
Paired with @kchadha on all of this.
2018-05-08 17:06:19 -04:00
DD
928245d5c9
Fix Edge
2018-05-08 14:25:32 -04:00
DD
296af1a079
Run quirks mode fixes on costumes loaded from sb2s
2018-05-08 12:03:34 -04:00
Ray Schamp
22852aeab4
Merge pull request #1119 from mzgoddard/recycle-args
...
Recycle block args
2018-05-08 12:00:29 -04:00
Ray Schamp
b657d6a50f
Merge pull request #1118 from mzgoddard/recycle-stack-frame
...
Add Thread.StackFrame class
2018-05-08 09:04:16 -04:00
Kenny2github
3f1c4aa2d8
thought I was being smart by using inline assignment, but noooooo
2018-05-08 08:27:51 +08:00
Kenny2github
e3b7f53319
Make sure switched costume is not current costume
2018-05-08 08:21:27 +08:00
Michael "Z" Goddard
8107349bec
Comment BlockCached
2018-05-07 15:32:31 -04:00
Michael "Z" Goddard
2db2287d12
BlockCached instances are always initialized
2018-05-07 15:32:30 -04:00
Michael "Z" Goddard
5fd749918f
Reuse argValues
...
Block args set by fields are static and never change. Inputs that do
change are always set onto args. With these two assumptions we can
reuse the same objects for each execution of the same block instead of
constantly creating them and letting them be garbage collected.
2018-05-07 15:32:30 -04:00
Michael "Z" Goddard
9b82530f51
Use a constructor to create the execute cache objects
2018-05-07 15:32:30 -04:00
Michael "Z" Goddard
0634e962a8
Add Thread.StackFrame class
...
Use a private StackFrame class to help internally manage use of Stack
Frame values and memory. Create params, reported, and executionContext
on demand.
2018-05-07 11:20:26 -04:00
Kenny2github
4419014421
Handle random backdrop
2018-05-05 18:25:18 +08:00
Michael "Z" Goddard
ff7b575114
Dynamically load music extension manifest
2018-05-04 15:47:48 -04:00
kchadha
16c6868779
Merge pull request #1110 from kchadha/sprite-upload
...
Support for Sprite Upload
2018-05-04 14:56:31 -04:00
Karishma Chadha
3db2083294
Address PR comment.
2018-05-04 14:48:29 -04:00
Karishma Chadha
8cdc9dc2cd
Updating vector should make bitmap resolution 1.
2018-05-04 14:39:20 -04:00
Karishma Chadha
0156dd139d
Do not delete bitmap resolution property when vector is edited because there are other things that still rely on it.
2018-05-04 13:37:07 -04:00
Karishma Chadha
9b1aa7d7c7
Move comments
2018-05-04 11:00:45 -04:00
Karishma Chadha
55352e88b1
Tests and cleanup of addSprite3 so that .sprite3 format does not need to be nested inside an extra {targets: ...}
2018-05-04 11:00:45 -04:00
Karishma Chadha
9cc34d7406
Fix attribute of block so that it doesn't have errors if referenced target doesn't exist.
2018-05-04 11:00:45 -04:00
Karishma Chadha
adf7571851
Add API to generically validate and add sprite based on validation results.
2018-05-04 11:00:45 -04:00
Michael "Z" Goddard
8e252f2d7d
Use arraybuffer-loader in place of buffer-loader
2018-05-03 18:58:59 -04:00
Eric Rosenbaum
4cee734cde
Merge pull request #1008 from towerofnix/itemnum-vm
...
Implement "item # of (thing) in (list)" block
2018-05-03 18:08:31 -04:00
Eric Rosenbaum
9979391200
Merge pull request #1085 from ericrosenbaum/feature/key-droppability
...
Re-write keyboard IO for droppability support
2018-05-03 11:10:24 -04:00
Eric Rosenbaum
49802688dd
Move key name strings to top
2018-05-02 15:34:17 -04:00
Eric Rosenbaum
23dd898daf
Use obj.map (can’t use obj.values)
2018-05-02 09:52:04 -04:00
DD Liu
5e6873628e
Merge pull request #1082 from fsih/updateBitmap
...
Add updateBitmap function. getCostume can now serve bitmaps as well as svgs
2018-05-01 17:05:34 -04:00
kchadha
54ee628b27
Merge pull request #1099 from towerofnix/scrollcompat-vm
...
"Implement" scroll blocks
2018-05-01 15:52:42 -04:00
kchadha
2b6f96ae0a
Merge pull request #1096 from towerofnix/warpspeed-vm
...
Implement "all at once" block
2018-05-01 15:43:37 -04:00
kchadha
3161831890
Merge pull request #1102 from towerofnix/misc-noop-vm
...
"Implement" miscellaneous no-op obsolete blocks
2018-05-01 15:42:53 -04:00
Florrie
25bb4bc82c
Remove doNothing method
2018-05-01 14:00:34 -03:00
Florrie
97a9b37843
Remove doNothing methods
2018-05-01 13:58:09 -03:00
Florrie
8d13bf3662
Add comment explaining all-at-once
2018-05-01 13:43:32 -03:00
kchadha
ae8c1e0ebf
Merge pull request #1101 from towerofnix/loud-vm
...
Implement "loud?" block
2018-05-01 10:19:26 -04:00
Eric Rosenbaum
85ac307261
Access key name strings from a getter
2018-05-01 09:01:36 -04:00
Mx Corey Frang
08a992f28d
Add a project to benchmark sensing_touchingobject vs other sprites ( #1094 )
2018-05-01 08:57:16 -04:00
Mx Corey Frang
dbdee0ca8b
Fix downloadProjectId method ( #1093 )
...
* Fix downloadProjectId method
* use .data not .data.buffer
2018-05-01 08:56:22 -04:00
Andrew Sliwinski
326d1c491a
Merge pull request #1086 from mortendybdal/feature/add-sprite-3
...
Included a function to add sprite 3 to vm
2018-05-01 08:38:08 -04:00
Morten Dybdal
41be65ba4d
Fixing js linting issues
2018-05-01 13:23:21 +02:00
Florrie
8c2d023925
Implement set/change stretch blocks
2018-04-30 21:29:34 -03:00
Florrie
fe13f30037
Lint
2018-04-30 21:04:50 -03:00
Florrie
231402fc53
Implement 'hide all sprites' and 'user id' blocks
2018-04-30 21:03:35 -03:00
DD
bd772e5f77
Remove bitmap resolution from svgs
2018-04-30 19:58:48 -04:00
Florrie
8e271c70d0
Implementation + tests for loud? block
2018-04-30 19:50:13 -03:00
Eric Rosenbaum
fbeaec600c
Detect arrow keys on Windows Edge
2018-04-30 17:06:23 -04:00
Eric Rosenbaum
64869e5a87
Check for “ “ (the space char)
2018-04-30 17:05:33 -04:00
Florrie
62b8dd93af
Spec maps for scroll blocks + "implementations"
2018-04-30 17:45:35 -03:00
DD
78cd327237
Move the place where we divide rotation center by resolution into the VM. Also revert the method of putting data into storage to the one that was convoluted but working
2018-04-30 16:35:24 -04:00
Paul Kaplan
8a9818d0d4
Merge pull request #1098 from paulkaplan/fix-say-bounds
...
Use renderer bounds instead of stage bounds for positioning bubbles.
2018-04-30 15:14:08 -04:00
Paul Kaplan
6c59ccbe1b
Use renderer bounds instead of stage bounds for positioning bubbles.
...
Instead of using the rendered bounds of the stage (which can be larger than the actual rendering area of the stage due to large costumes), use the `nativeSize` which is the size in scratch coords of the rendering area. Note that `nativeSize` is not the size of the canvas element or anything like that, it is the "logical size", i.e. the [width, height] in scratch coords.
2018-04-30 14:26:25 -04:00
Paul Kaplan
3f97ccc8ce
Remove the "optimization" for
2018-04-30 13:40:36 -04:00
Paul Kaplan
e4c109c0c8
Merge branch 'develop' into fix-say-flickering
2018-04-30 13:25:35 -04:00
Florrie
b6cb198144
Implement all-at-once block
2018-04-30 12:18:38 -03:00
Ray Schamp
23e72525bf
Merge pull request #1065 from mzgoddard/push-reported-again
...
Push reported again. Now with empty boolean support!
2018-04-30 09:36:32 -04:00
kchadha
8e65b3d80f
Merge pull request #1092 from kchadha/refactor-video-io
...
Refactor Video IO
2018-04-30 09:27:10 -04:00
Karishma Chadha
857f77c511
Addressing PR comments.
2018-04-29 19:52:21 -04:00
DD
9f0f2fcd27
Pass a data uri
2018-04-27 17:23:30 -04:00
Eric Rosenbaum
743135beb4
Merge branch 'develop' of https://github.com/LLK/scratch-vm into feature/key-droppability
2018-04-27 14:59:35 -04:00
Paul Kaplan
ad4f5652e4
Merge pull request #1088 from paulkaplan/fix-say-timing
...
Track say/thinks per target so they can maintain correct timing.
2018-04-27 11:10:12 -04:00
Paul Kaplan
c2bb1e3123
Add comment to jsdoc typedef where it belongs.
2018-04-27 09:21:38 -04:00
Karishma Chadha
271a19c05d
Add runtime/render related functionality back to VM.
2018-04-26 19:17:41 -04:00
DD
b2aa87da77
fix lint
2018-04-26 18:43:49 -04:00
DD
009253a8d1
Code review
2018-04-26 18:34:35 -04:00
DD
3a3d807cba
switch polyfill to one that doesn't break tests
2018-04-26 15:14:51 -04:00
DD
c73b06a254
add polyfill
2018-04-26 15:14:51 -04:00
DD
f1e70c430f
updateBitmap
2018-04-26 15:14:51 -04:00
Andrew Sliwinski
1ed5d57c98
Merge pull request #1087 from thisandagain/bugfix/974
...
Cast 'create clone' argument to string
2018-04-26 14:57:32 -04:00
DD
fc36ea5208
Rename getCostumeSvg to getCostume
2018-04-26 13:36:51 -04:00
Karishma Chadha
5f4139cbe4
Use video provider instead of making call to getUserMedia directly.
2018-04-26 13:24:31 -04:00
Paul Kaplan
3019d05181
Fix issue where say bubble flickers during conversation.
...
The fix for this involves something of hack where we decide whether to use the optimization that prevents "typewriter" style projects (say for 0.05s in a loop) based on the amount of time the block is going to run for. A full fix of this can only be achieved if the text bubble renders synchronously.
2018-04-26 13:03:57 -04:00
Paul Kaplan
50708c15e4
Track say/thinks per target so they can maintain correct timing.
2018-04-26 11:29:24 -04:00
Andrew Sliwinski
218725d771
Cast 'create clone' argument to string. Resolves GH-974
2018-04-26 10:29:29 -04:00
Morten Dybdal
d033271a1f
Included a function to add sprite 3 to vm
2018-04-26 10:59:53 +02:00
Eric Rosenbaum
999fb10d15
Re-write keyboard IO for droppability support
2018-04-25 11:58:50 -04:00
Michael "Z" Goddard
1c68b543df
Comment execute's BlocksExecuteCache usage
...
Explain how BlocksExecuteCache helps speed up execute by storing values from
Blocks and one-time derived values on an object that is released when Blocks is
edited in the editor. The one time created cache object for a block then
simplifies the complexity of later javascript operations to use these stored
values.
2018-04-24 19:05:44 -04:00
Michael "Z" Goddard
02dd9a8c22
Unset justReported after reading its value
...
Avoid justReported values leaking to other argValues by setting back to the
default null value.
2018-04-24 19:05:20 -04:00
kchadha
cde801bc17
Merge pull request #1075 from kchadha/load-costume-no-metadata
...
Load costume without metadata
2018-04-23 17:52:04 -04:00
Eric Rosenbaum
2590cf53e7
wip
2018-04-23 17:49:01 -04:00
Andrew Sliwinski
eeab0695d6
Merge pull request #1079 from thisandagain/bugfix/1072
...
Various refinements to Video Motion extension
2018-04-23 17:04:17 -04:00
Paul Kaplan
f118e912bf
Merge pull request #1081 from paulkaplan/fix-stage-clicks
...
Activate stage click hats if no other sprites are clicked
2018-04-23 14:47:26 -04:00
Paul Kaplan
978906d926
Activate stage click hats if no other clicks are hit.
...
Also check the bounds before to make sure clicks are inside the stage bounds.
2018-04-23 14:25:58 -04:00
Andrew Sliwinski
add879ab0a
Enable video layer when loading extension. Resolves GH-1072
2018-04-23 13:03:56 -04:00
Andrew Sliwinski
ced4de8995
Flip sort order of sensing object menu in video motion extension. Resolves GH-1074
2018-04-23 13:00:20 -04:00
Andrew Sliwinski
717ac46bbd
Reorder video motion blocks. Resolves GH-1073
2018-04-23 12:57:14 -04:00
Karishma Chadha
af7ed61016
Fix bitmap support. In Scratch 3.0, we are defaulting to bitmapResolution = 2 for all costumes.
2018-04-22 21:22:03 -04:00
Karishma Chadha
e1d9df3b1b
Undo an unnecessary change from the last commit.
2018-04-20 18:11:14 -04:00
Karishma Chadha
dfa3408add
Update sound dataFormat after editing
2018-04-20 14:13:57 -04:00
Andrew Sliwinski
968643ed16
Merge pull request #1069 from thisandagain/bugfix/underscore
...
Replace extension delimiter with '_'
2018-04-20 11:46:25 -04:00
Paul Kaplan
0f16e2fe65
Merge pull request #1070 from paulkaplan/fix-bubbles
...
Fix drag and empty costume bugs with say bubbles
2018-04-20 11:43:15 -04:00
Andrew Sliwinski
192084e0e7
Do not load extension if prefix is undefined
2018-04-20 11:36:16 -04:00
Andrew Sliwinski
fd97892eb1
Remove console log
2018-04-20 10:58:35 -04:00
Andrew Sliwinski
57b7e9916d
Resolve issue with SB2 import
2018-04-20 10:58:03 -04:00
Andrew Sliwinski
645a42b843
Address feedback from review
2018-04-20 10:49:06 -04:00
Paul Kaplan
393b5d54df
Handle positioning bubbles for empty costumes
2018-04-20 10:45:54 -04:00
Paul Kaplan
54d5be8bba
Do not bother repositioning bubbles for invisible sprites
2018-04-20 10:45:34 -04:00
Paul Kaplan
9782c137bb
Use the new general target visual change for updating bubbles.
2018-04-20 10:44:55 -04:00
Paul Kaplan
c36ff056a2
Add new event for all visual target changes, not just moving.
2018-04-20 10:43:45 -04:00
Andrew Sliwinski
9ec3d41ea1
Clarify 'core' list for SB2 import
2018-04-20 10:34:17 -04:00
Andrew Sliwinski
f86cad3305
Replace extension delimeter with '_'
2018-04-20 07:54:02 -04:00
Karishma Chadha
54b52ba96c
Use calculated rotation center from renderer when rotation center is not provided with the costume being loaded.
2018-04-20 00:04:08 -04:00
Karishma Chadha
d6f28f2266
Correct what is being passed into scratch-render if some metadata (rotationCenter, bitmapResolution) is missing.
2018-04-18 14:21:29 -04:00
kchadha
47a2d76a14
Merge pull request #1060 from kchadha/fix-sound-metadata
...
Update sound metadata and retrieve mp3 correctly from storage
2018-04-17 11:02:56 -04:00
Michael "Z" Goddard
d04d6b2c6a
Revert "Revert "Push reported""
...
This reverts commit 107adad647
.
2018-04-16 13:21:53 -04:00
Paul Kaplan
5b9dc4df77
Merge pull request #1061 from kchadha/video-transparency-save-load-fix
...
Fix video transparency save/load issue.
2018-04-13 13:58:19 -04:00
Karishma Chadha
bd0bcb9395
video transparency should be a number.
2018-04-13 13:47:05 -04:00
Paul Kaplan
d42135a40a
Merge pull request #1057 from thisandagain/bugfix/1056
...
Rename pen 'clear' to 'erase all'
2018-04-13 13:26:54 -04:00
Paul Kaplan
aff8f93999
Change displayed name to Video Motion
2018-04-13 12:52:46 -04:00
Karishma Chadha
e71e51866f
Fix typo.
2018-04-13 11:28:04 -04:00
Karishma Chadha
dca9270730
Use sound returned from audio engine to set sample rate and sample count since the sound gets resampled by the audio engine. Also, check for an mp3 format in deserialize assets, and otherwise default to wav.
2018-04-13 11:20:16 -04:00
Paul Kaplan
0838f6c875
Remove duplicate play
2018-04-13 11:12:44 -04:00
Paul Kaplan
c46d1157fa
Slicing array buffers with no args throws on Safari
2018-04-13 11:08:32 -04:00
Paul Kaplan
71333765c9
Use new mediaDevices API for getUserMedia
2018-04-13 11:08:32 -04:00
Andrew Sliwinski
6f80403e8a
Rename pen 'clear' to 'erase all'. Resolves GH-1056
2018-04-13 10:53:13 -04:00
kchadha
0e0d09c235
Merge pull request #1042 from mzgoddard/target-video-state
...
Configure video device with stage video settings
2018-04-13 09:12:25 -04:00
Andrew Sliwinski
3ac2922a07
Merge pull request #1028 from mzgoddard/motion-detect-4
...
Motion detect 4
2018-04-13 08:16:34 -04:00
kchadha
8739a524eb
Merge pull request #1031 from kchadha/block_serialization_compression
...
Block serialization compression
2018-04-11 19:17:42 -04:00
kchadha
7311b103fa
Merge pull request #1045 from kchadha/broadcast-message-shadow-fix
...
Fix import of broadcast block empty string obscured shadow import
2018-04-11 18:13:20 -04:00
Michael "Z" Goddard
8ebd659094
Use string enumerated values for videoSensing sensor block
2018-04-11 10:30:58 -04:00
Karishma Chadha
6c538d0659
Sounds should still get loaded from storage even if there is not an audio engine present. This is analagous to costumes getting loaded even if there is no renderer present.
2018-04-11 10:28:22 -04:00
Michael "Z" Goddard
cef9f58c2a
Set video device state and transparency from values in stage
...
Set the video device state and transparency to the values in the stage target
when the video sensing extension is loaded. Changing video state and
transparency from the extension's blocks will also store that setting to the
stage target.
2018-04-11 10:15:53 -04:00
Michael "Z" Goddard
b9911332c7
Default stage.videoState to ON
...
Set to ON, adding a video extension when a user selects a video extension in
the gui, the video extension will use stage.videoState to turn on the video
device. Adding a video extension as part of loading a project, the stage's
videoState will be set to the stored value in the project's saved data, and the
extension will set the video device's state with that saved value.
2018-04-11 10:15:52 -04:00
Michael "Z" Goddard
044370790c
Merge pull request #1016 from gnarf/io-video
...
Video IO Device Implementation
2018-04-11 10:14:56 -04:00
Paul Kaplan
f23b5a9625
Merge pull request #1041 from paulkaplan/fix-clone-drag
...
Only select the original target after a drag.
2018-04-11 10:04:25 -04:00
Paul Kaplan
64c2d1f7b1
Merge pull request #1038 from paulkaplan/skin-size
...
Attach the costume size to the costume when loaded and modified
2018-04-11 09:30:02 -04:00
Paul Kaplan
2478f2ff8b
Merge pull request #1040 from paulkaplan/filter-dragging-touching
...
Filter out dragging targets from touching sprite check.
2018-04-11 09:17:52 -04:00
Paul Kaplan
4a9adcc3d9
Make stopDrag deal with bare targets and add tests
2018-04-11 09:12:43 -04:00
Karishma Chadha
6f3c84bf77
Ensure we are serializing file extensions for costumes and sounds as lower case.
2018-04-10 17:01:31 -04:00
Karishma Chadha
585a46f334
Add one last pass to block serialization to remove orphan primitive shadow blocks.
2018-04-10 16:55:27 -04:00
Karishma Chadha
0df937f5c0
Adding a bit more clarification to comment.
2018-04-10 16:53:07 -04:00
Karishma Chadha
18c1a20eaa
Remove unnecessary comments.
2018-04-10 15:44:32 -04:00
Karishma Chadha
2f53996c9c
Switch video flipped string back to hyphen.
2018-04-10 15:43:29 -04:00
Chris Willis-Ford
631d7fb4de
Merge pull request #1021 from cwillisf/features-for-control-extension
...
Features for control extension
2018-04-10 12:17:43 -07:00
Karishma Chadha
a4d9ff9266
Fix issue with importing broadcast block with obscured empty string shadow.
2018-04-10 15:16:18 -04:00
Michael "Z" Goddard
461d523729
Add block comments to videoSensing.videoToggle and setVideoTransparency
2018-04-10 14:34:27 -04:00
Michael "Z" Goddard
d4037808a7
Add VideoState enum to Scratch3VideoSensingBlocks
2018-04-10 14:34:27 -04:00
Paul Kaplan
da539ea6cd
Only select the original target after a drag.
...
This allows you to still drag clones around, but when you stop dragging,
the original sprite gets selected.
2018-04-10 14:31:49 -04:00
Paul Kaplan
92d00b5944
Filter out dragging targets from touching sprite check.
...
This introduces an asymmetry that matches the Scratch 2 behavior, that
is, a sprite that is being dragged can detect other sprites using
touching <sprite>, but cannot be detected by other sprites while it is
being dragged.
2018-04-10 14:20:51 -04:00
Corey Frang
fe7aa8a78f
Add @param documentation for the frameInfo descriptor param
2018-04-10 13:59:23 -04:00
Corey Frang
a86202b8e2
make onError a prototype method
2018-04-10 13:59:23 -04:00
Corey Frang
0180964333
Simplify setup method promise, add onError
2018-04-10 13:59:23 -04:00
Corey Frang
89dd4720a4
store ghost state so previews will use last value whenever setup
2018-04-10 13:59:23 -04:00
Corey Frang
d0a71dcaf9
store the ghost effect in case preview is setup after it was last set
2018-04-10 13:59:23 -04:00
Corey Frang
e20723994f
fix sb2 conversion to load into correct VIDEO_STATE
2018-04-10 13:59:22 -04:00
Corey Frang
9cd5e4da2b
Reduce indentation waterfall
2018-04-10 13:59:22 -04:00
Corey Frang
f3a956af2b
add enabled state tracking, disable state waits for setup complete
2018-04-10 13:59:22 -04:00
Corey Frang
ce03e978dc
stop the track in the "on-off" scenario
2018-04-10 13:59:22 -04:00
Corey Frang
825ff22fa4
Guard against some issues that could happen with enable/disable video quickly
2018-04-10 13:59:22 -04:00
Corey Frang
f19ae793c0
enableVideo - get rid of "requests"
2018-04-10 13:59:22 -04:00
Corey Frang
efa6b3a069
stop track
2018-04-10 13:59:22 -04:00
Corey Frang
46b4ef4d80
Use a global mirror state
2018-04-10 13:59:21 -04:00
Corey Frang
90166dc732
Add extra control blocks for video transparency and on/off control
2018-04-10 13:59:21 -04:00
Corey Frang
e4bd9cf6b2
Move methods around to sort the public interface nearer the top
2018-04-10 13:57:54 -04:00
Corey Frang
992e884668
Make disableVideo a public method
2018-04-10 13:57:54 -04:00
Corey Frang
d512042415
Add set preview ghost
2018-04-10 13:57:54 -04:00
Corey Frang
da05e673fa
_singleSetup makes more sense
2018-04-10 13:57:54 -04:00
Corey Frang
c10696f88c
Rewrite the setup/disable process from review comments
2018-04-10 13:57:53 -04:00
Corey Frang
eef88f6c2d
First draft of video IO device
2018-04-10 13:57:53 -04:00
Michael "Z" Goddard
cd7e03f0f6
Merge pull request #1019 from mzgoddard/motion-detect-3
...
Test VideoMotion and VideoSensing blocks
2018-04-10 13:06:58 -04:00
Paul Kaplan
89eb1ce39b
Set the costume asset size when a costume is loaded or modified.
2018-04-10 09:51:29 -04:00
Paul Kaplan
f29482957c
Change getSkinSize to getCurrentSkinSize for renderer update.
2018-04-10 09:50:18 -04:00
Christopher Willis-Ford
53b5ba93f5
Add tests for converting extension metadata
...
These tests convert some extension metadata into scratch-blocks JSON and
XML, then verify that the JSON and XML are as expected.
2018-04-09 15:37:08 -07:00
kchadha
d177f4cd0c
Merge pull request #1033 from towerofnix/counter-vm
...
Implement counter blocks
2018-04-09 13:55:35 -04:00
kchadha
b794e19c31
Merge pull request #1032 from towerofnix/while-vm
...
Implement "while" block
2018-04-09 13:48:08 -04:00
Florrie
797d16be26
Implement counter blocks
2018-04-07 16:02:49 -03:00
Florrie
c57d0c94eb
Add implementation for while
2018-04-07 14:04:00 -03:00
Florrie
27d053acff
Add doWhile -> control_while to specmap
2018-04-07 14:04:00 -03:00
Michael "Z" Goddard
d3ff8b5eed
Test VideoMotion and VideoSensing blocks
...
- Add pngjs dev dependency to read test images
2018-04-06 18:09:50 -04:00
Karishma Chadha
9ce6040b0f
Fix lint error...
2018-04-06 16:57:52 -04:00
Karishma Chadha
1861b5a262
Can't have hyphens in identifiers.
2018-04-06 16:51:46 -04:00
Karishma Chadha
e92db8fa1e
Don't really need level 9 compression.
2018-04-06 15:47:24 -04:00
Karishma Chadha
44b1a2f798
List limit should apply to insert block as well.
2018-04-06 15:31:10 -04:00
Karishma Chadha
5d46f8de99
Not providing a zip to deserialize asset functions is not an error.
2018-04-06 15:04:03 -04:00
Michael "Z" Goddard
0591b475f2
Merge pull request #1020 from gnarf/sb2-spec-when-video-motion
...
Allow specmap to have methods to branch into multiple sb3 opcodes
2018-04-06 14:28:17 -04:00
Eric Rosenbaum
25f1c1a5e6
Merge pull request #1017 from ericrosenbaum/bugfix/clones-inherit-instrument
...
Clones inherit music custom state
2018-04-06 13:38:03 -04:00
Karishma Chadha
8c1e6095cb
Remove code that was temporarily accomodating for the old version of the default project in gui.
2018-04-06 11:33:44 -04:00
Karishma Chadha
4ec25b32b1
Code cleanup and commenting.
2018-04-06 11:33:44 -04:00
Karishma Chadha
9892dac904
Custom state (e.g. tempo, volume, video related state) should show up in a target that has been 'flattened' via JSON.stringify.
2018-04-06 11:33:44 -04:00
Karishma Chadha
2dbcdc2244
The stage should always be called 'Stage'.
2018-04-06 11:33:44 -04:00
Karishma Chadha
b436b5fd82
Add a limit to the number of items a list can have. No-op on 'addToList' block if trying to add to a list that is already at the limit.
2018-04-06 11:33:44 -04:00
Karishma Chadha
6c0d257a63
Deserialize tempo, volume, and video related state.
2018-04-06 11:33:44 -04:00
Karishma Chadha
4dd83cf717
Todo comment for clarity...
2018-04-06 11:33:44 -04:00
Karishma Chadha
118c6f0356
Use bitmap asset type and 'png' for various costume formats.
2018-04-06 11:33:44 -04:00
Karishma Chadha
d61ea23e1e
Deserialize compressed primitives.
2018-04-06 11:33:44 -04:00
Karishma Chadha
21d60604ac
Some block serialization compression -- compress primitives. This is a WIP since we don't deserialize blocks serialized in this way.
2018-04-06 11:33:44 -04:00
Karishma Chadha
334058b081
Block and variable compression. No need to serialize uid of block and shadow if they are the same, reduce duplication of information.
2018-04-06 11:33:44 -04:00
kchadha
4b62a938c4
Merge pull request #1000 from kchadha/deserialize-assets-in-sb2
...
Deserialize sb2 assets while loading local .sb2.
2018-04-06 11:33:00 -04:00
Ray Schamp
efb1bdb1ea
Remove video motion icon until we have one
2018-04-06 09:55:16 -04:00
Michael "Z" Goddard
91747fd229
Add back missing Scratch3VideoSensingBlocks.INTERVAL
...
The INTERVAL time defines how often to analyze a frame. Without the value the
test whether a frame should be analyzed will always be false.
2018-04-05 17:47:07 -04:00
Corey Frang
78199c41a5
Allow specmap to have methods to branch into multiple sb3 opcodes
2018-04-05 15:39:41 -04:00
Christopher Willis-Ford
3be16eddb1
Add code to load 'core' extensions
2018-04-05 12:20:03 -07:00
Christopher Willis-Ford
f8db6c3f02
Support extension translation
...
The new `maybeFormatMessage` function detects whether its argument
looks like a message descriptor object and, if so, will call
`formatMessage` on it. This is now used for all user-visible text fields
in extensions.
Also, messages may use "select" to check the target type with a message
like this: '{targetType, select, stage {text for stage} sprite {text for
sprite} other {text for other}'. Note that the "other" clause is
required by `formatMessage`.
2018-04-05 12:17:05 -07:00
Eric Rosenbaum
2a90e5868d
Fix runtime scope and unit test
2018-04-05 15:01:52 -04:00
Ray Schamp
41955913aa
Merge pull request #1007 from mzgoddard/motion-detect-2
...
Motion detect 2
2018-04-05 11:59:59 -04:00
Eric Rosenbaum
88b13e218d
Clones inherit music custom state
2018-04-05 11:27:54 -04:00
Christopher Willis-Ford
defdd42c47
Add TargetType enum for use by/with extensions
2018-04-04 23:45:26 -07:00
Christopher Willis-Ford
de9e2be265
Add EVENT extension block type
...
An EVENT block is like a HAT block but it has no implementation
function. Its stack runs when the VM emits the corresponding event.
2018-04-04 23:44:59 -07:00
Christopher Willis-Ford
af058b8146
Support LOOP and CONDITIONAL blocks in extensions
...
A LOOP block is like a conditional, but the LOOP block will be
re-evaluated after any child branch runs.
Also:
- Support using '---' as a block separator
- Refactor common code from `_registerExtensionPrimitives` and
`_refreshExtensionPrimitives` into new `_fillExtensionCategory`
- Improve error reporting during block conversion
2018-04-04 22:19:48 -07:00
Eric Rosenbaum
21ae14c499
Merge pull request #1014 from ericrosenbaum/bugfix/video-state
...
Import and store video state
2018-04-04 19:59:14 -04:00
Eric Rosenbaum
5dc8e51c6d
Import and store video state
2018-04-03 16:36:58 -04:00
Michael "Z" Goddard
d4bffcbddb
Rename playground/motion.html to video-sensing.html
2018-04-03 16:19:52 -04:00
Michael "Z" Goddard
6d2c29530f
Document VideoMotionView
2018-04-03 16:19:52 -04:00
Michael "Z" Goddard
9a2e937271
Document VideoMotion class
...
- Rename video_sensing/lib.js to video_sensing/library.js
2018-04-03 16:19:52 -04:00
Michael "Z" Goddard
a32b15a8f9
Add VideoSensing math module
...
- motionVector takes motion component and returns a 2d vector
- scratchAtan2 takes a y and x value and returns an angle in degrees
referencing Scratch's coordinate system
2018-04-03 16:19:52 -04:00
Michael "Z" Goddard
b46c956203
Comment items in Scratch3VideoSensingBlocks
2018-04-03 16:19:51 -04:00
Michael "Z" Goddard
c291a04cc7
Add file comment block to video_sensing/debug.js
2018-04-03 16:19:51 -04:00
Michael "Z" Goddard
e65b7985cb
Add whenMotionGreaterThan hat block to video sensing ext
2018-04-03 16:19:51 -04:00
Michael "Z" Goddard
cfd74a7c7f
Add checkboxes for each video sensing debug view
2018-04-03 16:19:51 -04:00
Michael "Z" Goddard
b012d60689
Add video sensing debug C_CELL and AB_CELL views
...
- Rename UV to UV_CELL, UV cannot be rendered in a non-cell format
Modify C and AB views as well to better represent in color the work being done.
If you watch the debug views with XY_CELL, AB_CELL, C_CELL, and UV_CELL you can
see how AB_CELL and C_CELL affect UV_CELL in similar color patterns.
2018-04-03 16:19:51 -04:00
Michael "Z" Goddard
0a58a6d806
Merge pull request #1001 from mzgoddard/motion-detect
...
Motion detect
2018-04-03 16:19:26 -04:00
Florrie
b861c78086
Implement 'get item # of (thing) in (list)'
2018-03-31 13:25:50 -03:00
Michael "Z" Goddard
f3d19dc1a1
Use videoSensing extension for sb2 senseVideoMotion
2018-03-29 19:02:07 -04:00
Michael "Z" Goddard
c206dc3241
Add motion playground page for debugging video sensing
2018-03-29 19:02:07 -04:00
Paul Kaplan
2d9bd92140
Merge pull request #930 from ericrosenbaum/bugfix/loudness-performance
...
Only measure loudness once per step
2018-03-29 16:27:10 -04:00
Michael "Z" Goddard
3c473f6ba8
Translate scratch 2 video sensing into scratch 3 extension
...
- Add videoSensing extension to extension-manager
2018-03-29 15:15:11 -04:00
kchadha
51306e3492
Merge pull request #963 from towerofnix/foreach-vm
...
Implement for-each block
2018-03-28 10:52:14 -04:00
Karishma Chadha
b8e67a7727
Hookup sb2 import code to deserialize assets from local sb2 file.
2018-03-25 18:14:30 -04:00
Paul Kaplan
13641297fd
Merge pull request #996 from paulkaplan/fix-bubble-bounds
...
Position the speech bubble more tightly.
2018-03-23 14:36:52 -04:00
Paul Kaplan
ea534b35ea
Position the speech bubble more tightly.
2018-03-23 10:51:19 -04:00
kchadha
dbc7b9597f
Merge pull request #979 from kchadha/serialization-cleanup
...
SB3 Serialization & Load Project
2018-03-23 10:11:49 -04:00
Paul Kaplan
a27ed888d2
Merge pull request #992 from paulkaplan/stage-clicked
...
Make "when clicked" blocks target dependent.
2018-03-23 09:20:22 -04:00
Chris Willis-Ford
9dc3df1fda
Merge pull request #994 from cwillisf/looks-extension-support
...
Looks extension support
2018-03-22 15:16:21 -07:00
Florrie
1db4a2c7a7
Compatibility implementation
2018-03-22 18:55:36 -03:00
Eric Rosenbaum
4e3c5c7f2e
Merge pull request #991 from ericrosenbaum/bugfix/clones-share-activesoundplayers
...
Clones share their parent’s activeSoundPlayers object
2018-03-22 16:49:04 -04:00
Karishma Chadha
c4ad76eef1
Turns out ArrayBuffers are not views of themselves.
2018-03-22 16:19:36 -04:00
Karishma Chadha
3a4f620318
Check if loadProject input is any typed array using ArrayBuffer.isView. This allows us to pass a project's asset.data (from storage) directly instead of calling toString on it first.
2018-03-22 14:04:58 -04:00
Karishma Chadha
2c3e3472ed
Add warning to 'fromJSON' function since it is now just a wrapper around loadProject. Change vm sb3_serialization test to use 'loadProject' function instead of 'fromJSON'.
2018-03-21 17:55:02 -04:00
Karishma Chadha
ce6ef92eb5
Clear runtime after validation success instead of before.
2018-03-21 17:46:39 -04:00
Karishma Chadha
ab863096cd
Remove cruft and fix for..in loops.
2018-03-21 17:42:01 -04:00
Karishma Chadha
9d3a3fd12f
When serializing md5+ext, the name should reflect that. Deserializing translates this name back to what vm and other components currently expect.
2018-03-21 16:51:40 -04:00
Karishma Chadha
24e248d4fb
Removing cruft...
2018-03-21 14:46:21 -04:00
Christopher Willis-Ford
26bc7851bb
Rename ReporterScope.SPRITE to TARGET & add JSDoc
2018-03-20 15:30:34 -07:00
Christopher Willis-Ford
d3352ac54d
Add JSDoc tags for ArgumentType & BlockType
2018-03-20 15:26:27 -07:00
Christopher Willis-Ford
1049e90a8f
Wrap extension menu function to provide context
...
When the extension system calls a function to retrieve extension menu
items, it now provides the ID of the current editing target. There's
also now a little bit of error-checking on the results.
2018-03-20 15:26:27 -07:00
Christopher Willis-Ford
2932f232c4
Improve developer feedback for missing block func
2018-03-20 15:26:12 -07:00
Christopher Willis-Ford
4201f212d3
Add JSDoc for extension metadata format
...
This is a first pass and is probably not 100% correct. It also contains
the new (experimental?) reporter scope field.
2018-03-20 15:05:21 -07:00
Christopher Willis-Ford
6a06984678
Add enum for reporter scope
...
Some reporters are sprite-specific, such as the costume name/number or
X position of the sprite. Others are global. This enum allows an
extension author to specify the scope of a reporter.
2018-03-20 15:05:21 -07:00
Paul Kaplan
140094a7ad
Make "when clicked" blocks target dependent.
...
This involves adding a new opcode, event_whenstageclicked, and adding a
method to the blocks container to update the opcode pair depending on
whether the target is the stage. This method is then called in two
places: first after the sb2 import parses the blocks (not done in the
sb2 parsing itself because no other blocks are target specific) and then
again when blocks are shared between targets.
Also added tests for the block container method, and a fixture project
that tests the opcode splitting on sb2 import.
2018-03-20 10:41:50 -04:00
Eric Rosenbaum
2b985fa083
Merge pull request #975 from ericrosenbaum/bugfix/move-volume-to-rendered-target
...
Move volume to rendered target
2018-03-19 16:45:25 -04:00
Eric Rosenbaum
2527c804ea
Clones get ref to parent’s activeSoundPlayers obj
2018-03-19 16:44:49 -04:00
Chris Willis-Ford
4c0e968bec
Merge pull request #978 from cwillisf/fix-saythink-and-wait
...
Fix say/think and wait
2018-03-19 10:36:01 -07:00
Paul Kaplan
979c8b05e0
Merge pull request #965 from bartljak/issue#960
...
fixed issue 960
2018-03-19 06:06:00 -07:00
Karishma Chadha
b4f6f24926
Fix up tests.
2018-03-16 11:43:27 -04:00
Florrie
6517bd0974
Make 'key pressed?' block import correctly
2018-03-16 11:58:25 -03:00
Karishma Chadha
003ed01015
Update VM to use scratch-parser callback interface
2018-03-15 22:40:40 -04:00
Andrew Sliwinski
1d90c82fcf
Merge pull request #945 from picklesrus/translate-extension
...
Translate extension block
2018-03-15 08:36:39 -04:00
kchadha
a3ed4cad99
Remove todo
2018-03-14 22:52:00 -04:00
kchadha
0d55e4c74f
Modifying apis to accomodate existing tests.
2018-03-14 22:52:00 -04:00
kchadha
22be2b15f3
Major refactor of project loading. Removed loadProjectLocal, in favor of going back to single API (loadProject). loadProject uses scratch-parser to unpack and validate project. Scratch-parser is getting updated to return validated project, with appended project metadata, and unpacked zip (JSZip object) if provided a buffer.
2018-03-14 22:52:00 -04:00
kchadha
2c551d1739
Some more cleanup.
2018-03-14 22:51:59 -04:00
kchadha
09c8110923
Always serialize parent and next on a block even if they're null.
2018-03-14 22:51:59 -04:00
kchadha
4f6ece9fa8
Be specific about what we're serializing. Flatten targets first by turning them into JSON strings and re-parsing them, and then only serialize the properties necessary for saving and loading.
2018-03-14 22:51:59 -04:00
Christopher Willis-Ford
4210c6dd4c
Fix stack check in stepThread
...
The previous logic seemed to be expecting `peekStack` to return 0 when
the stack was empty, but its return type is `?string` and it returns
`undefined` when the stack is empty. The `!== 0` check would never pass,
then, leading to problems with (for example) the "say/think and wait"
blocks.
2018-03-14 16:17:29 -07:00
Christopher Willis-Ford
b61c6a8f76
Don't render say/think bubbles during tests
...
This change makes say & think commands work during headless tests.
2018-03-14 16:07:05 -07:00
Eric Rosenbaum
a652156032
Sensing-of block gets target volume
2018-03-13 11:45:11 -04:00
Eric Rosenbaum
f8c2771776
Use target volume, not custom state
2018-03-13 11:43:53 -04:00
Eric Rosenbaum
a7c6c430b8
Add volume to rendered target
2018-03-13 11:43:33 -04:00
Andrew Sliwinski
2ae788ca28
Merge pull request #968 from gnarf/instanceof-fix
...
ensure this.workerClass exists before instanceof check
2018-03-12 12:45:09 -04:00
Andrew Sliwinski
6039f1b7e7
Merge pull request #969 from gnarf/fix-music-no-audio
...
Ensure music extension _decodeSound is promise
2018-03-12 12:44:16 -04:00
picklesrus
39d2559e37
Initial version of translate extension.
2018-03-11 12:18:21 -07:00
kchadha
adfbeddcab
Merge pull request #964 from kchadha/save-load
...
Preliminary Save and Load Work
2018-03-09 09:34:44 -05:00
Corey Frang
1d414dd5a0
Ensure music extension _decodeSound is promise
...
Currently if there is no audio engine detected this returns undefined,
which in turn causes the line above to fail trying to call `.then` on
it.
2018-03-08 12:32:01 -05:00
kchadha
d59a4ffd55
VM receives input buffer representing project to load and unpacks it as zip. This functionality will eventually move to storage.
2018-03-08 10:25:58 -05:00
Corey Frang
9b8a8647f0
ensure this.workerClass exists before instanceof check
...
This avoids an error I was running into in a node environment:
```
TypeError: Right-hand side of 'instanceof' is not an object
```
2018-03-07 18:13:15 -05:00
kchadha
cc2bf1dfc7
Merge pull request #957 from kchadha/mouse-up-drag-end
...
Use flag to selectively activate 'when this sprite clicked' hat on mouse up
2018-03-07 13:26:28 -05:00
Chris Willis-Ford
219f083a29
Merge pull request #934 from picklesrus/extensions-dynamic-menu
...
Extensions dynamic menu
2018-03-06 16:33:26 -05:00
Jake Bartles
11e12cca4f
fixed issue 960
2018-03-05 20:15:49 -05:00
Karishma Chadha
d6e248aab8
VM should do the heavy lifting of saving project to a zip file, and return a promise of the zip to gui.
2018-03-05 17:20:36 -05:00
Florrie
00b151b9ff
Add doForLoop to sb2 specmap
2018-03-05 17:36:17 -04:00
Karishma Chadha
c0afcd2ab3
Ensure that md5 and assetId stay in sync.
2018-03-05 15:16:06 -05:00
Karishma Chadha
605ce4b16d
Configuring scratch-vm to use changes made to scratch-parser.
2018-03-05 15:16:06 -05:00
Karishma Chadha
e0b23cde31
Can load saved sb3 files (including sounds and costumes that were modified in the 3.0 editors and saved in the sb3 zip when the project was saved). Tests still need to be fixed.
2018-03-05 15:16:06 -05:00
Karishma Chadha
089df0a50f
Sounds get updated in storage and vm runtime when they are updated in the sound editor. The updateSvg function ensures that the costume that was edited has an updated dataFormat property in the vm runtime. This is specifically for when pngs get edited in the vector editor. Their file format should then get updated to svg.
2018-03-05 15:16:06 -05:00
Karishma Chadha
52c77d9fb0
Updating asset serialization code to get data format from stored asset rather than vm state. Storage seems to be more up to date than vm in the case of editing the blank backdrop, which is stored as a png instead of an svg.
2018-03-05 15:16:06 -05:00
Karishma Chadha
525a8c2ce7
Serializing sounds and costumes into file descriptors upon 'saveProjectSb3'.
2018-03-05 15:16:06 -05:00
Florrie
928df260ff
Fix lint errors
2018-03-05 15:46:54 -04:00
Florrie
defcc45419
Implement foreach block
2018-03-05 15:36:26 -04:00
DD Liu
97d3785554
Temporarily return real costumes array. GUI currently relies on this behavior somewhere
2018-03-05 11:07:50 -05:00
picklesrus
16ecaab1be
Fix up comment.
2018-03-02 11:07:22 -08:00
picklesrus
026b9dc282
Stop wrapping function for no reason.
2018-03-02 11:02:56 -08:00
kchadha
a0c7d9aeb3
Merge pull request #956 from kchadha/validate-sb2
...
Validate sb2
2018-03-02 10:28:53 -05:00
DD
b885402081
Merge branch 'develop' into privateSprite
2018-03-01 17:27:10 -05:00
Eric Rosenbaum
5d658b5ecb
Merge pull request #953 from ericrosenbaum/bugfix/load-tempo-from-sb2
...
Load tempo from sb2
2018-03-01 13:20:37 -05:00
Eric Rosenbaum
981fc57a43
Merge pull request #950 from ericrosenbaum/bugfix/import-music-menus
...
Fix music extension menu import
2018-02-28 18:47:30 -05:00
kchadha
8bebc1f5a2
Merge pull request #952 from kchadha/duplicate-sprite-names
...
Duplicating sprite should give new sprite a fresh name.
2018-02-28 17:13:19 -05:00
Karishma Chadha
d9fb315e3b
Removing log messages.
2018-02-28 17:10:54 -05:00
Ray Schamp
4e933eed81
Merge pull request #878 from davidaylaian/reduce-peekstack-calls
...
Optimize stepThread by reducing the number of calls to peekStack
2018-02-28 16:50:20 -05:00
Karishma Chadha
d51a2ad39f
Use wasDragged flag to selectively activate 'when this sprite clicked' block on mouse up.
2018-02-28 16:45:26 -05:00
Karishma Chadha
7c7b016643
scratch-parser expects json string...
2018-02-28 11:52:22 -05:00
Karishma Chadha
59d1c2a0b3
Code cleanup and actually throw errors when project fails to load. Depends on scratch-gui loading sb3 version of default project.
2018-02-28 10:02:02 -05:00
Eric Rosenbaum
db795abfbc
Use tempo stored in stage
2018-02-27 11:48:49 -05:00
Eric Rosenbaum
7e5e43fbe1
Load tempo from sb2
2018-02-27 11:48:23 -05:00
Eric Rosenbaum
237616490f
Add tempo property to rendered target
2018-02-27 11:48:14 -05:00
Karishma Chadha
8c5c68b896
Duplicating sprite should give new sprite a fresh name.
2018-02-26 23:17:25 -05:00
Karishma Chadha
79169c81b3
Use scratch-parser to validate structure of project json files.
2018-02-26 22:43:55 -05:00
Eric Rosenbaum
651d46fff0
Add default values for obscured shadows
2018-02-26 17:28:20 -05:00
Paul Kaplan
1f3c6ac6ad
Merge pull request #939 from fsih/blockDrag
...
Block drag
2018-02-26 16:26:53 -05:00
Eric Rosenbaum
8b18ff7ae9
make inputOP, arg name and menu name the same
2018-02-26 15:56:37 -05:00
DD
9a65df4c12
Make index optional
2018-02-23 16:24:18 -05:00
DD
10789cd779
Bring in Karishmas changes from save-load to ensure the sound gets updated in storage when edited
2018-02-23 16:21:07 -05:00
DD
bb0394a668
Fix lint
2018-02-23 16:09:38 -05:00
DD
0a5ccbf42f
Use existing UID util
2018-02-23 12:07:07 -05:00
DD
8355dd662f
Switch to sending end drag event to be handled by gui
2018-02-23 11:57:19 -05:00
DD
2239d1b92b
Use promises
2018-02-23 11:09:19 -05:00
DD
75cf6407d4
Duplicate costume
2018-02-23 10:50:45 -05:00
DD
d6bcfae526
Remove costume ID
2018-02-23 10:25:14 -05:00
DD
b4d6db0ad9
Fix tests
2018-02-22 15:45:41 -05:00
DD
729fc3d303
Make sprite.costumes private so that I can enforce that when you add costumes, they get assigned a unique ID
2018-02-21 19:59:35 -05:00
DD
51fd97ee54
fix lint
2018-02-20 16:09:08 -05:00
DD
2545d1955d
Repopulate blocks with ids
2018-02-20 16:09:08 -05:00
DD
31def7d03d
Track hovered sprite. End drag may transfer blocks from one sprite to another.
2018-02-20 16:09:08 -05:00
DD
fe4b3d3c01
Pass through block drag event
2018-02-20 16:09:08 -05:00
Chris Willis-Ford
8e1719b716
Merge pull request #920 from towerofnix/scroll-detection
...
Scroll wheel detection for "when key (up/down) pressed" blocks
2018-02-16 12:21:27 -08:00
picklesrus
1910968b13
Fix lint errors.
2018-02-16 10:49:26 -08:00
Eric Rosenbaum
ca08cd69e9
Merge pull request #936 from ericrosenbaum/feature/require-music-assets
...
Feature/require music assets
2018-02-16 10:25:31 -05:00
Eric Rosenbaum
e67743a4ba
Require assets inside a try/catch
2018-02-16 10:05:54 -05:00
Eric Rosenbaum
063ac39019
Load music extension assets with require
2018-02-14 17:53:05 -05:00
Eric Rosenbaum
22038c947c
When getting sprite by name, skip the stage
2018-02-12 15:33:27 -05:00
kchadha
9675a1b8cf
Merge pull request #931 from kchadha/bugfix-912
...
Renaming sprite/costume/sound/backdrop updates corresponding blocks.
2018-02-12 11:53:50 -05:00
Paul Kaplan
8d42db7df8
Merge pull request #925 from LukeSchlangen/fix/rounding-numbers
...
round numbers but break tests
2018-02-08 08:59:54 -05:00
Luke Schlangen
45cf1f685d
add passing unit test
2018-02-07 17:49:18 -06:00
Eric Rosenbaum
33966ba582
Check for runtime.currentStepTime is null
2018-02-06 12:25:44 -05:00
Eric Rosenbaum
0a239005a9
Rename and initialize vars
2018-02-06 11:06:48 -05:00
Karishma Chadha
f5813b1845
Update sprite names, plus some code cleanup.
2018-02-05 16:54:58 -05:00
Karishma Chadha
7faeed7128
Update blocks after sound/costume rename.
2018-02-05 14:35:52 -05:00
kchadha
107adad647
Revert "Push reported"
2018-02-02 12:42:09 -05:00
Eric Rosenbaum
c661ac7cce
Only measure loudness once per step
2018-02-01 19:53:41 -05:00
Eric Rosenbaum
f78ddb2072
Change pitch effect range to -360 to 360
2018-01-31 16:44:54 -05:00
Luke Schlangen
f8dced53dc
round numbers but break tests
2018-01-31 08:23:08 -06:00
Christopher Willis-Ford
3717394f00
Playground: load renderer as UMD
...
The recent changes to the renderer's build output packaging broke this
repository's playground / benchmark suite. These changes aren't the only
way to fix the issue, but this is consistent with the way that the
storage module was already being loaded.
2018-01-29 14:04:19 -08:00
kchadha
490248f652
Merge pull request #914 from kchadha/bugfix-909
...
Keep block xml up-to-date after renaming a variable.
2018-01-29 09:30:10 -05:00
Chris Willis-Ford
188aa990f2
Merge pull request #917 from mzgoddard/push-reported
...
Push reported
2018-01-26 15:48:05 -08:00
picklesrus
b6bb92d8f6
Adding support for dynamic menus in extensions.
2018-01-26 14:36:36 -08:00
Karishma Chadha
0b2eaa9e19
Moving block updating code into blocks instead of runtime.
2018-01-26 16:58:45 -05:00
Florrie
be83c0ee74
Mouse wheel IO system
...
Towards fixing #865 . This adds an IO class for detecting the mouse wheel
being scrolled. Basic tests are included; they mock the runtime to see
what blocks are activated by scrolling.
2018-01-26 17:13:01 -04:00
Eric Rosenbaum
229cd7a50c
Merge pull request #911 from ericrosenbaum/bugfix/music-ext-safari-onended
...
Keep playing notes and drums forever on Safari
2018-01-26 13:00:56 -05:00
Michael "Z" Goddard
10acf3c4f5
Add BlocksExecuteCache
...
Add a Blocks cache available only to execute. This cache lets execute
get a blocks inputs, fields, opcode, and mutation in one request and an
object execute can further modify to store derivative values it use
this and every later execute iteration to perform its duties quicker.
2018-01-24 17:00:42 -05:00
Michael "Z" Goddard
41d6a8f925
Check if a thread's target is null in sequencer
...
Before calling execute, if a thread's target is null, retire that
thread.
This saves repeatedly checking if the thread's target is null in
recursive calls where even if scratch-gui or blocks, or some other
related library set the target to null, that will not happen during
block execution. It will happen at some time outside of the sequencer
letting the sequencer check once instead of execute checking at every
recursive level.
2018-01-24 17:00:37 -05:00
Michael "Z" Goddard
4286e3e982
Add Thread.blockContainer
...
Store the thread's blocks at blockContainer letting execute quickly
determine the block source. Monitor threads are a monitor thread. They
do not become a target thread suddenly.
2018-01-24 17:00:35 -05:00
Michael "Z" Goddard
ab8d8e5f34
Add optional recursiveCall argument to execute
...
When execute calls itself to step into the next stack level, pass
RECURSIVE to the recursiveCall level. This argument provides
opportunity to recursed calls in execute to reduce the time needed for
some checks.
- Reduce time for checking around setting
thread.requestScriptGlowInFrame
- Call thread.pushReportedValue at end of execute when in a recursive
call
A boolean check is faster than a type lookup, command blocks will only
be executed in non-recursive calls. This saves a minor amount of time
for any result reporting blocks like blocks that get variables or add
two inputs together.
If the block is not returning a promise and execute is a recursed call,
that implies that the block is neither a hat or that the thread is not
at the top. That reduces handleReport to pushReportedValue. Using the
recursiveCall argument the final block calling handleReport can
shortcut the extra work in handleReport and reduce it to immediately
calling pushReportedValue.
2018-01-24 17:00:24 -05:00
Michael "Z" Goddard
6b7582f1c7
Report block result to stackFrame.justReported
...
- Add stackFrame.justReported
Report the block result to a known key `justReported` instead of a
dynamic key on `reported`. Assuming blocks with a promised value are
relatively infrequent the most common recursive input flow immediately
reads the value "just" reported. In the assumed uncommon case of a
promised thread status, empty the already argValues assigned values
onto the currentStackFrame's reported member. In the next execute call
on this stackFrame, values assigned to reported are read back off onto
argValues, and execute will returned to the assumed common case. This
is a safe assumption since a thread in the promise state will not exit
that state until the next frame when javascript has a chance to call
the resolve handle, setting the thread's state back to another
executable state.
Using direct assignment to `justReported` saves building an object
dynamically. Instead of always building `reported` and `argValues` only
`argValues` is built until a promised state is reached. This also gives
a known time when `reported` is used, allowing cleanup of a
stackFrame's reported to only happen when it was used to persist
already reported values.
2018-01-24 17:00:12 -05:00
Florrie
6c2e0338a1
Fix eslint whitespace error
2018-01-23 18:36:33 -04:00
Florrie
8f0130e439
Automatically create asset for generated 'flattened' image
2018-01-23 18:34:28 -04:00
Florrie
9180f9cc24
Fix eslint errors
2018-01-23 16:10:39 -04:00
Eric Rosenbaum
115184a2a3
Merge pull request #891 from ericrosenbaum/bugfix/audioplayer-clone-state
...
Audio effects state for clones
2018-01-23 11:55:39 -05:00
Florrie
ad96ec952b
Fix 'promsie' typo in docs for loadOldTextCostume
2018-01-23 12:07:03 -04:00
Florrie
78c54852c6
Merge base/text layers
2018-01-23 12:03:39 -04:00
Florrie
430dbf0bd6
Remove old dead import file
2018-01-23 11:53:23 -04:00
Florrie
287222f7ed
Merge branch 'develop' of https://github.com/LLK/scratch-vm into old-text-costumes
2018-01-23 11:37:03 -04:00
Eric Rosenbaum
275b0c7944
Get customState but don’t create it
2018-01-22 16:38:45 -05:00
Karishma Chadha
784341909b
Update block xml for all blocks that use a variable that was just renamed.
2018-01-22 15:14:43 -05:00
Eric Rosenbaum
073ee84a91
Keep bufferSource refs so onended fires on safari
2018-01-22 11:57:06 -05:00
Eric Rosenbaum
9eaf67b504
Fix eslint-disable-line
2018-01-22 10:27:16 -05:00
Eric Rosenbaum
4778ab8d4f
Fix music extension asset loading on safari
2018-01-22 10:15:41 -05:00
Ray Schamp
cc1923f982
Merge pull request #901 from mzgoddard/benchmark-prototype
...
Benchmark prototype
2018-01-19 13:52:13 -05:00
Paul Kaplan
90e9e1c0b0
Merge pull request #889 from paulkaplan/fix-mouse-positions
...
Fix mouse positions for different stage zoom levels
2018-01-17 13:49:23 -05:00
Michael "Z" Goddard
4d4966cba9
Save and compare results, show individual results in iframe
2018-01-17 12:25:07 -05:00
Michael "Z" Goddard
775d38d8d5
Truncate benchmark selfTime and totalTime values
2018-01-17 12:16:08 -05:00
Michael "Z" Goddard
479f1ba163
Produce a benchmark share link storing the report in the url
2018-01-17 12:16:06 -05:00
Michael "Z" Goddard
c6f4d89371
Add benchmark suite, run and report on multiple benchmark projects
2018-01-17 12:10:27 -05:00
Michael "Z" Goddard
b02d7e8cd8
Read benchmark warm up time and recording time from uri
2018-01-17 11:59:58 -05:00
Paul Kaplan
d649b2555b
Require TextEncoder correctly
2018-01-17 11:41:24 -05:00
Ray Schamp
e83141e810
Revert "Use text-encoding library for text encoder"
2018-01-17 10:59:28 -05:00
Ray Schamp
301fcdc518
Merge pull request #897 from fsih/textencoding
...
Use text-encoding library for text encoder
2018-01-17 10:02:10 -05:00
Ray Schamp
c0db708986
Fix import syntax
2018-01-17 09:47:01 -05:00
DD
2c1412dda4
Use text-encoding library for text encoder
2018-01-16 17:41:18 -05:00
Paul Kaplan
57f3d43f4f
Update specmap for sensing blocks that are now fixed menus.
2018-01-13 13:23:33 -05:00
Paul Kaplan
223575f850
Remove extra call to initDrawable that was erasing existing drawable.
...
initDrawable is called in createClone previously, where the new costumes
are installed. Calling this again here erases those loaded skins and
causes an error when trying to calculate the uniforms when a drag
starts.
2018-01-12 11:20:17 -05:00
DD Liu
c6c01e7c93
Merge pull request #893 from fsih/nameName
...
Unique sprite and backdrop names
2018-01-12 10:33:43 -05:00
DD
7ed58da1cf
fix set editing target function
2018-01-11 16:43:18 -05:00
DD
bc64e6ed3e
Unique sprite and backdrop names
2018-01-11 11:28:21 -05:00
DD
323aafd165
Update VM's model of monitored blocks
2018-01-10 17:57:04 -05:00
DD
fce83dc2c3
make it work for non-droppable inputs
2018-01-10 17:50:48 -05:00
Eric Rosenbaum
eca66e9dde
Check for runtime
2018-01-09 19:22:33 -05:00
Eric Rosenbaum
283804c21c
Init and dispose audio player
2018-01-09 15:57:33 -05:00
Eric Rosenbaum
7c0117e9ed
Clones get synced to parent’s sound state
2018-01-09 15:56:58 -05:00
DD
db662b8584
fix lint
2018-01-09 14:55:46 -05:00
Paul Kaplan
327d1179d9
Update the mouse io to give scratch coordinates and client coordinates
...
Fixes GUI #642 https://github.com/LLK/scratch-gui/issues/642
Fixes GUI #179 https://github.com/LLK/scratch-gui/issues/179
2018-01-09 10:37:16 -05:00
Paul Kaplan
bbcb6bd5b7
Differentiate clamped from non clamped mouse io data (GUI#179)
2018-01-09 09:42:16 -05:00
DD Liu
0b6d7adf3e
Update monitor on dropdown change
2018-01-08 20:22:18 -05:00
Paul Kaplan
63be5bc487
Transform sb2 looks reporters to new menu blocks
2018-01-04 10:24:13 -05:00
Paul Kaplan
d6f1c48c08
Add opcodes for new looks reporters with menu for costume number/name
2018-01-04 10:04:54 -05:00
Paul Kaplan
4fd7ba896a
Merge pull request #881 from sjhuang26/issue-gui1127-pen-trails
...
No pen trails when dragging
2017-12-29 10:22:18 -05:00
Paul Kaplan
6d90a34ff1
Add setDragMode primitive and unit test
2017-12-29 09:38:21 -05:00
sjhuang26
72dee72148
Change let to const
2017-12-29 09:13:18 -05:00
sjhuang26
f7d80459c7
Fixed pen behavior when dragging
2017-12-29 09:01:30 -05:00
sjhuang26
b726c4c18d
Changed postSpriteInfo logic
2017-12-29 08:31:59 -05:00
Paul Kaplan
477ef531ba
Update specmap and sb2 import to add new fields to layering blocks.
2017-12-28 14:53:35 -05:00
Paul Kaplan
fe51bd6450
Update layering blocks
2017-12-28 14:40:08 -05:00
Paul Kaplan
d001a85571
Add setDragMode primitive and unit test
2017-12-28 12:31:23 -05:00
David Aylaian
a22879631f
Optimize stepThread by reducing the number of calls to peekStack
2017-12-27 19:44:49 -05:00
Paul Kaplan
9d5bbdbf3a
Merge pull request #860 from kchadha/broadcast-input-functionality
...
Broadcast Inputs and Implicit Message Deletion
2017-12-27 11:47:56 -05:00
Paul Kaplan
d0e402ddb7
Merge pull request #877 from cwillisf/fix-legacy-pen-blocks
...
Fix legacy `setPenHueToNumber` and `changePenHueBy`
2017-12-27 11:30:46 -05:00
Christopher Willis-Ford
ed1fc5f353
Use Scratch 2.0 block labels for legacy blocks
2017-12-22 11:08:05 -08:00
Christopher Willis-Ford
5dbffe67ac
Fix legacy setPenHueToNumber
and changePenHueBy
...
These two blocks were not doing the same shade-oriented math as
`setPenShadeToNumber`: effectively these blocks were using the new color
model instead of Scratch 2.0's hue-shade model. This change pulls the
hue-shade color update logic into a separate function, now called by all
the legacy pen blocks.
2017-12-22 10:47:11 -08:00
Karishma Chadha
6fc554daa5
Implicit deletion behavior for broadcast blocks.
2017-12-21 19:06:11 -05:00
Karishma Chadha
720c22db0e
Cleanup/refactoring.
2017-12-21 19:06:11 -05:00
Karishma Chadha
bcbe910643
Translating empty string messages from sb2 into messageN, where N is an integer >= n such that messageN is a fresh name.
2017-12-21 19:06:11 -05:00
Karishma Chadha
154987fbb0
SB2 Import functionality for broadcast blocks with pluggable inputs.
2017-12-21 19:06:11 -05:00
Karishma Chadha
c0e4ae455c
Streamlining broadcast block execution. When arg information is provided to execute function, corresponding broadcast message is looked up by id, if provided, or if not, then name. If neither id nor name is provided, we can't look up the broadcast message and something is wrong, so an error is logged. We no longer need to differentiate between the shadow menu vs. plugged in input cases via the argValue name (e.g. 'BROADCAST_OPTION' vs. 'BROADCAST_INPUT'). This refactor also helps with sb2 import, coming in the next commit.
2017-12-21 19:06:11 -05:00
Karishma Chadha
413d113dda
Adding support for blocks to be plugged into the input of broadcast blocks. SB2 Import to come.
2017-12-21 19:06:11 -05:00
Paul Kaplan
cd66eb7f96
Allow size to be set through postSpriteInfo, and emit updates when it is
...
Required to allow size to be added to sprite info panel in the GUI.
2017-12-20 15:35:35 -05:00
Eric Rosenbaum
ec8d9f2121
Merge pull request #875 from ericrosenbaum/bugfix/stop-literally-all-sounds
...
Stop all sounds for all targets
2017-12-20 15:15:47 -05:00
Andrew Sliwinski
d1d980cb62
Merge pull request #874 from thisandagain/feature/733
...
Accept both objects and strings for 'loadProject'
2017-12-20 14:44:12 -05:00
Eric Rosenbaum
a6d17fcba3
Stop all sounds for all targets
2017-12-20 14:00:23 -05:00
Andrew Sliwinski
05a1a668b3
Accept both objects and strings for 'loadProject'. Resolves GH-733
2017-12-20 11:49:40 -05:00
Eric Rosenbaum
8e554245c8
Check for runtime
2017-12-20 10:56:44 -05:00
Eric Rosenbaum
9f6cd92d93
Clear sound effects for all targets on GF and stop
2017-12-20 10:38:16 -05:00
Paul Kaplan
ebecb1d4fb
Merge pull request #870 from paulkaplan/fix-backdrop-promise
...
Return promise from backdrop loading
2017-12-19 16:27:17 -05:00
Eric Rosenbaum
c24a286666
Merge pull request #871 from ericrosenbaum/feature/extension-category-icons
...
Category menu icons for extensions
2017-12-19 16:27:07 -05:00
Eric Rosenbaum
a81b81251b
Remove current instrument from sound state
2017-12-19 15:54:45 -05:00
Eric Rosenbaum
2d6e91fa59
Merge branch 'develop' into feature/extension-category-icons
2017-12-19 15:39:00 -05:00
Eric Rosenbaum
dad620f015
Update block and menu icons for pen and music extensions
2017-12-19 14:47:37 -05:00
Eric Rosenbaum
9613046b2f
Add optional menuIcon for extension blocks
2017-12-19 14:47:11 -05:00
Eric Rosenbaum
7c853ab7f3
Merge pull request #869 from ericrosenbaum/feature/add-extension-separator
...
Add separator to extension block definition
2017-12-19 13:58:28 -05:00
Paul Kaplan
39115169ca
Return promise from backdrop loading
2017-12-19 11:11:38 -05:00
Paul Kaplan
437cee3c14
Cast to string before asking question. Same as say blocks do.
2017-12-15 15:52:04 -05:00
Eric Rosenbaum
00d6e9e8e7
Merge pull request #863 from ericrosenbaum/feature/blockly-extension-for-scratch-extensions
...
Add blockly extension for scratch extensions
2017-12-15 15:27:26 -05:00
Eric Rosenbaum
5cb0f5d76d
Add separator to extension block definition
2017-12-15 14:09:29 -05:00
Paul Kaplan
cc1cfbf70d
Merge pull request #859 from paulkaplan/fix-always-warp
...
Parse the `warp` property from the mutation instead of using directly.
2017-12-15 13:40:02 -05:00
Paul Kaplan
47549aa63b
Merge pull request #864 from paulkaplan/fix-promise-from-add-costume
...
Return a promise to indicate when a costume has loaded.
2017-12-15 11:16:56 -05:00
Paul Kaplan
cbebc28307
Return a promise to indicate when a costume has loaded.
...
Parallels the way the `addSound` method works. Needed to enable
selecting new assets automatically from GUI.
2017-12-14 16:46:31 -05:00
Eric Rosenbaum
5e6187bee7
Add blockly extension for scratch extensions
2017-12-14 14:37:08 -05:00
Paul Kaplan
0f82e2a84d
Be more cautious about parsing json.
2017-12-14 14:23:16 -05:00
Paul Kaplan
256d7b3d6c
Parse the warp
property from the mutation instead of using directly.
2017-12-13 15:53:55 -05:00
Paul Kaplan
0fe7eca018
Fix procedure name lookup to work with undefined procedures.
2017-12-13 15:37:58 -05:00
Eric Rosenbaum
ba1f217004
Merge pull request #854 from ericrosenbaum/bugfix/extension-block-outline-colour
...
Fix tertiary color of extension blocks
2017-12-13 15:00:07 -05:00
Ray Schamp
b191c87a77
Merge pull request #807 from mzgoddard/benchmark-prototype
...
Benchmark prototype
2017-12-13 14:58:29 -05:00
Ray Schamp
e8fd5b1f13
Replace playground with benchmark
2017-12-12 12:17:33 -05:00
Paul Kaplan
8411ef1c86
Merge pull request #810 from paulkaplan/select-after-drag
...
Select target after drag end
2017-12-12 10:55:27 -05:00
Ray Schamp
921ce24195
Merge branch 'benchmark-prototype' of https://github.com/mzgoddard/scratch-vm into mzgoddard-benchmark-prototype
...
# Conflicts:
# .gitignore
2017-12-12 09:48:52 -05:00
Eric Rosenbaum
25ded4cff7
Fix spelling of coloUrTertiary
2017-12-11 17:01:23 -05:00
chrisgarrity
f51cf9877e
Preliminary localization ( #777 )
...
* localize the block and menu strings in the pen extension
* adds .tx/config to be able to push translations to transifex
* includes format-message to localize strings and extracting them.
* add setLocale function to VM to allow GUI to pass in locale data.
* refresh block definitions when the locale changes.
### Still to be decided
For now just extracting messages from the pen extension into their own file. We’ll need to decide if each category gets its own file, or group all the strings into one resource.
2017-12-11 15:41:45 -05:00
Eric Rosenbaum
f33c6294bc
Merge pull request #825 from ericrosenbaum/bugfix/clones-get-audioplayer-ref
...
Clones get a reference to parent’s audioPlayer
2017-12-08 11:40:31 -05:00
Eric Rosenbaum
d771a24b82
Merge pull request #831 from ericrosenbaum/feature/drum-update
...
Drum update
2017-12-07 15:41:13 -05:00
Chris Willis-Ford
e7bbad60e8
Merge pull request #793 from cwillisf/remove-threads-safely
...
Make _removeThread safe during thread iteration
2017-12-06 17:18:10 -08:00
Paul Kaplan
2d2b691b6f
Return a default falsey value for unknown params based on param type
2017-12-06 11:46:43 -05:00
Eric Rosenbaum
8203eb2c91
Merge pull request #840 from ericrosenbaum/feature/music-block-icon
...
Add icon for music extension blocks
2017-12-05 15:43:10 -05:00
Eric Rosenbaum
506a36b8ef
Merge pull request #838 from ericrosenbaum/feature/move-extensions-into-folder
...
Move pen and wedo into extensions folder
2017-12-05 15:43:03 -05:00
Paul Kaplan
e6bd474720
Merge pull request #845 from kchadha/broadcast-msg-extra-create-bugfix
...
Broadcast Msg Bugfix
2017-12-05 15:38:12 -05:00
Paul Kaplan
bb69d157cd
Merge pull request #832 from paulkaplan/custom-procedure-updates
...
Updates for editable custom procedures
2017-12-05 15:37:56 -05:00
Karishma Chadha
34b0aff637
Bugfix for scratch-gui issue #994 , where executing a broadcast block from the flyout was creating a conflicting variable, causing a fatal error.
2017-12-04 18:01:29 -05:00
Paul Kaplan
aa306e1f29
Merge pull request #841 from sjhuang26/issue-795-clear-answer
...
Clear answer on green flag
2017-12-04 11:41:16 -05:00
sjhuang26
b2802b75f1
Go to front in stage does nothing
2017-12-02 08:33:32 -05:00
sjhuang26
eede8105d1
Clear answer on green flag
2017-12-01 20:06:55 -05:00
Paul Kaplan
0722708004
Merge pull request #817 from sjhuang26/develop
...
Fix ask-and-wait in stage
2017-12-01 11:53:37 -05:00
Paul Kaplan
a9e95f3b01
Merge pull request #829 from kchadha/broadcast-message-typed-variable
...
Broadcast message functionality
2017-12-01 11:51:38 -05:00
Karishma Chadha
aab4a45622
Minor Refactoring/cleanup.
2017-12-01 11:27:54 -05:00
Eric Rosenbaum
2091ef0636
Add icon for music extension blocks
2017-12-01 11:06:46 -05:00
Eric Rosenbaum
9611401e1c
Move pen and wedo into extensions folder
2017-12-01 10:31:04 -05:00
Karishma Chadha
80da989f01
SB2 Import for Broadcast Blocks (not including the input field functionality for 'broadcast' and 'broadcast and wait
...
'). Currently we also cannot import projects where messages and variables share names.
2017-12-01 10:29:32 -05:00
Eric Rosenbaum
68053adf7f
Quieter snare
2017-11-29 15:35:16 -05:00
Eric Rosenbaum
bcdc951eb1
Update bass drum
2017-11-29 15:27:07 -05:00
Eric Rosenbaum
bf5d489cda
Update crash cymbal
2017-11-29 15:25:40 -05:00
Eric Rosenbaum
799a8ab799
Update open and closed hi-hats
2017-11-29 15:25:34 -05:00
Paul Kaplan
5a53323715
Update to use explicit procedure names and ids
2017-11-29 12:00:00 -05:00
Karishma Chadha
e5378d323d
Adding unit tests for new lookupOrCreate funciton, fixing a bug that came up during testing (using lookupVariableById on a null target). Skipping integration tests that do not work right now because SB2 import of broadcast message blocks has not been implemented yet.
2017-11-29 10:43:07 -05:00
Paul Kaplan
80b4dab104
Decode the encoded argument information
2017-11-29 10:34:59 -05:00
Karishma Chadha
b674a0c047
Code cleanup and refactoring, and getting scratch3_event broadcast functionality to look up the variable name instead of getting it ad-hoc.
2017-11-28 22:33:27 -05:00
Eric Rosenbaum
773c167987
Check for instrument sample before playing
2017-11-28 13:15:48 -05:00
Eric Rosenbaum
a71e06af43
Clones get a reference to parent’s audioPlayer
2017-11-28 12:29:45 -05:00
Eric Rosenbaum
6dffc0e512
Merge pull request #820 from ericrosenbaum/bugfix/extension-menu-values
...
Convert music extension menu values to string
2017-11-27 17:10:23 -05:00
Andrew Sliwinski
519d41d966
Merge pull request #805 from thisandagain/bugfix/802
...
Replace 'got' module with 'nets'
2017-11-27 15:17:04 -05:00
Andrew Sliwinski
b78bdb4c93
Address feedback from review
2017-11-27 15:00:53 -05:00
Eric Rosenbaum
7e87f314fb
Convert menu values to string
2017-11-27 10:06:42 -05:00
sjhuang26
f610816e72
Added wasStage parameter
2017-11-24 21:28:48 -05:00
Karishma Chadha
0a15190b85
Broadcast message functionality (works with creating new messages, and switching back and forth between them as well). This commit includes a temporary workaround for the issue where the default broadcast message, 'message1' wasn't triggering a var_create event (filed in LLK/scratch-blocks#1258 ).
2017-11-21 16:48:48 -05:00
Paul Kaplan
fc61f9e547
Select target after drag end
2017-11-21 11:45:11 -05:00
Eric Rosenbaum
5fbfecb1a9
Note player ( #806 )
...
* Move drums into their own folder
* Load instrument samples
* Play notes
* Concurrency limit is shared across drums and instruments
* Increase MIDI note range
* Set instrument directly on musicState object
* JSDoc
* Clean up the play note functions and add comments
* Cleanup
* Check for audioEngine in playDrumNum
* JSDoc and comments
* Round the instrument number
* Fix unit test for set instrument
* Comment fixes
* Nit (condense onto single line)
2017-11-21 10:36:28 -05:00
DD Liu
58dd57fe48
Merge pull request #784 from fsih/perSpriteMonitors
...
Execute monitors on a given target ID when block is sprite-specific
2017-11-21 10:23:53 -05:00
Boaz Sender
a7314d6f0d
adds ui styling and context to benchmark prototype
2017-11-20 19:18:18 -05:00
Michael "Z" Goddard
7356546072
Add benchmark prototype
...
Build a page with webpack that loads a project and automatically runs
it, collecting performance information for a set amount of time,
stopping and displaying the results.
2017-11-20 18:40:55 -05:00
DD
ec9d8094bd
fix review comments
2017-11-20 17:23:59 -05:00
Andrew Sliwinski
a8c629dc9b
Replace 'got' module with 'nets'. Resolves GH-802
2017-11-20 17:04:17 -05:00
Eric Rosenbaum
614708d48c
Merge pull request #785 from ericrosenbaum/feature/load-drums-from-storage
...
Load drum sounds from storage and play them
2017-11-20 13:56:23 -05:00
Eric Rosenbaum
1e00a0c252
Comment for no-op above concurrency limit
2017-11-20 13:44:44 -05:00
Eric Rosenbaum
c3a72560f9
Clarify @TODO comment about extension status indicator
2017-11-20 13:42:35 -05:00
DD
6d26023104
revert unnecessary changes'
...
:
2017-11-20 13:00:37 -05:00
griffpatch
6ed2ca6caa
Cache Block Inputs & Procedure Definitions
...
* Cache Block Inputs & Procedure Definitions
* @mzgoddard requested changes on this pull request
* Move all caching into a single reusable field _cache.
* Invalidate 'all' caches on any change.
* Use 'typeof' instead of hasOwnProperty.
* Take caching out of Block and use lookup instead.
2017-11-20 10:22:51 -05:00
Christopher Willis-Ford
b19af399fa
Make _removeThread safe during thread iteration
...
Before: `_removeThread` stops a thread and immediately removes it from
the runtime's thread array. If this happens while iterating over the
thread array, such as in the case of clone deletion, some elements of
the array can be missed.
After: `_removeThread` has been renamed to `_stopThread`. It still stops
the thread immediately but it no longer removes the thread from the
runtime's thread array. Instead, `_stopThread` marks the thread for
later removal. Such threads are removed at the top of the next `_step`.
2017-11-17 12:56:25 -08:00
DD Liu
2d9722e69c
Merge pull request #787 from fsih/deleteMonitorBlocks
...
Delete monitor block when variable is deleted
2017-11-16 17:20:26 -05:00
DD
255e160ebb
Change it so we dont have to do string manipulation on IDs to get data out of events
2017-11-16 17:19:51 -05:00
Paul Kaplan
bbb8904467
Merge pull request #789 from paulkaplan/custom-procedure-update
...
Update naming and implementation for custom procedure blocks
2017-11-16 17:07:03 -05:00
Paul Kaplan
34dfbb50ba
Update naming and implementation for custom procedure blocks
2017-11-16 14:17:08 -05:00
Michael "Z" Goddard
3d92553459
Return restarted threads in list from startHats
...
Add restarted threads to the list of newThreads returned by startHats.
2017-11-16 11:23:51 -05:00
Michael "Z" Goddard
9864403bc9
A thread in the runtime but with the DONE status is not active
...
return false from isActiveThread if thread's status is done even when
its contained in the runtime threads list. As it is done, the thread
will not be run until either its replaced by a new copy of the thread
or the thread is removed from the list and another is added at a later
time.
2017-11-16 11:23:51 -05:00
kchadha
9df3b8ad86
Merge pull request #780 from mzgoddard/runtime-profiler
...
Runtime profiler
2017-11-16 10:02:37 -05:00
DD
0958db2618
Move data to blocks files
2017-11-15 17:53:43 -05:00
Eric Rosenbaum
5b0f7453f3
Merge pull request #779 from ericrosenbaum/feature/music-timing-with-stackframe
...
Music extension handles timing
2017-11-15 13:29:33 -05:00
Paul Kaplan
1e27d21b15
Merge pull request #782 from kchadha/list-typed-variable
...
List typed variable
2017-11-15 12:48:56 -05:00
DD
c8d5ba1d5e
Delete block does nothing if the block doesnt exist
2017-11-15 11:56:49 -05:00
DD
aa0064948a
Delete monitor block when variable is deleted
2017-11-15 11:37:27 -05:00
Karishma Chadha
fe86e38210
Addressing PR review comments.
2017-11-15 09:17:20 -05:00
DD
757dccd565
Move is sprite specific verification into VM in a temporary way. Remove monitors when their sprites are deleted.
2017-11-14 18:25:54 -05:00
Eric Rosenbaum
01e9000c04
JSDoc for _playDrumNum
2017-11-14 15:00:27 -05:00
Eric Rosenbaum
75ec76cd57
Fix unit test
2017-11-14 14:58:16 -05:00
Michael "Z" Goddard
ff82699440
Add Block % stats panel
...
Enable profiler when Block % is visible and display percent of time
block functions get to execute versus drawing and any overhead.
2017-11-14 14:57:32 -05:00
Michael "Z" Goddard
f73dae828e
Add enableProfiling and disableProfiling to Runtime
2017-11-14 14:57:32 -05:00
Michael "Z" Goddard
516d4f6f30
Add Profiler events to Runtime, Sequencer and execute
2017-11-14 14:57:32 -05:00
Michael "Z" Goddard
a5b55a5128
Add runtime Profiler
...
Profile internal virtual machine performance down to which blocks take
how long.
2017-11-14 14:57:31 -05:00
Eric Rosenbaum
9665b3ed25
Always yield on first run of a timed block
2017-11-14 14:40:27 -05:00
Eric Rosenbaum
7a65fe7d07
Limit number of concurrent drum sounds
2017-11-14 14:39:50 -05:00
Eric Rosenbaum
b64152637e
Play drums!
2017-11-14 14:39:11 -05:00
Eric Rosenbaum
73dbc82411
Get number of drums from drum info array
2017-11-14 14:36:34 -05:00
Eric Rosenbaum
14e2ca8d99
Round the drum num arg
2017-11-14 14:35:26 -05:00
Eric Rosenbaum
c26198d050
Load drum sounds into an array of buffers
2017-11-14 14:33:14 -05:00
Eric Rosenbaum
91878adfe1
Build menus using drum and instrument info arrays
2017-11-14 14:32:14 -05:00
Eric Rosenbaum
9f1bcd2594
Arrays with drum and instrument name and filename
2017-11-14 14:30:44 -05:00
DD
9048a9b9e7
Pipe through whether a monitor is sprite-specific
2017-11-14 12:20:24 -05:00
Karishma Chadha
386045f033
Some code cleanup.
2017-11-13 16:55:57 -05:00
Karishma Chadha
26d4a3a069
Refactoring representation of variable type.
2017-11-13 16:29:38 -05:00
Eric Rosenbaum
f5b25a190e
Add assets (drum sounds) for music extension
2017-11-13 16:23:10 -05:00
Eric Rosenbaum
961b3476b2
Move the music extension into a new extensions directory
2017-11-13 16:22:37 -05:00
Karishma Chadha
038a65b460
Finishing up lists.
2017-11-13 14:24:30 -05:00
Karishma Chadha
b18938963f
Fixing linting errors
2017-11-13 14:22:36 -05:00
Eric Rosenbaum
be25cd93bd
Use stack timer for timing of drum, note and rest blocks.
2017-11-13 10:43:09 -05:00
Paul Kaplan
95ca10038b
Merge pull request #772 from kchadha/improving-test-coverage
...
Improving test coverage
2017-11-13 10:17:09 -05:00
Eric Rosenbaum
db3b0ca204
Move musical timing into music extension
...
and use the stackframe timer, which improves timing accuracy.
2017-11-09 17:49:42 -05:00
Karishma Chadha
70959cc7f5
First cut at turning lists into typed variables
2017-11-09 17:19:34 -05:00
Karishma Chadha
c31fff8c4c
Fixing linter errors.
2017-11-09 09:18:44 -05:00
Karishma Chadha
7fae93f6e6
Removing unnecessary comments from edits.
2017-11-08 15:59:35 -05:00
Karishma Chadha
70081132cb
Changes to src/virtual-machine based on minor bugs found during testing. This was supposed to be included with the previous commit.
2017-11-08 15:49:51 -05:00
Paul Kaplan
16ca994818
Allow ask to use say bubble via events
2017-11-08 11:12:12 -05:00
Andrew Sliwinski
3fa1599b90
Merge pull request #701 from Scimonster/variable-xml-names
...
Correctly deserialize HTML entities in block DOM
2017-11-08 08:03:56 -05:00
Eric Rosenbaum
50c646259c
Merge branch 'develop' of https://github.com/LLK/scratch-vm into feature/extension-music
2017-11-07 15:54:38 -05:00
Eric Rosenbaum
112bb55b9b
JSDoc
2017-11-07 15:21:47 -05:00
Eric Rosenbaum
9bd48e8761
Mark the buildMenu function private
2017-11-07 15:21:20 -05:00
Ray Schamp
b07bbd4745
Merge pull request #765 from mzgoddard/execute-is-promise-deopt
...
Write src/engine/execute so it can be optimized
2017-11-07 12:19:58 -05:00
Ray Schamp
180e545b4e
Merge pull request #766 from mzgoddard/execute-handle-report-block-utility
...
Extract handleReport and BlockUtility from inside the execute function
2017-11-07 12:19:23 -05:00
Eric Rosenbaum
87cf546b03
Remove music opcodes from sound bocks
2017-11-07 11:28:04 -05:00
Eric Rosenbaum
533ed60d98
Update sb2 specmap with music extension blocks
2017-11-07 11:27:50 -05:00
Eric Rosenbaum
b2941f8c5a
Load music as internal extension
2017-11-07 11:27:33 -05:00
Paul Kaplan
1f98960636
Merge pull request #764 from paulkaplan/ask-answer-events
...
Ask/answer opcode implementation with runtime events.
2017-11-07 10:49:48 -05:00
Ray Schamp
5290570fc5
Merge pull request #758 from mzgoddard/done-threads-indexof
...
Constant time check if a thread is in doneThreads
2017-11-07 10:30:15 -05:00
Michael "Z" Goddard
e3dfe24d7f
Store references to target in say blocks
...
As part of reusing the block utility object, asynchronous say block
functions cannot use the utility in a promise or timeout asynchronous
handle. Store the needed target reference so utility is not needed
later.
2017-11-07 10:21:52 -05:00
Michael "Z" Goddard
bbe7981703
Extract blockUtility from execute to reduce allocations
...
blockUtility as an object literal inside execute creates 11 objects,
one for the object, and 10 for the function closures. As a separate
object and allocated once, setting its sequencer and thread members,
block functions can share the same util object. Extract blockUtility to
cut down on allocations.
2017-11-07 10:21:51 -05:00
Michael "Z" Goddard
78847de660
Extract handleReport and add arguments to prevent closure alloc
...
`handleReport` inside `src/engine/execute.js`'s `execute` method needs
to allocate a closure to be able to refer to the higher scoped
variables. `execute` is called frequently that this has a noticable
impact on memory allocation and later collection. Extract handleReport
and add arguments to prevent the allocation.
2017-11-07 10:21:51 -05:00
Andrew Sliwinski
1efc312c36
Merge pull request #767 from mzgoddard/docs-blocks-param-names
...
Replace duplicate documentation on getProcedureParamNames
2017-11-06 19:34:51 -05:00
Karishma Chadha
cb31f206a0
Improved test coverage of deleteSprite() in src/virtual-machine. Fixed bug where null check was happening after looking up property of given target.
2017-11-06 17:41:57 -05:00
Michael "Z" Goddard
888da915a5
Replace duplicate documentation on getProcedureParamNames
...
Replace the duplicate getProcedureDefintion documentation block above
getProcedureParamNames.
2017-11-06 17:28:34 -05:00
Eric Rosenbaum
fbeb1de1c1
Add music extension file
2017-11-06 16:57:16 -05:00
Michael "Z" Goddard
cd9004ce5b
Write src/engine/execute so it can be optimized
...
Testing with implicitly casted `value` and `value.then` is deoptimizing
isPromise, which deoptimizes execute. In this case deoptimizing means
that the JavaScript VM cannot compile the functions into a form that
can be run faster.
2017-11-06 15:54:22 -05:00
Paul Kaplan
73ffc6a797
Ask/answer opcode implementation with runtime events.
2017-11-06 15:08:15 -05:00
Eric Rosenbaum
a735459427
Merge pull request #762 from ericrosenbaum/bugfix/wedo-tilt-reporter-shape
...
Fix shape of boolean tilt reporter
2017-11-06 11:21:12 -05:00
Eric Rosenbaum
59e0c75abf
Fix shape of boolean tilt reporter
2017-11-06 10:17:53 -05:00
Eric Rosenbaum
323fde3859
Appease the linter
2017-11-06 10:10:41 -05:00
Eric Rosenbaum
cc35bcc791
Merge branch 'develop' of https://github.com/LLK/scratch-vm into feature/wedo-block-icon
2017-11-06 10:02:57 -05:00
Eric Rosenbaum
0540640684
Merge pull request #754 from ericrosenbaum/feature/pen-block-icon
...
Extension block icons (including pen icon)
2017-11-06 10:02:23 -05:00
Eric Rosenbaum
14087ef24f
Add wedo block icon
2017-11-06 10:00:13 -05:00
Paul Kaplan
caa9b97520
Fix linting
2017-11-04 10:10:17 -04:00
Paul Kaplan
8616390fab
Add back pen transparency from color number
2017-11-03 21:24:47 -04:00
Michael "Z" Goddard
6d82c0f115
In place filter threads at end of stepThreads
...
Skip a large array allocation by filtering done threads in place with a
for loop.
2017-11-03 17:48:52 -04:00
Michael "Z" Goddard
4e24a3f380
Constant time check if thread is in doneThreads
...
Remove indexOf tests for thread existence in doneThreads. Maintain a
list of null and thread objects mirroring the index position of threads
that are done in runtime.threads. Filter out null values after
filtering out done threads from runtime.threads.
This has a small side effect that threads that normally became DONE and
were added to doneThreads before being removed or restarted will not be
in doneThreads in this version. Restarted threads (_restartThread) do
not appear in this version but new copies will be in Runtime
this.threads supporting glow and monitor updates. Removed threads
(_removeThread) do not appear in this version if they are removed after
they were seen as DONE by the prior version. Threads removed before
they are seen as DONE do not appear in doneThreads in the prior or this
version.
Threads that are removed before normally becoming DONE do not appear in
doneThreads in either case. Threads that are restarted before the loop
checks if the thread is done do not appear in doneThreads in either
case.
2017-11-03 17:46:50 -04:00
Chris Willis-Ford
ef961c5a4b
Merge pull request #756 from cwillisf/autoload-extensions
...
Autoload extensions
2017-11-03 13:59:01 -07:00
Christopher Willis-Ford
0ad03f8d70
Actually finish SB2 specMap for WeDo 2.0
...
Apparently I took a break at the wrong time and forgot to come back to
this... :/
2017-11-03 13:48:05 -07:00
Christopher Willis-Ford
51dcfb954d
Pen integration test: don't pre-load pen extension
2017-11-03 12:50:37 -07:00
Christopher Willis-Ford
c88a8fa55a
Fix tests & a typo
2017-11-03 11:42:20 -07:00
Christopher Willis-Ford
0af3de9bf0
Load extensions when loading a project or sprite
...
- Accumulate extension info while deserializing JSON
- Install extensions (if any) before installing target(s)
- Merged 'install' steps of the "add sprite" and "load project" paths
2017-11-03 11:20:24 -07:00
Paul Kaplan
c1ba902ebb
Use category info that has colors when building menu blocks
2017-11-03 13:50:50 -04:00
Eric Rosenbaum
2ac464c53e
Prepend icon to each extension block
2017-11-03 11:35:42 -04:00
Eric Rosenbaum
a115d47bb8
Add block icon svg as single-line data URI
2017-11-03 11:25:39 -04:00
Paul Kaplan
e2ac6947af
Merge pull request #753 from paulkaplan/provide-argument-ids
...
Provide argument id list with callers and procdef blocks
2017-11-03 09:48:37 -04:00
Paul Kaplan
007fe2ed53
Fix linting
2017-11-02 17:14:00 -04:00
Paul Kaplan
5b9d4ae23e
Provide argument id list with callers and procdef blocks
2017-11-02 17:03:12 -04:00
Paul Kaplan
c5d3e2dbb4
Merge pull request #746 from paulkaplan/fix-variable-of
...
Search for variables by name in "of" block
2017-11-02 11:09:42 -04:00
Chris Willis-Ford
91420375d5
Merge pull request #724 from cwillisf/no-dupe-extensions
...
Prevent duplicate extensions
2017-11-01 21:29:00 -07:00
Paul Kaplan
2c3c9f9ac8
Search for variables by name in "of" block
2017-11-01 14:31:52 -04:00
Paul Kaplan
18398d010b
Add hideFromPalette flag for hiding legacy blocks
2017-11-01 11:30:15 -04:00
Paul Kaplan
082e051cce
Support legacy pen block op codes
2017-11-01 11:30:15 -04:00
Christopher Willis-Ford
8bb48e2a53
Add built-in extension "URL" to _loadedExtensions
...
Dupe prevention works better when you actually record the necessary
info...
2017-10-31 13:00:19 -07:00
Christopher Willis-Ford
ae878b2050
Simplify extension duplication prevention station
...
Since we will only have builtin extensions for a while, the
more-complicated, watchdog-based extension duplication prevention has
been replaced with one that treats the extension URL as equivalent to
the extension ID. This is true only for built-in extensions, so once we
start supporting third-party extensions we will likely need to bring
back the watchdog (commit e4381b4693
) and
the more-complex duplication prevention (commit
670e51d335
).
The code here should be treated as a last resort: ideally the GUI should
check if a particular extension is loaded (maybe by calling the
Extension Manager's new `isExtensionLoaded` method) and avoid calling
`loadExtensionURL` if it is.
2017-10-31 12:35:18 -07:00
Christopher Willis-Ford
670e51d335
Refuse to register second extension with same ID
...
If an extension attempts to register with the same ID as another
extension which has already registered, the new registration is refused.
If the extension is in a worker and no other extension is successfully
registered by that worker, the watchdog system will terminate the
"empty" worker.
2017-10-31 12:24:26 -07:00
Christopher Willis-Ford
e4381b4693
Add an init watchdog for extension workers
...
If an extension worker does not complete initialization in a reasonable
amount of time (currently 15 seconds) then the worker will be
terminated. A complete initialization includes registering an extension.
2017-10-31 11:28:56 -07:00
Paul Kaplan
48d3b20d69
Stringify things before saying
2017-10-30 15:38:56 -04:00
Paul Kaplan
4f7d6e8f5c
Merge pull request #731 from paulkaplan/fix-global-local-variable-creation
...
Prevent imported local variables from being duplicated on the stage.
2017-10-25 16:26:17 -04:00
Paul Kaplan
d126f799d8
Prevent imported local variables from being duplicated on the stage.
2017-10-25 11:17:29 -04:00
Paul Kaplan
bbbd3dd64b
Make test pass for undefined proc execution
2017-10-25 10:29:07 -04:00
Paul Kaplan
f07c70938a
Merge pull request #729 from paulkaplan/fix-say-think-moving
...
Fix several say/think bugs
2017-10-24 08:40:29 -04:00
Paul Kaplan
c14155c26d
Fix comment on drawableVisible property
2017-10-24 08:17:31 -04:00
Paul Kaplan
09bb01893c
Add back the visibility optimization in a simpler way.
2017-10-23 14:24:54 -04:00
Paul Kaplan
24d550d860
Remove "visible" state flag and use target visibility directly.
...
This fixes several other bugs like "saying" from a hidden sprite.
2017-10-23 13:26:08 -04:00
Eric Rosenbaum
9ffbd60bad
Merge pull request #725 from ericrosenbaum/feature/pen-extension
...
Set/change pen color blocks with color, brightness, saturation, transparency
2017-10-23 11:25:09 -04:00
Paul Kaplan
5ca58c7ceb
Fix new bubbles not moving with their owning sprite.
...
This was the original issue #728 that spurred these changes.
2017-10-23 11:20:46 -04:00
Paul Kaplan
87a0224790
Stop hide timeouts from sticking around through green flag/stop.
2017-10-23 11:19:39 -04:00
Paul Kaplan
44ca62fefc
Fix event listeners not being cleaned up
...
Eventually if you hit the green flag a million times with a "green flag
=> say" stack, you'd get an event emitter memory leak error.
2017-10-23 11:17:39 -04:00
Eric Rosenbaum
0a18ce7287
Lint
2017-10-18 13:16:24 -04:00
Eric Rosenbaum
bddabdbac6
JSDocs
2017-10-18 11:48:45 -04:00
Eric Rosenbaum
b5ad5e1f6b
Warn on set or change unknown color parameter
2017-10-18 11:33:52 -04:00
Eric Rosenbaum
aab1b834d6
On set color using picker, reset transparency to 0
2017-10-17 23:13:05 -04:00
Eric Rosenbaum
a32f7a6402
Default color setting matches default RGB values
...
For color (hue) in range 0-100, to get RGB (0, 0, 1), we need to use 100 * 2/3 = 66.66
2017-10-17 23:10:58 -04:00
Eric Rosenbaum
240c48ad0c
Set or change color param with a single function
2017-10-17 19:31:51 -04:00
Chris Willis-Ford
d8a3e659d5
Playground: use UMD to load storage as global ( #722 )
...
* Playground: use UMD to load storage as global
It appears that `expose-loader` is not compatible with WebPack's UMD
exporter, so the VM playground broke when I converted `scratch-storage`
to use UMD. This change causes the playground to load `scratch-storage`
as an independent script and relies on its UMD loader to expose it as a
global. Bonus points: we get better source mapping this way.
* Playground: tell eslint about global ScratchStorage
2017-10-17 17:40:11 -04:00
Eric Rosenbaum
086df4652e
Remove references to pen shade
2017-10-17 12:23:38 -04:00
Eric Rosenbaum
264042b4cc
Use the word “color” instead of “hue”
2017-10-17 12:22:53 -04:00
Eric Rosenbaum
4f8782cc84
Remove unused function
2017-10-17 11:27:46 -04:00
Eric Rosenbaum
3d6644609f
Add new set/change color param blocks with menu
...
And remove set/change color and shade blocks. All 4 params are now scaled 0-100.
2017-10-17 11:25:22 -04:00
Eric Rosenbaum
22e70ce095
Remove unused arguments for “clear” block
2017-10-17 11:25:22 -04:00
DD Liu
ceb47bd765
Merge pull request #718 from fsih/updateSvgStorage
...
Update storage when the SVG updates
2017-10-13 19:11:41 -04:00
Chris Willis-Ford
c4e79c9732
Merge pull request #713 from cwillisf/fix-extension-hats
...
Fix extension hats
2017-10-13 16:03:51 -07:00
DD
82efc42a13
Update storage when the SVG updates
2017-10-13 17:45:03 -04:00
Chris Willis-Ford
a8ae7bc5b4
Merge pull request #700 from cwillisf/extension-menus
...
Extensions: implement drop-down menus
2017-10-13 09:49:42 -07:00
Chris Willis-Ford
7051ccfd69
Merge pull request #687 from cwillisf/builtin-extensions
...
Builtin extensions
2017-10-13 09:48:56 -07:00
Christopher Willis-Ford
1a9e28bfc9
Small WeDo 2.0 fixups
2017-10-13 01:48:25 -07:00
Christopher Willis-Ford
96fa7315d5
Don't overwrite hat block's fields
...
Due to a typo (I believe) we were overwriting a horizontal hat block's
fields list when collecting hat block inputs. Now we collect inputs into
a temporary object in this case.
2017-10-13 01:46:35 -07:00
Paul Kaplan
4599a71dd7
Try to pin the bubbles within the left/right bounds
2017-10-11 16:34:50 -04:00
Paul Kaplan
b00a619e2d
Only flip bubble if it would fit the other way
2017-10-11 16:27:51 -04:00
Christopher Willis-Ford
309f02542f
Throw if extension tries to build a dynamic menu
...
Dynamic menus are not yet supported for extension menus, though they are
part of the extension spec. This change provides more thorough feedback
if an extension tries to register an unsupported dynamic menu.
2017-10-11 11:41:03 -07:00
Paul Kaplan
f09c4d0bb9
Merge pull request #691 from paulkaplan/say-think
...
Add say/think functionality to looks blocks
2017-10-11 14:24:10 -04:00
Paul Kaplan
fa2db053a7
Fix copy paste error on targetWasRemoved
2017-10-11 14:19:15 -04:00
Paul Kaplan
9af9eb1d92
Fix hide/show
2017-10-10 15:35:48 -04:00
Paul Kaplan
e8c5bbbf80
Fix tests and make chain more resilient
2017-10-10 12:19:27 -04:00
Scimonster
7afb17df7f
Correctly deserialize HTML entities in block DOM
...
E.g. in variable names
2017-10-09 01:19:55 +03:00
Christopher Willis-Ford
2f9796c163
Fix escapeHtml
error caused by rebase
2017-10-06 23:44:27 -07:00
Christopher Willis-Ford
67c788ec8d
Extensions: fix Boolean inputs
2017-10-06 23:33:33 -07:00
Christopher Willis-Ford
c1681e54d5
Implement drop-down menus for extension blocks
...
Also, add `ANGLE` argument type (like `NUMBER` but adds an angle picker)
2017-10-06 23:33:33 -07:00
Paul Kaplan
b0870518a4
Changing parsing of custom procedures for new style
2017-10-06 16:26:19 -04:00
Christopher Willis-Ford
ef3feca385
Fix typo in WeDo 2.0 blocks metadata
2017-10-06 10:56:38 -07:00
Paul Kaplan
14600d7893
Update looks implementation
2017-10-06 13:43:07 -04:00
Christopher Willis-Ford
7297341c51
Fixups from code review
...
- Remove WeDo 2 extension from the runtime's default block packages list
- The WeDo 2.0 extension now calls its own `connect` method on startup
I also renamed `EXTENSION_NAME` to `EXTENSION_ID` for consistency with
the rest of the extension system.
2017-10-06 09:55:19 -07:00
Paul Kaplan
43d061227c
WIP
2017-10-05 17:03:30 -04:00
Paul Kaplan
43a17bdaa8
Add say/think functionality to looks blocks
2017-10-05 11:16:27 -04:00
Christopher Willis-Ford
b6727a766f
Fix pen tests
2017-10-04 16:07:50 -07:00
Christopher Willis-Ford
dd20e09774
Extensions: escape HTML entities in default values
...
This prevents generation of invalid XML due to characters like '<' or
'>' in fields' default values. Unfortunately the value comes back in its
escaped form, so there's still more work to be done.
2017-10-04 13:00:45 -07:00
Christopher Willis-Ford
e9aed49a05
Make loadExtensionURL
handle built-in extensions
...
WeDo2 and Pen blocks have been converted to internal extensions, and can
now be loaded by giving `loadExtensionURL` the string 'pen' or 'wedo2'
instead of an actual URL.
2017-10-04 13:00:39 -07:00
Christopher Willis-Ford
6757fb6de9
Convert pen blocks into an "internal" extension
2017-10-04 12:54:30 -07:00
Paul Kaplan
e4830dfe51
Merge pull request #686 from paulkaplan/fix-extension-labels
...
Remove label generation for extensions
2017-10-04 15:37:06 -04:00
Paul Kaplan
0358d6c0c3
Remove label generation for extensions
2017-10-04 15:02:09 -04:00
Christopher Willis-Ford
99b868c0f0
Explain when it's OK to omit <field> element
...
Also, alphabetize the `ArgumentType` and `BlockType` enums.
2017-10-02 15:29:32 -07:00
Christopher Willis-Ford
772da24d9e
Add integration test for a non-worker extension
2017-10-02 12:02:44 -07:00
Christopher Willis-Ford
06252e020b
Extensions: add support for color-picker arguments
2017-09-27 00:02:53 -04:00
Christopher Willis-Ford
7a21d619bf
Add a way to load an extension without a Worker
...
The new `_registerInternalExtension` method on the extension manager
will register an extension object (an object with a `getInfo()` method)
with the extension system without sandboxing the object in a Worker.
2017-09-27 00:01:47 -04:00
Chris Willis-Ford
6087b5346c
Merge pull request #675 from cwillisf/feature/extensions
...
Feature/extensions
2017-09-14 13:34:18 -07:00
Paul Kaplan
0f04c99e67
Merge pull request #676 from paulkaplan/duplicate
...
Add sprite duplication method
2017-09-13 11:57:13 -04:00
Paul Kaplan
a885e7d619
Refactor error throwing
2017-09-12 10:16:26 -04:00
Paul Kaplan
4a7ba534c1
Fix linter
2017-09-11 15:15:30 -04:00
Eric Rosenbaum
b8bd77e394
Merge pull request #674 from ericrosenbaum/feature/pen-transparency
...
Add pen transparency blocks
2017-09-11 12:41:28 -04:00
Paul Kaplan
81370f7625
Refactor method exports to fix linting and CWF comment
2017-09-11 10:11:48 -04:00
Paul Kaplan
b68b874067
Add sprite duplication method
2017-09-07 11:51:21 -04:00
Christopher Willis-Ford
635c7966eb
Fix tests: don't require('scratch-blocks')
2017-09-06 01:24:24 -06:00
Christopher Willis-Ford
799d61ac98
Cleanup
2017-09-06 00:57:03 -06:00
Christopher Willis-Ford
d99c11ef91
Fix extension conditional blocks' appearance
...
The JSON generated for conditional blocks had slightly incorrect
structure for its `argsN` items and was missing some necessary
`messageN` items.
2017-09-06 00:57:03 -06:00
Christopher Willis-Ford
e7c727977a
Adjust for LLK/scratch-gui#655 & code review
...
- Move extension from this repository into LLK/scratch-gui
- Rename `EXTENSION_WAS_ADDED` event to `EXTENSION_ADDED`
2017-09-06 00:57:03 -06:00
Christopher Willis-Ford
d43749d675
WIP for demo
2017-09-06 00:57:03 -06:00
Christopher Willis-Ford
aaa7784d39
Add methods to fetch scratch-blocks XML and JSON
2017-09-06 00:57:03 -06:00
Christopher Willis-Ford
64bde25d22
Offer a promise for extension worker init
2017-09-06 00:57:03 -06:00
Christopher Willis-Ford
403adb743c
Track extension blocks in the Runtime
2017-09-06 00:57:03 -06:00
Christopher Willis-Ford
42255bbcfa
Collect extension info, prep scratch-blocks data
...
The Extension Manager now calls an extension's `getInfo` method, then
creates `scratch-blocks`-compatible XML and JSON block data from the
results.
2017-09-06 00:57:03 -06:00
Christopher Willis-Ford
7fb7f0dc7b
WIP Extension Manager
...
When asked to load an extension, the Extension Manager starts up a new
Worker. That worker runs the message dispatch system as well as an
instance of the new `ExtensionWorker` class, which will load the desired
extension and register it with the extension system.
Extensions, placed in `./src/extensions/*.js`, are now processed by
Webpack as separate entry points and packed into an `extensions`
subdirectory in the output.
Still to do: query an extension's information, including the blocks it
provides, and register that information with the VM, GUI, etc.
2017-09-06 00:57:03 -06:00
Eric Rosenbaum
58eaeaaf6a
Add pen transparency, clamped 0-100
2017-09-05 18:00:34 -04:00
DD
caf98cb185
change order
2017-09-05 17:53:27 -04:00
DD
48fec12391
add jsdoc
2017-09-05 17:49:30 -04:00
DD
29540e705e
Add updating the rotation center to updateSvg
2017-09-05 16:51:03 -04:00
Eric Rosenbaum
2b89063827
Merge branch 'patch-1' of https://github.com/Kenny2github/scratch-vm into Kenny2github-patch-1
2017-09-05 11:38:27 -04:00
Florrie
f4488d1b60
Begin work on 'old text' costumes
2017-09-03 20:35:27 -03:00
Ken
3185eb27e1
Rewrote transparency block
...
Wrapping of the value is now handled by a new function, _wrapTransparency;
_updatePenColor now handles the transparency value;
DEFAULT_PEN_STATE now includes a transparency value (100).
2017-09-01 14:11:09 +08:00
DD
5606b067e5
More comment fixes
2017-08-31 13:41:47 -04:00
DD
7d3b9a866c
Fix comment
2017-08-31 11:55:17 -04:00
DD
e5208445ac
Add updateSVG to tell the renderer about the updated drawing
2017-08-31 11:43:41 -04:00
Ken
f61366643d
Clamp transparency value (at least for set)
2017-08-31 09:24:41 +08:00
DD
5f5f7b1684
add get svg function
2017-08-30 14:23:03 -04:00
Ken
fc4f073526
Add glide (number) secs to [dropdown] block ( #662 )
...
* Add glide to dropdown block
* Use helper functions instead of copy-paste
* Wrong syntax for array 😒
* Aha
* Fix some Travis issues
* Aha!! This should work
* Wow, Travis is strict about spacing!
* Make requested changes
Rename function getTarget to getTargetXY
Rename parameter TO to targetName
2017-08-28 15:44:34 -04:00
Ray Schamp
f367f2d358
Merge pull request #670 from rschamp/eslint-config-scratch-4
...
Update eslint and eslint-config-scratch
2017-08-26 13:26:05 -04:00
Ray Schamp
32bc087bba
Fix remaining lint issues
2017-08-26 13:24:10 -04:00
Ray Schamp
5113876588
Pass with --fix
2017-08-26 13:24:10 -04:00
Ken
8a77329c79
Fix lint issue and update maximums
...
Inferring from the issue, the maximum seems to be 100, not 255 (default for set is 50 and change is 10). Changed that.
A comment line was too long (thanks lint) so it has now been reworded.
2017-08-25 15:24:56 +08:00
Ken
e30e5809d1
Add new blocks
...
change pen transparency by (num)
set pen transparency to (num)
2017-08-25 15:07:38 +08:00
Ray Schamp
f6189903f8
Merge pull request #668 from SillyInventor/develop
...
Switch from parseInt to Math.floor
2017-08-24 12:24:13 -04:00
Andrew Sliwinski
d1af3ef808
Merge pull request #562 from bigeyex/feature/fix-deleted-clone-sequence-order
...
Fix the next thread is skipped after clone deleted
2017-08-23 09:51:38 -04:00
SillyInventor
525b601253
Switch from parseInt to Math.floor
2017-08-22 10:30:41 -04:00
Chris Willis-Ford
2665ef2b2b
Merge pull request #640 from cwillisf/feature/message-dispatch
...
Implement message dispatch system
2017-08-17 10:57:23 -07:00
Ken
884e24f782
*facepalm*
2017-08-11 02:23:43 +12:00
Ken
28e61dbf48
Cleaned up
2017-08-11 01:58:59 +12:00
Ken
328514ae63
This kinda doesn’t make sense, but ok
2017-08-11 01:46:26 +12:00
Ken
5af99566fa
Wait includes is case sensitive
...
Made it convert to lowercase before comparing
2017-08-11 01:27:31 +12:00
Ken
3b601e8595
Add string contains string
2017-08-11 00:52:41 +12:00
Christopher Willis-Ford
b4c0cfe940
Refactor common code in {central,worker}-dispatch
...
Central dispatch and worker dispatch share most of their code now by
inheriting from a new shared dispatch class.
Also, the format of passed messages has been altered to make it easier
to understand in a debugger.
2017-08-09 17:30:00 -04:00
neurosie
86e2b2338e
Fix variable deserializing
2017-08-08 16:00:31 -04:00
DD Liu
a48efe681e
tests
2017-07-31 17:57:51 -04:00
DD Liu
cc1678fa9e
Also run monitor blocks every frame
2017-07-28 14:38:26 -04:00
DD Liu
2aef75bc11
Merge branch 'develop' into timerBlock
2017-07-28 11:35:47 -04:00
TheBrokenRail
936ff04b0f
Fix setting Infinity to direction ( #612 )
...
* Create rendered-target.js
* Update math-util.js
* Update rendered-target.js
* Update math-util.js
* Update rendered-target.js
2017-07-26 17:44:02 -04:00
Paul Kaplan
f2bd32a81a
Merge pull request #653 from paulkaplan/sound-ids
...
Use sound ID instead of md5 for playing sounds
2017-07-26 09:00:00 -04:00
Paul Kaplan
25a0e2ffaf
Use new audio engine api to retreive and set sound buffers
2017-07-25 17:03:26 -04:00
Paul Kaplan
44298fd71b
Use soundId instead of md5 for playing sounds
2017-07-25 12:20:32 -04:00
Paul Kaplan
0cf05647d2
Merge branch 'develop' into fix-asset-naming
2017-07-25 10:48:25 -04:00
Paul Kaplan
f96a92b4d1
Move renaming and adding into rendered-target with tests
2017-07-25 10:32:25 -04:00
Christopher Willis-Ford
97d67d75f4
Allow 'then' on service registration
...
This allows a service to postpone communication with other services
until it can be sure that it's registered with central dispatch. Service
registration on the main thread always happens immediately, but that
version of `setService` still returns a Promise for consistency.
2017-07-21 13:23:52 -07:00
Christopher Willis-Ford
0fcc248ac1
Add tests for message dispatch system; fix bugs
...
The tests run using TinyWorker, which emulates web workers on Node.
There are quite a few quirks in that situation due to the differences
between Node and Webpack as well as the differences between TinyWorker
and real Web Workers.
The tests also exposed a few bugs in the dispatch system, which have now
been fixed. Most notably, if a method called through the dispatch system
throws an exception that exception will now be passed back to the
caller. Previously the exception would escape the dispatch system and
the caller would never hear any response at all.
2017-07-21 13:23:52 -07:00
Christopher Willis-Ford
09d3fe330f
Implement message dispatch system
...
This message dispatch system allows a "service" to register itself under
a particular name, and then anyone can call any method on that service
from any context (the main "window" thread or any worker). Return values
are passed back through promise resolution.
2017-07-21 13:22:14 -07:00
Paul Kaplan
bd3a29650b
Fix variable import scoping
2017-07-17 12:28:44 -04:00
DD Liu
912e7daa81
Merge pull request #636 from fsih/deleteMonitors
...
Update monitors when deleting or renaming variables
2017-07-17 11:06:29 -04:00
Paul Kaplan
0e33d061fe
Merge pull request #633 from paulkaplan/fix-sound-indexing
...
Fix sound indexing and add tests
2017-07-13 15:08:05 -04:00
Paul Kaplan
eb04fcab57
Merge pull request #634 from paulkaplan/sound-costume-renaming
...
Add public API for costume and sound renaming
2017-07-13 09:00:19 -04:00
DD Liu
3722aefb17
fix greater than hat block click activation, and also event activation which was only on half the time
2017-07-12 15:46:23 -04:00
DD Liu
01db5da8ce
fix value
2017-07-11 13:08:18 -04:00
DD Liu
4b1307bb11
fix test
2017-07-11 11:51:47 -04:00
DD Liu
7f1f9079e3
support rename variable
2017-07-10 18:29:25 -04:00
Paul Kaplan
a83c0808a0
Add public API for costume and sound renaming with tests
2017-07-07 08:19:32 -04:00
Paul Kaplan
2ddb6215fd
Add tests and fixes for set instrument and play drum
2017-07-06 14:56:46 -04:00
Paul Kaplan
1b6baf8114
Make playSound use one indexing
2017-07-06 14:28:11 -04:00
Paul Kaplan
6fa49b1e7a
Merge pull request #629 from marisaleung/develop
...
ChangeBlock uses id's of variable instead of name.
2017-06-30 08:10:55 -04:00
Chris Willis-Ford
47fc38fd9a
Merge pull request #619 from cwillisf/clone-custom-state
...
Clone custom state
2017-06-27 22:37:30 -07:00
marisaleung
22f87e32f8
ChangeBlock uses id's of variable instead of name.
2017-06-27 16:28:37 -07:00
Paul Kaplan
b0fb4f0b55
Merge pull request #614 from marisaleung/develop_cherry-picks
...
Updated variables and var_fire event listener.
2017-06-23 13:05:03 -04:00
marisaleung
875ccf5b88
Updated variables and var_fire event listener.
2017-06-23 09:57:01 -07:00
Eric Rosenbaum
01f801a2a2
Remove all audio effects except pitch and pan
2017-06-19 14:56:29 -04:00
Christopher Willis-Ford
06d5994a32
Use targetWasCreated
event to clone pen state
...
Remove explicit cloning of `_customState` in favor of smarter,
state-specific cloning.
2017-06-16 14:22:51 -07:00
Christopher Willis-Ford
04871e24d6
Move RenderedTarget.runtime into Target
...
Some code in `Target` was already assuming a `runtime` property was
available, so this change just makes it official.
2017-06-16 13:16:13 -07:00
DD Liu
2fb502fb70
add ability to refresh workspace for current editing target
2017-06-15 11:53:30 -04:00
Paul Kaplan
93bac9ad85
Merge pull request #608 from paulkaplan/unshadow-variable-dropdown
...
Use variable field instead of input shadow
2017-06-15 10:02:08 -04:00
Paul Kaplan
5df4456c4a
Use variable field directly
2017-06-14 16:31:29 -04:00
Christopher Willis-Ford
884ba19aab
Add support for older SB3 JSON
...
If the `dataFormat` field is absent, fall back on the older `assetType`
field. That can at least help us tell if something is a vector or bitmap
image, though it doesn't tell us which kind of bitmap.
2017-06-13 14:56:06 -07:00
Christopher Willis-Ford
88e44c65eb
Remember the data format when an asset is imported
2017-06-12 12:31:49 -07:00
Ray Schamp
d9704b23c3
Merge pull request #598 from cwillisf/improve-clone-cleanup
...
Improve cleanup on clone disposal
2017-06-12 09:45:07 -04:00
Paul Kaplan
f968edec54
Merge pull request #594 from paulkaplan/select-other-sprites-after-delete
...
Select the last target instead of the first after deleting
2017-06-12 08:41:20 -04:00
Paul Kaplan
9c5d43e9d3
Enhance sprite delete behavior
2017-06-12 08:35:27 -04:00
DD Liu
fb986effe6
Merge pull request #593 from fsih/fixWaitCalledEveryFrame
...
Change wait to use a promise instead of being called every frame
2017-06-08 15:35:48 -04:00
Christopher Willis-Ford
454082b569
Improve cleanup on clone disposal
...
The `dispose()` method on `RenderedTarget` now:
- informs the runtime that it should end any threads corresponding the
target being disposed, and
- removes the clone from its sprite.
2017-06-07 17:05:24 -07:00
Chris Willis-Ford
d41997b58b
Merge pull request #556 from cwillisf/wedo2-blocks
...
Add WeDo 2.0 blocks
2017-06-07 09:57:36 -07:00
Paul Kaplan
40345384aa
Select the last target instead of the first
2017-06-07 09:06:46 -04:00
DD Liu
e237d24846
fix lint
2017-06-06 10:21:27 -04:00
DD Liu
ab0cef52eb
Change wait to use a promise instead of being called every frame
2017-06-05 16:55:15 -04:00
Ray Schamp
ecf535f4c3
Merge pull request #579 from cwillisf/load-jpeg-backdrops
...
Specify dataFormat when loading asset for import
2017-06-02 09:06:37 -04:00
Ray Schamp
adcd225598
Merge pull request #584 from rschamp/nit/no-useless-call
...
Fix no-useless-call todo
2017-06-01 09:48:58 -04:00
DD Liu
d3d82bae69
Merge pull request #574 from fsih/immutableState
...
Only send update monitor events when changes happen
2017-05-30 12:38:09 -04:00
Ray Schamp
b810b7be0a
Merge pull request #583 from rschamp/bugfix/save-clones-bad
...
Don't serialize clones when saving
2017-05-30 10:24:52 -04:00
DD Liu
55f677702a
add missing file
2017-05-30 10:05:13 -04:00
Paul Kaplan
51928bac65
Merge pull request #581 from paulkaplan/feature/variable-persistence
...
Add variable creation and variable serialization
2017-05-30 09:26:37 -04:00
DD Liu
809760b954
Merge branch 'develop' into immutableState
2017-05-26 13:50:50 -04:00
Paul Kaplan
3e9dfde43f
Merge pull request #576 from paulkaplan/feature/monitor-labels
...
Send monitor opcode and block params instead of fixed label/categories
2017-05-26 11:07:58 -04:00
Paul Kaplan
77cc01a38a
Add variable creation and variable serialization
2017-05-25 11:44:49 -04:00
Christopher Willis-Ford
cbfbc5d600
Convert motor duration: seconds -> milliseconds
...
The block takes seconds, whereas the device takes milliseconds. Turning
on a motor for 1 millisecond isn't very dramatic.
2017-05-24 16:40:55 -07:00
Christopher Willis-Ford
06fe701624
Implement WeDo 2.0 blocks
2017-05-24 16:40:55 -07:00
Christopher Willis-Ford
2625529ebe
Create WeDo 2.0 device communication classes
2017-05-24 16:40:55 -07:00
Christopher Willis-Ford
eb931fd99b
Specify dataFormat when loading asset for import
...
When importing a project we know the file extension for each asset to be
loaded. This change provides that information to the storage system so
that we can load assets which don't use the default. For example, this
allows loading JPG-format backdrops.
In support of this change, there's a new function on `StringUtil` called
`splitFirst`, which splits a string on the first instance of a separator
character. This change includes unit tests for this new function.
2017-05-24 15:35:10 -07:00
Chris Willis-Ford
3970883e45
Merge pull request #549 from cwillisf/device-manager-client
...
Device manager client
2017-05-24 14:43:28 -07:00
DD Liu
18282fc1d0
remove get for records
2017-05-24 16:33:22 -04:00
DD Liu
2867b5c331
add record file
2017-05-24 15:43:12 -04:00
DD Liu
5df3d4ab68
Merge branch 'develop' into immutableState
2017-05-24 15:42:54 -04:00
DD Liu
1902848ea4
Switch to ordered maps of monitor records for monitor state
2017-05-24 15:42:29 -04:00
Paul Kaplan
df9230a0ff
Make helper private
2017-05-23 09:55:42 -04:00
DD Liu
acdc783f27
emit immutable
2017-05-22 17:31:53 -04:00
Andrew Sliwinski
b39de6722f
Merge pull request #575 from TheBrokenRail/patch-32
...
Fix SB2 Imports
2017-05-22 13:47:37 -07:00
Paul Kaplan
5973e2d305
Add reporting for block params
2017-05-22 15:18:48 -04:00
Paul Kaplan
817ea47e32
Remove XY from monitor reporting
2017-05-22 14:40:07 -04:00
Paul Kaplan
144a0b349d
Change monitor reporting from category and label to opcode
2017-05-22 13:38:29 -04:00
Paul Kaplan
3eaec99e51
Always activate the current costume after deleting
2017-05-22 08:17:28 -04:00
Paul Kaplan
423da12c3c
Handle more cases of deleting costumes
2017-05-22 08:17:28 -04:00
Paul Kaplan
30a0c0d251
Allow deleting the last sound
2017-05-22 08:17:28 -04:00
Paul Kaplan
a608ca4fed
Make rendered targets in charge of deleting their own sounds and costumes
2017-05-22 08:17:28 -04:00
Paul Kaplan
73cb823199
Add delete costume and sound functions to the vm public api
2017-05-22 08:17:28 -04:00
TheBrokenRail
5b81c8b087
Update sb2_specmap.js
2017-05-21 12:26:16 -04:00
DD Liu
48c51ab2ec
switch to nested immutables state
2017-05-19 17:28:00 -04:00
DD Liu
9645a513b1
Only send monitor update on change
2017-05-19 12:28:05 -04:00
DD Liu
adc60001ee
Merge branch 'develop' into updateMonitorsAction
2017-05-18 16:50:34 -04:00
Paul Kaplan
745a81ef96
Merge pull request #573 from paulkaplan/fix-sprite-renames
...
Fix sprite rename incrementing when renamed to itself
2017-05-18 15:40:11 -04:00
Paul Kaplan
beaef901a7
Add failing test for gui issues 370
...
Fix rename increment when renamed to itself
2017-05-18 09:13:31 -04:00
Ray Schamp
cf188bc5e4
Don't serialize clones when saving
2017-05-18 02:07:35 +09:00
Paul Kaplan
2c4361b830
Fix refreshTargets race condition
2017-05-16 09:20:52 -04:00
Ray Schamp
548aa6dd70
Fix no-useless-call todo
...
The linter is correct that `devObject[func].call(devObject, args)` is unnecessary because it's equivalent to `devObject[func](args)`.
@tmickel probably either meant to allow passing an array of arguments to be applied, or to call the function with the provided argument. Since we probably want to be able to use multi-argument functions, use `apply` and fix the one place that uses `ioQuery` with an argument.
2017-05-15 21:11:38 -07:00
DD Liu
f1208720f6
restore things lost in bad merge
2017-05-15 16:25:34 -04:00
DD Liu
65d998f473
attach issue to todo
2017-05-15 10:47:36 -04:00
DD Liu
dcdb806b57
fix merge more
2017-05-15 10:45:20 -04:00
DD Liu
4cfedc8d9d
fix merge conflicts
2017-05-15 10:18:48 -04:00
DD Liu
9060a35350
Merge branch 'develop' into updateMonitorsAction
2017-05-15 10:16:12 -04:00
DD Liu
6ee1e6614c
Remove leftover instances of MONITORS_ADDED and MONITORS_REMOVED, change updateMonitor to requestUpdateMonitor, update some todos with tracking numbers.
2017-05-15 10:12:25 -04:00
Ray Schamp
20337b53f2
Stop emitting SPRITE_INFO_REPORT
...
Instead, set the `_refreshTargets` flag, and emit a full target list at the end of the step.
2017-05-12 11:42:22 -04:00
Wang Yu
6ec231db9d
Fix the next thread is skipped after clone deleted
...
Problem:
When a clone is deleted, its thread is removed from the thread
list; but the index "i" in the execution for-loop will still +1,
making the next thread skipped.
Changes:
Added a flag "isKilled" on a thread;
Set the flag when a thread is removed from the thread list;
reduce the "i" counter if the thread of the current loop is removed.
2017-05-12 14:01:37 +08:00
DD Liu
7a1b3eccd0
fix Object.values is not a function test
2017-05-11 17:28:48 -04:00
DD Liu
2a7f3edda6
Fix some issues: 1. Monitors not running anymore if you change categories 2. Visual reports not showing 3. threads acquiring properties of old thread when restarting thread
2017-05-11 17:12:19 -04:00
DD Liu
6b774c58f5
Update some comments
2017-05-11 15:23:11 -04:00
Christopher Willis-Ford
9d306962bd
Fix socket.io-client dependency problems re: build
...
The Socket.io client library pulls in some extra dependencies in a way
that isn't fully compatible with Webpack. Switching to their build
output file, instead of the file specified in their `package.json`,
makes those errors go away.
2017-05-11 12:07:46 -07:00
Ray Schamp
6c9701f4b2
Merge branch 'develop' into feature/serialization
2017-05-11 13:04:27 -04:00
DD Liu
7841d44ccf
Move the block.isMonitored below the block is undefined check
2017-05-11 10:33:46 -04:00
DD Liu
1ea69dd504
Rename functions to be less wordy
2017-05-11 10:20:33 -04:00
Ray Schamp
33fc797868
Select the stage if the project has no sprites
2017-05-11 02:24:10 -04:00
Ray Schamp
635b40ec2b
Log parsing errors
2017-05-11 02:22:12 -04:00
DD Liu
b2e0a632e3
add add monitor action
2017-05-10 17:00:08 -04:00
DD Liu
b1355c6b0b
Fire remove monitors VM event
2017-05-10 15:47:06 -04:00
DD Liu
138b4631e1
Merge branch 'develop' into updateMonitorsAction
2017-05-10 14:21:31 -04:00
DD Liu
4687fe41fe
don't show green flag when monitor running
2017-05-10 14:06:02 -04:00
DD Liu
777d1f3824
add comment to monitor block listener filtering of events
2017-05-10 11:27:55 -04:00
DD Liu
4045ae7338
Merge pull request #558 from fsih/monitors
...
Will run blocks with boxes checked next to them once per frame in the playground, once the code to emit checkbox events is in scratch-blocks
2017-05-10 11:27:17 -04:00
DD Liu
97bfc90351
add comment to monitor block listener filtering of events
2017-05-10 11:22:03 -04:00
DD Liu
4ae1321252
indicate show visual report or update monitor on the thread
2017-05-09 17:34:13 -04:00
DD Liu
35a208d1d3
make it possible for VM to emit update monitors action
2017-05-09 12:10:11 -04:00
DD Liu
26a5098347
don't show visual report when monitor is running
2017-05-08 16:51:45 -04:00
DD Liu
706e112082
Add a block container for monitors that will run in the sequencer
2017-05-08 15:45:55 -04:00
Rasmus Haglund
d0f1b77209
Copy _customState for now until blocks have init functions
2017-05-05 21:58:18 +02:00
Christopher Willis-Ford
35d0544ce0
Respond to review comments
...
- Pin `got` and `socket-io.client`
- Finish removing `removeSocket`-related code
2017-05-05 10:37:29 -07:00
Ray Schamp
baee9a2793
Don't clean costume and sound lists
...
They are already clean, since we don't store the data on them any more.
2017-05-04 13:03:42 -04:00
Ray Schamp
efe31f4825
Fix costume deserialization
2017-05-04 12:41:54 -04:00
Ray Schamp
2181e51c38
Don't store costume data uris on costumes
2017-05-04 12:29:28 -04:00
Ray Schamp
c5cf6d9b40
Use asset id reference on sounds
2017-05-04 12:29:10 -04:00
Christopher Willis-Ford
e096f43487
DeviceManager: add more jsdoc, remove _sockets
...
It turns out we don't need the Device Manager to centrally track each
socket, so this change removes the Device Manager's `_sockets` property
and related code.
2017-05-03 16:28:06 -07:00
Christopher Willis-Ford
9a9c509e76
Implement a few tests for io/deviceManager
2017-04-28 14:50:57 -07:00
Christopher Willis-Ford
f3c6be2881
Add an I/O device to represent the Device Manager
2017-04-28 13:40:13 -07:00
Ray Schamp
4f59e98bc8
Merge branch 'develop' of https://github.com/LLK/scratch-vm into feature/serialization
...
# Conflicts:
# src/virtual-machine.js
2017-04-27 17:53:30 -04:00
Ray Schamp
f785117e1d
Lint and fix failing tests
2017-04-27 17:49:57 -04:00
Ray Schamp
c9ce6776aa
Get SB3 imports working
...
For now, store the md5 + extension on costumes in the VM. This way we can load them the same way as we load SB2 assets.
2017-04-27 17:08:06 -04:00
Paul Kaplan
9fce03b16f
Merge pull request #547 from paulkaplan/fix-add-sprite-refresh
...
Fix sprite not drawing after being added
2017-04-27 12:39:59 -04:00
Paul Kaplan
c891268672
Fix sprite not drawing after being added
2017-04-27 11:10:22 -04:00
Ray Schamp
b2ea201707
Don't include asset data in exported JSON
2017-04-26 17:45:36 -04:00
Ray Schamp
2a4af8a9ca
Fix up most linting/merge errors
2017-04-26 16:50:53 -04:00
Ray Schamp
a4cdb027ab
Merge branch 'develop' of github.com:morantsur/scratch-vm into feature/serialization
...
# Conflicts:
# src/playground/index.html
# src/serialization/sb2.js
# src/sprites/rendered-target.js
# src/virtual-machine.js
# test/unit/serialization_sb2.js
2017-04-26 11:44:53 -04:00
Ray Schamp
83ae96b51b
Merge pull request #542 from a49594a/patch-1
...
Fix missing right quote marks in `blockToXML`
2017-04-24 12:23:55 -04:00
john
e91865fc21
the right quots is mission in blockToXML
...
the right quote is mission in blockToXML, and it will result in the following code execution errors
vm.on('workspaceUpdate', function (data) {
workspace.clear();
var dom = Blockly.Xml.textToDom(data.xml);
Blockly.Xml.domToWorkspace(dom, workspace);
});
2017-04-21 16:36:33 +08:00
Christopher Willis-Ford
c750f53c81
Get Asset
and AssetType
from storage instance
2017-04-20 16:12:17 -07:00
Ray Schamp
9c34b692c0
Fix ES6 lint after merge
2017-04-19 17:54:52 -04:00
Ray Schamp
e96807b399
Merge branch 'develop' of https://github.com/LLK/scratch-vm into es6
...
# Conflicts:
# src/import/sb2import.js
# src/virtual-machine.js
# webpack.config.js
2017-04-19 17:54:31 -04:00
Ray Schamp
d2343e3601
Fix up some auto-converted weirdness
2017-04-19 17:36:33 -04:00
Paul Kaplan
8a4c3af18a
Merge pull request #535 from paulkaplan/isolate-import
...
Separate downloading from installation of sprite info
2017-04-19 11:40:30 -04:00
Paul Kaplan
4b5e7a57a5
Fix binding issues
2017-04-19 08:53:07 -04:00
Paul Kaplan
f161640876
Update tests
2017-04-18 11:55:38 -04:00
Paul Kaplan
d86fe6a075
Do not add targets to runtime until they are fully loaded
2017-04-18 09:27:58 -04:00
Ray Schamp
a4f095db5e
Use ES6 style classes
2017-04-17 19:42:48 -04:00
Ray Schamp
4455b0694f
Fix remaining no-var and no-use-before-define's
2017-04-17 17:15:19 -04:00
Ray Schamp
e01c4ae108
Pass with --fix
2017-04-17 15:10:04 -04:00
Ray Schamp
f646a61c5b
Use es6 lint rules
2017-04-17 15:09:57 -04:00
Rasmus Haglund
b693d4f4ef
Fix rounded get size reporting
2017-04-08 19:35:29 +02:00
Eric Rosenbaum
092084cc6b
Merge pull request #513 from ericrosenbaum/feature/loudness
...
Add loudness block
2017-04-07 14:06:18 -04:00
Chris Willis-Ford
44623db5e3
Merge pull request #522 from presight/develop
...
Fix so that size is set in float to ensure backward compatibility with Scratch 2.0
2017-04-06 14:55:08 -07:00
Paul Kaplan
aa2e255add
Merge pull request #526 from paulkaplan/report-sound-costume-data
...
Report sound costume data
2017-04-06 11:45:50 -04:00
Paul Kaplan
8e84b2757e
Report costume and sound data in sprite json
2017-04-06 09:37:39 -04:00
spenen
41082a76cd
Fixed xml import/export in Playground
2017-04-05 20:23:16 +02:00
spenen
0f0292320b
Added size to playground render info
2017-04-05 18:51:16 +02:00
spenen
8c7097f724
Fix #521 so that size is set in float to ensure backward compatibility with Scratch 2.0
2017-04-05 13:46:42 +02:00
Paul Kaplan
771f18e23b
Merge pull request #516 from paulkaplan/add-sound-public-api
...
Expose VM#addSound publicly
2017-04-04 09:05:45 -04:00
Paul Kaplan
2d6eaae01e
Update jsdoc
2017-04-03 16:00:58 -04:00
Paul Kaplan
33f436811c
return sound in promise
2017-04-03 16:00:31 -04:00
Ray Schamp
57e73a68a6
Add costume dataURI to costumes from storage ( #517 )
...
* Add costume dataURI to costumes from storage
Towards #515 , LLK/scratch-gui#279
* Fix tests
* Load costumes incrementally
Some of our tests assume that at least some of our costume data is available before the costume data is loaded. So, provide as much costume data as is available.
* Remove unnecessary filter for null costumes
Resolved when we updated to load costumes incrementally.
/ht @cwillisf
2017-04-03 15:58:13 -04:00
Chris Willis-Ford
a4aa3810ae
Merge pull request #462 from griffpatch/optimise/reduceGetBlockCalls
...
Optimise reducegetblockcalls
2017-04-03 13:00:05 -04:00
Paul Kaplan
251244ce9c
Expose VM#addSound publicly
2017-04-03 09:33:23 -04:00
Paul Kaplan
828f7bfd1c
Merge pull request #514 from paulkaplan/fix-costume-backdrop-loading
...
Use costume loading from importer in public costume and backdrop loader
2017-03-31 12:52:06 -04:00
Paul Kaplan
70530dbeb3
Do not need to emit targets update, done in setCostume
2017-03-31 12:35:20 -04:00
Paul Kaplan
2559f9557f
Resolve to null on error
2017-03-31 11:26:20 -04:00
Eric Rosenbaum
5d14315199
Use log.error
2017-03-29 12:28:20 -04:00
Paul Kaplan
6531dbc2fe
Add logger (thanks linter)
2017-03-27 15:12:25 -04:00
Paul Kaplan
df44134e1c
Use costume loading from importer in public costume and backdrop loader
2017-03-27 15:04:44 -04:00
Eric Rosenbaum
b74c03dbbd
Loudness returns -1 if no audio engine exists
...
To match Scratch 2.0 behavior
2017-03-27 13:20:44 -04:00
Eric Rosenbaum
1ec1165905
Audio engine decodes sounds
2017-03-27 11:56:28 -04:00
Eric Rosenbaum
2303a1abc5
Remove call to loadSounds from rendered-target initDrawable
2017-03-27 11:56:28 -04:00
Chris Willis-Ford
c8b4871b19
Merge pull request #498 from cwillisf/use-scratch-storage
...
Load projects & costumes through scratch-storage
2017-03-23 22:10:25 -07:00
Christopher Willis-Ford
10cb97c52e
Report missing storage module as an error
2017-03-23 16:03:32 -07:00
Silly Inventor
77775cdadb
Switch to using number directly, instead of toNumber for costume switch ( #499 )
2017-03-23 18:34:04 -04:00
griffpatch
c754cc7cf8
Remove line break
2017-03-22 09:11:53 +00:00
griffpatch
220d854f28
Merge remote-tracking branch 'refs/remotes/LLK/develop' into optimise/reduceGetBlockCalls
...
# Conflicts:
# src/engine/execute.js
2017-03-22 08:58:01 +00:00
griffpatch
25429b1192
Tidy up commit and revert direct member access
2017-03-22 08:48:30 +00:00
griffpatch
a5ce0f60cf
Merge remote-tracking branch 'refs/remotes/LLK/develop' into optimise/reduceGetBlockCalls
2017-03-22 07:56:04 +00:00
Eric Rosenbaum
144c587e78
Merge pull request #507 from ericrosenbaum/bugfix/clamp-audio-inputs
...
Clamp audio inputs
2017-03-21 17:48:10 -04:00
Eric Rosenbaum
b4a94c266f
Add loudness block
2017-03-20 17:01:44 -04:00
Eric Rosenbaum
106db6a024
Clamp range for each audio effect
2017-03-20 14:53:04 -04:00
Paul Kaplan
8bbb395b35
Add sprite name incrementing and reserved naming
2017-03-20 12:52:57 -04:00
Paul Kaplan
052ecef91c
Add string utils with tests
2017-03-20 12:12:38 -04:00
Paul Kaplan
5d2352e471
Add test for skipping rename on blank input
2017-03-20 11:14:25 -04:00
Eric Rosenbaum
c9338f37ed
Clamp tempo range
...
The function in AudioEngine for change tempo can now be removed
2017-03-17 18:13:33 -04:00
Eric Rosenbaum
f2ac365859
Clamp beat durations for play note, play drum and rest
2017-03-17 17:29:23 -04:00
Eric Rosenbaum
1ba7ad0218
Clamp range for “play note” input
...
Clamp to 36-96, which is C2-C7.
This is a temporary fix to prevent errors, until we have a new instrument player implementation, which may have a different range.
2017-03-17 17:23:53 -04:00
Chris Willis-Ford
3d7f1187e5
Merge branch 'develop' into use-scratch-storage
2017-03-13 15:48:21 -07:00
Christopher Willis-Ford
c945b37288
Fix lint, missing require
2017-03-13 15:44:13 -07:00
Moran
94d2a39cc1
Merge branch 'develop' of https://github.com/LLK/scratch-vm into develop
2017-03-13 18:07:17 -04:00
Christopher Willis-Ford
6ad0f3351b
Check if storage module is present before using it
2017-03-13 15:06:28 -07:00
Christopher Willis-Ford
e4fd9d57a2
Fix tests involving scratch-storage
...
- Attach the storage module to the VM for tests which load projects or
other assets.
- Move `import_sb2.js` from `test/unit/ into `test/integration` since it
now depends heavily on `scratch-storage`.
- Skip loading costumes when there is no renderer.
2017-03-09 15:50:43 -08:00
Ray Schamp
b03768cad6
Remove filter toolbox utility ( #496 )
...
* Revert "Merge pull request #486 from rschamp/fix-filter-tests"
This reverts commit ba00db897f
, reversing
changes made to 739c5deb63
.
* Revert "Show Categories that use custom code to load (variables, procedures) (#483 )"
This reverts commit 739c5deb63
.
* Revert "Merge pull request #461 from rschamp/filter-toolbox"
This reverts commit 343b5bfe8e
, reversing
changes made to 370f2c6a47
.
2017-03-09 16:41:06 -05:00
Christopher Willis-Ford
c23e9c6bf8
Load projects & costumes through scratch-storage
...
This also sets up the framework to load sounds through scratch-storage,
to be finished in a later change.
2017-03-09 11:25:55 -08:00
Paul Kaplan
2ebb112d30
Merge pull request #495 from paulkaplan/fix-target-id
...
Add check to make sure `target` exists
2017-03-08 12:13:10 -05:00
Paul Kaplan
8aaadf2fab
Add check to make sure target exists
2017-03-08 11:40:02 -05:00
Paul Kaplan
5b82096670
Clear gfx on stop all
2017-03-06 15:54:52 -05:00
Moran
d8e1d42bf2
Merge branch 'develop' of https://github.com/LLK/scratch-vm into develop
2017-03-03 15:23:43 -05:00
Ray Schamp
bf2303f6de
Merge pull request #490 from rschamp/dnd
...
Add methods for dragging and dropping sprites
2017-03-03 09:50:34 -05:00
Ray Schamp
d0cd9cd897
Add methods for dragging and dropping sprites
...
* Add `getTargetIdForDrawableId` to translate between renderer picks and VM targets
* Add `startDrag` to stop sprite motion while dragging
* Add `stopDrag` to return sprite motion after dragging
2017-03-03 09:43:31 -05:00
Ray Schamp
319f27a060
Merge pull request #487 from rschamp/draggability
...
Add draggable property to sprites
2017-03-02 15:56:12 -05:00
Ray Schamp
11e28111c5
Activate click hats on mouse up to match 2.0
2017-03-02 11:32:10 -05:00
Andrew Sliwinski
a4578ba086
Default bitmapResolution to 1 if not provided in costume metadata ( #485 )
...
* Default bitmapResolution to 1 if not provided in costume metadata. Resolves GH-484
2017-03-02 11:21:01 -05:00
Ray Schamp
8dadc42857
Add draggable property to sprites
...
This property should be managed by the VM so that it can be displayed in the sprite info panel in the GUI.
2017-03-01 18:49:17 -05:00
Andrew Sliwinski
7042bdb45c
Merge pull request #472 from griffpatch/bug/escapeFromConditionalBranches
...
Bug - escapeFromConditionalBranches
2017-03-01 16:42:30 -05:00
TheBrokenRail
739c5deb63
Show Categories that use custom code to load (variables, procedures) ( #483 )
2017-03-01 09:25:11 -05:00
Ray Schamp
390b2373e9
Refactor filter methods into util
2017-02-27 12:57:38 -05:00
Ray Schamp
a9b495fced
Filter the playground toolbox
2017-02-27 12:57:38 -05:00
Ray Schamp
99e1b24285
Add rudimentary toolbox filtering method
2017-02-27 12:57:38 -05:00
Ray Schamp
370f2c6a47
Merge pull request #459 from griffpatch/feature/FencingAgain
...
Feature fencing again
2017-02-24 11:27:10 -05:00
Chris Willis-Ford
a56db95aba
Merge pull request #446 from magmaboat/hasownproperty
...
Perform hasOwnProperty validation
2017-02-22 13:55:54 -08:00
griffpatch
c5eb8ece16
Handle actual looping cases
...
And it starts to get a little less elegant :/
Wondering if this should not be handled better in another part of the
codebase?
We don't want to be duplicating existing code stepping functionality
locally at the end of the promise script really... What do you think?
2017-02-20 09:40:32 +00:00
griffpatch
362a231279
bug - escape from conditional branches
...
Execution bug: can't escape from conditional branches that end with a
Promise-resolution-terminating command block (see #464 )
2017-02-20 08:20:21 +00:00
griffpatch
a141bfb1b9
Fix lint issues
2017-02-16 10:54:17 +00:00
griffpatch
7bc141e76e
Feature Fencing
...
This is a re-comit after the previous pull was reverted.
2017-02-15 15:59:54 +00:00
Ray Schamp
39158c9d48
Revert "Feature fencing"
2017-02-15 09:40:10 -05:00
griffpatch
75e3f6002b
Fencing - Take 3
...
Dependant on scratch-render pull request.
2017-02-14 09:12:35 +00:00
Christopher Willis-Ford
18107cde7b
Reverse target iteration in allScriptsDo
...
The `allStacksAndOwnersDo` function in Scratch 2.0 runtime iterates
targets in reverse and projects sometimes rely on that for correct
initialization. If, for example, each sprite runs a "go back 999 layers"
or "go to front" block as its first action, the order of execution will
determine the ordering of the layers.
This change makes Scratch 3.0 match the Scratch 2.0 execution order.
2017-02-13 14:45:29 -08:00
Christopher Willis-Ford
bd76395676
Minor cleanup around cloning methods
2017-02-13 14:44:51 -08:00
griffpatch
75a1542fc3
Merge remote-tracking branch 'refs/remotes/origin/develop' into optimise/reduceGetBlockCalls
2017-02-11 15:39:33 +00:00
griffpatch
9aa81d6776
Merge remote-tracking branch 'refs/remotes/LLK/develop' into feature/fencing
2017-02-11 14:30:59 +00:00
griffpatch
4d63dcac3b
Rename fencing method
2017-02-11 14:30:18 +00:00
griffpatch
ea59f8cd66
Reduce calls to getBlock
2017-02-11 14:26:23 +00:00
Christopher Willis-Ford
243d68f88b
Use Webpack to generate the whole playground
...
The previous configuration mixed Webpack output with static content in
order to create the playground. This change moves that static content
from `/playground/` into `/src/playground/` and adds a Webpack rule to
copy it into the playground as part of the build.
On the surface this might seem unnecessary, but it provides at least two
benefits:
- It's no longer possible to accidentally load stale build output
through `webpack-dev-server` in the event of a misconfiguration. This
was very easy in the previous configuration, and might in fact be the
only way that `webpack-dev-server` ever worked for this repository.
- It's simpler to ensure that various rules apply to the hand-authored
content and not build outputs. This includes lint rules, `.gitignore`,
IDE symbol search paths, etc.
2017-02-10 14:21:37 -08:00
Eric Rosenbaum
99be466aa7
Merge pull request #444 from ericrosenbaum/bugfix/playnote-volume
...
Pass volume to audioengine playnote
2017-02-10 14:09:55 -05:00
Ray Schamp
fb181d5ce3
Merge pull request #447 from CSnap/fix_keyPressToUpperCase
...
Switch From Return Null to Return Empty String in keyCodeToScratchKey
2017-02-10 14:00:50 -05:00
griffpatch
246ff28363
Merge remote-tracking branch 'refs/remotes/LLK/develop' into bug/WhiteSpaceEqualsZero
2017-02-10 08:02:43 +00:00
griffpatch
ad5bc1afbd
Pull white space checks into function
...
Clean up code by pulling white space checks into a seperate helper
function
2017-02-10 08:02:11 +00:00
griffpatch
338b2f3458
Merge remote-tracking branch 'refs/remotes/LLK/develop' into bug/WhiteSpaceEqualsZero
2017-02-10 07:43:44 +00:00