Mil millons de miniarreglos

Afegides traduccions faltants
This commit is contained in:
2024-09-26 22:13:20 +02:00
parent 69027f96e6
commit 05e3fddb8f
18 changed files with 173 additions and 28 deletions

View File

@@ -278,4 +278,40 @@ DEIXA BUIT PER A
MODE FORA DE LINEA MODE FORA DE LINEA
## 93 - MENU OPCIONES ## 93 - MENU OPCIONES
TAULER DE PUNTS TAULER DE PUNTS
## 94 - NOTIFICACIONES
Torna a polsar per eixir ...
## 95 - DEFINE BUTTONS
Disparar cap a l'esquerra
## 96 - DEFINE BUTTONS
Disparar cap amunt
## 97 - DEFINE BUTTONS
Disparar cap a la dreta
## 98 - DEFINE BUTTONS
Start
## 99 - DEFINE BUTTONS
Servei
## 100 - DEFINE BUTTONS
Jugador
## 101 - MARCADOR
Mode demostracio
## 102 - MARCADOR
Game Over
## 103 - MARCADOR
Pulsa START
## 104 - MARCADOR
per jugar
## 105 - MARCADOR
Continuar?

View File

@@ -278,4 +278,40 @@ LEAVE BLANK FOR
OFFLINE MODE OFFLINE MODE
## 93 - MENU OPCIONES ## 93 - MENU OPCIONES
HISCORE TABLE HISCORE TABLE
## 94 - NOTIFICACIONES
Press again to quit
## 95 - DEFINE BUTTONS
Fire left
## 96 - DEFINE BUTTONS
Fire up
## 97 - DEFINE BUTTONS
Fire right
## 98 - DEFINE BUTTONS
Start
## 99 - DEFINE BUTTONS
Service
## 100 - DEFINE BUTTONS
Player
## 101 - MARCADOR
Demo mode
## 102 - MARCADOR
Game Over
## 103 - MARCADOR
Press START
## 104 - MARCADOR
to play
## 105 - MARCADOR
Continue?

View File

@@ -278,4 +278,40 @@ DEJA EN BLANCO PARA
MODO SIN CONEXION MODO SIN CONEXION
## 93 - MENU OPCIONES ## 93 - MENU OPCIONES
TABLA DE PUNTUACIONES TABLA DE PUNTUACIONES
## 94 - NOTIFICACIONES
Pulsa otra vez para salir
## 95 - DEFINE BUTTONS
Disparar a la izquierda
## 96 - DEFINE BUTTONS
Disparar hacia arriba
## 97 - DEFINE BUTTONS
Disparar hacia la derecha
## 98 - DEFINE BUTTONS
Start
## 99 - DEFINE BUTTONS
Servicio
## 100 - DEFINE BUTTONS
Jugador
## 101 - MARCADOR
Mode demostracion
## 102 - MARCADOR
Game Over
## 103 - MARCADOR
Pulsa START
## 104 - MARCADOR
para jugar
## 105 - MARCADOR
Continuar?

View File

