diff --git a/data/lang/ba_BA.txt b/data/lang/ba_BA.txt index 0dabd8d..78c34aa 100644 --- a/data/lang/ba_BA.txt +++ b/data/lang/ba_BA.txt @@ -236,4 +236,31 @@ PUNTS J1: PUNTS J2: ## 79 - TEXTOS DEL JUEGO -Ultima fase! \ No newline at end of file +Ultima fase! + +## 80 - NOTIFICACIONES +Fallo al conectar a + +## 81 - NOTIFICACIONES +No s'ha pogut obtenir + +## 82 - NOTIFICACIONES +la puntuacio online + +## 83 - NOTIFICACIONES +No ha especificat + +## 84 - NOTIFICACIONES +cap jailerID + +## 85 - NOTIFICACIONES +ha iniciat la sesio + +## 86 - NOTIFICACIONES +Punts enviats: + +## 86 - NOTIFICACIONES +No s'ha pogut + +## 87 - NOTIFICACIONES +enviar la puntuacio \ No newline at end of file diff --git a/data/lang/en_UK.txt b/data/lang/en_UK.txt index 00f4b6a..1f491f1 100644 --- a/data/lang/en_UK.txt +++ b/data/lang/en_UK.txt @@ -236,4 +236,31 @@ PLAYER1 SCORE: PLAYER2 SCORE: ## 79 - TEXTOS DEL JUEGO -Last stage! \ No newline at end of file +Last stage! + +## 80 - NOTIFICACIONES +Failed connecting to + +## 81 - NOTIFICACIONES +Can't get + +## 82 - NOTIFICACIONES +online scores + +## 83 - NOTIFICACIONES +No JailerID + +## 84 - NOTIFICACIONES +name was set + +## 85 - NOTIFICACIONES +is logged in + +## 86 - NOTIFICACIONES +Score submitted + +## 86 - NOTIFICACIONES +Failed to send + +## 87 - NOTIFICACIONES +score to online server \ No newline at end of file diff --git a/data/lang/es_ES.txt b/data/lang/es_ES.txt index fd9cfb4..8adfbd8 100644 --- a/data/lang/es_ES.txt +++ b/data/lang/es_ES.txt @@ -236,4 +236,31 @@ PUNTUACION J1: PUNTUACION J2: ## 79 - TEXTOS DEL JUEGO -Ultima fase! \ No newline at end of file +Ultima fase! + +## 80 - NOTIFICACIONES +Fallo al conectar a + +## 81 - NOTIFICACIONES +No se ha podido obtener + +## 82 - NOTIFICACIONES +la puntuacion online + +## 83 - NOTIFICACIONES +No se ha especificado + +## 84 - NOTIFICACIONES +ningun jailerID + +## 85 - NOTIFICACIONES +ha iniciado la sesion + +## 86 - NOTIFICACIONES +Puntos enviados: + +## 86 - NOTIFICACIONES +No se ha podido + +## 87 - NOTIFICACIONES +enviar la puntuacion \ No newline at end of file diff --git a/source/common/jscore.cpp b/source/common/jscore.cpp index c16a494..8d0b7ef 100644 --- a/source/common/jscore.cpp +++ b/source/common/jscore.cpp @@ -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; } diff --git a/source/director.cpp b/source/director.cpp index 0446e98..f5d823e 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -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 diff --git a/source/game.cpp b/source/game.cpp index ddcbba0..eb4d13d 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -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; } }