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

@@ -2,7 +2,7 @@
#include "service.h"
// Constructor
Title::Title(Screen *screen, Asset *asset, Input *input, options_t *options, Lang *lang, param_t *param, section_t *section, JA_Music_t *music)
Title::Title(Screen *screen, Asset *asset, Input *input, Lang *lang, options_t *options, param_t *param, section_t *section, JA_Music_t *music)
{
// Copia las direcciones de los punteros y objetos
this->screen = screen;
@@ -268,33 +268,47 @@ void Title::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;
break;
case SERVICE_RESET:
{
section->name = SECTION_PROG_LOGO;
screen->showNotification("Reset");
break;
}
case SERVICE_SHADERS:
screen->switchShaders();
break;
case SERVICE_CONFIG:
defineButtons->enable(0);
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;
}
case SERVICE_SWAP_CONTROLLERS:
{
swapControllers();
break;
}
default:
{
break;
}
}
// Comprueba si algun mando quiere ser configurado
for (int i = 0; i < input->getNumControllers(); ++i)
{
if (checkServiceButton(input, i) == SERVICE_CONFIG)
{
defineButtons->enable(i);
}
}
// Comprueba el botón de START de los mandos
for (int i = 0; i < input->getNumControllers(); ++i)