Move tempstring off of Graphics, Game, and UtilityClass

Unlike, say, the scriptclass i/j/k stuff, these tempstrings are only
purely visual, and there's no known glitches to manipulate them anyway.
Thus I think it's safe to make this cleanup.
This commit is contained in:
Misa
2020-04-02 15:05:41 -07:00
committed by Ethan Lee
parent ff449a2c3a
commit f7ff076074
7 changed files with 51 additions and 50 deletions

View File

@@ -1144,14 +1144,14 @@ void Graphics::drawmenu( int cr, int cg, int cb, int division /*= 30*/ )
//Draw it highlighted
if (game.menuoptionsactive[i])
{
tempstring = game.menuoptions[i];
std::string tempstring = game.menuoptions[i];
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);
}
else
{
tempstring = game.menuoptions[i];
std::string tempstring = game.menuoptions[i];
tempstring = "[ " + tempstring + " ]";
//Draw it in gray
Print(110 + (i * division) - 16 +game.menuxoff, 140 + (i * 12)+game.menuyoff, tempstring, 128, 128, 128);
@@ -1183,14 +1183,14 @@ void Graphics::drawlevelmenu( int cr, int cg, int cb, int division /*= 30*/ )
//Draw it highlighted
if (game.menuoptionsactive[i])
{
tempstring = game.menuoptions[i];
std::string tempstring = game.menuoptions[i];
std::transform(tempstring.begin(), tempstring.end(),tempstring.begin(), ::toupper);
tempstring = std::string("[ ") + tempstring + std::string(" ]");
Print(110 + (i * division) - 16 +game.menuxoff, 140+8 + (i * 12) +game.menuyoff, tempstring, cr, cg, cb);
}
else
{
tempstring = game.menuoptions[i];
std::string tempstring = game.menuoptions[i];
tempstring = "[ " + tempstring + " ]";
//Draw it in gray
Print(110 + (i * division) - 16 +game.menuxoff, 140+8 + (i * 12)+game.menuyoff, tempstring, 128, 128, 128);
@@ -1199,14 +1199,14 @@ void Graphics::drawlevelmenu( int cr, int cg, int cb, int division /*= 30*/ )
//Draw it highlighted
if (game.menuoptionsactive[i])
{
tempstring = game.menuoptions[i];
std::string tempstring = game.menuoptions[i];
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);
}
else
{
tempstring = game.menuoptions[i];
std::string tempstring = game.menuoptions[i];
tempstring = "[ " + tempstring + " ]";
//Draw it in gray
Print(110 + (i * division) - 16 +game.menuxoff, 140 + (i * 12)+game.menuyoff, tempstring, 128, 128, 128);