From b9b7aeb8f99b7553ca89f1a382cd5547c470ea34 Mon Sep 17 00:00:00 2001 From: Sergio Valor Martinez Date: Mon, 13 Feb 2023 12:26:39 +0100 Subject: [PATCH] =?UTF-8?q?A=C3=B1adido=20limite=20de=20caracteres=20para?= =?UTF-8?q?=20el=20jailerID=20en=20la=20tabla=20de=20mejores=20puntuacione?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/hiscore_table.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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) {