Commit graph

2052 commits

Author SHA1 Message Date
Ray Schamp
9c556219ce
Merge pull request #1528 from kchadha/fix-comment-import
Fix Comment import/save/load issue
2018-08-28 16:04:53 -04:00
Ray Schamp
713792480e
Merge pull request #1524 from kchadha/only-undefined-in-c-block-fix
Resolve project load error with undefined opcodes inside c/e blocks.
2018-08-28 16:03:24 -04:00
picklesrus
b95b8d41ff Fix #1395 by resetting the utterance we check for in the edge trigger hat on green flag (#1476) 2018-08-27 11:10:51 -04:00
picklesrus
b9a757ea08 Fix speech extension in Safari (#1202) by calling getUserMedia for every listen and wait block rather than trying to reuse it. Also get rid of some code that was not actually doing anything. (#1467) 2018-08-27 11:05:51 -04:00
Karishma Chadha
2c24ef37a0 Fix issue where block comments converted to workspace comments import correctly when there are no scripts on the workspace. 2018-08-24 14:29:10 -04:00
Karishma Chadha
0532f9a80a Fix issue where a c-block that contained only blocks with unknown opcodes, was causing an import error. 2018-08-23 18:20:45 -04:00
Karishma Chadha
5e1dd8a7cf Fix issue with importing projects from 2.0 where block comments were converted to workspace comments and the corresponding block was deleted. 2018-08-22 18:41:47 -04:00
Evelyn Eastmond
5320dfb676 WeDo2 backwards compatibility update (#1518)
* Resolving #1492: No longer trying to make WeDo2 backwards compatible with Scratch Link API v1.0.

* Closing the socket on all BLE/BT errors.

* Adding BT disconnection.
2018-08-22 17:45:26 -04:00
Karishma Chadha
f567e34c3a
Merge pull request #1515 from kchadha/fix-stack-glow
Fix stack glow
2018-08-22 17:30:14 -04:00
Eric Rosenbaum
d6831cf97d
Merge branch 'develop' into wedo2-fixes 2018-08-22 16:01:29 -04:00
Evelyn Eastmond
ab7f24bf9a WeDo2 rate limiting (#1509)
* Starting work on #1456: rate limiting.

* Fixing #1456: rate limit send messages.

* Chaining a couple of send operation Promises.

* Fixing linting.
2018-08-22 15:53:17 -04:00
Karishma Chadha
62bf790d8f Fix stack glows so that stacks glow as soon as the first block in the stack starts running as opposed to after the first block has finished. Make sure that monitored reporters in the flyout are not glowing. 2018-08-22 14:44:06 -04:00
jokebookservice1
3ef61e2248
Make SWITCH COSTUME and SWITCH BACKDROP compatible with 2.0 2018-08-22 20:39:15 +03:00
Evelyn Eastmond
1f7d9d3b67 Revert "Attempting to fix #1492: WeDo2 use of should be backwards compatible."
This reverts commit ae28a0c1b86209c66dcdbe9b10e0df8c39be7e10.
2018-08-22 11:17:31 -04:00
Evelyn Eastmond
bfa4dfaac2 Attempting to fix #1492: WeDo2 use of should be backwards compatible. 2018-08-22 11:17:31 -04:00
Evelyn Eastmond
f4e9212249 Fixing #1504: WeDo2: Distance sensor not being cleared on device disconnect. 2018-08-22 11:17:31 -04:00
Evelyn Eastmond
3659973101 Fixing #1510: WeDo2 stop button gives console error if device not connected. 2018-08-22 11:17:31 -04:00
Karishma Chadha
d1761466fc
Merge pull request #1427 from paulkaplan/fix-bubble-positioning
Remove heuristic for bubble positioning that was not accurate.
2018-08-22 10:39:50 -04:00
Karishma Chadha
fa1bf5b165 Merge branch 'fix-bubble-positioning' of https://github.com/paulkaplan/scratch-vm into develop 2018-08-22 10:30:01 -04:00
Karishma Chadha
e5ca208a41 Return function to restore a costume when it gets deleted. 2018-08-21 15:33:19 -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
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
Karishma Chadha
6f9367a8e2
Merge pull request #1468 from gnarf/serialization-util
export deserializeBlocks method
2018-08-20 19:58:19 -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
Evelyn Eastmond
2121a3be80 Some small EV3 fixes (#1494)
* Fixing #1353: Stop button should stop EV3 beep sound.

* Fixing #1358: EV3 and Microbit: shouldn't send requests if not connected?.

* Fixing #1373: EV3 motor does not brake at the end of a motor command.
2018-08-20 11:00:48 -04:00
Ray Schamp
4f18cdd4ee
Merge pull request #1497 from amazinigmech2418/revert-1453-round-setxy
Revert "round x and y like Scratch 2 does"
2018-08-20 10:36:46 -04:00
Evelyn Eastmond
5395f9c321 WeDo2 changes for upcoming smoke test (#1493)
* Starting on #1491: use 'startNotifications' instead of 'read'.  Still need to make backwards compatible.

* Fixing #1489: WeDo2 set light color block should wrap values to 0-100.

* Fixing #1488: WeDo2 should not clear LED light on stop button.

* Fixing to support negative LED light color inputs.

* Removing a binding.

* Using wrapClamp for inputHue for LED color block.
2018-08-19 22:09:57 -04:00
amazinigmech2418
f0d47923b0
Revert "round x and y like Scratch 2 does" 2018-08-17 20:35:42 -04:00
Karishma Chadha
24b098257b Return restore sound function when deleting a sound. 2018-08-17 14:01:24 -04:00
Ray Schamp
a1249bd3f8
Merge pull request #1453 from mzgoddard/round-setxy
round x and y like Scratch 2 does
2018-08-17 10:26:15 -04:00
Karishma Chadha
84f4c8c0a6
Merge pull request #1486 from kchadha/fix-delete-sprite-local-vars
Fix issue with deleting sprite with local variables
2018-08-16 17:28:43 -04:00
Eric Rosenbaum
83b3eabf1d
Regulate micro:bit send timing (#1471)
* display blocks yield for 50ms

* WIP on microbit command send timing

* WIP on microbit command send timing

* Cleanup and JSDOC

* Send “withResponse” param to Link

* Remove caching, add busy timeout
2018-08-16 15:38:03 -04:00
Eric Rosenbaum
825035f503
Fix importing WeDo 2.0 blocks from SB2 (#1487)
* Fix wedo2 import from sb2

* Hide wedo play note block
2018-08-16 14:24:19 -04:00
Corey Frang
896e62d2c4 Also export serializeBlocks for round-tripping 2018-08-15 17:06:30 -04:00
Corey Frang
df9dbd112a Make importing with deserialized stuff okay 2018-08-15 17:04:49 -04:00
Karishma Chadha
b95350da6e Fix issue where deleting a sprite with a monitored local variable creates that local variable on all other sprites after switching sprites twice or more. 2018-08-15 14:31:40 -04:00
Evelyn Eastmond
0df334fd38 Fixes #1423: WeDo commands should be able to be translated. (#1482) 2018-08-15 14:21:42 -04:00
Evelyn Eastmond
280be8379b
Merge pull request #1481 from evhan55/feature/wedo2-fixes
Various WeDo2 fixes and enhancements
2018-08-15 14:11:04 -04:00
Evelyn Eastmond
35a2411f92 Fixing motor direction block to also work when the motor is on indefinitely. 2018-08-15 14:01:08 -04:00
Evelyn Eastmond
c21d5eba1c
Merge pull request #1469 from ericrosenbaum/feature/wedo-icon
Add WeDo 2.0 block icon
2018-08-15 12:01:48 -04:00
Evelyn Eastmond
82df80a04c Fixing lint error. 2018-08-15 11:44:49 -04:00
Evelyn Eastmond
9fb522b3ff Moving a function. 2018-08-15 11:39:26 -04:00
Evelyn Eastmond
13edf16caa Fixing #1457: extension should parse incoming messages using port table. 2018-08-15 11:39:26 -04:00
Evelyn Eastmond
d61f6e3d6f Fixing #1460: 'set motor direction' block should work while a motor is running. 2018-08-15 11:39:26 -04:00
Evelyn Eastmond
3023b7a9c2 Fixing #1455: set LED to blue on connecting. 2018-08-15 11:39:26 -04:00
Evelyn Eastmond
9f25872c1f Fixing #1454: extension should cast and clamp input values. 2018-08-15 11:39:26 -04:00
Evelyn Eastmond
d89020cfb1 Fixing #1461: distance sensor should report 0-100 in steps of 10. 2018-08-15 11:39:26 -04:00
Florrie
5af79a086b Use round() instead of floor() in repeat, add unit test 2018-08-14 20:27:18 -03:00
Connor Hudson
f9814a5f88 Allow localizing EV3 blocks (#1437)
* Add formatMessage calls to block text in EV3 extension

* Make some EV3 l10n descriptions more descriptive
2018-08-14 14:36:19 -04:00
Eric Rosenbaum
3af8a4eca5 Add WeDo 2.0 block icon 2018-08-14 13:51:17 -04:00
Connor Hudson
8d88058ae5 Allow localizing micro:bit blocks (#1431)
* Replace micro:bit block text with formatMessage calls

* Add l10n support to micro:bit block menus

* Remove A, B button translation, update some l10n descriptions

* Fix mismatched l10n description
2018-08-14 12:19:26 -04:00
Corey Frang
fe46a81cc9 export deserializeBlocks method 2018-08-14 11:17:47 -04:00
Evelyn Eastmond
f01733f019 WeDo2 Extension: First Pass (#1441)
* Adding WeDo2 connection/disconnection over Scratch Link BLE.

* Testing motor and LED output.

* Reading sensor attachment and registering for sensor notifications.

* Motor indexing.

* Some refactoring notes.  Moving some functions around.

* Refactoring and enums.

* Removing some comments

* Fixing linting error.

* Fixing tilt reporter values and added stopAll bound to stop button to stop piezo, LED and motors.
2018-08-13 17:10:55 -04:00
Michael "Z" Goddard
f1fce036f0
round x and y like Scratch 2 does
https://github.com/LLK/scratch-flash/blob/develop/src/scratch/ScratchSprite.as#L180-L186

Scratch 2 rounds the X and Y to the nearest whole number.
2018-08-13 14:53:00 -04:00
Mx Corey Frang
30892dfd43
Update npm packages to get new renderer and update benchmark for Bob Ross 🌲 (#1443) 2018-08-13 10:47:41 -04:00
kchadha
ec41b4a113
Merge pull request #1438 from kchadha/return-add-sprite-function-when-deleting
Export the sprite and return an add function when deleting the sprite.
2018-08-09 15:25:45 -04:00
Karishma Chadha
a1f03f58e1 Add integration test for deleting and restoring a sprite, and restoreFunciton should return a promise. 2018-08-09 11:53:37 -04:00
Mx Corey Frang
c092fe9f83
Use proposed drawableTouching interface from render (#1419)
* use new drawableTouching interface from render

* Fix mock renderer for new API call

* with lint fix
2018-08-09 10:10:23 -04:00
Karishma Chadha
5ef246a2b0 Export the sprite and return an add function when deleting the sprite. 2018-08-08 18:29:54 -04:00
Ray Schamp
4b5cf6505a
Merge pull request #1398 from paulkaplan/publish-docs
Publish jsdoc to gh-pages
2018-08-08 16:46:48 -04:00
kchadha
6b26e6e68c
Merge pull request #1434 from kchadha/fix-variable-xml
Fix variable xml
2018-08-08 15:32:09 -04:00
Michael "Z" Goddard
a15a9a1b7b Fix benchmark suite (#1397)
* add scratch-svg-renderer adaptors to benchmark vm

* disable benchmark with monitor error

* fixup! add scratch-svg-renderer adaptors to benchmark vm

* fixup! disable benchmark with monitor error
2018-08-08 14:36:38 -04:00
Karishma Chadha
d91788406c Don't generate new IDs for variables when making a sprite clone. 2018-08-07 16:24:02 -04:00
Karishma Chadha
337c1f464d Fix duplication of variables and re-write variable ids in referencing fields. 2018-08-07 00:30:03 -04:00
Paul Kaplan
6e6e9b49cb
Merge pull request #1415 from paulkaplan/fix-current-menu
Import current block menu as field not input
2018-08-06 16:45:51 -04:00
Paul Kaplan
ae3605b00c Remove heuristic for bubble positioning that was not accurate.
"guessing" the bubble positioning before rendering is no longer needed because the positioning logic has changed, bubbles that don't fit during the positioning stage get flipped.
2018-08-06 16:00:20 -04:00
Paul Kaplan
98e45ecdfe Import current block menu as field not input 2018-08-02 13:45:00 -04:00
Paul Kaplan
79ab2fcb72 Add turbo mode events 2018-08-02 10:00:21 -04:00
Eric Rosenbaum
c8158321fc
Add "set voice" block to text2speech extension (#1400)
* Add set voice block

* Store voice in custom state

* Use a regex to preserve punctuation in kitten language

* cleanup

* don’t re-use args

* add todo comment about locale

* Use voice Id strings and add puppy

* Cleanup and comments

* Use extension name “Text-to-Speech”

* Add issue link in comment
2018-07-31 14:41:02 -04:00
Paul Kaplan
138d7136af Fix various jsdoc issues preventing the docs from building 2018-07-31 11:22:42 -04:00
Paul Kaplan
c7db7ad086
Merge pull request #1399 from paulkaplan/add-to-target
Add an extra param for adding sounds and costumes to specific targets
2018-07-31 11:09:37 -04:00
Paul Kaplan
8540c139dc Add an extra param for adding sounds and costumes to specific targets 2018-07-31 09:47:48 -04:00
Karishma Chadha
53ccb8d709 Don't serialize layerOrder when exporting a sprite. 2018-07-24 16:11:18 -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
kchadha
c77b1f25e2
Merge pull request #1392 from kchadha/sprite-layer-save-load
Sprite Layer Ordering Save/Load
2018-07-24 13:53:29 -04:00
Evelyn Eastmond
6444cf071d Feature/critical extension fixes (#1383)
* Resolves - Turning micro bit power off doesn't disconnect microbit #1366.

* Resolves EV3 motor block causes distance to return 0 #1363.

* Fixing linting.

* Tweak micro:bit auto-disconnect timeout.
2018-07-24 11:08:48 -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
b3ee2c439d Remove layerOrder property, sprites are rendered in the order the targets are listed in in the .sb2 file. 2018-07-23 15:48:27 -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
Eric Rosenbaum
f5066626e5
Use sprite’s soundbank to play text2speech sound (#1388)
* Use sprite’s soundbank to play sound

* Add todo comment
2018-07-23 11:16:00 -04:00
picklesrus
db0597ada5 Get rid of some config that Safari cannot handle and was part of the older getUserMedia. (#1297) 2018-07-23 10:45:27 -04:00
Paul Kaplan
6d4c6df692 Add UserData ioDevice for setting and getting username from blocks 2018-07-23 09:38:58 -04:00
Paul Kaplan
4570184c6b Fix linting 2018-07-19 16:41:07 -04:00
Paul Kaplan
a762892879 Do not send coast if another motor command has been sent 2018-07-19 15:46:01 -04:00
Paul Kaplan
a069a295d7
Merge pull request #1377 from paulkaplan/update-extension-names
Update the category info name when the extension is refreshed.
2018-07-18 15:18:27 -04:00
Paul Kaplan
7aa45ddb38 Update the category info name when the extension is refreshed.
Fixes an issue where changing languages did not update the name in the category menu.
2018-07-18 15:01:22 -04:00
chrisgarrity
d4f20522b8
Merge pull request #1367 from chrisgarrity/issue/gui2530-blockwidth-locale
Add function to return the current VM/blocks locale
2018-07-18 10:57:24 -04:00
Andrew Sliwinski
cf2b858d43 Change 'video motion' to 'video sensing'. See LLK/scratch-gui#2621 2018-07-18 10:11:08 -04:00
Paul Kaplan
c428e2ec02
Merge pull request #1341 from mzgoddard/fix-report
fix unnecessary stackClick report from nested promise reporters
2018-07-18 09:58:47 -04:00
kchadha
5f5ea5ec24
Merge pull request #1361 from kchadha/sprite-upload-global-local-fix
Fix sprite upload variable conflict
2018-07-18 09:56:47 -04:00
chrisgarrity
4ba7e9373f Add function to return the current VM/blocks locale 2018-07-18 09:52:55 -04:00
Paul Kaplan
13c6c4f9d4
Merge pull request #1362 from paulkaplan/fix-duplicate-sound
Fix duplicating sounds not working
2018-07-18 09:03:03 -04:00
Paul Kaplan
3bb455dae5 Duplicating a sprite copied the sounds into the original, not the new 2018-07-17 16:50:40 -04:00
Karishma Chadha
37b276935e Update fields of blocks to reference new variable names for renamed global so that the VM always has up-to-date and accurate information about the blocks. 2018-07-17 16:27:00 -04:00
Kreg Hanning
9524db5609 Only send matrix data if input !== null (#1356) 2018-07-17 16:12:38 -04:00
Kreg Hanning
2af04c43ea Ignore display command with blank string (#1355) 2018-07-17 16:09:12 -04:00
Evelyn Eastmond
c4ee7065a2 EV3/Microbit critical fixes for code freeze (#1354)
* Resolves - BLESession and BTSession should emit PERIPHERAL_SCAN_TIMEOUT #1348.

* Resolves - BLESession should handle 'could not find service' error #1350.

* Resolves - BTSession should handle 'no peripheral connected' error #1351.

* Fixing a typo that caused device scan timeout bugs.

* Resolves - Add casting and clamping throughout the EV3 extension #1352.

* Fixing a linting error.

* Further fixes for issue #1351.
2018-07-17 16:03:05 -04:00
Eric Rosenbaum
1dcdfc9548
Use secure web socket address for ble and bt connection (#1359) 2018-07-17 15:40:47 -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
kchadha
0776845a94
Merge pull request #1347 from kchadha/fix-var-rename-delete
Fix local var rename/delete
2018-07-17 11:07:13 -04:00
Eric Rosenbaum
b8ea846eed
Use 2x png for microbit icon (#1346)
* Use file-loader for png

* Use 2x png for microbit block icon

* Load png via data URI

* JSDOC
2018-07-17 09:21:44 -04:00
Karishma Chadha
ee9a99b928 Fix variable deletion bug. 2018-07-15 19:00:55 -04:00
Karishma Chadha
a8fc399746 Fix var rename bug where variable would go back to old name after switching sprites. 2018-07-15 18:58:56 -04:00
picklesrus
bf22cdbf13 Make the end listening sound only play one time even if multiple bloc… (#1232)
* Make the end listening sound only play one time even if multiple blocks stop listening at the same time.

* Update for new sound API
2018-07-15 15:04:27 -04:00
picklesrus
ed78231fe9 Turn speech block text into i18n messages. (#1224)
* Turn speech block text into i18n messages.

* Update message descriptions and other code review comments.

* fix typo

* Add bit about not translating Google to message description.

* Change default when I hear text
2018-07-15 14:34:24 -04:00
picklesrus
bd83d66bff Update speech extension to use new audio engine api since the old version no longer exists. (#1272) 2018-07-15 14:23:14 -04:00
Paul Kaplan
3fa28cac35
Merge pull request #1326 from kchadha/share-local-var-fix
Fix variable conflicts that arise when sharing the love with the stage.
2018-07-13 13:24:49 -04:00
Evelyn Eastmond
133ade7f48 EV3 port and sensor polling updates (#1342)
* Add motor rotate, without coasting yet.  Fixed some todos.

* Removing logging.

* Implemented motor set position, motor set power, and beep note for time blocks.  Changed labels on motor blocks.  Tracking motor speeds for all ports.

* Fixing motor ports to 0-3 and then output bit field when sending commands.

* Added stop all motors with stop button.  Added port masking function.  Some cleanup.  Moved beeping up an octave.

* Combine device list polling and sensor polling into a single timeout call, device list requested every 20 times.

* Don't reset sensors on device update.  Don't store undefined sensor/motor values.  Some comments.

* Fixing some linting.
2018-07-13 13:14:53 -04:00
Karishma Chadha
2b2fc2e561 Code cleanup, refactor, abstraction 2018-07-13 12:58:45 -04:00
Michael "Z" Goddard
fee3c4cc04
fix unnecessary stackClick report from nested promise reporters
Check that a reporting block is the last operation as part of some
parent block. The last operation is the block itself which may report
values for stack clicks and monitor updates if it meets other
requirements.
2018-07-13 10:23:42 -04:00
Karishma Chadha
13df3e7bd6 Add unit tests and fix object shallow vs. deep copying bug. 2018-07-13 09:36:43 -04:00
Karishma Chadha
406e59fc18 Fix variable conflicts that arise when sharing the love of a sprite-local variable with the stage. 2018-07-13 09:36:43 -04:00
Andrew Sliwinski
c69a59575d
Merge pull request #1316 from ericrosenbaum/feature/language-reporter
Change translate extension reporter block text to 'language'
2018-07-13 08:41:33 -04:00
Paul Kaplan
ec0ac19772
Merge pull request #1332 from ericrosenbaum/bugfix/microbit-bail-out
Microbit write bails out if not connected
2018-07-13 08:32:58 -04:00
Paul Kaplan
b9203ac5d6
Merge pull request #1333 from ericrosenbaum/bugfix/fix-microbit-extension-name
Change extension name to micro:bit
2018-07-13 08:32:45 -04:00
Paul Kaplan
b33d9ba4e0
Merge pull request #1335 from mzgoddard/fix-execute
fix asynchronous block execution
2018-07-13 08:32:20 -04:00
Paul Kaplan
e463781bc1
Merge pull request #1330 from paulkaplan/glow-on-stack-click
Always glow threads that come from stack clicks
2018-07-13 07:53:05 -04:00
Michael "Z" Goddard
d2c637a621
fix asynchronous block execution
Freeze promise waiting blocks into an array of reported values. Thaw
those reported values into parent values of matching blocks by id. If
the reporting block was waiting on a promise and reported a value
assign it to its parent value at that future time.
2018-07-13 00:04:49 -04:00
DD Liu
c7e9c833c0
Merge pull request #1315 from fsih/loadCostume
Don't depend on this until https://github.com/LLK/scratch-gui/pull/2575 is in

Break out loadVector and loadBitmap from loadCostumeAsset, and handle bitmap resolution 1 assets in loadBitmap
2018-07-12 18:50:14 -04:00
DD Liu
46918f266e Add bitmap resolution so that required proptype warning stops 2018-07-12 17:25:53 -04:00
DD Liu
1c74c9028c Better error handling 2018-07-12 17:18:38 -04:00
Eric Rosenbaum
eaeefdcfe7 Change extension name to micro:bit 2018-07-12 15:26:32 -04:00
Eric Rosenbaum
ea1bb602f9
Microbit display commands yield for a tick (#1331)
* Microbit display commands yield for a tick

* JSDOC fixes
2018-07-12 15:19:28 -04:00
DD Liu
004f38190a Merge branch 'develop' into loadCostume 2018-07-12 15:16:17 -04:00
Eric Rosenbaum
a7f4fc2212 Microbit write bails out if not connected 2018-07-12 14:41:28 -04:00
Paul Kaplan
9dbb362b36 Remove log line 2018-07-12 14:40:13 -04:00
DD Liu
0258a7390f Convert to node style callback and convert to bitmap resolution 2 always 2018-07-12 14:33:38 -04:00
Paul Kaplan
bcd76c995e Always glow threads that come from stack clicks 2018-07-12 11:24:06 -04:00
Andrew Sliwinski
0c21f739ec
Merge pull request #1327 from thisandagain/feature/deleteall
Add opcode implementation for `data_deletealloflist`
2018-07-12 11:02:14 -04:00
Kreg Hanning
06c4e5516f Add micro:bit matrix field block (#1314)
* Add micro:bit matrix field block

* Remove debug logs

* Remove rowcol menu

* Fix lint errors
2018-07-11 16:13:49 -04:00
chrisgarrity
0810c455c2
Merge pull request #1321 from chrisgarrity/issue/1299-switch-language
Issue/1299 switch language
2018-07-11 16:03:10 -04:00
Paul Kaplan
760fcd8231
Merge pull request #1318 from paulkaplan/fix-bt-connection
Set internal connected flag before emitting event
2018-07-11 14:20:22 -04:00
Andrew Sliwinski
f7aafe4d9c Add opcode implementation for data_deletealloflist 2018-07-11 13:14:01 -04:00
Paul Kaplan
31cd204117 Add semicolons... 2018-07-11 11:47:29 -04:00
Paul Kaplan
eecca39a97 Update microbit block and menu icons using the new ones 2018-07-11 11:20:19 -04:00
chrisgarrity
849412ba82 Switch setLocale to return a promise
Convert refreshBlocks to a function returning a promise, and return that from setLocale. Now GUI can ensure that refreshing the toolbox and workspace only happens after all the blocks have refreshed.
2018-07-11 08:35:22 -04:00
Paul Kaplan
82a33691d3 Set internal connected flag before emitting event 2018-07-10 15:57:25 -04:00
Eric Rosenbaum
0cc219fa0a Change ‘viewer language’ reporter to ‘language’ 2018-07-10 15:10:27 -04:00
DD Liu
747b4d1aed Add bitmap resolution 2018-07-10 11:59:10 -04:00
DD Liu
704be2d83f fix comment 2018-07-10 10:39:47 -04:00
DD Liu
6aefd13af6 Break load costume into more functions, and update how bitmaps are loaded 2018-07-10 10:30:38 -04:00
picklesrus
e156b0536c Fix name of translate extension and add the logo back. Basically fixes #1029 (#1313) 2018-07-10 10:25:49 -04:00
Andrew Sliwinski
c9d71488c3
Merge pull request #1311 from thisandagain/feature/polly
Update text-to-speech extension to use new audio engine
2018-07-10 08:30:52 -04:00
Andrew Sliwinski
ace5ae40d0 Update text-to-speech extension to use new audio engine 2018-07-09 14:40:13 -04:00
Evelyn Eastmond
394b57ebb6 Removing some logging. 2018-07-09 14:31:09 -04:00
Evelyn Eastmond
f511730602 Fix motor turn for ports C/D. Zero out sensors and motor values on disconnect. 2018-07-09 14:31:09 -04:00
Evelyn Eastmond
a220829007 Changes to EV3 extension: motor reporter 0-360, distance reporter rounded to tenths, motors coasting after turn for time commands, buttons distinguishable by port, and motor reporters for ports C/D fixed. 2018-07-09 14:31:09 -04:00
Ray Schamp
55944bc4b6
Merge pull request #1285 from LLK/feature/device-connection
Device connection update for micro:bit and EV3 extensions
2018-07-09 14:26:06 -04:00
Eric Rosenbaum
e02dd35dbf remove logging 2018-07-09 13:49:41 -04:00
Eric Rosenbaum
b30092e890 Motor for time opcodes return promise to wait 2018-07-09 13:49:41 -04:00
Eric Rosenbaum
a78866f99a Add EV3 block icon 2018-07-09 13:49:41 -04:00
Eric Rosenbaum
2cfc6d601a Fix required module name to lowercase 2018-07-09 13:49:41 -04:00
Evelyn Eastmond
190f4b5796 Fixing linting errors. 2018-07-09 13:49:41 -04:00
Eric Rosenbaum
2ec894b5a7 Get motor positions for reporter block 2018-07-09 13:49:41 -04:00
Eric Rosenbaum
1cc013ea1b Stringify errors 2018-07-09 13:49:41 -04:00
Evelyn Eastmond
b9ea6005f8 Clearing ports on disconnect. 2018-07-09 13:49:41 -04:00
Evelyn Eastmond
cf98e35564 EV3 blocks progress: distance, brightness, button, motor position. Only single button for now, distance needs threshold at 0. 2018-07-09 13:49:41 -04:00
Evelyn Eastmond
d79efbece8 Some logging cleanup. 2018-07-09 13:49:41 -04:00
Eric Rosenbaum
387f03b08c Add disconnect and getPeripheralIsConnected to EV3 extension 2018-07-09 13:49:41 -04:00
Eric Rosenbaum
6f5ff31eb3 Add disconnectExtensionSession and getPeripheralIsConnected 2018-07-09 13:49:41 -04:00
Evelyn Eastmond
613a9f96c3 Adding initial test polling for EV3 distance sensor data. 2018-07-09 13:49:41 -04:00
Evelyn Eastmond
0280966a61 Connected Ev3 extension to device connection modals. 2018-07-09 13:49:40 -04:00
Evelyn Eastmond
d1d9b38bf9 Added all EV3 block commands/reporters/booleans to Ev3 device class as stubbed functions. 2018-07-09 13:49:40 -04:00
Evelyn Eastmond
42e0576549 All EV3 blocks stubbed out with console logs for now. 2018-07-09 13:49:40 -04:00
Evelyn Eastmond
2d8ad05a78 Adding Ev3 extension with three test blocks to latest device-connection work, auto-connecting to device for now. 2018-07-09 13:49:40 -04:00
Evelyn Eastmond
4332725d33 Adding more errors based on web socket onerror and onclose. Moved extension runtime mapping of devices back to MicroBit class. 2018-07-09 13:41:57 -04:00
Evelyn Eastmond
9d66c54f8a Adding error reporting to runtime from BLESession. 2018-07-09 13:41:57 -04:00
Evelyn Eastmond
73cc149783 Adding promises to return on BLE write. Some refactoring. 2018-07-09 13:41:57 -04:00
Evelyn Eastmond
701f430e56 Remove pinging in BLE connection. 2018-07-09 13:41:57 -04:00
Evelyn Eastmond
730b798686 Extension/runtime protocol refactoring. 2018-07-09 13:41:57 -04:00
Eric Rosenbaum
d778ddf00e wip 2018-07-09 13:41:57 -04:00
Paul Kaplan
665bf9a322
Merge pull request #1305 from paulkaplan/fix-broadcast-wait
Fix tick yielding threads
2018-07-09 13:41:55 -04:00
kchadha
6c118cf8e0
Merge pull request #1301 from kchadha/variable-scope
Variable scope
2018-07-06 14:39:56 -04:00
Karishma Chadha
a0a11f2f19 Add 'islocal' flag to XML serialization for variables. 2018-07-06 13:02:23 -04:00
Paul Kaplan
24355c6e6d Fix tick yielding threads 2018-07-05 14:56:00 -04:00
Paul Kaplan
2c7de6380e Add implementation for "When loudness >" block 2018-07-05 09:42:00 -04:00
Paul Kaplan
06573f4624
Merge pull request #1280 from paulkaplan/fix-bubble-state
Fix a few say bubble issues
2018-07-05 08:55:39 -04:00
Karishma Chadha
ed608ffe6f Refactor to fix issue with global var not checking for name conflicts on all sprites. 2018-07-03 23:20:49 -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
Paul Kaplan
63e96634bf Use bounds of the renderer instead of stage target for positioning.
Fixes the regression where bubbles almost always point left instead of right.
2018-06-28 16:45:07 -04:00
Paul Kaplan
a6a29a5437 Fix hidden bubbles not resetting on stop 2018-06-28 16:44:33 -04:00
Andrew Sliwinski
840510c733 Update colors for extensions. Resolves GH-1275 2018-06-27 18:10:51 -04:00
Paul Kaplan
c3386ad84d
Merge pull request #1254 from paulkaplan/fix-undefined-block-parsing
Skip unknown opcode blocks while parsing
2018-06-27 17:01:00 -04:00
Karishma Chadha
92dfebdae6 Add variables from var_create events to appropriate target based on isLocal flag. 2018-06-27 16:32:10 -04:00
Eric Rosenbaum
aa400ea15b
Show extension status button via XML attr not button (#1270) 2018-06-27 15:53:18 -04:00
Paul Kaplan
0e3413e6bd Fix comment 2018-06-27 14:17:33 -04:00
Paul Kaplan
4967155285 Fix nits 2018-06-27 10:44:28 -04:00
Paul Kaplan
9f517bd483 Deal with comments attached to undefined blocks
Also fix an issue where you couldn't save/load projects that had multiple comments linked to a single block.
2018-06-26 16:41:10 -04:00
Paul Kaplan
e7e300caeb Skip unknown opcode blocks while parsing 2018-06-26 15:58:43 -04:00
Connor Hudson
0bed25e01b Merge develop into feature/extension-serialization 2018-06-26 08:56:42 -04:00
Mx Corey Frang
236f914f55 delete clone should not stop sound (#1269) 2018-06-25 15:44:39 -04:00
Michael "Z" Goddard
0dffc65ce9 stop drum immediately if it is still starting (#1266) 2018-06-25 15:31:35 -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
55a5592ab6 Add optional type param to export sprite API. 2018-06-25 09:23:04 -04:00
Karishma Chadha
f06b8a3943 Clean up calls to fixUpVariableReferences 2018-06-25 09:11:48 -04:00
Corey Frang
4431b43e45 A few leftover loadSound that werent updated 2018-06-22 09:45:23 -04:00
Michael "Z" Goddard
c268bbae47 add decoded SoundPlayer's to a Sprite's SoundBank (#1260) 2018-06-21 17:23:33 -04:00
Corey Frang
14f8c44ad9 Stop all sounds by clones when disposed 2018-06-21 17:00:03 -04:00
Corey Frang
c087cf326a soundbank tests 2018-06-21 17:00:03 -04:00
Michael "Z" Goddard
61dacfc915
Merge pull request #1258 from mzgoddard/green-music-extension
Use new scratch-audio APIs in music extension
2018-06-21 16:59:42 -04:00
Michael "Z" Goddard
7e48bed0ab
use scratch-audio EffectChain and SoundPlayer in music extension
- Use AudioEngine to decode sounds
- Store players instead of buffers
- Use SoundPlayer stop event to track concurrency
2018-06-21 16:53:45 -04:00
Connor Hudson
befcbec393 Create extensions list in serialize function
Removed runtime argument from serializeTarget call because it wasn't used
2018-06-21 15:01:00 -04:00
Connor Hudson
026dd96491 Modify serializeTarget function to take an extension set as an argument
This allows the serialize function to build a list of all extensions used
2018-06-21 15:00:17 -04:00
Connor Hudson
17679340f9 Return extension ids from serializeBlocks instead of modifying Set passed to it 2018-06-20 15:42:56 -04:00
kchadha
39c27d82ef
Merge pull request #1248 from towerofnix/sprite-quad-fix
Fix new sprites only showing up in the top-right quadrant
2018-06-20 14:40:11 -04:00
Connor Hudson
15de2eaa68 Remove extension deserialization 2018-06-20 14:33:01 -04:00
Karishma Chadha
b40ac54fdd Remove stray newline. 2018-06-20 13:37:31 -04:00
Karishma Chadha
b75a779540 Call fixUpVariableReferences in installTargets, before emitting the workspace update. 2018-06-20 12:12:33 -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
chrisgarrity
f0951d16fa
Merge pull request #1246 from chrisgarrity/feature/translate-labels
Localize category labels
2018-06-20 08:33:44 -04:00
Connor Hudson
68215664ec Merge branch 'develop' into feature/extension-serialization 2018-06-19 17:01:13 -04:00
Karishma Chadha
9646e3d11e Refactor and move variable reference fixup function into target. 2018-06-19 15:31:08 -04:00
Karishma Chadha
f2aacbc79c Fix up variable references after deserializing a .sprite2 or .sprite3 to avoid conflicts with pre-existing variables. 2018-06-19 14:02:54 -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
Karishma Chadha
5cc48b6ef3 Provide global vars to sb2 import when deserializing a single sprite. 2018-06-19 08:52:22 -04:00
Karishma Chadha
86a8d93eb6 Sprite3 Export/Import. 2018-06-19 08:51:16 -04:00
Florrie
0527fcde64 Fix new sprites only showing up in the top-right quadrant 2018-06-18 17:20:59 -03:00
Connor Hudson
aa16930e34 Add initial implementation of extension serialization/deserialization 2018-06-18 15:00:33 -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
chrisgarrity
1e3907e922 Localize category labels
Added formatMessage to the name attribute for:
* music
* pen
* translate
* video motion

Skipped speak extension - trademarked name
Skipped extensions that are not yet localized at all.
2018-06-18 11:37:10 -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
kchadha
29b79878bc
Merge pull request #1236 from kchadha/comment-save-load
Comment Save & Load
2018-06-14 18:42:19 -04:00
kchadha
529d271186
Merge pull request #1235 from kchadha/xml-escape-comments
XML escape comment text.
2018-06-14 14:46:02 -04:00
Karishma Chadha
e2eadbf603 Comment save and load. 2018-06-14 14:11:20 -04:00
Eric Rosenbaum
8c748cebb4
Merge pull request #1233 from ericrosenbaum/feature/extension-status-button
Add extension status button
2018-06-14 11:51:32 -04:00
Karishma Chadha
0d403d8e83 XML escape comment text. 2018-06-14 11:39:03 -04:00
Ray Schamp
f5234c777a
Merge pull request #1211 from mzgoddard/broadcast-and-wait-promise
yield a tick if broadcastandwait is waiting on threads waiting for a future tick
2018-06-13 15:58:37 -04:00
Eric Rosenbaum
c2b262ba97 Add status button to microbit extension 2018-06-13 15:53:05 -04:00
Eric Rosenbaum
7d0c45546c Add extension status button XML 2018-06-13 15:52:51 -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
Paul Kaplan
4b64df222a Hoist target list assignment to simplify code. 2018-06-13 10:09:22 -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
kchadha
b4891bb0d5
Merge pull request #1226 from towerofnix/costumename-vm
Implement "costume name" block
2018-06-12 18:50:46 -04:00
Florrie
c24e34d4e3 Remove unused getCostumeName function 2018-06-12 19:32:29 -03:00
Florrie
24c6338302 Map costumeName -> costumenumbername [name]
...instead of mapping to a new obsolete/hidden block 'costumename'.
Thanks to @kchadha for helping with this!
2018-06-12 19:27:36 -03:00
Karishma Chadha
5086eced15 Position for block comments imported from 2.0 should be updated when receiving a create event from scratch-blocks. 2018-06-12 17:10:16 -04:00
Michael "Z" Goddard
728769ea24
do not enumerate Blocks._cache
Do not stringify or enumerate Blocks._cache items.
2018-06-12 14:21:40 -04:00
Michael "Z" Goddard
05291aa254
turn reporter tree into instruction sequence
Turn the reporter tree execute walks into a sequence of block
functions. After calling a block function store the reported value in
the arguments object its depending block will use.

- Set the reported value on the thread. There is only ever one "just"
  reported value, which is read and stored elsewhere after being
  reported.
2018-06-12 14:21:40 -04:00
Michael "Z" Goddard
e0ec1ad08f
add id to block execute cache data 2018-06-12 10:05:54 -04:00
Michael "Z" Goddard
d161251a9b
yield a thread loop or tick in event_broadcastandwait
- yield a thread loop or tick in looks_switchbackdroptoandwait

If all threads broadcastAndWait is watching are "waiting" for a future
frame, yield until the next tick so event_broadcastandwait also defers
to a future frame.
2018-06-12 10:02:28 -04:00
Paul Kaplan
418c3837c6
Merge pull request #1209 from technoboy10/bugfix/gh-1135-bubble-edge
Check that bubble bounds do not extend past stage boundaries
2018-06-11 12:14:53 -04:00
Connor Hudson
244ffb38c4
Merge pull request #1218 from technoboy10/bugfix/gh-1165-monitor-import
Fix importing hidden monitors from Scratch 2 projects
2018-06-11 10:27:45 -04:00
Eric Rosenbaum
78074ec575
Merge pull request #1222 from picklesrus/speech-extension-icons
Speech extension icons
2018-06-11 09:50:42 -04:00
Connor Hudson
38756e1022 Update code comments to address PR feedback 2018-06-11 08:37:25 -04:00
Florrie
404834018b Implement costume name block 2018-06-09 21:34:21 -03:00
picklesrus
97b8ec83bd Ignore lint for the icons 2018-06-08 14:45:13 -07:00
picklesrus
6184c3ba12 Replace icons with version downloaded from https://material.io/tools/icons/?style=baseline 2018-06-08 14:42:46 -07:00
Connor Hudson
78da15c09c Remove blocks.mode reference 2018-06-08 17:04:52 -04:00
Connor Hudson
a6629628cd Use monitor show/hide monitor functions, remove incorrect block property references 2018-06-08 16:00:12 -04:00
Connor Hudson
0e394fc873 Add monitor show/hide functions, changed remove monitor to delete state 2018-06-08 15:59:35 -04:00
Eric Rosenbaum
173fb6127c
Merge pull request #1214 from ericrosenbaum/feature/when-touching
Add when touching hat
2018-06-07 15:26:09 -04:00
Connor Hudson
2cb276c476 Consolidate some logic in requestAddMonitor and requestUpdateMonitor 2018-06-07 15:18:45 -04:00
kchadha
3a61cac384
Merge pull request #1217 from kchadha/comment-state-fixes
Comment state fixes
2018-06-07 14:31:43 -04:00
Eric Rosenbaum
db7c56e08b Change function name and comment for clarity 2018-06-07 14:12:23 -04:00
Connor Hudson
99dc46ba80 Add x, y to changeBlock function again after change to merge logic 2018-06-07 11:27:10 -04:00
Connor Hudson
833c27ef21 Remove debug comments, tweak logic for monitor data merging 2018-06-07 11:24:55 -04:00
Karishma Chadha
6bc04c4bef Let comment change event handler multitask. 2018-06-07 11:04:03 -04:00
Paul Kaplan
db3fca17bc
Merge pull request #1204 from paulkaplan/reorder-apis
Add methods for reordering costumes and sounds
2018-06-07 10:54:15 -04:00
Ray Schamp
7de83bea07
Merge pull request #1215 from picklesrus/speech-extension-audiocontext
Add webkitAudioContext if AudioContext does not exist. This might fix…
2018-06-07 10:53:45 -04:00
Karishma Chadha
7b55d8e7ab Undo change that moves block comment relative to block move. 2018-06-07 10:18:34 -04:00
Connor Hudson
13bf932fbb Remove unnecessary arguments to requestAddMonitor 2018-06-07 10:11:15 -04:00
Karishma Chadha
d99a082952 CommentChange events now store text changes in an object with property text, instead of just a string. 2018-06-07 10:09:38 -04:00
picklesrus
391f47d100 Add webkitAudioContext if AudioContext does not exist. This might fix the speech extension in safari, but it is tricky to tell since I am running into problems with permissions and localhost. 2018-06-06 16:49:46 -07:00
Paul Kaplan
28f425d53e Set costume directly, no updates are needed 2018-06-06 17:29:48 -04:00
Connor Hudson
77dda04228 Set visible: false instead of deleting state in requestRemoveMonitor
This potentially has performance implications, to be investigated later.
2018-06-06 17:14:09 -04:00
Eric Rosenbaum
1a72512a62 Moving touchingObject into rendered target 2018-06-06 16:34:58 -04:00
Connor Hudson
0d0543810f Properly capture all variable monitor values on add 2018-06-06 16:00:59 -04:00
Connor Hudson
18640d7ddc use mergeWith in requestAddMonitor, requestUpdateMonitor
So undefined values don't overwrite defined ones
2018-06-06 15:54:12 -04:00
Paul Kaplan
bf2879ee0b Fix incorrect clamping 2018-06-06 15:01:02 -04:00
Eric Rosenbaum
431d4bd66b Add when touching hat 2018-06-06 13:39:23 -04:00
Paul Kaplan
0cd50fbb2c Propagate the return value of reorder functions, update comments 2018-06-06 11:13:30 -04:00
Eric Rosenbaum
332e90e408
Merge pull request #1208 from ericrosenbaum/feature/increase-pen-size
Increase maximum pen size to 1200
2018-06-06 10:16:15 -04:00
Michael "Z" Goddard
0a006dc981
add Runtime.isWaitingThread
Add a Runtime Thread helper to check if a thread is in a state where it
will not change at least until next frame. This includes any state
where the thread is done, as that will not change either.
2018-06-06 10:16:05 -04:00
Michael "Z" Goddard
9311a274d5
add BlockUtility.yieldTick 2018-06-06 10:16:05 -04:00
Michael "Z" Goddard
84705fc463
replace new Promise(r => r()) with Promise.resolve
Promise.resolve is a Promise convenience method that creates a promise
resolved to a given argument like creating a promise with a function
that immediately calls the resolve function with the given value.
2018-06-06 09:53:45 -04:00
Paul Kaplan
d6d72f6fa7 Use utility function for clamping 2018-06-06 09:43:54 -04:00
Paul Kaplan
1ebb736a2a Check specifically for number in optional property 2018-06-06 09:43:54 -04:00
Paul Kaplan
837703d4ac Make reorder functions return if a change occurred.
Gotta get that testing coverage percent up :)
2018-06-06 09:43:54 -04:00
Paul Kaplan
e6ebc33e9e Add sound and costume reordering methods and tests to top-level API 2018-06-06 09:43:54 -04:00
Paul Kaplan
d3fd3ff806 Add reorderSound and unit test to rendered-target 2018-06-06 09:43:54 -04:00
Paul Kaplan
5fd5b30ccf Add reorderCostume method and unit test to rendered target 2018-06-06 09:43:54 -04:00
Paul Kaplan
9fce4d40d0 Fix bug with zero adding a costume/sound at index 0 2018-06-06 09:43:54 -04:00
Andrew Sliwinski
c2645f3da5
Merge pull request #1210 from thisandagain/feature/polly
Add initial working version of the Amazon Polly extension
2018-06-05 18:35:38 -04:00
Andrew Sliwinski
bccdef0674 Future-proof opcode and fix issues with copied comments 2018-06-05 18:32:02 -04:00
Andrew Sliwinski
55b1a794ce Add initial working version of the Amazon Polly extension 2018-06-05 17:51:55 -04:00
kchadha
1f209ad4e0
Merge pull request #1191 from kchadha/comment-events
Persist comment state.
2018-06-05 16:53:57 -04:00
Paul Kaplan
a11d1be3fc Fix comments 2018-06-05 16:08:14 -04:00
Eric Rosenbaum
23c7df5751 Max pen size 1200 2018-06-05 15:59:14 -04:00
Connor Hudson
25290e7f6a Check that bubble bounds do not extend past stage boundaries
For when you can't flip the bubble, but need it to remain on-stage
2018-06-05 15:58:03 -04:00
Karishma Chadha
644fab0135 Track block comment movement when block moves. 2018-06-05 15:40:19 -04:00
Karishma Chadha
7c5a2ae8e0 Add check that block associated with comment actually exists. 2018-06-05 15:17:28 -04:00
Karishma Chadha
d58bb8bcfb Clean up optRuntime checks in blocklyListen 2018-06-05 15:13:03 -04:00
Karishma Chadha
2171cb69d0 No need to floor workspace coordinates in vm runtime. 2018-06-05 15:12:25 -04:00
Paul Kaplan
3a697ae0ac Add top-level API for getting and setting variable values 2018-06-05 10:46:06 -04:00
Paul Kaplan
7b2f606316 Fix an issue where variable lookup would error if stage did not exist. 2018-06-05 10:45:51 -04:00
Eric Rosenbaum
ca6a7f9311
Merge pull request #1199 from picklesrus/speech-extension-loginfo
Add some log info with more information about the speech match so we …
2018-06-04 16:35:58 -04:00
picklesrus
e668a210a0 Add some log info with more information about the speech match so we can debug better. 2018-06-04 13:17:34 -07:00
Kreg Hanning
9055706333 Add check for invalid symbol 2018-06-04 15:22:12 -04:00
Kreg Hanning
94464f0a52 Update microbit extension for latest firmware 2018-06-04 14:52:52 -04:00
Karishma Chadha
522706ccf8 Persist comment state. 2018-06-01 18:10:25 -04:00
Eric Rosenbaum
294801c1f3
Merge pull request #1184 from ericrosenbaum/bugfix/sound-blocks-yield
Set/change sound effect and volume blocks yield until the next tick
2018-06-01 13:19:50 -04:00
Eric Rosenbaum
2348d55f14 Use promises to yield 2018-05-31 17:09:47 -04:00
Paul Kaplan
ac91d8af65
Merge pull request #1180 from kchadha/parse-sb2-comments
Import Comments from 2.0 Projects
2018-05-31 16:51:22 -04:00
Eric Rosenbaum
46f885fc03 Sound effect and volume blocks request redraw 2018-05-31 16:47:40 -04:00
Karishma Chadha
537dc9bcd5 Addressing PR comments. 2018-05-31 16:33:42 -04:00
Michael "Z" Goddard
4ceeebb257 Use src/index as browser entry point
Use src/index.js as the entry by default in tools building scratch-vm
into a larger package. This saves file space by excluding extra webpack
boilerplate and may allow for deeper optimizations.

Depend on script dependencies for downstream webpack. For another
package to build in scratch-vm's dependencies without them already
being built into a consumed webpack build they need to be listed as
dependencies. This can benefit large projects that reuse the same
dependencies multiple times. Node will still use the main entry point
and its webpack build leaves the dependencies as external references so
it may reuse common modules in Node as well as in a build a browser
environment.
2018-05-31 16:32:46 -04:00
Eric Rosenbaum
c9842ec3dc
Merge pull request #1121 from picklesrus/speech-extension-checkin
Initial version of the speech extension.  There is certainly still so…
2018-05-31 15:35:09 -04:00
picklesrus
968eeaf936 Fix missing comma from bad merge. 2018-05-31 12:14:55 -07:00
Eric Rosenbaum
3e43786ef6 Default to a random language 2018-05-31 11:48:37 -04:00
Karishma Chadha
acd728dc2b No more xml differentiation for 'scratch' type of comments. 2018-05-30 21:18:45 -04:00
Karishma Chadha
f079eb4bbd Don't serialize x and y for sb2 comments so that they can be auto positioned. 2018-05-30 21:18:45 -04:00
Karishma Chadha
b0aa288916 Add info about minimized state to comment xml. 2018-05-30 21:18:45 -04:00
Karishma Chadha
1639444a4d Fix lint and tests. 2018-05-30 21:18:45 -04:00
Karishma Chadha
1401d54add Parse SB2 comments and attach block comments to the blocks they belong to. Send comment xml on workspace update so they can be rendered. 2018-05-30 21:15:14 -04:00
picklesrus
3a5051646f Now fuzzymatchResult is unused so remove it too. 2018-05-30 13:22:07 -07:00
picklesrus
bb408b8673 Remove some code that set the utterance to the fuzzy match result 2018-05-30 13:22:07 -07:00
picklesrus
e72ea04c10 Move the add event listener code to be in the same place where we call connect so there is only one place to do it. 2018-05-30 13:22:07 -07:00
picklesrus
ef142107a6 Remove the event listener for processing audio at the same time that we disconnect the script node. At this point we are closing the web socket and do not want to process more of the microphone data even if it is already in flight. Also add it back when we resume listening instead of just at init time. 2018-05-30 13:22:07 -07:00
picklesrus
ffced16b95 Fix a copy/paste comment error and initialize current_utterance differently 2018-05-30 13:22:07 -07:00
picklesrus
a2eee6a1dd Change name of opcode to speech_ from speech.Plus, remove old comment. 2018-05-30 13:22:07 -07:00
picklesrus
adf5d0acfd Add speech extension to the extension manager. 2018-05-30 13:22:07 -07:00
picklesrus
250570e0ed Use arraybuffer-loader instead of buffer-loader to load the start and end sounds. The music extension switched to this a few days ago. 2018-05-30 13:20:38 -07:00
picklesrus
e7987a6a4c Initial version of the speech extension. There is certainly still some stuff to figure out but the core of it is here. 2018-05-30 13:20:38 -07:00
Eric Rosenbaum
057e89b1e0
Merge pull request #1178 from picklesrus/translate-language-reporter-block
Add language reporter block to translate extension
2018-05-30 10:25:22 -04:00
picklesrus
123edcb913 remove stray space 2018-05-29 15:14:38 -07:00
picklesrus
e2f6dfd29f - Update the reporter to return the human readable language.
- Remove the non-final icons and replace with a TODO.
- Add messages for the text in the blocks.
2018-05-29 15:06:38 -07:00
picklesrus
f615e9191a Add language reporter block to translate extension 2018-05-28 11:58:17 -07:00
DD
7874ea9b1a Allow rotation centers with zeros 2018-05-25 16:54:54 -04:00
kchadha
a85f641d25
Merge pull request #1148 from kchadha/stage-layering
Layer group ordering.
2018-05-25 09:10:05 -04:00
Chris Willis-Ford
b3db00fab7
Merge pull request #1154 from vincentbriglia/issue1552
Allow override of icons per block
2018-05-25 01:10:57 -07:00
Chris Willis-Ford
eae258cce6
Merge pull request #1153 from vincentbriglia/issue1551
Add option for Extensions to have different colour
2018-05-25 01:07:20 -07:00
DD Liu
13d277e7c8
Merge pull request #1164 from fsih/bgOffset
Always give backdrops a certain rotation center
2018-05-24 16:54:01 -04:00
Ray Schamp
3b49f45b9a
Merge pull request #1160 from Kenny2github/patch-1
Round (x position) and (y position) to 8 places
2018-05-24 13:58:16 -04:00
Paul Kaplan
02041c8218
Merge pull request #1163 from paulkaplan/username-stub
Add logged out version of username block
2018-05-24 13:29:47 -04:00
Eric Rosenbaum
b052205457
Merge pull request #1162 from ericrosenbaum/feature/emit-keyboard-events
Runtime emits key pressed event
2018-05-23 17:04:05 -04:00
Eric Rosenbaum
3cdc9765a8
Translation extension imports translated language names (#1159)
* wip

* wip

* Get viewer language code, and cleanup

* Revert "wip"

This reverts commit 6598738ed2.

# Conflicts:
#	src/extensions/scratch3_translate/index.js
2018-05-23 17:00:59 -04:00
DD Liu
10aa6979ed Multiply by bitmap resolution 2018-05-23 14:18:22 -04:00
DD Liu
85689201ed Always give backdrops a certain rotation center 2018-05-23 14:06:23 -04:00
Paul Kaplan
c5cc129821 Add logged out version of username block 2018-05-23 11:30:12 -04:00
Eric Rosenbaum
508ac91b82 Runtime emits key pressed event 2018-05-22 17:24:22 -04:00
Paul Kaplan
b7e40c9735
Merge pull request #1147 from paulkaplan/fix-say-hide
Fix say bug with show/hide
2018-05-22 14:49:50 -04:00
Ken
5af6887cfe Round (x position) and (y position) to 8 places 2018-05-22 12:46:22 +08:00
DD Liu
8c0f5a71f0
Merge pull request #1149 from fsih/compatMode
Pass in argument to indicate compat mode
2018-05-21 15:03:27 -04:00
Karishma Chadha
5e40bfb7ee No more explicit layer groups, and separate extension into video and pen. 2018-05-20 22:30:20 -04:00
Karishma Chadha
38875bc65c Bubbles should be in the same layer as sprites. Other cleanup. 2018-05-20 19:49:42 -04:00