Añadido limite de caracteres para el jailerID en la tabla de mejores puntuaciones
This commit is contained in:
@@ -108,14 +108,15 @@ void HiScoreTable::render()
|
|||||||
int numUsers = jscore::getNumUsers();
|
int numUsers = jscore::getNumUsers();
|
||||||
for (int i = 0; i < numUsers; ++i)
|
for (int i = 0; i < numUsers; ++i)
|
||||||
{
|
{
|
||||||
const int nameLenght = jscore::getUserName(i).length();
|
const std::string userName = jscore::getUserName(i).substr(0, 17);
|
||||||
|
const int nameLenght = (int)userName.length();
|
||||||
const int numDots = 20 - nameLenght;
|
const int numDots = 20 - nameLenght;
|
||||||
std::string dots = "";
|
std::string dots = "";
|
||||||
for (int j = 0; j < numDots; ++j)
|
for (int j = 0; j < numDots; ++j)
|
||||||
{
|
{
|
||||||
dots = dots + ".";
|
dots = dots + ".";
|
||||||
}
|
}
|
||||||
const std::string line = jscore::getUserName(i) + dots + scoreToString(jscore::getPoints(i));
|
const std::string line = userName + dots + scoreToString(jscore::getPoints(i));
|
||||||
text->writeDX(TXT_CENTER | TXT_SHADOW, GAMECANVAS_CENTER_X, (i * spaceBetweenLines) + spaceBetweenHeader, line, 1, orangeColor, 1, shdwTxtColor);
|
text->writeDX(TXT_CENTER | TXT_SHADOW, GAMECANVAS_CENTER_X, (i * spaceBetweenLines) + spaceBetweenHeader, line, 1, orangeColor, 1, shdwTxtColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,7 +124,7 @@ void HiScoreTable::render()
|
|||||||
if (numUsers < 10)
|
if (numUsers < 10)
|
||||||
{
|
{
|
||||||
std::vector<std::string> names;
|
std::vector<std::string> names;
|
||||||
names.insert(names.end(), {"Bry", "Usufondo", "G.Lucas", "P.Delgat", "P.Aarrabalera", "Pelechano", "Sahuquillo", "Bacteriol", "Pepe", "Rosita"});
|
names.insert(names.end(), {"Bry", "Usufondo", "G.Lucas", "P.Delgat", "P.Arrabalera", "Pelechano", "Sahuquillo", "Bacteriol", "Pepe", "Rosita"});
|
||||||
|
|
||||||
for (int i = numUsers; i < 10; ++i)
|
for (int i = numUsers; i < 10; ++i)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user