From fbf3e391578d5ce5d86b4ca8f9847171c9ddfa73 Mon Sep 17 00:00:00 2001 From: gitProtogen Date: Fri, 30 Jan 2026 12:07:49 +0100 Subject: [PATCH] wtf just broke --- functions.h | 8 ++++++++ ledy.ino | 30 ++++++++++++++++++++++++++---- lowLevel.ino | 1 - 3 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 functions.h diff --git a/functions.h b/functions.h new file mode 100644 index 0000000..57d8a3a --- /dev/null +++ b/functions.h @@ -0,0 +1,8 @@ +#ifndef FUNCTIONS_H +#define FUNCTIONS_H + +#include "ledy.ino" +#include "lowLevel.ino" +#include "server.ino" + +#endif // FUNCTIONS_H \ No newline at end of file diff --git a/ledy.ino b/ledy.ino index a0368f6..e22a690 100644 --- a/ledy.ino +++ b/ledy.ino @@ -30,7 +30,7 @@ short getTextNodeX2(TextNode *node) void addNewTextNode ( - char text[TEXT_MAX_LENGTH + 1], uint32_t color = 0x00010101, short pos_x = 0, short pos_y = 0, + char text[TEXT_MAX_LENGTH + 1], uint32_t color = 0x00010101, bool handle_pos_via_cursor = true, short pos_x = 0, short pos_y = 0, unsigned char scroll_slowness = 0, bool is_scrolling = true, bool is_small = true ) { @@ -43,8 +43,16 @@ void addNewTextNode strncpy(text_nodes[i].content, text, TEXT_MAX_LENGTH); text_nodes[i].color = color; - text_nodes[i].pos_x = pos_x; - text_nodes[i].pos_y = pos_y; + if (handle_pos_via_cursor) + { + text_nodes[i].pos_x = cursor.x; + text_nodes[i].pos_y = cursor.y; + } + else + { + text_nodes[i].pos_x = pos_x; + text_nodes[i].pos_y = pos_y; + } text_nodes[i].characterSize.height = is_small ? SMALL_TEXT_HEIGHT : MEDIUM_TEXT_HEIGHT; text_nodes[i].characterSize.width = is_small ? SMALL_TEXT_WIDTH : MEDIUM_TEXT_WIDTH; @@ -53,6 +61,11 @@ void addNewTextNode text_nodes[i].is_scrolling = is_scrolling; text_nodes[i].is_deleted = false; ever_created_text_nodes++; + + if (handle_pos_via_cursor) + { + cursor.x += (text_nodes[i].characterSize.width + 1) * text_length; + } break; } } @@ -133,7 +146,16 @@ void loop() handle_server(); if (text_nodes[0].is_deleted) { - addNewTextNode(" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~", 0xFF121212, 49, 0, 1); + cursor.x = PANEL_MAX_X + 1; + addNewTextNode("color", 0xFF121212, true); + } + else if (text_nodes[1].is_deleted) + { + addNewTextNode("ful ", 0xFF000036, true); + } + else if (text_nodes[2].is_deleted) + { + {addNewTextNode("test", 0xFF121212, true); } scrollAllScrollableTexts(); pixels.show(); diff --git a/lowLevel.ino b/lowLevel.ino index 1352b03..9614855 100644 --- a/lowLevel.ino +++ b/lowLevel.ino @@ -1,7 +1,6 @@ #include "lowLevel.h" unsigned char saved_images_count = 0; -Cursor cursor1; uint32_t saved_imaged[2][16][16] = {