Karishma Chadha
784341909b
Update block xml for all blocks that use a variable that was just renamed.
2018-01-22 15:14:43 -05:00
DD
fce83dc2c3
make it work for non-droppable inputs
2018-01-10 17:50:48 -05:00
DD
db662b8584
fix lint
2018-01-09 14:55:46 -05:00
DD Liu
0b6d7adf3e
Update monitor on dropdown change
2018-01-08 20:22:18 -05:00
David Aylaian
a22879631f
Optimize stepThread by reducing the number of calls to peekStack
2017-12-27 19:44:49 -05:00
Karishma Chadha
c0e4ae455c
Streamlining broadcast block execution. When arg information is provided to execute function, corresponding broadcast message is looked up by id, if provided, or if not, then name. If neither id nor name is provided, we can't look up the broadcast message and something is wrong, so an error is logged. We no longer need to differentiate between the shadow menu vs. plugged in input cases via the argValue name (e.g. 'BROADCAST_OPTION' vs. 'BROADCAST_INPUT'). This refactor also helps with sb2 import, coming in the next commit.
2017-12-21 19:06:11 -05:00
Karishma Chadha
413d113dda
Adding support for blocks to be plugged into the input of broadcast blocks. SB2 Import to come.
2017-12-21 19:06:11 -05:00
Eric Rosenbaum
2d6e91fa59
Merge branch 'develop' into feature/extension-category-icons
2017-12-19 15:39:00 -05:00
Eric Rosenbaum
9613046b2f
Add optional menuIcon for extension blocks
2017-12-19 14:47:11 -05:00
Eric Rosenbaum
7c853ab7f3
Merge pull request #869 from ericrosenbaum/feature/add-extension-separator
...
Add separator to extension block definition
2017-12-19 13:58:28 -05:00
Eric Rosenbaum
00d6e9e8e7
Merge pull request #863 from ericrosenbaum/feature/blockly-extension-for-scratch-extensions
...
Add blockly extension for scratch extensions
2017-12-15 15:27:26 -05:00
Eric Rosenbaum
5cb0f5d76d
Add separator to extension block definition
2017-12-15 14:09:29 -05:00
Eric Rosenbaum
5e6187bee7
Add blockly extension for scratch extensions
2017-12-14 14:37:08 -05:00
Paul Kaplan
0f82e2a84d
Be more cautious about parsing json.
2017-12-14 14:23:16 -05:00
Paul Kaplan
256d7b3d6c
Parse the warp
property from the mutation instead of using directly.
2017-12-13 15:53:55 -05:00
Eric Rosenbaum
25ded4cff7
Fix spelling of coloUrTertiary
2017-12-11 17:01:23 -05:00
chrisgarrity
f51cf9877e
Preliminary localization ( #777 )
...
* localize the block and menu strings in the pen extension
* adds .tx/config to be able to push translations to transifex
* includes format-message to localize strings and extracting them.
* add setLocale function to VM to allow GUI to pass in locale data.
* refresh block definitions when the locale changes.
### Still to be decided
For now just extracting messages from the pen extension into their own file. We’ll need to decide if each category gets its own file, or group all the strings into one resource.
2017-12-11 15:41:45 -05:00
Chris Willis-Ford
e7bbad60e8
Merge pull request #793 from cwillisf/remove-threads-safely
...
Make _removeThread safe during thread iteration
2017-12-06 17:18:10 -08:00
Paul Kaplan
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
sjhuang26
eede8105d1
Clear answer on green flag
2017-12-01 20:06:55 -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
5a53323715
Update to use explicit procedure names and ids
2017-11-29 12:00:00 -05:00
Karishma Chadha
e5378d323d
Adding unit tests for new lookupOrCreate funciton, fixing a bug that came up during testing (using lookupVariableById on a null target). Skipping integration tests that do not work right now because SB2 import of broadcast message blocks has not been implemented yet.
2017-11-29 10:43:07 -05:00
Paul Kaplan
80b4dab104
Decode the encoded argument information
2017-11-29 10:34:59 -05:00
Karishma Chadha
b674a0c047
Code cleanup and refactoring, and getting scratch3_event broadcast functionality to look up the variable name instead of getting it ad-hoc.
2017-11-28 22:33:27 -05:00
Karishma Chadha
0a15190b85
Broadcast message functionality (works with creating new messages, and switching back and forth between them as well). This commit includes a temporary workaround for the issue where the default broadcast message, 'message1' wasn't triggering a var_create event (filed in LLK/scratch-blocks#1258 ).
2017-11-21 16:48:48 -05:00
DD Liu
58dd57fe48
Merge pull request #784 from fsih/perSpriteMonitors
...
Execute monitors on a given target ID when block is sprite-specific
2017-11-21 10:23:53 -05:00
DD
ec9d8094bd
fix review comments
2017-11-20 17:23:59 -05:00
DD
6d26023104
revert unnecessary changes'
...
:
2017-11-20 13:00:37 -05:00
griffpatch
6ed2ca6caa
Cache Block Inputs & Procedure Definitions
...
* Cache Block Inputs & Procedure Definitions
* @mzgoddard requested changes on this pull request
* Move all caching into a single reusable field _cache.
* Invalidate 'all' caches on any change.
* Use 'typeof' instead of hasOwnProperty.
* Take caching out of Block and use lookup instead.
2017-11-20 10:22:51 -05:00
Christopher Willis-Ford
b19af399fa
Make _removeThread safe during thread iteration
...
Before: `_removeThread` stops a thread and immediately removes it from
the runtime's thread array. If this happens while iterating over the
thread array, such as in the case of clone deletion, some elements of
the array can be missed.
After: `_removeThread` has been renamed to `_stopThread`. It still stops
the thread immediately but it no longer removes the thread from the
runtime's thread array. Instead, `_stopThread` marks the thread for
later removal. Such threads are removed at the top of the next `_step`.
2017-11-17 12:56:25 -08:00
DD Liu
2d9722e69c
Merge pull request #787 from fsih/deleteMonitorBlocks
...
Delete monitor block when variable is deleted
2017-11-16 17:20:26 -05:00
DD
255e160ebb
Change it so we dont have to do string manipulation on IDs to get data out of events
2017-11-16 17:19:51 -05:00
Paul Kaplan
bbb8904467
Merge pull request #789 from paulkaplan/custom-procedure-update
...
Update naming and implementation for custom procedure blocks
2017-11-16 17:07:03 -05:00
Paul Kaplan
34dfbb50ba
Update naming and implementation for custom procedure blocks
2017-11-16 14:17:08 -05:00
Michael "Z" Goddard
3d92553459
Return restarted threads in list from startHats
...
Add restarted threads to the list of newThreads returned by startHats.
2017-11-16 11:23:51 -05:00
Michael "Z" Goddard
9864403bc9
A thread in the runtime but with the DONE status is not active
...
return false from isActiveThread if thread's status is done even when
its contained in the runtime threads list. As it is done, the thread
will not be run until either its replaced by a new copy of the thread
or the thread is removed from the list and another is added at a later
time.
2017-11-16 11:23:51 -05:00
kchadha
9df3b8ad86
Merge pull request #780 from mzgoddard/runtime-profiler
...
Runtime profiler
2017-11-16 10:02:37 -05:00
DD
0958db2618
Move data to blocks files
2017-11-15 17:53:43 -05:00
Paul Kaplan
1e27d21b15
Merge pull request #782 from kchadha/list-typed-variable
...
List typed variable
2017-11-15 12:48:56 -05:00
DD
c8d5ba1d5e
Delete block does nothing if the block doesnt exist
2017-11-15 11:56:49 -05:00
DD
aa0064948a
Delete monitor block when variable is deleted
2017-11-15 11:37:27 -05:00
Karishma Chadha
fe86e38210
Addressing PR review comments.
2017-11-15 09:17:20 -05:00
DD
757dccd565
Move is sprite specific verification into VM in a temporary way. Remove monitors when their sprites are deleted.
2017-11-14 18:25:54 -05:00
Michael "Z" Goddard
f73dae828e
Add enableProfiling and disableProfiling to Runtime
2017-11-14 14:57:32 -05:00
Michael "Z" Goddard
516d4f6f30
Add Profiler events to Runtime, Sequencer and execute
2017-11-14 14:57:32 -05:00
Michael "Z" Goddard
a5b55a5128
Add runtime Profiler
...
Profile internal virtual machine performance down to which blocks take
how long.
2017-11-14 14:57:31 -05:00
DD
9048a9b9e7
Pipe through whether a monitor is sprite-specific
2017-11-14 12:20:24 -05:00
Karishma Chadha
386045f033
Some code cleanup.
2017-11-13 16:55:57 -05:00
Karishma Chadha
26d4a3a069
Refactoring representation of variable type.
2017-11-13 16:29:38 -05:00
Karishma Chadha
038a65b460
Finishing up lists.
2017-11-13 14:24:30 -05:00
Karishma Chadha
b18938963f
Fixing linting errors
2017-11-13 14:22:36 -05:00
Karishma Chadha
70959cc7f5
First cut at turning lists into typed variables
2017-11-09 17:19:34 -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
Ray Schamp
b07bbd4745
Merge pull request #765 from mzgoddard/execute-is-promise-deopt
...
Write src/engine/execute so it can be optimized
2017-11-07 12:19:58 -05:00
Ray Schamp
180e545b4e
Merge pull request #766 from mzgoddard/execute-handle-report-block-utility
...
Extract handleReport and BlockUtility from inside the execute function
2017-11-07 12:19:23 -05:00
Ray Schamp
5290570fc5
Merge pull request #758 from mzgoddard/done-threads-indexof
...
Constant time check if a thread is in doneThreads
2017-11-07 10:30:15 -05:00
Michael "Z" Goddard
bbe7981703
Extract blockUtility from execute to reduce allocations
...
blockUtility as an object literal inside execute creates 11 objects,
one for the object, and 10 for the function closures. As a separate
object and allocated once, setting its sequencer and thread members,
block functions can share the same util object. Extract blockUtility to
cut down on allocations.
2017-11-07 10:21:51 -05:00
Michael "Z" Goddard
78847de660
Extract handleReport and add arguments to prevent closure alloc
...
`handleReport` inside `src/engine/execute.js`'s `execute` method needs
to allocate a closure to be able to refer to the higher scoped
variables. `execute` is called frequently that this has a noticable
impact on memory allocation and later collection. Extract handleReport
and add arguments to prevent the allocation.
2017-11-07 10:21:51 -05:00
Andrew Sliwinski
1efc312c36
Merge pull request #767 from mzgoddard/docs-blocks-param-names
...
Replace duplicate documentation on getProcedureParamNames
2017-11-06 19:34:51 -05:00
Michael "Z" Goddard
888da915a5
Replace duplicate documentation on getProcedureParamNames
...
Replace the duplicate getProcedureDefintion documentation block above
getProcedureParamNames.
2017-11-06 17:28:34 -05:00
Michael "Z" Goddard
cd9004ce5b
Write src/engine/execute so it can be optimized
...
Testing with implicitly casted `value` and `value.then` is deoptimizing
isPromise, which deoptimizes execute. In this case deoptimizing means
that the JavaScript VM cannot compile the functions into a form that
can be run faster.
2017-11-06 15:54:22 -05:00
Eric Rosenbaum
0540640684
Merge pull request #754 from ericrosenbaum/feature/pen-block-icon
...
Extension block icons (including pen icon)
2017-11-06 10:02:23 -05:00
Michael "Z" Goddard
6d82c0f115
In place filter threads at end of stepThreads
...
Skip a large array allocation by filtering done threads in place with a
for loop.
2017-11-03 17:48:52 -04:00
Michael "Z" Goddard
4e24a3f380
Constant time check if thread is in doneThreads
...
Remove indexOf tests for thread existence in doneThreads. Maintain a
list of null and thread objects mirroring the index position of threads
that are done in runtime.threads. Filter out null values after
filtering out done threads from runtime.threads.
This has a small side effect that threads that normally became DONE and
were added to doneThreads before being removed or restarted will not be
in doneThreads in this version. Restarted threads (_restartThread) do
not appear in this version but new copies will be in Runtime
this.threads supporting glow and monitor updates. Removed threads
(_removeThread) do not appear in this version if they are removed after
they were seen as DONE by the prior version. Threads removed before
they are seen as DONE do not appear in doneThreads in the prior or this
version.
Threads that are removed before normally becoming DONE do not appear in
doneThreads in either case. Threads that are restarted before the loop
checks if the thread is done do not appear in doneThreads in either
case.
2017-11-03 17:46:50 -04:00
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
Paul Kaplan
18398d010b
Add hideFromPalette flag for hiding legacy blocks
2017-11-01 11:30:15 -04:00
Paul Kaplan
d126f799d8
Prevent imported local variables from being duplicated on the stage.
2017-10-25 11:17:29 -04:00
Chris Willis-Ford
c4e79c9732
Merge pull request #713 from cwillisf/fix-extension-hats
...
Fix extension hats
2017-10-13 16:03:51 -07:00
Chris Willis-Ford
a8ae7bc5b4
Merge pull request #700 from cwillisf/extension-menus
...
Extensions: implement drop-down menus
2017-10-13 09:49:42 -07:00
Chris Willis-Ford
7051ccfd69
Merge pull request #687 from cwillisf/builtin-extensions
...
Builtin extensions
2017-10-13 09:48:56 -07:00
Christopher Willis-Ford
96fa7315d5
Don't overwrite hat block's fields
...
Due to a typo (I believe) we were overwriting a horizontal hat block's
fields list when collecting hat block inputs. Now we collect inputs into
a temporary object in this case.
2017-10-13 01:46:35 -07:00
Christopher Willis-Ford
309f02542f
Throw if extension tries to build a dynamic menu
...
Dynamic menus are not yet supported for extension menus, though they are
part of the extension spec. This change provides more thorough feedback
if an extension tries to register an unsupported dynamic menu.
2017-10-11 11:41:03 -07:00
Paul Kaplan
f09c4d0bb9
Merge pull request #691 from paulkaplan/say-think
...
Add say/think functionality to looks blocks
2017-10-11 14:24:10 -04:00
Paul Kaplan
fa2db053a7
Fix copy paste error on targetWasRemoved
2017-10-11 14:19:15 -04:00
Paul Kaplan
e8c5bbbf80
Fix tests and make chain more resilient
2017-10-10 12:19:27 -04:00
Scimonster
7afb17df7f
Correctly deserialize HTML entities in block DOM
...
E.g. in variable names
2017-10-09 01:19:55 +03:00
Christopher Willis-Ford
2f9796c163
Fix escapeHtml
error caused by rebase
2017-10-06 23:44:27 -07:00
Christopher Willis-Ford
67c788ec8d
Extensions: fix Boolean inputs
2017-10-06 23:33:33 -07:00
Christopher Willis-Ford
c1681e54d5
Implement drop-down menus for extension blocks
...
Also, add `ANGLE` argument type (like `NUMBER` but adds an angle picker)
2017-10-06 23:33:33 -07:00
Paul Kaplan
b0870518a4
Changing parsing of custom procedures for new style
2017-10-06 16:26:19 -04:00
Paul Kaplan
14600d7893
Update looks implementation
2017-10-06 13:43:07 -04:00
Christopher Willis-Ford
7297341c51
Fixups from code review
...
- Remove WeDo 2 extension from the runtime's default block packages list
- The WeDo 2.0 extension now calls its own `connect` method on startup
I also renamed `EXTENSION_NAME` to `EXTENSION_ID` for consistency with
the rest of the extension system.
2017-10-06 09:55:19 -07:00
Christopher Willis-Ford
dd20e09774
Extensions: escape HTML entities in default values
...
This prevents generation of invalid XML due to characters like '<' or
'>' in fields' default values. Unfortunately the value comes back in its
escaped form, so there's still more work to be done.
2017-10-04 13:00:45 -07:00
Christopher Willis-Ford
6757fb6de9
Convert pen blocks into an "internal" extension
2017-10-04 12:54:30 -07:00
Paul Kaplan
e4830dfe51
Merge pull request #686 from paulkaplan/fix-extension-labels
...
Remove label generation for extensions
2017-10-04 15:37:06 -04:00
Paul Kaplan
0358d6c0c3
Remove label generation for extensions
2017-10-04 15:02:09 -04:00
Christopher Willis-Ford
99b868c0f0
Explain when it's OK to omit <field> element
...
Also, alphabetize the `ArgumentType` and `BlockType` enums.
2017-10-02 15:29:32 -07:00
Christopher Willis-Ford
06252e020b
Extensions: add support for color-picker arguments
2017-09-27 00:02:53 -04:00
Chris Willis-Ford
6087b5346c
Merge pull request #675 from cwillisf/feature/extensions
...
Feature/extensions
2017-09-14 13:34:18 -07:00
Paul Kaplan
0f04c99e67
Merge pull request #676 from paulkaplan/duplicate
...
Add sprite duplication method
2017-09-13 11:57:13 -04:00
Paul Kaplan
b68b874067
Add sprite duplication method
2017-09-07 11:51:21 -04:00
Christopher Willis-Ford
635c7966eb
Fix tests: don't require('scratch-blocks')
2017-09-06 01:24:24 -06:00
Christopher Willis-Ford
799d61ac98
Cleanup
2017-09-06 00:57:03 -06:00
Christopher Willis-Ford
d99c11ef91
Fix extension conditional blocks' appearance
...
The JSON generated for conditional blocks had slightly incorrect
structure for its `argsN` items and was missing some necessary
`messageN` items.
2017-09-06 00:57:03 -06:00
Christopher Willis-Ford
e7c727977a
Adjust for LLK/scratch-gui#655 & code review
...
- Move extension from this repository into LLK/scratch-gui
- Rename `EXTENSION_WAS_ADDED` event to `EXTENSION_ADDED`
2017-09-06 00:57:03 -06:00
Christopher Willis-Ford
d43749d675
WIP for demo
2017-09-06 00:57:03 -06:00