@@ -39,7 +39,7 @@ Screen::Screen(SDL_Window *window, SDL_Renderer *renderer, Asset *asset, Input *
fpsCounter = 0; fpsCounter = 0;
fps = 0; fps = 0;
#ifdef DEBUG #ifdef DEBUG
showInfo = true; showInfo = false;
#else #else
showInfo = false; showInfo = false;
#endif #endif
@@ -354,12 +354,14 @@ void Screen::checkInput()
return; return;
} }
#ifdef DEBUG
// Comprueba el teclado para mostrar la información de debug // Comprueba el teclado para mostrar la información de debug
if (input->checkInput(input_showinfo, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_KEYBOARD)) if (input->checkInput(input_showinfo, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_KEYBOARD))
{ {
showInfo = !showInfo; showInfo = !showInfo;
return; return;
} }
#endif
for (int i = 0; i < input->getNumControllers(); ++i) for (int i = 0; i < input->getNumControllers(); ++i)
{ {

View File

@@ -20,27 +20,27 @@ DefineButtons::DefineButtons(Input *input, Text *text, param_t *param, options_t
buttons.clear(); buttons.clear();
db_button_t button; db_button_t button;
button.label = "DISPARAR CAP A L'ESQUERRA"; button.label = lang::getText(95);
button.input = input_fire_left; button.input = input_fire_left;
button.button = SDL_CONTROLLER_BUTTON_X; button.button = SDL_CONTROLLER_BUTTON_X;
buttons.push_back(button); buttons.push_back(button);
button.label = "DISPARAR CAP AMUNT"; button.label = lang::getText(96);
button.input = input_fire_center; button.input = input_fire_center;
button.button = SDL_CONTROLLER_BUTTON_Y; button.button = SDL_CONTROLLER_BUTTON_Y;
buttons.push_back(button); buttons.push_back(button);
button.label = "DISPARAR CAP A LA DRETA"; button.label = lang::getText(97);
button.input = input_fire_right; button.input = input_fire_right;
button.button = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER; button.button = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER;
buttons.push_back(button); buttons.push_back(button);
button.label = "START"; button.label = lang::getText(98);
button.input = input_start; button.input = input_start;
button.button = SDL_CONTROLLER_BUTTON_START; button.button = SDL_CONTROLLER_BUTTON_START;
buttons.push_back(button); buttons.push_back(button);
button.label = "SERVEI"; button.label = lang::getText(99);
button.input = input_exit; button.input = input_exit;
button.button = SDL_CONTROLLER_BUTTON_BACK; button.button = SDL_CONTROLLER_BUTTON_BACK;
buttons.push_back(button); buttons.push_back(button);
@@ -69,7 +69,7 @@ void DefineButtons::render()
{ {
if (enabled) if (enabled)
{ {
text->writeCentered(x, y - 10, "JUGADOR " + std::to_string(options->controller[indexController].playerId)); text->writeCentered(x, y - 10, lang::getText(100) + std::to_string(options->controller[indexController].playerId));
text->writeCentered(x, y, controllerNames[indexController]); text->writeCentered(x, y, controllerNames[indexController]);
text->writeCentered(x, y + 10, buttons[indexButton].label); text->writeCentered(x, y + 10, buttons[indexButton].label);
} }

View File

@@ -4,6 +4,7 @@
#include "common/input.h" #include "common/input.h"
#include "common/text.h" #include "common/text.h"
#include "const.h" #include "const.h"
#include "lang.h"
struct db_button_t struct db_button_t
{ {

View File

@@ -73,7 +73,7 @@ Director::Director(int argc, char *argv[])
dbg_init(renderer); dbg_init(renderer);
// Crea los objetos // Crea los objetos
lang::loadFromFile(asset->get("ba_BA.txt")); lang::loadFromFile(getLangFile((lang::lang_e)options->game.language));
input = new Input(asset->get("gamecontrollerdb.txt")); input = new Input(asset->get("gamecontrollerdb.txt"));
initInput(); initInput();
@@ -521,7 +521,7 @@ void Director::initOptions()
// Opciones de juego // Opciones de juego
options->game.difficulty = DIFFICULTY_NORMAL; options->game.difficulty = DIFFICULTY_NORMAL;
options->game.language = 1; options->game.language = lang::ba_BA;
options->game.autofire = true; options->game.autofire = true;
// Opciones de control // Opciones de control
@@ -695,7 +695,7 @@ bool Director::loadConfigFile()
if (options->game.language < 0 || options->game.language > 2) if (options->game.language < 0 || options->game.language > 2)
{ {
options->game.language = 2; options->game.language = lang::en_UK;
} }
return success; return success;
@@ -1176,4 +1176,28 @@ bool Director::setOptions(options_t *options, std::string var, std::string value
} }
return success; return success;
}
// Obtiene una fichero a partir de un lang_e
std::string Director::getLangFile(lang::lang_e lang)
{
switch (lang)
{
case lang::ba_BA:
return asset->get("ba_BA.txt");
break;
case lang::es_ES:
return asset->get("es_ES.txt");
break;
case lang::en_UK:
return asset->get("en_UK.txt");
break;
default:
break;
}
return asset->get("en_UK.txt");
} }

View File

@@ -115,6 +115,9 @@ private:
// Ejecuta el juego en modo demo // Ejecuta el juego en modo demo
void runDemoGame(); void runDemoGame();
// Obtiene una fichero a partir de un lang_e
std::string getLangFile(lang::lang_e lang);
public: public:
// Constructor // Constructor
Director(int argc, char *argv[]); Director(int argc, char *argv[]);

View File

@@ -2826,6 +2826,6 @@ void Game::quit(int code)
} }
else else
{ {
screen->showNotification("Torna a polsar per eixir"); screen->showNotification(lang::getText(94));
} }
} }

View File

@@ -346,6 +346,6 @@ void HiScoreTable::quit(int code)
} }
else else
{ {
screen->showNotification("Torna a polsar per eixir"); screen->showNotification(lang::getText(94));
} }
} }

