Un altre punteret a pendre per cul: options

This commit is contained in:
2024-09-27 19:00:09 +02:00
parent 0de9188547
commit 20de9e4b72
26 changed files with 677 additions and 679 deletions

View File

@@ -1,9 +1,10 @@
#include "instructions.h"
#include "param.h"
#include "options.h"
#include <iostream>
// Constructor
Instructions::Instructions(Screen *screen, Asset *asset, Input *input, options_t *options, section_t *section, JA_Music_t *music)
Instructions::Instructions(Screen *screen, Asset *asset, Input *input, section_t *section, JA_Music_t *music)
{
// Copia los punteros
this->screen = screen;
@@ -11,7 +12,6 @@ Instructions::Instructions(Screen *screen, Asset *asset, Input *input, options_t
this->input = input;
this->section = section;
this->music = music;
this->options = options;
renderer = screen->getRenderer();
// Crea objetos
@@ -359,10 +359,10 @@ void Instructions::checkInput()
// Comprueba si se va a activar o desactivar el audio
if (input->checkModInput(input_service, input_mute, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, i))
{
options->audio.sound.enabled = options->audio.music.enabled = !options->audio.music.enabled;
JA_EnableMusic(options->audio.music.enabled);
JA_EnableSound(options->audio.sound.enabled);
screen->showNotification("Audio " + boolToOnOff(options->audio.music.enabled));
options.audio.sound.enabled = options.audio.music.enabled = !options.audio.music.enabled;
JA_EnableMusic(options.audio.music.enabled);
JA_EnableSound(options.audio.sound.enabled);
screen->showNotification("Audio " + boolToOnOff(options.audio.music.enabled));
return;
}
}