Añadidas nuevas funciones al botón de servicio
El botón de servicio se puede usar en cualquier sección del juego
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "game.h"
|
||||
#include "service.h"
|
||||
|
||||
#define GAME_OVER_COUNTER 350
|
||||
|
||||
@@ -124,7 +125,7 @@ void Game::init(int playerID)
|
||||
|
||||
// Obtiene el "id" del jugador que va a jugar
|
||||
Player *player = getPlayer(playerID);
|
||||
|
||||
|
||||
// Cambia el estado del jugador seleccionado
|
||||
player->setStatusPlaying(PLAYER_STATUS_PLAYING);
|
||||
|
||||
@@ -2038,20 +2039,37 @@ void Game::updateMenace()
|
||||
void Game::checkInput()
|
||||
{
|
||||
// Comprueba las teclas que afectan al programa (solo para el primer jugador)
|
||||
if (input->checkInput(input_exit, DO_NOT_ALLOW_REPEAT))
|
||||
if (input->checkInput(input_exit, INPUT_DO_NOT_ALLOW_REPEAT))
|
||||
{
|
||||
section->name = SECTION_PROG_QUIT;
|
||||
section->options = SECTION_OPTIONS_QUIT_NORMAL;
|
||||
return;
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_reset, DO_NOT_ALLOW_REPEAT))
|
||||
// Comprueba el botón de SERVICE
|
||||
switch (checkServiceButton(input, 0))
|
||||
{
|
||||
case SERVICE_EXIT:
|
||||
{
|
||||
section->name = SECTION_PROG_QUIT;
|
||||
section->options = SECTION_OPTIONS_QUIT_SHUTDOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
case SERVICE_SHADERS:
|
||||
{
|
||||
screen->switchShaders();
|
||||
break;
|
||||
}
|
||||
|
||||
case SERVICE_RESET:
|
||||
{
|
||||
section->name = SECTION_PROG_LOGO;
|
||||
screen->showNotification("Reset");
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_mute, DO_NOT_ALLOW_REPEAT))
|
||||
case SERVICE_MUTE:
|
||||
{
|
||||
const bool value = !options->audio.music.enabled;
|
||||
options->audio.music.enabled = value;
|
||||
@@ -2060,12 +2078,19 @@ void Game::checkInput()
|
||||
JA_EnableSound(value);
|
||||
const std::string text = value ? "on" : "off";
|
||||
screen->showNotification("Audio " + text);
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_pause, DO_NOT_ALLOW_REPEAT))
|
||||
case SERVICE_PAUSE:
|
||||
{
|
||||
pause(!paused);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Modo Demo activo
|
||||
@@ -2153,7 +2178,7 @@ void Game::checkInput()
|
||||
if (player->isPlaying())
|
||||
{
|
||||
// Input a la izquierda
|
||||
if (input->checkInput(input_left, ALLOW_REPEAT, options->controller[controllerIndex].deviceType, options->controller[controllerIndex].index))
|
||||
if (input->checkInput(input_left, INPUT_ALLOW_REPEAT, options->controller[controllerIndex].deviceType, options->controller[controllerIndex].index))
|
||||
{
|
||||
player->setInput(input_left);
|
||||
#ifdef RECORDING
|
||||
@@ -2163,7 +2188,7 @@ void Game::checkInput()
|
||||
else
|
||||
{
|
||||
// Input a la derecha
|
||||
if (input->checkInput(input_right, ALLOW_REPEAT, options->controller[controllerIndex].deviceType, options->controller[controllerIndex].index))
|
||||
if (input->checkInput(input_right, INPUT_ALLOW_REPEAT, options->controller[controllerIndex].deviceType, options->controller[controllerIndex].index))
|
||||
{
|
||||
player->setInput(input_right);
|
||||
#ifdef RECORDING
|
||||
@@ -2242,7 +2267,7 @@ void Game::checkInput()
|
||||
else
|
||||
{
|
||||
// Si no está jugando, el botón de start le permite continuar jugando
|
||||
if (input->checkInput(input_start, ALLOW_REPEAT, options->controller[controllerIndex].deviceType, options->controller[controllerIndex].index))
|
||||
if (input->checkInput(input_start, INPUT_ALLOW_REPEAT, options->controller[controllerIndex].deviceType, options->controller[controllerIndex].index))
|
||||
{
|
||||
// Si no ha entrado ya en el estado de game over, entonces se puede continuar
|
||||
if (gameOverCounter == GAME_OVER_COUNTER)
|
||||
|
||||
Reference in New Issue
Block a user