Initial implementation of textbox sprites

This commit adds a system for displaying sprites in textboxes, meant to
replace the hardcoded system in the main game. This does not support
levelcomplete.png and gamecomplete.png yet, which will most likely just
be special cases.
This commit is contained in:
AllyTally
2023-08-05 19:34:15 -03:00
committed by Misa Elizabeth Kai
parent 187fd85e14
commit 76ea4488af
6 changed files with 67 additions and 1 deletions

View File

@@ -1049,6 +1049,17 @@ void Graphics::drawgui(void)
//blue guy
draw_sprite(crew_xp, crew_yp, crew_sprite, 75, 75, 255 - help.glow / 4 - textboxes[i].rand);
}
for (int index = 0; index < (int) textboxes[i].sprites.size(); index++)
{
TextboxSprite* sprite = &textboxes[i].sprites[index];
draw_sprite(
sprite->x + textboxes[i].xp,
sprite->y + textboxes[i].yp,
sprite->tile,
getcol(sprite->col)
);
}
}
}
@@ -1428,6 +1439,17 @@ void Graphics::textboxtimer(int t)
textboxes[m].timer = t;
}
void Graphics::addsprite(int x, int y, int tile, int col)
{
if (!INBOUNDS_VEC(m, textboxes))
{
vlog_error("addsprite() out-of-bounds!");
return;
}
textboxes[m].addsprite(x, y, tile, col);
}
void Graphics::addline( const std::string& t )
{
if (!INBOUNDS_VEC(m, textboxes))