Afegit global_inputs.c
El audio no es podía mutejar amb el teclat, soles amb els mandos
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "global_inputs.h"
|
||||
#include "intro.h"
|
||||
#include "param.h"
|
||||
#include "options.h"
|
||||
#include "param.h"
|
||||
|
||||
// Constructor
|
||||
Intro::Intro(JA_Music_t *music)
|
||||
@@ -192,21 +193,6 @@ void Intro::checkEvents()
|
||||
// Comprueba las entradas
|
||||
void Intro::checkInput()
|
||||
{
|
||||
// Comprueba si se sale con el teclado
|
||||
if (input->checkInput(input_exit, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_KEYBOARD))
|
||||
{
|
||||
quit(section::OPTIONS_QUIT_NORMAL);
|
||||
return;
|
||||
}
|
||||
|
||||
// Comprueba si se va a resetear el juego
|
||||
if (input->checkInput(input_reset, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_KEYBOARD))
|
||||
{
|
||||
section::name = section::NAME_INIT;
|
||||
screen->showNotification("Reset");
|
||||
return;
|
||||
}
|
||||
|
||||
// Comprueba si se ha pulsado cualquier botón (de los usados para jugar)
|
||||
if (input->checkAnyButtonPressed())
|
||||
{
|
||||
@@ -216,36 +202,11 @@ void Intro::checkInput()
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < input->getNumControllers(); ++i)
|
||||
{
|
||||
// Comprueba si se sale con el mando
|
||||
if (input->checkModInput(input_service, input_exit, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, i))
|
||||
{
|
||||
quit(section::OPTIONS_QUIT_SHUTDOWN);
|
||||
return;
|
||||
}
|
||||
|
||||
// Comprueba si se va a resetear el juego
|
||||
if (input->checkModInput(input_service, input_reset, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, i))
|
||||
{
|
||||
section::name = section::NAME_INIT;
|
||||
screen->showNotification("Reset");
|
||||
return;
|
||||
}
|
||||
|
||||
// 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));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Comprueba el input para el resto de objetos
|
||||
screen->checkInput();
|
||||
|
||||
// Comprueba los inputs que se pueden introducir en cualquier sección del juego
|
||||
checkGlobalInputs();
|
||||
}
|
||||
|
||||
// Actualiza las escenas de la intro
|
||||
@@ -467,18 +428,4 @@ void Intro::run()
|
||||
checkEvents(); // Tiene que ir antes del render
|
||||
render();
|
||||
}
|
||||
}
|
||||
|
||||
// Termina
|
||||
void Intro::quit(section::options_e code)
|
||||
{
|
||||
if (screen->notificationsAreActive())
|
||||
{
|
||||
section::name = section::NAME_QUIT;
|
||||
section::options = code;
|
||||
}
|
||||
else
|
||||
{
|
||||
screen->showNotification(lang::getText(94));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user