Redid the entire textbox code to be really nice now.

This commit is contained in:
2022-04-21 09:39:20 -07:00
parent 45228018f2
commit 6cd31448ce
10 changed files with 121 additions and 76 deletions

View File

@@ -21,6 +21,7 @@ inline void conversationTextboxInit() {
TEXTBOX_STATE = 0;
// Setup window data
wait_vbl_done();
move_win(7, SCREENHEIGHT - (TEXTBOX_HEIGHT_IN_TILES * 8));
set_win_data(FONT_DATA_POSITION, FONT_IMAGE_TILES, FONT_IMAGE);
set_win_data(BORDER_DATA_POSITION, BORDER_IMAGE_TILES, BORDER_IMAGE);
@@ -122,7 +123,8 @@ inline void textboxFillBlank() {
TEXTBOX_TILES[i + (j * TEXTBOX_CHARS_PER_ROW)] = TEXTBOX_TILE_BLANK;
}
}
wait_vbl_done();
set_win_tiles(
0x01, 0x01,
TEXTBOX_WIDTH_IN_TILES - 0x02, TEXTBOX_HEIGHT_IN_TILES - 0x02,
@@ -145,7 +147,9 @@ inline void conversationTextboxUpdate() {
// 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;
wait_vbl_done();
HIDE_WIN;
conversationQueueNext();
return;
}
@@ -165,6 +169,9 @@ inline void conversationTextboxUpdate() {
TEXTBOX_STATE |= TEXTBOX_STATE_SCROLLED;
} else {
tiles[0] = c - 33 + FONT_DATA_POSITION;
// tiles[0] = c + FONT_DATA_POSITION;
wait_vbl_done();
set_win_tiles(
0x01 + (TEXTBOX_SCROLL % TEXTBOX_CHARS_PER_ROW),
0x01 + (TEXTBOX_SCROLL / TEXTBOX_CHARS_PER_ROW),
@@ -173,5 +180,4 @@ inline void conversationTextboxUpdate() {
);
TEXTBOX_SCROLL++;
}
}