Finished basic question box

This commit is contained in:
2022-04-30 09:48:00 -07:00
parent 768c73bba5
commit bee024c3e1
7 changed files with 74 additions and 24 deletions

View File

@@ -57,7 +57,7 @@ void conversationTextboxSetText(char *text) {
// IF that number is less than the remaining chars on the current row,
// then treat this space like a newline.
if(k >= (rowStart + TEXTBOX_CHARS_PER_ROW - 1)) {
if(k >= (rowStart + TEXTBOX_CHARS_PER_ROW + 1)) {
stateFlags |= 1 << 0;
}
} else if(c == '\n') {
@@ -70,7 +70,7 @@ void conversationTextboxSetText(char *text) {
i++;
rowStart = i;// Update the row start (Should this be i+1?)
//TODO: can I optimize the next line by using rowStart somehow?
j = ((j / TEXTBOX_CHARS_PER_ROW) + 1) * TEXTBOX_CHARS_PER_ROW;// Update destination character position.
j = ((j / TEXTBOX_CHARS_PER_ROW)+1) * TEXTBOX_CHARS_PER_ROW;// Update destination character position.
TEXTBOX_ROW_COUNT++;
continue;
}
@@ -109,7 +109,7 @@ inline void conversationTextboxUpdate() {
// Have we finished scrolling?
if(TEXTBOX_STATE & TEXTBOX_STATE_SCROLLED) {
// Is the user trying to go to the next line?
if(INPUT_STATE & J_A) {
if(INPUT_PRESSED & J_A) {
// First, lets figure out if there's any more text to reveal or not.
if((TEXTBOX_ROW_COUNT - TEXTBOX_ROW_CURRENT) < TEXTBOX_TILES_ROWS) {
TEXTBOX_STATE &= ~TEXTBOX_STATE_VISIBLE;