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,12 +3,13 @@
#include <iostream>
// Constructor
Logo::Logo(Screen *screen, Asset *asset, Input *input, param_t *param, section_t *section)
Logo::Logo(Screen *screen, Asset *asset, Input *input, options_t *options, param_t *param, section_t *section)
{
// Copia la dirección de los objetos
this->screen = screen;
this->asset = asset;
this->input = input;
this->options = options;
this->param = param;
this->section = section;
SDL_Renderer *renderer = screen->getRenderer();
@@ -118,21 +119,40 @@ void Logo::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;
return;
break;
}
case SERVICE_SHADERS:
screen->switchShaders();
case SERVICE_RESET:
{
section->name = SECTION_PROG_LOGO;
screen->showNotification("Reset");
break;
}
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();