Compare commits
3 Commits
10e9abece9
...
9bb4696eb9
| Author | SHA1 | Date | |
|---|---|---|---|
| 9bb4696eb9 | |||
| b9b7aeb8f9 | |||
| 9f17ffdeb3 |
@@ -579,12 +579,12 @@ std::string boolToString(bool value)
|
||||
// Convierte una cadena a minusculas
|
||||
std::string toLower(std::string str)
|
||||
{
|
||||
char *original = str.c_str();
|
||||
const char *original = str.c_str();
|
||||
char *lower = (char *)malloc(str.size() + 1);
|
||||
for (int i = 0; i < str.size(); ++i)
|
||||
{
|
||||
char c = original[i];
|
||||
lower[i] = (c >= 65 || c <= 90) ? c + 32 : c;
|
||||
lower[i] = (c >= 65 && c <= 90) ? c + 32 : c;
|
||||
}
|
||||
lower[str.size()] = 0;
|
||||
std::string nova(lower);
|
||||
|
||||
@@ -401,7 +401,7 @@ void Director::initOptions()
|
||||
options->online.server = "jaildoctor.duckdns.org";
|
||||
options->online.port = 9911;
|
||||
#ifdef DEBUG
|
||||
options->online.gameID = "coffee_crisis_test";
|
||||
options->online.gameID = "coffee_crisis_test2";
|
||||
#else
|
||||
options->online.gameID = "coffee_crisis";
|
||||
#endif
|
||||
@@ -898,7 +898,7 @@ bool Director::setOptions(options_t *options, std::string var, std::string value
|
||||
|
||||
else if (var == "jailerID")
|
||||
{
|
||||
options->online.jailerID = value;
|
||||
options->online.jailerID = toLower(value);
|
||||
}
|
||||
|
||||
// Opciones de notificaciones
|
||||
|
||||
@@ -1739,7 +1739,7 @@ void Game::renderScoreBoard()
|
||||
{
|
||||
if (jscore::getNumUsers() > 0)
|
||||
{
|
||||
const std::string txt = jscore::getUserName(0) + " - " + updateScoreText((Uint32)jscore::getPoints(0));
|
||||
const std::string txt = jscore::getUserName(0).substr(0,12) + " - " + updateScoreText((Uint32)jscore::getPoints(0));
|
||||
textScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset4, txt);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -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<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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user