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
Magmaboat
85eee4f18e
Perform hasOwnProperty validation
2017-02-09 21:12:47 -05:00
Eric Rosenbaum
cd750b5dda
pass volume to audioengine playnote
2017-02-09 14:52:15 -05:00
SillyInventor
8354774fcf
Switch from return null to return empty string in keyCodeToScratchKey
2017-02-09 14:09:01 -05:00
Chris Willis-Ford
cde9ebd6bf
Merge pull request #442 from griffpatch/bug/PenColorOpacity
...
Bug pen opacity reset
2017-02-09 07:53:15 -08:00
morant
19275799df
Load md5 information from sounds
2017-02-09 10:44:28 -05:00
Andrew Sliwinski
4bb5f30bd8
Merge pull request #410 from griffpatch/optimisation/only-check-for-compatability-once
...
Optimisation - Only check browser compatability once
2017-02-09 08:17:51 -05:00
Andrew Sliwinski
d650e5393e
Merge pull request #439 from griffpatch/bug/StopThisScript
...
Implement "Stop this script" function
2017-02-09 08:10:00 -05:00
griffpatch
464722f7bd
Feature - Fencing of sprites
...
This change requires that the pull request for scratch-render (Feature
fencing #82 ) be taken first
2017-02-09 10:02:45 +00:00
griffpatch
a6c56a6e20
Merge remote-tracking branch 'refs/remotes/LLK/develop' into bug/PenColorOpacity
2017-02-09 08:51:10 +00:00
griffpatch
2ba177aa0f
Bug - Return pen opacity to opaque
...
When setting the pen color using pen blocks, the opacity should be reset
to fully opaque if no alpha is supplied.
2017-02-09 08:50:37 +00:00
griffpatch
276ae82769
Fixes Case Insensitive Broadcast Bug
...
Broadcasts are case sensitive #433
2017-02-08 10:05:48 +00:00
griffpatch
9cb595312e
Implement "Stop this script" function
...
Existing implementation incorrectly terminates the entire thread.
See: http://llk.github.io/scratch-vm/#144142535
2017-02-08 09:44:10 +00:00
griffpatch
cf215bf0bc
Fix for the "Empty or white space strings equal 0" bug
...
See: Empty or white space strings equal 0 #435
2017-02-08 08:38:50 +00:00
griffpatch
7d69ecc005
Optimisation - Only check browser compatability once
...
Disable use of more accurate timer temporarilly due to performance.
However, with the rearrange and introduction of the 'nowObj' it turns
out most of the delay is in resolving 'self.performance'... so keeping
this cached in nowObj actually mitigates most of the delay.
2017-02-08 08:11:10 +00:00
griffpatch
57c222e94f
Merge remote-tracking branch 'refs/remotes/LLK/develop' into optimisation/only-check-for-compatability-once
2017-02-08 08:04:47 +00:00
morant
ed978e3062
Read sprite costume names from JSON, and write currentCostume to JSON
2017-02-07 20:12:55 -05:00
morant
6b545ea16d
Update isStage for each sprite when loading JSON, removing things copied from SB2 which are not relevant.
2017-02-07 18:38:44 -05:00
morant
0dc1883e9f
Write costumes and sounds to JSON on save
2017-02-07 18:15:11 -05:00
morant
e16f2924a3
Merge branch 'develop' of https://github.com/LLK/scratch-vm into develop
2017-02-07 09:53:17 -05:00
Andrew Sliwinski
92ff57de7d
Add basic test coverage for the sound blocks
2017-02-03 17:39:36 -05:00
Eric Rosenbaum
9741dc2e35
Merge branch 'develop' of https://github.com/LLK/scratch-vm into sound
2017-02-02 16:37:07 -05:00
Ray Schamp
727fcc7875
Lint for eslint-config-scratch@3
2017-02-01 16:27:55 -05:00
Eric Rosenbaum
0947775a31
Merge branch 'develop' of https://github.com/LLK/scratch-vm into sound
2017-02-01 10:18:01 -05:00
SillyInventor
1ac89f5aa4
Added new util function that sends tan function infinities correctly
...
Changed mathop to call new math util
Changed sin & cos to round correctly (to get 0)
Added testing for the new math util function
Added testing for the new mathop functions
2017-01-31 19:05:54 -05:00
Eric Rosenbaum
53127f6320
use customstate for sound volume, instrument, effects
2017-01-31 18:33:32 -05:00
Eric Rosenbaum
95e29ed66a
move sound-related code out of rendered target
2017-01-31 18:32:46 -05:00
Andrew Sliwinski
fff63e3af2
Merge pull request #414 from thisandagain/bugfix/413
...
Bugfix - Continue import if opcode is not found during SB2 import
2017-01-30 15:36:24 -05:00
Andrew Sliwinski
c2a488a197
Merge pull request #408 from griffpatch/optimisation/avoid-negative-index-lookups
...
Optimisation - Avoid negative index lookups #407
2017-01-30 15:06:02 -05:00
Andrew Sliwinski
249c0d6dca
Merge pull request #409 from griffpatch/optimisation/remove-redundant-lookups
...
Optimisation - Remove redunant lookups
2017-01-30 15:04:42 -05:00
Andrew Sliwinski
7c18b33f99
Continue import if opcode is not found during SB2 import. Resolves GH-413
2017-01-30 14:32:32 -05:00
Eric Rosenbaum
2d8491123e
Merge branch 'develop' of https://github.com/LLK/scratch-vm into sound
2017-01-30 11:28:52 -05:00
Eric Rosenbaum
dd30e07052
comments on getSoundIndex
2017-01-30 10:56:50 -05:00
Eric Rosenbaum
9d8819ddc7
audio engine handles rest block
2017-01-30 10:56:31 -05:00
Eric Rosenbaum
cb4209b27a
target handles playnote via audio engine
2017-01-30 10:56:06 -05:00
Eric Rosenbaum
5966a46bbd
target manages instrument setting
2017-01-30 10:54:24 -05:00
Eric Rosenbaum
4e4b0b86e1
target manages audio effect values
2017-01-30 10:53:12 -05:00
Eric Rosenbaum
01e237a2d5
audio engine loads all sounds
2017-01-30 10:50:28 -05:00
Eric Rosenbaum
4e57ab561d
move playsound function to target
2017-01-30 10:45:15 -05:00
Eric Rosenbaum
d5e0d433aa
include md5 in sprite sound object
2017-01-30 10:43:28 -05:00
griffpatch
fbf2c0c345
Optimisation - Recycle Stack Frame for cosecutive blocks
...
This saves popping, destroying, recreating, and pushing the stack frame,
and then reassigning the warp mode attribute for every block to block
step in the execution.
2017-01-28 17:06:07 +00:00
griffpatch
bd405ecc4a
Optimisation - Only check browser compatability once
...
This saves doing the checks everytime the time functions are referenced
2017-01-28 16:43:37 +00:00
griffpatch
76c9c993f2
Optimisation - Remove redunant lookups
...
It's surprising how much time it takes to do an object member lookup, so
reducing these is a great idea.
2017-01-28 16:33:20 +00:00
Andrew Sliwinski
824628220c
Merge pull request #406 from griffpatch/bugfix/end-warp-bug
...
Runtime does not exit warp mode if at end of loop #398
2017-01-28 09:56:04 -05:00
griffpatch
bd9159b9fb
More negative index checks
2017-01-28 14:39:22 +00:00
griffpatch
a25e117412
optimisation/avoid negative index lookups #407
...
Run-time Optimisation
The thread.stackFrames array is accessed all the time to retrieve the
'parent' stack frame. This is done using as index of [this.stack.length
- 1]. However, a lot of the time this evaluated to [-1]. Although this
results in null, which is fine, to get to this javascript actually
defers from a numeric array lookup to an object lookup using the string
"-1". This is roughly 100 times slower to compute and so a simple catch
for negative indexes is well worth the extra check.
2017-01-28 14:38:13 +00:00
griffpatch
c6a872ef4a
Fix whitespace issues
2017-01-28 14:11:48 +00:00
griffpatch
5f100129b6
Fix for ending warp bug
...
When popping down the stack frame it is assumed that you keep using the
previous warp state rather than looking at the warp state of the level
you just popped out to. This causes the loss of screen updates if the
warping block was the last statement in a loop as the loop does not obey
it's 'non warp' status.
2017-01-28 14:03:29 +00:00
morant
c6c1a63ff0
Merge branch 'feature/194' of https://github.com/morantsur/scratch-vm into develop
...
+ Solve code conflicts, and handle deserialization of 3.0 projects.
# Conflicts:
# src/index.js
# test/unit/serialization_sb2.js
2017-01-27 20:05:54 -05:00
Andrew Sliwinski
de4035055b
Merge pull request #403 from griffpatch/feature/Support-ARGB-for-pen
...
Fix for Support ARGB for pen #393
2017-01-27 17:07:43 -05:00
griffpatch
0dcaa46107
Fix lint issues
...
Had to update the test scripts to handle the alpha channel, also I note
that all the hex tests are using CSS notation, not scratch notation
(which is 0x not #)
2017-01-27 17:05:17 +00:00
Andrew Sliwinski
eb3b7bfd40
Merge pull request #401 from griffpatch/Effect-not-correctly-copied-to-clones
...
Effect not correctly copied to clones #337
2017-01-27 10:52:24 -05:00
griffpatch
b856041d9a
Fix for Support ARGB for pen #393
...
Requires fix to scratch-render before this will work (see:
6f5acfee7b961d71237f1fd50bb3d5a5139c527e)
2017-01-27 13:45:16 +00:00
griffpatch
2ac4b73a1f
Importers: adjust block coordinate calculation so blocks overlap less. #326
...
This change imports the scratch blocks much closer to the Scratch 2
spacing.
2017-01-27 13:39:21 +00:00
griffpatch
cf43efe3ee
Effect not correctly copied to clones #337
...
Fixes Effect not correctly copied to clones #337
2017-01-27 13:11:17 +00:00
Christopher Willis-Ford
88cc50aa18
Code review: more docs, move constants, clone util
...
Changes include:
- Added missing JSDoc for items in `scratch3_pen.js` and `target.js`.
- Moved constants used by `Scratch3PenBlocks` into the class.
- Created a constant for minimum and maximum pen size.
- Added `util/clone.js` to host cloning functionality.
- Pen blocks now check for the renderer before trying to use it.
- The pen integration test covers all blocks, though `clear`, `stamp`,
and `pen down` will skip some of their functionality when there is no
renderer.
2017-01-20 11:26:18 -08:00
Christopher Willis-Ford
d0845728ee
Add unit tests for new color-related functionality
...
Also, fix a math error in `Color.rgbToHsv`.
Newly covered functions:
- `toRbgColorObject` from `util/cast.js`
- `hsvToRgb` from `util/colors.js`
- `rgbToHsv` from `util/colors.js`
- `mixRgb` from `util/colors.js`
2017-01-19 15:24:45 -08:00
Christopher Willis-Ford
a6190da774
Lint fixes and related cleanup
2017-01-19 12:50:46 -08:00
Christopher Willis-Ford
369c02b5d5
Implement pen blocks
...
These blocks implement pen features as found in Scratch 2.0
Supporting changes include:
- `Target` is now an event emitter
- `RenderedTarget` now emits an event when it moves
- `Target` can now store arbitrary "extra" data, called "custom state"
in the code, using a `Target`'s `setCustomState` and `getCustomState`
methods. This is used to store per-target pen state without requiring
`Target` or `RenderedTarget` to know anything about the pen.
- `Cast` can now cast to an RGB color object.
- `Color` now has functions to convert between RGB and HSV, constants
for for black & white, and a `mixRgb` function to lerp between two
colors.
2017-01-19 11:51:22 -08:00
Ray Schamp
c6c4c4c00c
Merge pull request #379 from rschamp/bugfix/empty-rotation-center
...
Only update costume rotationCenter if it exists
2017-01-13 16:55:39 -05:00
Chris Willis-Ford
9b04392211
Move build outputs into a dist/
subdirectory ( #375 )
...
* Move Node output: /dist.js => /dist/node/scratch-vm.js
* Move web output: /vm{.js,.min.js} => /dist/web/scratch-vm{.js,.min.js}
* Update build output references in package.json and the playground's index.html
* Move the VirtualMachine class out of index.js into its own file, referenced by index.js. The VirtualMachine class is otherwise unchanged.
* Add .gitattributes rules for new file types which were added to this repository without specifying their text/binary attributes
* Turn on source maps in webpack and add corresponding .gitignore rule
2017-01-13 13:34:26 -08:00
Ray Schamp
a56346d0a9
Only update costume rotationCenter if it exists
...
This prevents sending `NaN`s to the renderer as the rotation center, which prevents the initial render of the costume/backdrop.
Towards LLK/scratch-gui#18
2017-01-13 13:05:06 -05:00
Ray Schamp
4ba76bbdbd
Fix adding SVG costumes
...
Previously it assumed every costume to have a `bitmapResolution` property which doesn't apply to vector costumes. This caused the renderer to not render added SVG costumes when they were added with setCostume.
2017-01-12 15:34:05 -05:00
Eric Rosenbaum
4022703537
move audio state vars into rendered target
2017-01-11 15:42:07 -05:00
Eric Rosenbaum
9cc1c316d6
wrapclamp drum and instrument to num available
2017-01-11 11:41:21 -05:00
Eric Rosenbaum
f2ad364b90
vm converts one-indexing of drums and instruments to zero-indexing
2017-01-11 11:23:39 -05:00
Eric Rosenbaum
71339874de
fix name of DRUM arg
2017-01-11 11:22:58 -05:00
Eric Rosenbaum
76a475c31c
cast args to numbers
2017-01-10 18:00:33 -05:00
Eric Rosenbaum
3344c92f7e
change ‘drumtype’ to ‘drum’ in specmap
2017-01-10 18:00:02 -05:00
Eric Rosenbaum
f034564603
Merge branch 'develop' of https://github.com/LLK/scratch-vm into sound
2017-01-09 15:51:47 -05:00
Eric Rosenbaum
4d7ff97011
instrument number is zero-indexed inside audio engine
2017-01-09 15:48:31 -05:00
Eric Rosenbaum
ce8b069140
include volume reporter
2017-01-09 15:48:02 -05:00
Eric Rosenbaum
2d7cfd128a
use a single global tempo owned by audioengine
2017-01-09 15:47:29 -05:00
Eric Rosenbaum
dc9126e067
Merge pull request #373 from ericrosenbaum/sound
...
Integrate audio engine
2017-01-06 16:28:09 -05:00
Eric Rosenbaum
bd8fdad1d4
add check for audioengine
2017-01-06 16:24:16 -05:00
Eric Rosenbaum
18c88c8ee0
fix stop for audio
2017-01-06 16:14:41 -05:00
Eric Rosenbaum
b88c6c96e2
initialize audio player once per sprite (not for clones)
2017-01-06 16:14:27 -05:00
Eric Rosenbaum
9980f4da3f
lint
2017-01-06 16:13:43 -05:00
Eric Rosenbaum
fec9e5b91a
add audio to playground
2017-01-06 11:49:25 -05:00
Eric Rosenbaum
9350baef3b
add current volume block
2017-01-06 10:31:11 -05:00
Eric Rosenbaum
dbe2cef93c
move promise into audio engine
...
changes to play note, play drum and rest blocks so their promises to wait are returned by the audio engine
2017-01-06 10:31:01 -05:00
Eric Rosenbaum
c0d57b4b6b
separate out main audioengine from audioplayer for each clone
2017-01-04 18:37:55 -05:00
Eric Rosenbaum
5a1386f727
remove redundant type check
2017-01-04 14:42:00 -05:00
Eric Rosenbaum
3bf9238e0c
treat numeric input to sound name as 1-indexed
2017-01-04 14:41:14 -05:00
Eric Rosenbaum
7a49a3ae43
lint
2017-01-03 23:41:49 -05:00
Andrew Sliwinski
5daaaa4438
Merge pull request #362 from thisandagain/bugfix/coverage
...
Add integration test coverage
2017-01-03 09:38:14 -05:00
Andrew Sliwinski
6d83931341
WIP clean-up
2016-12-30 10:19:58 -05:00
Andrew Sliwinski
04d9620631
Merge branch 'patch-24' of https://github.com/TheBrokenRail/scratch-vm into feature/194
2016-12-24 08:46:50 -05:00
Andrew Sliwinski
4709cae4b7
Basic integration (end-to-end) testing for default project
2016-12-23 10:39:19 -05:00
Andrew Sliwinski
48721dd336
If not hat fields are not found, check inputs before continuing. Resolves GH-360
2016-12-23 09:38:18 -05:00
Eric Rosenbaum
f0e01d3e87
fix name of sounds menu
2016-12-22 14:12:20 -05:00
Eric Rosenbaum
f90807e8a4
add get sound index by name
2016-12-21 16:42:19 -05:00
Eric Rosenbaum
f2793a1d59
Merge branch 'develop' of https://github.com/LLK/scratch-vm into sound
...
# Conflicts:
# package.json
# src/engine/runtime.js
# src/sprites/clone.js
2016-12-21 15:29:57 -05:00
TheBrokenRail
2ffb17458d
Update index.js
2016-12-11 12:45:35 -05:00
TheBrokenRail
838608af86
Update sprite.js
2016-12-11 12:42:39 -05:00
TheBrokenRail
04fc32b294
Update rendered-target.js
2016-12-11 12:40:06 -05:00
TheBrokenRail
b304cecefb
Add Testing Pt. 1
2016-12-11 12:33:02 -05:00
Ray Schamp
e9da046969
Report full sprite info in targetsUpdate
...
We need more than just the name for the initial render, so send everything consistent with sprite info reports.
2016-12-07 17:11:08 -05:00
TheBrokenRail
06e5124a3c
Update index.js
2016-12-04 08:42:28 -05:00
TheBrokenRail
a58bcb93e6
Update index.js
2016-12-04 08:39:22 -05:00
TheBrokenRail
c4750d64b6
Fix Drawable Properties Not Getting Updated
2016-12-03 16:50:06 -05:00
TheBrokenRail
7fe597c9f9
Now Actually loads Rendered Target Properties
2016-12-03 16:29:56 -05:00
TheBrokenRail
05a827c0ea
Update index.js
2016-12-02 16:30:34 -05:00
TheBrokenRail
f2a08b466d
Update Names
2016-12-02 16:03:52 -05:00
TheBrokenRail
34d2676db3
Update index.js
2016-12-02 15:57:56 -05:00
TheBrokenRail
424b41ac31
Pretty Print
2016-12-02 15:41:55 -05:00
TheBrokenRail
a520990a80
Update index.js
2016-12-02 15:37:35 -05:00
TheBrokenRail
0707c4bcc8
Update index.js
2016-12-02 15:35:35 -05:00
TheBrokenRail
dd86759915
Update rendered-target.js
2016-12-02 15:34:01 -05:00
Ray Schamp
adaf2df743
Emit sprite info report for all sprites
...
This allows costume data to reach listeners even when the sprite isn't the editing target.
Filter out non-editing target reports in the playground to match previous behavior.
2016-11-30 13:21:00 -05:00
Ray Schamp
ce17fdbd30
Include costume data in sprite info reports
...
Also emit the report on all costume changes
2016-11-30 13:19:49 -05:00
TheBrokenRail
72b44b3ec7
Update rendered-target.js
2016-11-29 18:57:35 -05:00
TheBrokenRail
74b8378a7c
Update sprite.js
2016-11-29 18:55:38 -05:00
TheBrokenRail
1980fbc98d
Update rendered-target.js
2016-11-29 18:53:38 -05:00
TheBrokenRail
f4959305ab
Update index.js
2016-11-29 18:14:12 -05:00
TheBrokenRail
1777ab6a21
Update index.js
2016-11-29 18:09:28 -05:00
TheBrokenRail
51d829786c
Update index.js
2016-11-29 18:07:50 -05:00
TheBrokenRail
16449ae73d
Add Loading And Exporting
2016-11-29 17:50:31 -05:00
TheBrokenRail
0f4e80cbfc
Add Export To Sprite
2016-11-29 17:23:28 -05:00
TheBrokenRail
cac52020a4
Add Export To Rendered Target
2016-11-29 17:18:20 -05:00
Ray Schamp
d00cdd6b2c
Account for done threads on threadCount update
...
Also rename inactiveThreads -> doneThreads, since this describes them better. They are the threads that have completed in the step.
2016-11-28 10:49:05 -05:00
Ray Schamp
0003b294cb
Lint
2016-11-24 10:36:30 -05:00
Ray Schamp
55ac7e269c
Add PROJECT_RUN_START/STOP events
...
These events signal when any threads are running or when all threads have stopped running. This maps to whether the green flag or the stop button should be illuminated in the GUI.
2016-11-23 15:47:49 -05:00
Ray Schamp
2ff719f2ba
Fix consistency of existing emits
2016-11-23 15:43:05 -05:00
Tim Mickel
a767c5ec79
Keep min and max scale in relative bounds as in Scratch 2.0
2016-11-14 12:20:29 -05:00
Tim Mickel
4deee071b2
Don't copy threads in step; stable restartThread ( #331 )
2016-11-10 15:05:49 -05:00
Ray Schamp
2c3e4536eb
Merge pull request #316 from tmickel/feature/remove-empty-project
...
Remove empty project
2016-11-10 12:56:31 -05:00
Tim Mickel
b99f089ae7
Fix #327 , "switch costume to [next/previous]" ( #330 )
2016-11-09 11:22:17 -05:00
Tim Mickel
f235cb47e6
Merge remote-tracking branch 'LLK/develop' into feature/remove-empty-project
...
# Conflicts:
# src/index.js
2016-10-31 10:39:36 -04:00
Eric Rosenbaum
6dadaba117
onStopAll function for stop button
2016-10-27 16:28:39 -04:00
Eric Rosenbaum
1e5555e96d
add volume and tempo blocks
2016-10-27 11:31:22 -04:00
Tim Mickel
0ede7e6ca1
Rename and delete sprites ( #319 )
...
* Add function to rename sprites
* Add delete sprite function
* Add `isSprite` helper and duplicate check for rename
2016-10-26 13:27:24 -04:00
Tim Mickel
56ef01745f
Implement sprite info emitting and posting ( #320 )
2016-10-26 13:27:12 -04:00
Tim Mickel
1dc4aaa2d7
Remove rAF usage and inline into _step ( #318 )
2016-10-26 11:32:15 -04:00
Tim Mickel
2f0ce7137c
Rename Clone -> RenderedTarget ( #317 )
2016-10-26 11:19:43 -04:00
Tim Mickel
6e9b3f262c
Divide rotation center by bitmap resolution ( #309 )
2016-10-26 10:38:24 -04:00
Tim Mickel
d75f1c5965
Remove empty project
2016-10-26 10:30:16 -04:00
Tim Mickel
cf20ca1add
Fix #313 (block specs in shadow) ( #315 )
2016-10-26 10:26:56 -04:00
Tim Mickel
28a0831e8d
Fix 1-1 in daysSince2000
2016-10-26 10:26:03 -04:00
Tim Mickel
5103cfb853
Address #299 and #300 ( #314 )
...
* Place clones behind sprite
* Disallow stage from cloning itself
2016-10-26 10:06:58 -04:00
Liam
f75577bcbe
Implement '(attribute) of' sensing block ( #311 )
...
* Implement '(attribute) of' sensing block
* Remove unused util parameter
2016-10-24 20:37:27 -04:00
Eric Rosenbaum
90867cd14e
convert string to number for sound index
2016-10-24 17:00:51 -04:00
Andrew Sliwinski
1b4a1ca1bc
Resolve merge conflicts
2016-10-24 15:53:42 -04:00
Andrew Sliwinski
153df22918
Address feedback from PR review
2016-10-24 15:16:06 -04:00
Ray Schamp
659014b45f
Fix typo
2016-10-24 14:07:38 -04:00
Ray Schamp
d2a0e6fa2d
Disable no-useless-call in case of behavior change
2016-10-24 13:01:57 -04:00
Ray Schamp
22bf947ddb
Revert no-lonely-if
2016-10-24 13:01:41 -04:00
Andrew Sliwinski
279a9560af
Resolve JSDoc lint errors
2016-10-24 12:04:06 -04:00
Andrew Sliwinski
336bc65e2d
Add minimal test coverage and docs for mouse module
2016-10-24 11:56:52 -04:00
Ray Schamp
04d7f4f019
Use consistent function declaration style
2016-10-24 11:49:34 -04:00
Andrew Sliwinski
2de58050dd
Conform JSdoc for keyboard module to format used elsewhere
2016-10-24 11:40:07 -04:00
Ray Schamp
9f0c4eb098
Update to eslint-config-scratch 2.0
...
We are on a fast release cycle here.
2016-10-24 11:39:39 -04:00
Ray Schamp
63cfa4229a
Fix space-infix-ops
...
http://eslint.org/docs/rules/space-infix-ops
2016-10-24 11:19:07 -04:00
Ray Schamp
7712b2902f
Fix quote-props
2016-10-24 11:02:19 -04:00
Ray Schamp
14a2dbc50f
Revert no-lonely-if
2016-10-24 10:28:31 -04:00
Ray Schamp
73edb65c4d
Replace console with minilog
2016-10-23 22:20:30 -04:00
Ray Schamp
f6c0064235
All linting other than console statements
2016-10-23 22:20:29 -04:00
Ray Schamp
68ed110b49
Pass with eslint --fix
...
Resolved whitespace issues, e.g., space-before-function-paren and key-spacing
2016-10-23 12:41:45 -04:00
Andrew Sliwinski
faf8a898a0
Add minimal test coverage and docs for keyboard module.
2016-10-21 18:31:07 -04:00
Tim Mickel
84bd42d734
Functions to add Sprite2/costumes/backdrops ( #291 )
...
* Functions to add Sprite2/costumes/backdrops
* Have sb2import return the top-level target
2016-10-20 11:44:01 -04:00
Tim Mickel
3d57c2e74c
Drop single-stepping and pause modes ( #294 )
2016-10-20 11:42:16 -04:00
Tim Mickel
9af9a87cb6
Pass rotation center and bitmap resolution to renderer ( #288 )
2016-10-19 17:01:48 -04:00
Eric Rosenbaum
0858a22ffb
adding theremin block and set instrument
2016-10-19 15:44:30 -04:00
Tim Mickel
e49f076fa1
Interpreter fixes, enhancements, features ( #280 )
...
* Thread stepping rework; interp.redraw equivalent
* Add turbo mode and pause mode
* Yielding behavior to match Scratch 2.0
* Implement warp-mode procedure threads
* Add check for recursive call
* Inline wait block timer
* Revert to setInterval and always drawing
* Restore yielding in glide
* 30TPS compatibility mode
* 5-call count recursion limit
* Removing dead primitive code
* To simplify, access runtime.threads inline in `stepThreads`.
* Warp mode/timer fixes; recursive check fixes; clean-up
* Add basic single-stepping
* Add single-stepping speed slider
* Allow yielding threads to run in single-stepping
* Restore inactive threads tracking for block glows
* Add clock pausing during pause mode
* Documentation and clean-up throughout
* Don't look for block glows in `thread.topBlock`.
* Add null check for block glows; rename `_updateScriptGlows` to reflect block glowing
* Use the current executed block for glow, instead of stack
* Add more comments to `stepToProcedure`, and re-arrange to match 2.0
* Tweak to Blocks.prototype.getTopLevelScript
* Revert previous
* Fix threads array to be resilient to changes during `stepThreads`
* Restore inactive threads filtering
* Fix typo in "procedure"
* !! instead of == true
2016-10-17 23:23:16 -04:00
Tim Mickel
060d1ab2a5
Updated blocks for new renderer features ( #257 )
...
* Add "touching" block, layers blocks
* Keep in fence, if on edge bounce, fix to touching edge
* Fix degtoRad in "if on edge, bounce"
* Fixes from review
2016-10-17 23:17:55 -04:00
Eric Rosenbaum
6d9f889aa7
fixed sound loading
2016-10-17 17:16:55 -04:00
Eric Rosenbaum
ba84b6e34b
move audioengine to its own module
2016-10-17 17:16:13 -04:00
Eric Rosenbaum
7bd0142deb
Merge branch 'develop' of https://github.com/LLK/scratch-vm into sound
...
# Conflicts:
# playground/index.html
2016-10-17 17:13:43 -04:00
Tim Mickel
352c6516d3
Fix parent setting in sb2 importer ( #283 )
2016-10-17 16:44:33 -04:00
Cosmic Web Services
454eb904a3
Add days since 2000 block ( #272 )
...
* Add days since 2000 block
* Empty line addition
* Add semicolin
* Empty line addition
* Tabed
* Remove extra line
* Make it exactly like scratch 2 was
* Fixed spacing
2016-10-17 13:57:25 -04:00
Ray Schamp
2904152318
Merge pull request #282 from rschamp/feature/vm.clear
...
Add VM.clear method
2016-10-17 13:56:37 -04:00
Ray Schamp
5615583fb2
Lint
2016-10-17 13:54:27 -04:00
Ray Schamp
bd95c1461d
Add VM.clear method
...
Use it before loading projects so targets don't accumulate when multiple projects are loaded on the same instance.
Move check to see if the clone is the original clone onto the block implementation so all clones can be removed.
Fixes #274
2016-10-17 13:43:38 -04:00
Andrew Sliwinski
ace9a96fc2
Fix degToRad function definition. Resolves GH-229
2016-10-17 11:52:02 -04:00
Tim Mickel
3bfd755e60
Complete implementation of stop block ( #271 )
...
* "Other scripts in stage" sb2
* Complete implementation of "stop" block
2016-10-13 23:00:46 -04:00
Tim Mickel
c45b420115
Fix check for existing hat threads ( #269 )
2016-10-13 22:14:19 -04:00
Tim Mickel
1e86d48a31
Clicking blocks in the toolbox ( #267 )
2016-10-13 17:15:49 -04:00
Tim Mickel
8c654bbe60
Procedure blocks ( #264 )
2016-10-13 13:11:26 -04:00
Eric Rosenbaum
31d680a229
lint
2016-10-13 11:54:00 -04:00
Eric Rosenbaum
d808a83f79
lint
2016-10-13 11:48:31 -04:00
Eric Rosenbaum
e084a76485
lint
2016-10-13 11:35:52 -04:00
dekrain
91037a261e
Fix relative localization for assets
2016-10-13 16:19:42 +02:00
Eric Rosenbaum
80764f053d
lint
2016-10-12 17:22:50 -04:00
dekrain
49d6bd3b67
Fix new project creation ( #256 )
...
* Fix new project creation
* Fix new project creation
* const -> var
2016-10-12 13:56:31 -04:00
Eric Rosenbaum
7b179546ed
new setup for use with scratch-gui
2016-10-12 13:17:51 -04:00
Tim Mickel
a7522c7734
Fix data_listcontents block name ( #254 )
2016-10-11 17:12:19 -04:00
Eric Rosenbaum
0024b209bd
Merge remote-tracking branch 'LLK/develop' into develop
2016-10-11 13:47:24 -04:00
Eric Rosenbaum
ed650ba487
Merge remote-tracking branch 'LLK/develop' into develop
2016-10-05 17:16:13 -04:00
Liam
30535d8e6e
Implement "distance to" block ( #239 )
...
* Implement "distance-to" block
* distance-to in stage should always be 10000
2016-10-04 21:26:59 -04:00
TheBrokenRail
9b07889b3f
Fix Stage PNG ( #241 )
...
* Fix Stage PNG
* Add New Stage PNG
* Remove Old Stage PNG
* Delete backdrop1.png
* Rename New Stage PNG
* Delete stage.png
* Fix Stage Resolution
2016-10-04 20:38:11 -04:00
Liam
5871672551
Implement "go to" block ( #238 )
...
* Implement "go to" block
* Add a missing semicolon
My text editor doesn't automatically insert them and I'm not used to using
semicolons so much. :(
* Implement go-to-random
* Clean up the go-to-random code a bit
* Add rounding to _random_ picks
2016-10-04 18:19:52 -04:00
Liam
886bcbe3c1
Implement the point-towards block ( #235 )
...
* Implement the point-towards block
* Pointing towards a nonexistent sprite should do nothing, not throw an error
2016-10-04 15:20:53 -04:00
Eric Rosenbaum
0db0783fe8
working on sound font player
2016-10-04 14:19:04 -04:00
Tim Mickel
0a66c62f6a
Mutations in block representation; an unfeatured procedure call ( #212 )
...
* Add scratch3_procedures and no-op for defnoreturn
* Add mutation adapter to parse mutations in CREATE/CHANGE events
* Add mutation-to-XML
* Update spec map for Blockly procedure names
* Placeholder for procedure special cases
* Basic stepping to procedures
* Remove extra case
* Validation for changeBlock
2016-10-03 17:43:24 -04:00
Tim Mickel
5728d648b1
Ensure clone.effects is defined on each instance ( #225 )
...
* Ensure clone.effects is defined on each instance
* Add regression test for GH-224
2016-10-03 10:16:43 -04:00
Eric Rosenbaum
e1df4b3aaf
fixed dictionary of loaded sounds
2016-10-01 17:27:28 -04:00
Tim Mickel
2226fda19e
Implement rotation style ( #223 )
2016-09-28 17:09:04 -04:00