Add a "previous page" option to the levels list

This makes it more convenient if you have a large levels directory, as
some people in the VVVVVV custom levels community do.

On the first page, this option will change to be "last page" instead.

Since the addition of another menu option pushes up the list of levels
too close to the selected level data itself, I've had to move the list
of levels down by 4 pixels (but "next page"/"previous page"/"return to
menu" are still in their same position).

This feature was already added to VCE but hasn't been upstreamed until
now.
This commit is contained in:
Misa
2020-04-16 23:05:49 -07:00
committed by Ethan Lee
parent e909515f3d
commit 85b16b969a
4 changed files with 28 additions and 9 deletions

View File

@@ -1129,7 +1129,7 @@ void Graphics::drawlevelmenu( int cr, int cg, int cb, int division /*= 30*/ )
{
if ((int) i == game.currentmenuoption)
{
if(game.menuoptions.size()-i<=2){
if(game.menuoptions.size()-i<=3){
//Draw it highlighted
if (game.menuoptions[i].active)
{
@@ -1152,20 +1152,20 @@ void Graphics::drawlevelmenu( int cr, int cg, int cb, int division /*= 30*/ )
std::string tempstring = game.menuoptions[i].text;
std::transform(tempstring.begin(), tempstring.end(),tempstring.begin(), ::toupper);
tempstring = std::string("[ ") + tempstring + std::string(" ]");
Print(110 + (i * division) - 16 +game.menuxoff, 140 + (i * 12) +game.menuyoff, tempstring, cr, cg, cb);
Print(110 + (i * division) - 16 +game.menuxoff, 144 + (i * 12) +game.menuyoff, tempstring, cr, cg, cb);
}
else
{
std::string tempstring = game.menuoptions[i].text;
tempstring = "[ " + tempstring + " ]";
//Draw it in gray
Print(110 + (i * division) - 16 +game.menuxoff, 140 + (i * 12)+game.menuyoff, tempstring, 128, 128, 128);
Print(110 + (i * division) - 16 +game.menuxoff, 144 + (i * 12)+game.menuyoff, tempstring, 128, 128, 128);
}
}
}
else
{
if(game.menuoptions.size()-i<=2){
if(game.menuoptions.size()-i<=3){
//Draw it normally
if (game.menuoptions[i].active)
{
@@ -1180,12 +1180,12 @@ void Graphics::drawlevelmenu( int cr, int cg, int cb, int division /*= 30*/ )
//Draw it normally
if (game.menuoptions[i].active)
{
Print(110 + (i * division) +game.menuxoff, 140 + (i * 12)+game.menuyoff, game.menuoptions[i].text, cr, cg, cb);
Print(110 + (i * division) +game.menuxoff, 144 + (i * 12)+game.menuyoff, game.menuoptions[i].text, cr, cg, cb);
}
else
{
//Draw it in gray
Print(110 + (i * division) +game.menuxoff, 140 + (i * 12)+game.menuyoff, game.menuoptions[i].text, 128, 128, 128);
Print(110 + (i * division) +game.menuxoff, 144 + (i * 12)+game.menuyoff, game.menuoptions[i].text, 128, 128, 128);
}
}
}