Add textimage for levelcomplete and gamecomplete

`levelcomplete` and `gamecomplete` were hardcoded using textbox colors
which were offset by 1. This PR fixes that, no longer requiring
slightly-off colors, and instead adding a new property to textboxes
which tell the game to display either level complete or game complete.
This commit is contained in:
AllyTally
2023-08-20 14:11:44 -03:00
committed by Misa Elizabeth Kai
parent b5c9508dd4
commit 103b4d36a1
7 changed files with 56 additions and 4 deletions

View File

@@ -944,7 +944,7 @@ void Graphics::drawgui(void)
continue;
}
if (textboxes[i].yp == 12 && textboxes[i].r == 165)
if (textboxes[i].image == TEXTIMAGE_LEVELCOMPLETE)
{
// Level complete
const char* english = "Level Complete!";
@@ -981,7 +981,7 @@ void Graphics::drawgui(void)
}
}
}
else if (textboxes[i].yp == 12 && textboxes[i].g == 165)
else if (textboxes[i].image == TEXTIMAGE_GAMECOMPLETE)
{
// Game complete
const char* english = "Game Complete!";
@@ -1430,6 +1430,17 @@ void Graphics::addsprite(int x, int y, int tile, int col)
textboxes[m].addsprite(x, y, tile, col);
}
void Graphics::setimage(TextboxImage image)
{
if (!INBOUNDS_VEC(m, textboxes))
{
vlog_error("setimage() out-of-bounds!");
return;
}
textboxes[m].setimage(image);
}
void Graphics::addline( const std::string& t )
{
if (!INBOUNDS_VEC(m, textboxes))