Commit graph

1662 commits

Author SHA1 Message Date
Michael "Z" Goddard
4e24a3f380
Constant time check if thread is in doneThreads
Remove indexOf tests for thread existence in doneThreads. Maintain a
list of null and thread objects mirroring the index position of threads
that are done in runtime.threads. Filter out null values after
filtering out done threads from runtime.threads.

This has a small side effect that threads that normally became DONE and
were added to doneThreads before being removed or restarted will not be
in doneThreads in this version. Restarted threads (_restartThread) do
not appear in this version but new copies will be in Runtime
this.threads supporting glow and monitor updates. Removed threads
(_removeThread) do not appear in this version if they are removed after
they were seen as DONE by the prior version. Threads removed before
they are seen as DONE do not appear in doneThreads in the prior or this
version.

Threads that are removed before normally becoming DONE do not appear in
doneThreads in either case. Threads that are restarted before the loop
checks if the thread is done do not appear in doneThreads in either
case.
2017-11-03 17:46:50 -04:00
Chris Willis-Ford
ef961c5a4b
Merge pull request #756 from cwillisf/autoload-extensions
Autoload extensions
2017-11-03 13:59:01 -07:00
Christopher Willis-Ford
0ad03f8d70 Actually finish SB2 specMap for WeDo 2.0
Apparently I took a break at the wrong time and forgot to come back to
this... :/
2017-11-03 13:48:05 -07:00
Christopher Willis-Ford
51dcfb954d Pen integration test: don't pre-load pen extension 2017-11-03 12:50:37 -07:00
Paul Kaplan
034d1a9792
Merge pull request #755 from paulkaplan/fix-extension-colors
Use category info that has colors when building menu blocks
2017-11-03 15:15:15 -04:00
Christopher Willis-Ford
c88a8fa55a Fix tests & a typo 2017-11-03 11:42:20 -07:00
Christopher Willis-Ford
0af3de9bf0 Load extensions when loading a project or sprite
- Accumulate extension info while deserializing JSON
- Install extensions (if any) before installing target(s)
- Merged 'install' steps of the "add sprite" and "load project" paths
2017-11-03 11:20:24 -07:00
Paul Kaplan
c1ba902ebb Use category info that has colors when building menu blocks 2017-11-03 13:50:50 -04:00
Eric Rosenbaum
2ac464c53e Prepend icon to each extension block 2017-11-03 11:35:42 -04:00
Eric Rosenbaum
a115d47bb8 Add block icon svg as single-line data URI 2017-11-03 11:25:39 -04:00
Paul Kaplan
e2ac6947af
Merge pull request #753 from paulkaplan/provide-argument-ids
Provide argument id list with callers and procdef blocks
2017-11-03 09:48:37 -04:00
Paul Kaplan
007fe2ed53 Fix linting 2017-11-02 17:14:00 -04:00
Paul Kaplan
5b9d4ae23e Provide argument id list with callers and procdef blocks 2017-11-02 17:03:12 -04:00
greenkeeper[bot]
54e19b2bb5 chore(package): update scratch-storage to version 0.3.0 2017-11-02 20:05:55 +00:00
Paul Kaplan
c5d3e2dbb4
Merge pull request #746 from paulkaplan/fix-variable-of
Search for variables by name in "of" block
2017-11-02 11:09:42 -04:00
Chris Willis-Ford
91420375d5
Merge pull request #724 from cwillisf/no-dupe-extensions
Prevent duplicate extensions
2017-11-01 21:29:00 -07:00
Paul Kaplan
3fb48319c2
Merge pull request #745 from paulkaplan/legacy-pen-blocks
Support legacy hue and shade pen blocks
2017-11-01 16:20:33 -04:00
Paul Kaplan
2c3c9f9ac8 Search for variables by name in "of" block 2017-11-01 14:31:52 -04:00
Paul Kaplan
18398d010b Add hideFromPalette flag for hiding legacy blocks 2017-11-01 11:30:15 -04:00
Paul Kaplan
082e051cce Support legacy pen block op codes 2017-11-01 11:30:15 -04:00
Christopher Willis-Ford
8bb48e2a53 Add built-in extension "URL" to _loadedExtensions
Dupe prevention works better when you actually record the necessary
info...
2017-10-31 13:00:19 -07:00
Christopher Willis-Ford
ae878b2050 Simplify extension duplication prevention station
Since we will only have builtin extensions for a while, the
more-complicated, watchdog-based extension duplication prevention has
been replaced with one that treats the extension URL as equivalent to
the extension ID. This is true only for built-in extensions, so once we
start supporting third-party extensions we will likely need to bring
back the watchdog (commit e4381b4693) and
the more-complex duplication prevention (commit
670e51d335).

