editing normal nodetText

This commit is contained in:
2026-02-06 11:10:18 +01:00
parent b9eabc2d61
commit 51d81c6780
5 changed files with 249 additions and 12 deletions
+17
View File
@@ -71,6 +71,7 @@ void addNewTextNode
text_nodes[i].is_scrolling = is_scrolling;
text_nodes[i].is_repeating = is_repeating;
text_nodes[i].disappear_time = disappear_time;
text_nodes[i].id = ever_created_text_nodes;
ever_created_text_nodes++;
if (handle_pos_via_cursor)
@@ -82,6 +83,21 @@ void addNewTextNode
}
}
void modifyTextNodeById(unsigned char id, uint32_t new_color, char new_text[TEXT_MAX_LENGTH + 1], unsigned char new_slowness)
{
for (unsigned char i = 0; i < MAX_TEXT_NODES_COUNT; i++)
{
if (text_nodes[i].id == id && text_nodes[i].disappear_time != 0)
{
text_nodes[i].color = new_color;
strncpy(text_nodes[i].content, new_text, TEXT_MAX_LENGTH);
text_nodes[i].character_count = strlen(new_text);
text_nodes[i].scroll_slowness = new_slowness;
break;
}
}
}
void scrollAllScrollableTexts(bool split_scroll_mode = false)
{
for (unsigned char i = 0; i < MAX_TEXT_NODES_COUNT; i++)
@@ -187,6 +203,7 @@ void addNewMultiColor
multi_color_text_node[i].is_scrolling = is_scrolling;
multi_color_text_node[i].is_repeating = is_repeating;
multi_color_text_node[i].disappear_time = disappear_time;
multi_color_text_node[i].id = ever_created_multi_color_text_nodes;
ever_created_multi_color_text_nodes++;
if (handle_pos_via_cursor)