Hard-codes(!) a special-case fix for the pen_menu_colorParam shadow block; we reviewed all shadow blocks that Leopard supports and would have included like fixes for any similar cases, but this is the only one.
pen_menu_colorParam is different from normal SB3 shadow blocks because its field is named colorParam and does not match the name, COLOR_PARAM, of the input into which it is placed. All other names do match and we can just apply the shadow block's field as an sb-edit input with the same name, but this one needs to be manually transferred from sb3 field colorParam to sb-edit input COLOR_PARAM.
This fixes loading blocks which use this input (there are two in the Pen extension) and makes it so output formats see the COLOR_PARAM input that they're expecting. Our testing:
Not directly related, but Leopard's component-based pen color does work with these blocks correctly!
Updated snapshot test (which loads with fromSb3 and writes with toLeopard,toSb3, and toScratchblocks)
Internal project.json is now pretty-printed w/ JSON.stringify for more convenient git review. The SB3 is very old and saving it from the Scratch editor without making any changes will still produce a flat-out different file (in subtle ways), so the diff was manually reviewed to only commit the code changes. This should make for a clean diff in the snapshot file.
Have requested a review from @adroitwhiz since this is probably at least of note to you, but all cool if you aren't around to look at this closely at the moment!
Development:
Hard-codes(!) a special-case fix for the
pen_menu_colorParam
shadow block; we reviewed all shadow blocks that Leopard supports and would have included like fixes for any similar cases, but this is the only one.pen_menu_colorParam
is different from normal SB3 shadow blocks because its field is namedcolorParam
and does not match the name,COLOR_PARAM
, of the input into which it is placed. All other names do match and we can just apply the shadow block's field as an sb-edit input with the same name, but this one needs to be manually transferred from sb3 fieldcolorParam
to sb-edit inputCOLOR_PARAM
.This fixes loading blocks which use this input (there are two in the Pen extension) and makes it so output formats see the
COLOR_PARAM
input that they're expecting. Our testing:toLeopard
andtoSb3
are working, and don't require any changes.fromSb3
and writes withtoLeopard
,toSb3
, andtoScratchblocks
)project.json
is now pretty-printed w/JSON.stringify
for more convenient git review. The SB3 is very old and saving it from the Scratch editor without making any changes will still produce a flat-out different file (in subtle ways), so the diff was manually reviewed to only commit the code changes. This should make for a clean diff in the snapshot file.