View File

@@ -393,6 +393,6 @@ void Instructions::quit(int code)
} }
else else
{ {
screen->showNotification("Torna a polsar per eixir"); screen->showNotification(lang::getText(94));
} }
} }

View File

@@ -471,6 +471,6 @@ void Intro::quit(int code)
} }
else else
{ {
screen->showNotification("Torna a polsar per eixir"); screen->showNotification(lang::getText(94));
} }
} }

View File

@@ -4,6 +4,8 @@
namespace lang namespace lang
{ {
std::vector<std::string> texts; // Vector con los textos
// Inicializa los textos del juego en el idioma seleccionado // Inicializa los textos del juego en el idioma seleccionado
bool loadFromFile(std::string filePath) bool loadFromFile(std::string filePath)
{ {

View File

@@ -6,8 +6,12 @@
namespace lang namespace lang
{ {
// Variables enum lang_e
std::vector<std::string> texts; // Vector con los textos {
es_ES = 0,
ba_BA = 1,
en_UK = 2,
};
// Inicializa los textos del juego en el idioma seleccionado // Inicializa los textos del juego en el idioma seleccionado
bool loadFromFile(std::string filePath); bool loadFromFile(std::string filePath);

View File

@@ -345,6 +345,6 @@ void Logo::quit(int code)
} }
else else
{ {
screen->showNotification("Torna a polsar per eixir"); screen->showNotification(lang::getText(94));
} }
} }

View File

@@ -8,6 +8,7 @@
#include "common/sprite.h" #include "common/sprite.h"
#include "common/utils.h" #include "common/utils.h"
#include "const.h" #include "const.h"
#include "lang.h"
#include <vector> #include <vector>
/* /*

View File

@@ -238,20 +238,20 @@ void Scoreboard::fillPanelTextures()
break; break;
case SCOREBOARD_MODE_DEMO: case SCOREBOARD_MODE_DEMO:
textScoreBoard->writeCentered(slot4_1.x, slot4_1.y + 4, "Mode demostracio"); textScoreBoard->writeCentered(slot4_1.x, slot4_1.y + 4, lang::getText(101));
if (counter % 10 < 8) if (counter % 10 < 8)
{ {
textScoreBoard->writeCentered(slot4_3.x, slot4_3.y - 2, "Pulsa START"); textScoreBoard->writeCentered(slot4_3.x, slot4_3.y - 2, lang::getText(103));
textScoreBoard->writeCentered(slot4_4.x, slot4_4.y - 2, "per jugar"); textScoreBoard->writeCentered(slot4_4.x, slot4_4.y - 2, lang::getText(104));
} }
break; break;
case SCOREBOARD_MODE_GAME_OVER: case SCOREBOARD_MODE_GAME_OVER:
textScoreBoard->writeCentered(slot4_1.x, slot4_1.y + 4, "Game Over"); textScoreBoard->writeCentered(slot4_1.x, slot4_1.y + 4, lang::getText(102));
if (counter % 10 < 8) if (counter % 10 < 8)
{ {
textScoreBoard->writeCentered(slot4_3.x, slot4_3.y - 2, "Pulsa START"); textScoreBoard->writeCentered(slot4_3.x, slot4_3.y - 2, lang::getText(103));
textScoreBoard->writeCentered(slot4_4.x, slot4_4.y - 2, "per jugar"); textScoreBoard->writeCentered(slot4_4.x, slot4_4.y - 2, lang::getText(104));
} }
break; break;
@@ -276,7 +276,7 @@ void Scoreboard::fillPanelTextures()
textScoreBoard->writeCentered(slot4_2.x, slot4_2.y, updateScoreText(score[i])); textScoreBoard->writeCentered(slot4_2.x, slot4_2.y, updateScoreText(score[i]));
// CONTINUE // CONTINUE
textScoreBoard->writeCentered(slot4_3.x, slot4_3.y, "Continuar?"); textScoreBoard->writeCentered(slot4_3.x, slot4_3.y, lang::getText(105));
textScoreBoard->writeCentered(slot4_4.x, slot4_4.y, std::to_string(continueCounter[i])); textScoreBoard->writeCentered(slot4_4.x, slot4_4.y, std::to_string(continueCounter[i]));
break; break;

View File

@@ -407,6 +407,6 @@ void Title::quit(int code)
} }
else else
{ {
screen->showNotification("Torna a polsar per eixir"); screen->showNotification(lang::getText(94));
} }
} }