Rótulo do bloco declarado pela library (tb_type_block_set_label)

A library diz como o bloco aparece no editor ("liste as ferramentas de
%1", valores iniciais "a|b"); o editor usa a tabela dele quando conhece
o tipo e o rótulo da library quando não conhece. Assim uma library
carregada de fora não aparece só com o nome técnico.

Acessibilidade: aviso comum não repete "aviso" na descrição.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mguinhosandClaude Opus 5.5 committed 2026-10-23 07:50:39 -03:00
1 parent 8f046833e7
commit 2d580005b1
4 files changed
+33 -112

No files matched your search

+9
View File
@@ -47,6 +47,8 @@ static TinyBlocks_Block* type_clone(const TinyBlocks_Block* self, TinyBlocks* rt
t->flow = src->flow;
t->event = src->event;
t->lazy_inputs = src->lazy_inputs;
t->label = src->label;
t->label_defaults = src->label_defaults;
for (uint32_t i = 0; i < src->input_desc_count; i++)
tb_type_block_set_input_flags(t, i, tb_type_block_input_flags(src, i));
for (uint32_t i = 0; i < src->output_desc_count; i++)
@@ -65,6 +67,13 @@ void tb_type_block_set_event(TinyBlocks_TypeBlock* tb, const char* event)
if (event) tb->shape = TB_SHAPE_HAT;
}
void tb_type_block_set_label(TinyBlocks_TypeBlock* tb, const char* label, const char* defaults)
{
if (!tb) return;
tb->label = label;
tb->label_defaults = defaults;
}
void tb_type_block_set_input_flags(TinyBlocks_TypeBlock* tb, uint32_t i, uint32_t flags)
{ if (tb && tb->input_flags && i < tb->input_desc_count) tb->input_flags[i] = flags; }
void tb_type_block_set_output_flags(TinyBlocks_TypeBlock* tb, uint32_t i, uint32_t flags)