Commit graph

226 commits

Author SHA1 Message Date
Andrew Sliwinski
f86cad3305 Replace extension delimeter with '_' 2018-04-20 07:54:02 -04:00
Michael "Z" Goddard
044370790c
Merge pull request #1016 from gnarf/io-video
Video IO Device Implementation
2018-04-11 10:14:56 -04:00
Corey Frang
eef88f6c2d
First draft of video IO device 2018-04-10 13:57:53 -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
Christopher Willis-Ford
f8db6c3f02 Support extension translation
The new `maybeFormatMessage` function detects whether its argument
looks like a message descriptor object and, if so, will call
`formatMessage` on it. This is now used for all user-visible text fields
in extensions.

Also, messages may use "select" to check the target type with a message
like this: '{targetType, select, stage {text for stage} sprite {text for
sprite} other {text for other}'. Note that the "other" clause is
required by `formatMessage`.
2018-04-05 12:17:05 -07:00
Christopher Willis-Ford
de9e2be265 Add EVENT extension block type
An EVENT block is like a HAT block but it has no implementation
function. Its stack runs when the VM emits the corresponding event.
2018-04-04 23:44:59 -07:00
Christopher Willis-Ford
af058b8146 Support LOOP and CONDITIONAL blocks in extensions
A LOOP block is like a conditional, but the LOOP block will be
re-evaluated after any child branch runs.

Also:
- Support using '---' as a block separator
- Refactor common code from `_registerExtensionPrimitives` and
  `_refreshExtensionPrimitives` into new `_fillExtensionCategory`
- Improve error reporting during block conversion
2018-04-04 22:19:48 -07:00
Chris Willis-Ford
219f083a29
Merge pull request #934 from picklesrus/extensions-dynamic-menu
Extensions dynamic menu
2018-03-06 16:33:26 -05:00
picklesrus
026b9dc282 Stop wrapping function for no reason. 2018-03-02 11:02:56 -08:00
DD
8355dd662f Switch to sending end drag event to be handled by gui 2018-02-23 11:57:19 -05:00
DD
fe4b3d3c01 Pass through block drag event 2018-02-20 16:09:08 -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
picklesrus
1910968b13 Fix lint errors. 2018-02-16 10:49:26 -08:00
Eric Rosenbaum
22038c947c When getting sprite by name, skip the stage 2018-02-12 15:33:27 -05:00
kchadha
107adad647
Revert "Push reported" 2018-02-02 12:42:09 -05:00
picklesrus
b6bb92d8f6 Adding support for dynamic menus in extensions. 2018-01-26 14:36:36 -08: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
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
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
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
sjhuang26
eede8105d1 Clear answer on green flag 2017-12-01 20:06:55 -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
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
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
DD
0958db2618 Move data to blocks files 2017-11-15 17:53:43 -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
DD
9048a9b9e7 Pipe through whether a monitor is sprite-specific 2017-11-14 12:20:24 -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
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
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
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