The code here should be treated as a last resort: ideally the GUI should
check if a particular extension is loaded (maybe by calling the
Extension Manager's new `isExtensionLoaded` method) and avoid calling
`loadExtensionURL` if it is.
2017-10-31 12:35:18 -07:00
Christopher Willis-Ford
670e51d335 Refuse to register second extension with same ID
If an extension attempts to register with the same ID as another
extension which has already registered, the new registration is refused.
If the extension is in a worker and no other extension is successfully
registered by that worker, the watchdog system will terminate the
"empty" worker.
2017-10-31 12:24:26 -07:00
Christopher Willis-Ford
e4381b4693 Add an init watchdog for extension workers
If an extension worker does not complete initialization in a reasonable
amount of time (currently 15 seconds) then the worker will be
terminated. A complete initialization includes registering an extension.
2017-10-31 11:28:56 -07:00
Paul Kaplan
fe30683d37
Merge pull request #737 from paulkaplan/fix-say-non-string
Fix say/think with non-string inputs
2017-10-31 09:16:12 -04:00
Paul Kaplan
48d3b20d69 Stringify things before saying 2017-10-30 15:38:56 -04:00
Ray Schamp
dfd28fbc1f Merge pull request #679 from aeons/unqualified-paths
Use unqualified paths in package.json scripts
2017-10-26 09:21:43 -04:00
Paul Kaplan
4f7d6e8f5c Merge pull request #731 from paulkaplan/fix-global-local-variable-creation
Prevent imported local variables from being duplicated on the stage.
2017-10-25 16:26:17 -04:00
Paul Kaplan
aaa107dbe5 Merge pull request #730 from paulkaplan/fix-undefined-proc-execution
Fix undefined procedure execution
2017-10-25 13:18:23 -04:00
Paul Kaplan
d126f799d8 Prevent imported local variables from being duplicated on the stage. 2017-10-25 11:17:29 -04:00
Paul Kaplan
bbbd3dd64b Make test pass for undefined proc execution 2017-10-25 10:29:07 -04:00
Paul Kaplan
ec1d8c657e Add failing test for callNoReturn on undefined proc 2017-10-25 10:29:07 -04:00
Paul Kaplan
f07c70938a Merge pull request #729 from paulkaplan/fix-say-think-moving
Fix several say/think bugs
2017-10-24 08:40:29 -04:00
Paul Kaplan
c14155c26d Fix comment on drawableVisible property 2017-10-24 08:17:31 -04:00
greenkeeper[bot]
5e4bdb2bc3 chore(package): update worker-loader to version 1.1.0
Closes #680
2017-10-24 02:08:45 +00:00
Paul Kaplan
09bb01893c Add back the visibility optimization in a simpler way. 2017-10-23 14:24:54 -04:00
Paul Kaplan
24d550d860 Remove "visible" state flag and use target visibility directly.
This fixes several other bugs like "saying" from a hidden sprite.
2017-10-23 13:26:08 -04:00
Eric Rosenbaum
9ffbd60bad Merge pull request #725 from ericrosenbaum/feature/pen-extension
Set/change pen color blocks with color, brightness, saturation, transparency
2017-10-23 11:25:09 -04:00
Paul Kaplan
5ca58c7ceb Fix new bubbles not moving with their owning sprite.
This was the original issue #728 that spurred these changes.
2017-10-23 11:20:46 -04:00
Paul Kaplan
87a0224790 Stop hide timeouts from sticking around through green flag/stop. 2017-10-23 11:19:39 -04:00
Paul Kaplan
44ca62fefc Fix event listeners not being cleaned up
Eventually if you hit the green flag a million times with a "green flag
=> say" stack, you'd get an event emitter memory leak error.
2017-10-23 11:17:39 -04:00
greenkeeper[bot]
b74c82a08a chore(package): update socket.io-client to version 2.0.4 2017-10-22 13:19:34 +00:00
Eric Rosenbaum
0a18ce7287 Lint 2017-10-18 13:16:24 -04:00
Eric Rosenbaum
bddabdbac6 JSDocs 2017-10-18 11:48:45 -04:00
Eric Rosenbaum
b5ad5e1f6b Warn on set or change unknown color parameter 2017-10-18 11:33:52 -04:00
Eric Rosenbaum
aab1b834d6 On set color using picker, reset transparency to 0 2017-10-17 23:13:05 -04:00
Eric Rosenbaum
a32f7a6402 Default color setting matches default RGB values
For color (hue) in range 0-100, to get RGB (0, 0, 1), we need to use 100 * 2/3 = 66.66
2017-10-17 23:10:58 -04:00
Eric Rosenbaum
240c48ad0c Set or change color param with a single function 2017-10-17 19:31:51 -04:00
Chris Willis-Ford
d8a3e659d5 Playground: use UMD to load storage as global (#722)
* Playground: use UMD to load storage as global

It appears that `expose-loader` is not compatible with WebPack's UMD
exporter, so the VM playground broke when I converted `scratch-storage`
to use UMD. This change causes the playground to load `scratch-storage`
as an independent script and relies on its UMD loader to expose it as a
global. Bonus points: we get better source mapping this way.

* Playground: tell eslint about global ScratchStorage
2017-10-17 17:40:11 -04:00
Eric Rosenbaum
086df4652e Remove references to pen shade 2017-10-17 12:23:38 -04:00