Notação do fórum do Scratch (scratchblocks): exportar e importar scripts
- Nova library tinyblocks-scratchblocks: converte uma aba (TbBpTab da
blueprint) para o texto do fórum e de volta. Blocos com equivalente no
Scratch saem em inglês ("when flag clicked", "repeat (10)", "set [x v]
to (0)", "if <> then ... else ... end", listas, operadores, sensores);
os do TinyBlocks usam o rótulo em português com "::categoria". A
importação aceita as duas formas, comentários "//", "::categoria",
escapes e as tags [scratchblocks]. Forma, tipo dos campos e categoria
vêm por callbacks (a library não conhece o editor).
- Editor: "Exportar scratchblocks" no menu Exportar (aba atual -> .txt);
"Abrir" aceita .txt/.sb e cria uma aba com os scripts.
- test-scratchblocks + cenário de ida e volta no harness.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
649ae14fb3
commit
d842890b0b
11 files changed
+1255
-38
No files matched your search
@@ -593,11 +593,12 @@ typedef struct { FlyKind kind; int cat; int bi; float y, h; } FlyItem;
|
||||
typedef enum { ES_IDLE, ES_PRESS, ES_DRAG, ES_PAN } EdSt;
|
||||
typedef enum { SN_NONE, SN_NEXT, SN_SUB, SN_ABOVE, SN_ARG } SnapKind;
|
||||
enum { CM_DUPLICATE, CM_DELETE, CM_EDIT_DEF, CM_CLEANUP, CM_NEW_COMPOSITE,
|
||||
CM_EXP_JSON, CM_EXP_XML, CM_EXP_CSV };
|
||||
CM_EXP_JSON, CM_EXP_XML, CM_EXP_CSV, CM_EXP_SB };
|
||||
|
||||
/* Modos da barra de caminho do menu (path_input) */
|
||||
enum { PM_NONE, PM_LIB, PM_LOAD, PM_SAVE, PM_EXP_JSON, PM_EXP_XML, PM_EXP_CSV,
|
||||
PM_IMGLOAD, PM_IMSAVE, PM_IMADDR, PM_IMADDV, PM_CODELOAD, PM_CODESAVE };
|
||||
PM_IMGLOAD, PM_IMSAVE, PM_IMADDR, PM_IMADDV, PM_CODELOAD, PM_CODESAVE,
|
||||
PM_EXP_SB };
|
||||
|
||||
/* Explorador de arquivos (library privada tinyblocks-editor-files).
|
||||
O estado vive aqui para sobreviver ao hot reload do modulo. */
|
||||
|
||||
Reference in new issue
Block a user