diff --git a/data/lang/ba_BA.txt b/data/lang/ba_BA.txt index aafa1ec..5048a7a 100644 --- a/data/lang/ba_BA.txt +++ b/data/lang/ba_BA.txt @@ -380,4 +380,28 @@ Torna a polsar per reiniciar Torna a polsar per canviar el idioma a ## 127 - NOTIFICACIONES -Idioma canviat a \ No newline at end of file +Idioma canviat a + +## 128 - VARIOS +activat + +## 129 - VARIOS +desactivat + +## 130 - VARIOS +Dispar automatic + +## 131 - VARIOS +Zoom de finestra + +## 132 - VARIOS +Mode finestra + +## 133 - VARIOS +Mode pantalla completa + +## 134 - VARIOS +Mode d'escalat sencer + +## 135 - VARIOS +Filtre \ No newline at end of file diff --git a/data/lang/en_UK.txt b/data/lang/en_UK.txt index 159861d..119098b 100644 --- a/data/lang/en_UK.txt +++ b/data/lang/en_UK.txt @@ -380,4 +380,28 @@ Press again to reset Press again to change languaje to ## 127 - NOTIFICACIONES -Language set to \ No newline at end of file +Language set to + +## 128 - VARIOS +on + +## 129 - VARIOS +off + +## 130 - VARIOS +Autofire + +## 131 - VARIOS +Window zoom + +## 132 - VARIOS +Window mode + +## 133 - VARIOS +Fullscreen mode + +## 134 - VARIOS +Integer scale + +## 135 - VARIOS +Filter \ No newline at end of file diff --git a/data/lang/es_ES.txt b/data/lang/es_ES.txt index e2f4137..4980bee 100644 --- a/data/lang/es_ES.txt +++ b/data/lang/es_ES.txt @@ -380,4 +380,28 @@ Vuelve a pulsar para reiniciar Vuelve a pulsar para cambiar el idioma a ## 127 - NOTIFICACIONES -Idioma cambiado a \ No newline at end of file +Idioma cambiado a + +## 128 - VARIOS +activado + +## 129 - VARIOS +desactivado + +## 130 - VARIOS +Disparo automático + +## 131 - VARIOS +Zoom de ventana + +## 132 - VARIOS +Modo ventana + +## 133 - VARIOS +Modo pantalla completa + +## 134 - VARIOS +Modo de escalado entero + +## 135 - VARIOS +Filtro \ No newline at end of file diff --git a/source/global_inputs.cpp b/source/global_inputs.cpp index 493dd59..7261dba 100644 --- a/source/global_inputs.cpp +++ b/source/global_inputs.cpp @@ -49,7 +49,7 @@ namespace globalInputs if (Notifier::get()->checkCode(CODE)) { section::name = section::Name::INIT; - Notifier::get()->show({"Reset"}); + Notifier::get()->show({lang::getText(111)}); } else { @@ -74,6 +74,22 @@ namespace globalInputs Notifier::get()->show({"Audio " + boolToOnOff(options.audio.enabled)}); } + // Cambia el modo de escalado entero + void toggleintegerScale() + { + options.video.integer_scale = !options.video.integer_scale; + SDL_RenderSetIntegerScale(Screen::get()->getRenderer(), options.video.integer_scale ? SDL_TRUE : SDL_FALSE); + Screen::get()->setVideoMode(); + Notifier::get()->show({lang::getText(134) + " " + boolToOnOff(options.video.integer_scale)}); + } + + // Activa o desactiva los shaders + void toggleShaders() + { + Screen::get()->toggleShaders(); + Notifier::get()->show({lang::getText(135) + " " + boolToOnOff(options.video.shaders)}); + } + // Obtiene una fichero a partir de un lang::Code std::string getLangFile(lang::Code code) { @@ -131,7 +147,7 @@ namespace globalInputs void toggleFireMode() { options.game.autofire = !options.game.autofire; - Notifier::get()->show({"Autofire " + boolToOnOff(options.game.autofire)}); + Notifier::get()->show({lang::getText(130) + " " + boolToOnOff(options.game.autofire)}); } // Salta una sección del juego @@ -141,7 +157,7 @@ namespace globalInputs { case section::Name::INTRO: JA_StopMusic(); - // Continua en el case de abajo + /* Continua en el case de abajo */ case section::Name::LOGO: case section::Name::HI_SCORE_TABLE: case section::Name::INSTRUCTIONS: @@ -161,13 +177,12 @@ namespace globalInputs { // Teclado { -#ifndef ARCADE // Comprueba el teclado para cambiar entre pantalla completa y ventana if (Input::get()->checkInput(InputType::WINDOW_FULLSCREEN, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::KEYBOARD)) { Screen::get()->toggleVideoMode(); - const std::string mode = options.video.mode == ScreenVideoMode::WINDOW ? "Window" : "Fullscreen"; - Notifier::get()->show({mode + " mode"}); + const std::string mode = options.video.mode == ScreenVideoMode::WINDOW ? lang::getText(132) : lang::getText(133); + Notifier::get()->show({mode}); return; } @@ -176,7 +191,7 @@ namespace globalInputs { if (Screen::get()->decWindowZoom()) { - Notifier::get()->show({"Window zoom x" + std::to_string(options.video.window.zoom)}); + Notifier::get()->show({lang::getText(131) + " x" + std::to_string(options.video.window.zoom)}); } return; } @@ -186,11 +201,11 @@ namespace globalInputs { if (Screen::get()->incWindowZoom()) { - Notifier::get()->show({"Window zoom x" + std::to_string(options.video.window.zoom)}); + Notifier::get()->show({lang::getText(131) + " x" + std::to_string(options.video.window.zoom)}); } return; } -#endif + // Salir if (Input::get()->checkInput(InputType::EXIT, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::KEYBOARD)) { @@ -236,16 +251,14 @@ namespace globalInputs // Shaders if (Input::get()->checkInput(InputType::VIDEO_SHADERS, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::KEYBOARD)) { - Screen::get()->toggleShaders(); + toggleShaders(); return; } if (Input::get()->checkInput(InputType::VIDEO_INTEGER_SCALE, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::KEYBOARD)) { - options.video.integer_scale = !options.video.integer_scale; - SDL_RenderSetIntegerScale(Screen::get()->getRenderer(), options.video.integer_scale ? SDL_TRUE : SDL_FALSE); - Screen::get()->setVideoMode(); - Notifier::get()->show({"Integer scale " + std::string(options.video.integer_scale ? "on" : "off")}); + toggleintegerScale(); + return; } #ifdef DEBUG @@ -296,7 +309,7 @@ namespace globalInputs if (Input::get()->checkInput(InputType::SERVICE, INPUT_ALLOW_REPEAT, InputDeviceToUse::CONTROLLER, i) && Input::get()->checkInput(InputType::VIDEO_SHADERS, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::CONTROLLER, i)) { - Screen::get()->toggleShaders(); + toggleShaders(); return; } #ifdef DEBUG diff --git a/source/screen.cpp b/source/screen.cpp index bbda19c..4f3882f 100644 --- a/source/screen.cpp +++ b/source/screen.cpp @@ -273,7 +273,6 @@ void Screen::renderShake() void Screen::toggleShaders() { options.video.shaders = !options.video.shaders; - Notifier::get()->show({"Shaders " + std::string(options.video.shaders ? "on" : "off")}); } // Activa / desactiva la información de debug diff --git a/source/utils.cpp b/source/utils.cpp index 54c577d..d8d5cc2 100644 --- a/source/utils.cpp +++ b/source/utils.cpp @@ -9,6 +9,7 @@ #include // Para basic_ostream, cout, basic_ios, endl, ios #include // Para runtime_error #include // Para basic_string, string, char_traits, opera... +#include "lang.h" // Variables Overrides overrides = Overrides(); @@ -121,7 +122,7 @@ std::string boolToString(bool value) // Convierte un valor booleano en una cadena "on" o "off" std::string boolToOnOff(bool value) { - return value ? "on" : "off"; + return value ? lang::getText(128) : lang::getText(129); } // Convierte una cadena a minusculas