diff --git a/source/hiscore_table.cpp b/source/hiscore_table.cpp index b48480b..7eb3a94 100644 --- a/source/hiscore_table.cpp +++ b/source/hiscore_table.cpp @@ -108,14 +108,15 @@ void HiScoreTable::render() int numUsers = jscore::getNumUsers(); 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; std::string dots = ""; for (int j = 0; j < numDots; ++j) { 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); } @@ -123,7 +124,7 @@ void HiScoreTable::render() if (numUsers < 10) { std::vector 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) {