En proceso de eliminar el online y los menus

This commit is contained in:
2024-05-10 14:04:50 +02:00
parent 5587b25e41
commit b5c04c6c26
11 changed files with 11 additions and 1236 deletions

View File

@@ -1,5 +1,4 @@
#include "game.h"
#include "common/jscore.h"
// Constructor
Game::Game(int numPlayers, int currentStage, SDL_Renderer *renderer, Screen *screen, Asset *asset, Lang *lang, Input *input, bool demo, options_t *options, section_t *section)
@@ -62,7 +61,6 @@ Game::Game(int numPlayers, int currentStage, SDL_Renderer *renderer, Screen *scr
Game::~Game()
{
saveScoreFile();
sendOnlineScore();
saveDemoFile();
// Restaura el metodo de control
@@ -766,38 +764,6 @@ bool Game::saveScoreFile()
return success;
}
// Sube la puntuación online
bool Game::sendOnlineScore()
{
if (!options->online.enabled)
{
return true;
}
if (demo.enabled)
{
return true;
}
const int score = players[0]->getScore();
if (score <= options->online.score)
{
return true;
}
if (jscore::updateUserPoints(options->online.gameID, options->online.jailerID, score))
{
options->online.score = score;
screen->showNotification(lang->getText(86) + std::to_string(score), "", 2);
return true;
}
else
{
screen->showNotification(lang->getText(86), lang->getText(87));
return false;
}
}
// Guarda el fichero de datos para la demo
bool Game::saveDemoFile()
{
@@ -3681,9 +3647,6 @@ void Game::runGameOverScreen()
// Guarda los puntos
saveScoreFile();
// Sube la puntuación online
sendOnlineScore();
// Reinicia el menu
gameOverMenu->reset();
@@ -3964,22 +3927,5 @@ void Game::setHiScore()
// Carga el fichero de puntos
loadScoreFile();
// Establece el resto de variables
if (options->online.enabled)
{
if (jscore::getNumUsers() > 0)
{
hiScoreName = jscore::getUserName(0).substr(0, 12) + " - ";
hiScore = (Uint32)jscore::getPoints(0);
}
else
{
hiScoreName = "Bacteriol - ";
hiScore = 10;
}
}
else
{
hiScoreName = "";
}
hiScoreName = "";
}