Commit Graph
462 Commits
Author SHA1 Message Date
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
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
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
Vincent Briglia 0c8662bc23 Allow override of icons per block 2018-05-17 15:27:24 +02:00
Vincent Briglia 76ce7d6fe6 add option to override colours 2018-05-17 15:25:20 +02:00
Karishma Chadha 67b114b9c9 Layer group ordering. 2018-05-15 22:22:44 -04:00
Eric Rosenbaum bdda3bc2c9 Add extension id to toolbox category XML 2018-05-10 15:41:44 -04:00
DD Liu 5c003641f9 Merge pull request #1126 from fsih/fixQuirksOnLoadCostume
Run quirks mode fixes on costumes loaded from sb2s
2018-05-10 13:42:48 -04:00
DD 589dd7d5e0 Attach the svg renderer instead of providing it in order to fix VM tests 2018-05-10 12:03:38 -04:00
Paul Kaplan f3404f4275 Merge pull request #1128 from paulkaplan/sb2-monitors
Import monitors from sb2 files.
2018-05-09 13:52:29 -04:00
Paul Kaplan 6793349898 Do not stringify reported monitor values.
Consulted @fsih, should be fine since formatting is being handled in the GUI anyway.
2018-05-09 11:39:14 -04:00
Paul Kaplan cc1314d289 Clear out monitor state on vm.clear
Fixes https://github.com/LLK/scratch-gui/issues/1848
2018-05-09 11:34:01 -04:00
Paul Kaplan 13dfef553e Fix default value for monitor record 2018-05-08 17:30:39 -04:00
Paul Kaplan 4713f47fb7 Import monitors from sb2 files.
Paired with @kchadha on all of this.
2018-05-08 17:06:19 -04:00
Ray Schamp 22852aeab4 Merge pull request #1119 from mzgoddard/recycle-args
Recycle block args
2018-05-08 12:00:29 -04:00
Michael "Z" Goddard 8107349bec Comment BlockCached 2018-05-07 15:32:31 -04:00
Michael "Z" Goddard 2db2287d12 BlockCached instances are always initialized 2018-05-07 15:32:30 -04:00
Michael "Z" Goddard 5fd749918f Reuse argValues
Block args set by fields are static and never change. Inputs that do
change are always set onto args. With these two assumptions we can
reuse the same objects for each execution of the same block instead of
constantly creating them and letting them be garbage collected.
2018-05-07 15:32:30 -04:00
Michael "Z" Goddard 9b82530f51 Use a constructor to create the execute cache objects 2018-05-07 15:32:30 -04:00
Michael "Z" Goddard 0634e962a8 Add Thread.StackFrame class
Use a private StackFrame class to help internally manage use of Stack
Frame values and memory. Create params, reported, and executionContext
on demand.
2018-05-07 11:20:26 -04: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
Michael "Z" Goddard 1c68b543df Comment execute's BlocksExecuteCache usage
Explain how BlocksExecuteCache helps speed up execute by storing values from
Blocks and one-time derived values on an object that is released when Blocks is
edited in the editor. The one time created cache object for a block then
simplifies the complexity of later javascript operations to use these stored
values.
2018-04-24 19:05:44 -04:00
Michael "Z" Goddard 02dd9a8c22 Unset justReported after reading its value
Avoid justReported values leaking to other argValues by setting back to the
default null value.
2018-04-24 19:05:20 -04:00
Andrew Sliwinski f86cad3305 Replace extension delimeter with '_' 2018-04-20 07:54:02 -04:00
Michael "Z" Goddard d04d6b2c6a Revert "Revert "Push reported""
This reverts commit 107adad647.
2018-04-16 13:21:53 -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
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
Christopher Willis-Ford 4210c6dd4c Fix stack check in stepThread
The previous logic seemed to be expecting `peekStack` to return 0 when
the stack was empty, but its return type is `?string` and it returns
`undefined` when the stack is empty. The `!== 0` check would never pass,
then, leading to problems with (for example) the "say/think and wait"
blocks.
2018-03-14 16:17:29 -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
Ray Schamp 4e933eed81 Merge pull request #878 from davidaylaian/reduce-peekstack-calls
Optimize stepThread by reducing the number of calls to peekStack
2018-02-28 16:50:20 -05:00
DD 0a5ccbf42f Use existing UID util 2018-02-23 12:07:07 -05:00
DD 8355dd662f Switch to sending end drag event to be handled by gui 2018-02-23 11:57:19 -05:00
DD 2545d1955d Repopulate blocks with ids 2018-02-20 16:09:08 -05:00
DD 31def7d03d Track hovered sprite. End drag may transfer blocks from one sprite to another. 2018-02-20 16:09:08 -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