Posibilidad de activar o desactivar el modo online

This commit is contained in:
2022-11-15 22:34:26 +01:00
parent 3ac9c1afce
commit a0042b91cc
5 changed files with 59 additions and 21 deletions

View File

@@ -730,6 +730,11 @@ bool Game::saveScoreFile()
// Sube la puntuación online
bool Game::sendOnlineScore()
{
if (!options->online.enabled)
{
return true;
}
const int score = players.at(0)->getScore();
if (score <= options->online.score)
{
@@ -1683,9 +1688,15 @@ void Game::renderScoreBoard()
// HI-SCORE
textScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset3, lang->getText(56));
// textScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset4, updateScoreText(hiScore));
const std::string txt = jscore::getUserName(0) + " - " + updateScoreText((Uint32)jscore::getPoints(0));
textScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset4, txt);
if (options->online.enabled)
{
const std::string txt = jscore::getUserName(0) + " - " + updateScoreText((Uint32)jscore::getPoints(0));
textScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset4, txt);
}
else
{
textScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset4, updateScoreText(hiScore));
}
}
// Actualiza las variables del jugador