Commit graph

612 commits

Author SHA1 Message Date
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