Somehow everything is working

This commit is contained in:
2025-06-22 17:14:15 -05:00
parent 0ed65d3703
commit 9ebe0630e3
6 changed files with 135 additions and 54 deletions

View File

@ -20,6 +20,8 @@ void drawUI() {
void drawUITextbox() {
if(!UI_TEXTBOX.visible) return;
uitextbox_t *textbox = &UI_TEXTBOX;
// Semi-transparent dark blue
Color background = (Color){ 0, 0, 128, 128 };
DrawRectangle(
@ -33,11 +35,14 @@ void drawUITextbox() {
if(UI_TEXTBOX.charsRevealed > 0) {
char_t buffer[UI_TEXTBOX_CHARS_PER_LINE + 1];// +1 for null term
uint8_t charsRendered = 0;
uitextbox_t *textbox = &UI_TEXTBOX;
// For each line
for(uint8_t i = 0; i < UI_TEXTBOX_LINES_PER_PAGE; i++) {
// Get count of chars in the line
uint8_t lineLength = UI_TEXTBOX.lineLengths[i];
uint8_t lineLength = UI_TEXTBOX.lineLengths[
i + (UI_TEXTBOX.page * UI_TEXTBOX_LINES_PER_PAGE)
];
if(lineLength == 0) continue;
// Determine how many chars left to render
@ -50,11 +55,10 @@ void drawUITextbox() {
// Update how many rendered
charsRendered += lineChars;
// Copy string from VN Textbox...
memoryCopy(
buffer,
UI_TEXTBOX.text + (UI_TEXTBOX.page * UI_TEXTBOX_PAGE_CHARS) +
UI_TEXTBOX.text + (UI_TEXTBOX.page * UI_TEXTBOX_CHARS_PER_PAGE) +
(i * UI_TEXTBOX_CHARS_PER_LINE),
lineChars
);