Afegides traduccions a les notificacions que faltaven

This commit is contained in:
2025-03-14 21:53:27 +01:00
parent 6c7cfaae59
commit 919e2b9ca7
6 changed files with 105 additions and 20 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -9,6 +9,7 @@
#include <iostream> // Para basic_ostream, cout, basic_ios, endl, ios
#include <stdexcept> // Para runtime_error
#include <string> // 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