Commit graph

459 commits

Author SHA1 Message Date
Katie Broida
6ef600dc2c
Add runtime event for when the project is loaded (#1669) 2018-10-30 15:26:22 -04:00
Karishma Chadha
fd5e178d3b
Merge pull request #1703 from kchadha/cloud-io
Cloud IO
2018-10-30 11:57:20 -04:00
Paul Kaplan
b245b3868f
Merge pull request #1416 from paulkaplan/fix-mouse-down
Make click hats trigger on mouse down instead of up
2018-10-29 15:05:18 -04:00
Karishma Chadha
be238d35d2
Merge pull request #1517 from joker314/costume-compatibility
Make "switch costume" and "switch backdrop" blocks compatible with 2.0
2018-10-29 11:39:41 -04:00
Karishma Chadha
19b6c35cab Add unit tests for cloud io device 2018-10-29 00:59:24 -04:00
Paul Kaplan
e002db48f2 Add logic to trigger click hats on mouse up on a draggable target
As long as the event was not a drag
2018-10-25 15:08:37 -04:00
Paul Kaplan
9bf7ef8573 Add unit tests for activating click hats 2018-10-25 14:06:36 -04:00
Katie Broida
18c83dcc67
Prevent non-core extensions from adding monitors (#1688) 2018-10-24 16:43:01 -04:00
Michael "Z" Goddard
ef4045aaf1
Merge pull request #1642 from mzgoddard/set-procedure-param-defaults
Set procedure param defaults
2018-10-23 15:13:16 -04:00
Michael "Z" Goddard
5e5655c916
Merge pull request #1632 from mzgoddard/stop-other-sounds
Stop other sounds
2018-10-23 15:11:08 -04:00
DD
91e2f3a935 Revert 1643 Confirm extension in use in sb2 serialization 2018-10-18 11:06:13 -04:00
Katie Broida
899ce56214
Confirm extension in use in sb2 serialization (#1643)
Add a check when serializing sb2 projects to see whether an extension is actually in use in a block or a visible monitor.
2018-10-17 10:49:08 -04:00
Michael "Z" Goddard
2b257dde57
add getProcedureParamNamesIdsAndDefaults
Use getProcedureParamNamesIdsAndDefaults to get the defaults along with
names and ids so defaults may be set for a procedure call if the
parameter is not provided.
2018-10-16 16:31:45 -04:00
Andrew Sliwinski
23f6346045
Merge pull request #1631 from mzgoddard/stop-other-asks
Stop other asks
2018-10-15 13:16:49 -04:00
jokebookservice1
341bd8f3d3
feat: Allow switching to specially named backdrops
The `switch costume` block accepts special values like "next costume" and
"previous costume". If you create a costume with these names, these take
priority over the special values. However, the `switch backdrop` block
keeps these special values for values like "next backdrop", "previous
backdrop", "random backdrop". It is impossible to navigate to such a
backdrop by name via block. This commit also modifies tests to allow for
this.

BREAKING CHANGE: specially-named backdrops can now be navigated
2018-10-10 20:06:54 +01:00
jokebookservice1
1a7ce093c3
style(blocks_looks.js): add semicolon/space 2018-10-10 19:39:57 +01:00
jokebookservice1
f2a46098ab
refactor: move helper functions for tests
Move the helper functions `testCostume` and `testBackdrop` outside of
their test definitions. In addition, define the latter in terms of the
former.
2018-10-10 19:20:03 +01:00
jokebookservice1
c90e033148
test: add more comments, add additional test 2018-10-10 18:16:58 +01:00
Michael "Z" Goddard
4d56dd3872
ask and wait units should define target.sprite 2018-10-05 16:42:46 -04:00
Michael "Z" Goddard
ecf9a359e2
fix inaccuracy in 760 unit regression test 2018-10-05 16:34:01 -04:00
Andrew Sliwinski
853de9fa7d
Merge pull request #1593 from joker314/fix/compare-strings
Fix locale-dependant string comparison operators to match 2.0
2018-10-04 14:38:40 -04:00
Andrew Sliwinski
e024b7d369
Add case from GH-1526 to unit test suite 2018-10-04 14:36:44 -04:00
Michael "Z" Goddard
574749bbba
add STOP_FOR_TARGET runtime event and respond for ask blocks
Remove questions for targets that are individually stopping and
progress the asked question if it is from a stopping target.
2018-10-03 10:38:14 -04:00
Chris Willis-Ford
c541e87da5
Merge pull request #1587 from cwillisf/util_token-bucket
Add a rate-limited task queue utility
2018-09-19 10:48:04 -07:00
Ray Schamp
6c94c85c9a Add API for the attached renderer
Resolves #1281
2018-09-18 15:47:47 -04:00
jokebookservice1
bbefc18158
test: correct typo for function name 2018-09-17 23:25:40 +01:00
jokebookservice1
460b1745be
test: Ensure less-than compares well 2018-09-17 23:12:30 +01:00
Christopher Willis-Ford
69ba2045fe Rename TokenBucket to TaskQueue 2018-09-14 22:34:34 -04:00
Christopher Willis-Ford
70c6ad4ef1 Add cancelAll method to clear the task queue 2018-09-14 22:10:17 -04:00
Christopher Willis-Ford
33e0197ad5 Add tests for TokenBucket 2018-09-13 17:05:00 -04:00
Chris Willis-Ford
8977ce1e93
Merge pull request #1565 from cwillisf/extension-monitors
Extension monitors
2018-09-12 18:10:12 -04:00
Christopher Willis-Ford
2a13697621 Add tests for getLabelForOpcode 2018-09-12 17:23:01 -04:00
Evelyn Eastmond
ec432e3b2f Refactor for hardware extensions (#1555)
* Beginning refactor: renaming 'device' to 'peripheral', shortening function names, reordering functions, etc.

* Continuing refactoring: renaming some functions to be more verbose in the runtime, adding JSDocs, etc.

* Changing 'device' to 'peripheral', etc.

* Changing 'session' to 'socket'.

* Fixing EV3 menus and menu arg validation, reordering functions, etc.

* Add _send, add some references to documentation, etc.

* Factored out _outputCommand and _inputCommand, renamed some enums, etc.

* Fixed _outputCommand, some other minor cleanup.

* Make _outputCommand and _inputCommand public.

* Added TODO.

* Renamed BLE UUID enums to be clearer.

* Change WeDo2 in comments to WeDo 2.0, etc.

* Changed some WeDo2Motor command names, cleaned up some JSDocs.

* Beginning a major EV3 refactor.

* WeDo2 formatting and comment changes.

* Motor refactoring in EV3: motorTurnClockwise and motorTurnCounterClockwise initial working state.

* Add reminders to possibly cast motor menu args in WeDo2.

* Continue to move motor commands in EV3 to EV3Motor class, don't create new EV3Motor on every poll cycle, etc.

* Factoring EV3 polling value commands, etc.

* Fixing EV3 motor power, position and button pressed, and some commenting, etc.

* Move EV3 motor position parsing to EV3Motor class, move directCommand and directCompoundCommand functions, some commenting, etc.

* Changed WeDo2 motor label enum name.

* Removed some EV3 motor functions that aren't needed, changed menu label enum names, moved some opcodes up to enums.

* Fixing comments and documentation.

* Some commenting.

* Adding further documentation and references to PDFs, changed reply check to be safer, etc.

* Some comment changes.

* Moving some functions around in EV3 and WeDo2 to match.

* Commenting, etc.

* Some renaming of session, etc.

* Fix stopAllMotors in EV3.

* Fixing clearing of motors in EV3.

* Some comment changes.

* Change runtime .extensions/registerExtension to .peripheralExtensions/registerPeripheralExtension.

* Renaming outputCommand/inputCommand to generateOutputCommand/generateInputCommand, etc.

* Moved motorCommandIDs to EV3Motor class, renamed directCommand to generateCommand, etc.

* Adding a reminder to rename something.

* JSDoc fix in EV3Motor class.

* Fixing microbit function name.

* Adding a todo item.

* Changing Ev3 menu formats to be backwards compatible, moving a BLE function up.

* Fixing EV3 ports again, and button pressed returning a boolean.

* Fixing menu value to be a string in EV3.
2018-09-07 17:01:23 -04:00
Eric Rosenbaum
39be6d873c
Rate-limiting with a token bucket for the WeDo extension (#1540)
* Initial version of token bucket

* Add rateLimiter util

* Remove check for motor.isOn in stopAllMotors

* Fix unit test

* Fix unit test with stubbed timer, and cleanup

* Add comment

* Reduce WeDo rate limit to 20 sends/sec

* Move rate limit into a constant

* Stop button stops motors and tone even if rate limit exceeded
2018-08-29 17:37:59 -04:00
jokebookservice1
c81f7ee9a6
Create unit tests for SWITCH COSTUME and SWITCH BACKDROP 2018-08-22 20:38:46 +03:00
Karishma Chadha
3fb48f9aa4 Add and update tests for deleteCostume functionality. 2018-08-21 15:42:14 -04:00
Karishma Chadha
6f9da87abe
Merge pull request #1503 from kchadha/restore-sound
Restore sound
2018-08-21 15:28:39 -04:00
Karishma Chadha
a8c56948cb Clean up test. 2018-08-21 15:23:14 -04:00
Karishma Chadha
0c53659476
Merge pull request #1475 from towerofnix/fix-repeat-count
Use round() instead of floor() in repeat
2018-08-21 12:58:54 -04:00
Corey Frang
ae219e361a Add comments for deserialization and add tests 2018-08-20 13:25:24 -04:00
Karishma Chadha
e0a1f464ce Add and update unit tests for sound deletion. 2018-08-20 12:49:30 -04:00
Florrie
5af79a086b Use round() instead of floor() in repeat, add unit test 2018-08-14 20:27:18 -03:00
Karishma Chadha
5d25a5afcf Add unit tests for new duplicate variable functions on target. 2018-08-07 18:21:01 -04:00
Paul Kaplan
79ab2fcb72 Add turbo mode events 2018-08-02 10:00:21 -04:00
Paul Kaplan
ac550d2d38
Merge pull request #1387 from paulkaplan/userdata-io-device
Add UserData ioDevice for setting and getting username from blocks
2018-07-24 15:13:15 -04:00
Karishma Chadha
812e7a3772 Preserve sprite layer order information across saving and loading an sb3. 2018-07-24 11:00:48 -04:00
Karishma Chadha
2508dc46ca Order sprites in 2.0 projects based on the serailzied indexInLibrary property. Store original ordering (e.g. layer order of sprites on the stage) to use when installing targets. 2018-07-23 15:25:05 -04:00
Paul Kaplan
6d4c6df692 Add UserData ioDevice for setting and getting username from blocks 2018-07-23 09:38:58 -04:00
Karishma Chadha
99c1ce9286 Fix variable conflict that arises during sprite upload where the sprite may reference a global variable that conflicts with the name of a local variable on a different sprite in the project. 2018-07-17 15:37:28 -04:00
Karishma Chadha
2b2fc2e561 Code cleanup, refactor, abstraction 2018-07-13 12:58:45 -04:00
Karishma Chadha
13df3e7bd6 Add unit tests and fix object shallow vs. deep copying bug. 2018-07-13 09:36:43 -04:00
Paul Kaplan
2c7de6380e Add implementation for "When loudness >" block 2018-07-05 09:42:00 -04:00
Ray Schamp
4525139d59
Merge pull request #1212 from mzgoddard/unwrapped
execute optimization by unwrapping recursion
2018-07-02 11:20:01 -04:00
kchadha
d187517d85
Merge pull request #1256 from kchadha/sprite-save-load
Sprite save load
2018-06-25 11:21:01 -04:00
Karishma Chadha
f06b8a3943 Clean up calls to fixUpVariableReferences 2018-06-25 09:11:48 -04:00
Ray Schamp
9afe401dca Revert "Revert #1260, #1258, #1239"
This reverts commit 28f90648b0.
2018-06-22 09:33:08 -04:00
Ray Schamp
28f90648b0 Revert #1260, #1258, #1239
This reverts commits
c268bbae47
61dacfc915
30b8cb8eb1
2018-06-22 09:30:17 -04:00
Corey Frang
c087cf326a soundbank tests 2018-06-21 17:00:03 -04:00
Karishma Chadha
889443fcef fixUpVariableReferences should handle conflicting local variables that don't have blocks referencing them. Add unit tests for the function. 2018-06-20 12:07:42 -04:00
Karishma Chadha
073bb37c30 Add a test for 'getAllVariableAndListReferences' function. 2018-06-20 10:32:36 -04:00
Paul Kaplan
6e2af4f3cc
Merge pull request #1244 from paulkaplan/sharing-apis
Add shareSound and shareCostume APIs with unit tests to the VM
2018-06-19 11:31:00 -04:00
Evelyn Eastmond
d09c3f0418 MicroBit extension, Scratch Link first draft. (#1230)
* First microbit gui tests

* Fixed JSONRPC inheritance.  Renamed ScratchBLE/ScratchBT files.  Removed ScratchBT test code from Microbit extension.  Renamed addLine to log.

* Fixed log comments.  Removed addLine from Microbit.

* Adding auto-connect to Microbit at extension loading.  Adding hack for displayText block to Scratch-Link.

* Resolved merge conflicts and brought in latest microbit extension example code.

* Updated microbit write tests for displayText and displaySymbol blocks.  Some linting.

* Some linting and adding of BLE Characteristic consts.

* Linting fixes.

* Moving micro:bit device connection code all to the MicroBit class, decoupling Scratch3MicroBitBlocks from connection code.

* Removing old disconenct handlers from MicroBit class.  Moved service into new BLEUUID data structure.

* Renamed _write to _send.  Moved all BLE encoding concerns to the _send method.

* Using the util log.  Some linting.

* Added _read method to MicroBit class.  Renamed _send to _write.

* Some linting and formatting comments.

* First pass at peripheral chooser pattern for ScratchBLE.

* Testing characteristicDidChange events, and some changes to ScratchBLE on ready events.

* Refactoring work on PeripheralChooser and ScratchBLE.

* Some variable renaming and method signature stubs.

* Peripheral chooser method signatures.

* Moved base64 encoding/decoding to util.  Some method signature formatting.

* Adding test stubs for new util and io classes.

* Adding test stub for MicroBit extension.

* Clean up for PR.

* Clean up for PR.

* Final cleanup for PR.

* Removed logging to console.

* Adding 'btoa' and 'atob' node modules and using them in Base64Util.
2018-06-18 14:56:51 -04:00
Paul Kaplan
1dcd174dea Add shareSound and shareCostume APIs with unit tests to the VM 2018-06-18 10:39:22 -04:00
kchadha
da30abbfb5
Merge pull request #1240 from kchadha/block-comment-disappearing-bugfix
Add comment id to block when converting from XML to vm representation.
2018-06-15 17:36:48 -04:00
Karishma Chadha
f3d49f75c8 Clean up comment serialization, add tests for new and old serialization (old is still valid, just more verbose). 2018-06-15 14:57:49 -04:00
Karishma Chadha
76b423e481 Make sure to set comment property of block when creating a new block via XML using the adapter. Update unit tests. 2018-06-15 13:58:03 -04:00
Karishma Chadha
861d801d88 Add tests for comment save and load. 2018-06-14 16:58:03 -04:00
Paul Kaplan
bd80e4262d
Merge pull request #1231 from paulkaplan/reorder-tarrgets
Add top-level `reorderTarget` API to VM
2018-06-13 11:07:52 -04:00
kchadha
3308a7c6a2
Merge pull request #1229 from kchadha/imported-comment-positioning-fix
Update position for comments imported from 2.0 projects after auto-positioning.
2018-06-13 09:51:45 -04:00
Paul Kaplan
0ec0ea6ef7 Add reorderTarget API to VM 2018-06-13 09:20:22 -04:00
Florrie
c24e34d4e3 Remove unused getCostumeName function 2018-06-12 19:32:29 -03:00
Karishma Chadha
240701d65a Add some tests for comments... 2018-06-12 18:29:43 -04:00
Michael "Z" Goddard
05291aa254
turn reporter tree into instruction sequence
Turn the reporter tree execute walks into a sequence of block
functions. After calling a block function store the reported value in
the arguments object its depending block will use.

- Set the reported value on the thread. There is only ever one "just"
  reported value, which is read and stored elsewhere after being
  reported.
2018-06-12 14:21:40 -04:00
Florrie
93d6b23772 Test for getCostumeName 2018-06-09 21:52:46 -03:00
Paul Kaplan
0cd50fbb2c Propagate the return value of reorder functions, update comments 2018-06-06 11:13:30 -04:00
Paul Kaplan
837703d4ac Make reorder functions return if a change occurred.
Gotta get that testing coverage percent up :)
2018-06-06 09:43:54 -04:00
Paul Kaplan
e6ebc33e9e Add sound and costume reordering methods and tests to top-level API 2018-06-06 09:43:54 -04:00
Paul Kaplan
d3fd3ff806 Add reorderSound and unit test to rendered-target 2018-06-06 09:43:54 -04:00
Paul Kaplan
5fd5b30ccf Add reorderCostume method and unit test to rendered target 2018-06-06 09:43:54 -04:00
Paul Kaplan
3a697ae0ac Add top-level API for getting and setting variable values 2018-06-05 10:46:06 -04:00
Karishma Chadha
537dc9bcd5 Addressing PR comments. 2018-05-31 16:33:42 -04:00
Karishma Chadha
1639444a4d Fix lint and tests. 2018-05-30 21:18:45 -04:00
kchadha
a85f641d25
Merge pull request #1148 from kchadha/stage-layering
Layer group ordering.
2018-05-25 09:10:05 -04:00
Paul Kaplan
91e97ebdda Gotta get that unit test coverage up :) 2018-05-23 11:33:33 -04:00
Karishma Chadha
e2ce047fa1 Test and lint fixes. 2018-05-16 16:00:50 -04:00
Karishma Chadha
55352e88b1 Tests and cleanup of addSprite3 so that .sprite3 format does not need to be nested inside an extra {targets: ...} 2018-05-04 11:00:45 -04:00
Eric Rosenbaum
4cee734cde
Merge pull request #1008 from towerofnix/itemnum-vm
Implement "item # of (thing) in (list)" block
2018-05-03 18:08:31 -04:00
Eric Rosenbaum
9979391200
Merge pull request #1085 from ericrosenbaum/feature/key-droppability
Re-write keyboard IO for droppability support
2018-05-03 11:10:24 -04:00
kchadha
2b6f96ae0a
Merge pull request #1096 from towerofnix/warpspeed-vm
Implement "all at once" block
2018-05-01 15:43:37 -04:00
Florrie
b30d070d90 Lint test 2018-04-30 20:19:21 -03:00
Florrie
8e271c70d0 Implementation + tests for loud? block 2018-04-30 19:50:13 -03:00
Florrie
62dd6c58c6 Add test for allAtOnce 2018-04-30 12:36:15 -03:00
Ray Schamp
23e72525bf
Merge pull request #1065 from mzgoddard/push-reported-again
Push reported again. Now with empty boolean support!
2018-04-30 09:36:32 -04:00
Eric Rosenbaum
6f9669683b Update unit tests 2018-04-25 12:26:52 -04:00
Andrew Sliwinski
4a78e9c4af All tests passing 2018-04-20 10:29:29 -04:00
Michael "Z" Goddard
d04d6b2c6a
Revert "Revert "Push reported""
This reverts commit 107adad647.
2018-04-16 13:21:53 -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
Michael "Z" Goddard
8ebd659094
Use string enumerated values for videoSensing sensor block 2018-04-11 10:30:58 -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
4a9adcc3d9 Make stopDrag deal with bare targets and add tests 2018-04-11 09:12:43 -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
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
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
466a3b62ef Add test for repeatWhile 2018-04-07 14:07:15 -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
Christopher Willis-Ford
8ef4aec7fa Add tests for maybeFormatMessage 2018-04-06 12:26:12 -07: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
58c9b11dd3 Update test to use new function. 2018-04-06 11:38:41 -04:00
Karishma Chadha
80499c9ae5 Fixing tests 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
Eric Rosenbaum
2a90e5868d Fix runtime scope and unit test 2018-04-05 15:01:52 -04:00
Karishma Chadha
b2a4f563a0 Pull JSON.parse into extractProjectJson function. 2018-04-05 13:58:45 -04:00
Karishma Chadha
6c2838e8f4 Renaming file reading/extracting functions in tests. 2018-04-05 13:46:07 -04:00
Florrie
fd188741ba Lint 2018-03-31 13:41:39 -03:00
Florrie
b861c78086 Implement 'get item # of (thing) in (list)' 2018-03-31 13:25:50 -03: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
kchadha
51306e3492
Merge pull request #963 from towerofnix/foreach-vm
Implement for-each block
2018-03-28 10:52:14 -04:00
Florrie
307a48da5a Remove tests for old behavior 2018-03-28 11:38:19 -03:00
Karishma Chadha
1511fa79e3 Update tests to allow parsing whole .sb2s 2018-03-25 19:08:52 -04:00
kchadha
dbc7b9597f
Merge pull request #979 from kchadha/serialization-cleanup
SB3 Serialization & Load Project
2018-03-23 10:11:49 -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
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
Karishma Chadha
b4f6f24926 Fix up tests. 2018-03-16 11:43:27 -04:00
Florrie
a03f45d1d7 Add tests for forEach block 2018-03-05 16:18:09 -04: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
a0525542fc Stub runtime to fix unit test 2018-02-27 15:38:34 -05:00
Karishma Chadha
8c5c68b896 Duplicating sprite should give new sprite a fresh name. 2018-02-26 23:17:25 -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
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
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
Karishma Chadha
4cca426f96 Adding test coverage for new updateAssetName function. 2018-02-09 17:29:41 -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
c32086f56a Unit test for loudness with caching 2018-02-06 12:26:20 -05:00
Karishma Chadha
3dbcf13c87 Fixing renameSprite tests. 2018-02-05 17:26:13 -05:00
kchadha
107adad647
Revert "Push reported" 2018-02-02 12:42:09 -05:00
Luke Schlangen
f8dced53dc round numbers but break tests 2018-01-31 08:23:08 -06: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
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
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
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
Paul Kaplan
3afe709cb0 Add unit tests for new reporter blocks in looks 2018-01-04 10:42:51 -05:00
Paul Kaplan
6d90a34ff1 Add setDragMode primitive and unit test 2017-12-29 09:38:21 -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
d001a85571 Add setDragMode primitive and unit test 2017-12-28 12:31:23 -05:00
Karishma Chadha
29c08c3583 Fixing unit test. 2017-12-21 19:06:11 -05:00
Paul Kaplan
a586c5d9cd Revert "Fix test"
This reverts commit 6b00f97804.
2017-12-13 15:37:44 -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
Paul Kaplan
2d2b691b6f Return a default falsey value for unknown params based on param type 2017-12-06 11:46:43 -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
a9e95f3b01
Merge pull request #829 from kchadha/broadcast-message-typed-variable
Broadcast message functionality
2017-12-01 11:51:38 -05:00
Paul Kaplan
6b00f97804 Fix test 2017-11-29 15:46:04 -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
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
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
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
b6cf12202c Rename unit test file 2017-11-20 13:50:46 -05: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
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
91c93830a8 Fix tests 2017-11-16 14:23:56 -05:00
Paul Kaplan
34dfbb50ba Update naming and implementation for custom procedure blocks 2017-11-16 14:17:08 -05:00
Michael "Z" Goddard
d173326290
Add broadcastAndWait regression test 2017-11-16 11:23:51 -05:00
Eric Rosenbaum
ba529ad50b Update unit test 2017-11-15 14:10:50 -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
aa0064948a Delete monitor block when variable is deleted 2017-11-15 11:37:27 -05:00
Eric Rosenbaum
75ec76cd57 Fix unit test 2017-11-14 14:58:16 -05:00
Karishma Chadha
3f444138db Updating tests for refactoring lists. Updating demo fixture -- now we have IDs and variable types for variables. 2017-11-13 16:30:47 -05:00
Karishma Chadha
1d4acde7dc Fixing unit/integration tests. 2017-11-13 14:25:12 -05:00
Eric Rosenbaum
37d627bc89 Fix unit test 2017-11-13 10:57:36 -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
Karishma Chadha
c31fff8c4c Fixing linter errors. 2017-11-09 09:18:44 -05:00
Karishma Chadha
bf6b78137a Test coverage for virtual-machine's deleteSprite and duplicateSprite functions. 2017-11-08 15:48:24 -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
dc4767646f Move music-related unit tests into a separate file 2017-11-07 16:26:20 -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
Paul Kaplan
73ffc6a797 Ask/answer opcode implementation with runtime events. 2017-11-06 15:08:15 -05:00
Christopher Willis-Ford
c88a8fa55a Fix tests & a typo 2017-11-03 11:42:20 -07:00
Paul Kaplan
ec1d8c657e Add failing test for callNoReturn on undefined proc 2017-10-25 10:29:07 -04:00
Paul Kaplan
8d722b9073 Fix opcode, which isn't actually used in the code... 2017-10-10 15:10:03 -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
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
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
963078210a Add test coverage 2017-08-11 01:37:10 +12:00