Correcciones en el botón de servicio

This commit is contained in:
2024-09-15 15:27:12 +02:00
parent 41e57064cb
commit 333c905b1a
21 changed files with 224 additions and 105 deletions

View File

@@ -3,7 +3,7 @@
#include <iostream>
// Constructor
Instructions::Instructions(Screen *screen, Asset *asset, Input *input, Lang *lang, param_t *param, section_t *section, JA_Music_t *music)
Instructions::Instructions(Screen *screen, Asset *asset, Input *input, Lang *lang, options_t *options, param_t *param, section_t *section, JA_Music_t *music)
{
// Copia los punteros
this->screen = screen;
@@ -13,6 +13,7 @@ Instructions::Instructions(Screen *screen, Asset *asset, Input *input, Lang *lan
this->param = param;
this->section = section;
this->music = music;
this->options = options;
renderer = screen->getRenderer();
// Crea objetos
@@ -338,20 +339,32 @@ void Instructions::checkInput()
}
// Comprueba el botón de SERVICE
switch (checkServiceButton(input, 0))
switch (checkServiceButton(input))
{
case SERVICE_EXIT:
section->name = SECTION_PROG_QUIT;
section->options = SECTION_OPTIONS_QUIT_SHUTDOWN;
case SERVICE_RESET:
{
section->name = SECTION_PROG_LOGO;
screen->showNotification("Reset");
break;
}
case SERVICE_SHADERS:
screen->switchShaders();
case SERVICE_MUTE:
{
const bool value = !options->audio.music.enabled;
options->audio.music.enabled = value;
options->audio.sound.enabled = value;
JA_EnableMusic(value);
JA_EnableSound(value);
const std::string text = value ? "on" : "off";
screen->showNotification("Audio " + text);
break;
}
default:
{
break;
}
}
// Comprueba el input para el resto de objetos
screen->checkInput();