Traducidas las notificaciones a los tres idiomas

This commit is contained in:
2023-02-12 22:40:01 +01:00
parent ec9572175f
commit 3fa7324569
6 changed files with 95 additions and 75 deletions

View File

@@ -126,11 +126,11 @@ namespace jscore {
return score.size();
}
string getUserName(const int index) {
if (score.size()==0 || index >= score.size()) return "";
if (score.size()==0 || index >= (int)score.size()) return "";
return score[index].name;
}
const int getPoints(const int index) {
if (score.size()==0 || index >= score.size()) return 0;
if (score.size()==0 || index >= (int)score.size()) return 0;
return score[index].points;
}

View File

@@ -738,11 +738,11 @@ void Director::initOnline()
// Establece el servidor y el puerto
jscore::init(options->online.server, options->online.port);
#ifdef DEBUG
const std::string caption = options->online.jailerID + " IS LOGGED IN (DEBUG)";
const std::string caption = lang->getText(85) + " (DEBUG)";
#else
const std::string caption = options->online.jailerID + " IS LOGGED IN";
const std::string caption = lang->getText(85);
#endif
screen->showNotification(caption);
screen->showNotification(options->online.jailerID, caption, 12);
if (options->console)
{
std::cout << caption << std::endl;
@@ -751,10 +751,10 @@ void Director::initOnline()
// Obtiene la información de puntuaciones online
if (!jscore::initOnlineScore(options->online.gameID))
{
screen->showNotification("Fallo al conectar a " + options->online.server);
screen->showNotification(lang->getText(80), options->online.server);
if (options->console)
{
std::cout << "Fallo al conectar a " << options->online.server << std::endl;
std::cout << "Can't connect to " << options->online.server << std::endl;
}
options->online.enabled = false;
@@ -766,10 +766,10 @@ void Director::initOnline()
const int points = jscore::getUserPoints(options->online.gameID, options->online.jailerID);
if (points == 0)
{ // Fallo de conexión o no hay registros
screen->showNotification("No se ha podido obtener la puntuacion online");
screen->showNotification(lang->getText(81), lang->getText(82));
if (options->console)
{
std::cout << "No se ha podido obtener la puntuacion online" << std::endl;
std::cout << "Can't get online scores" << std::endl;
}
}
else
@@ -777,67 +777,6 @@ void Director::initOnline()
options->online.score = points;
}
}
/* OLD
if (!options->online.enabled)
{
return;
}
// Obten el Jailer ID
if (options->online.jailerID == "")
{ // Jailer ID no definido
screen->showNotification("No ha especificado ningun Jailer ID");
if (options->console)
{
std::cout << "No ha especificado ningun Jailer ID" << std::endl;
}
}
else
{ // Jailer ID iniciado
// Establece el servidor y el puerto
jscore::init(options->online.server, options->online.port);
// Obtiene la información online
if (jscore::initOnlineScore(options->online.gameID))
{
screen->showNotification(options->online.jailerID + " ha iniciado sesion");
if (options->console)
{
std::cout << options->online.jailerID << " ha iniciado sesion" << std::endl;
}
}
else
{
screen->showNotification("Fallo al conectar a " + options->online.server);
if (options->console)
{
std::cout << "Fallo al conectar a " << options->online.server << std::endl;
}
options->online.enabled = false;
return;
}
// Obten la puntuación online
const int points = jscore::getUserPoints(options->online.gameID, options->online.jailerID);
if (points == 0)
{ // Fallo de conexión o no hay registros
screen->showNotification("No se ha podido obtener la puntuacion online");
if (options->console)
{
std::cout << "No se ha podido obtener la puntuacion online" << std::endl;
}
}
else
{
options->online.score = points;
}
}
*/
}
// Asigna variables a partir de dos cadenas

View File

@@ -780,12 +780,12 @@ bool Game::sendOnlineScore()
if (jscore::updateUserPoints(options->online.gameID, options->online.jailerID, score))
{
options->online.score = score;
screen->showNotification("PUNTUACION ENVIADA: " + std::to_string(score) + " PUNTOS");
screen->showNotification(lang->getText(86) + std::to_string(score), "", 2);
return true;
}
else
{
screen->showNotification("NO SE HA PODIDO ENVIAR LA PUNTUACION");
screen->showNotification(lang->getText(86), lang->getText(87));
return false;
}
}