treballant en ServiceMenu
This commit is contained in:
@@ -11,14 +11,11 @@
|
||||
#include "param.h" // Para Param, ParamGame, param
|
||||
#include "screen.h" // Para Screen
|
||||
#include "section.h" // Para Name, name, Options, options, AttractMode
|
||||
#include "service_menu.h" // Para ServiceMenu
|
||||
#include "utils.h" // Para boolToOnOff
|
||||
|
||||
namespace globalInputs
|
||||
{
|
||||
// Variables
|
||||
int service_pressed_counter = 0;
|
||||
bool service_pressed = false;
|
||||
|
||||
// Termina
|
||||
void quit(section::Options code)
|
||||
{
|
||||
@@ -146,7 +143,7 @@ namespace globalInputs
|
||||
}
|
||||
|
||||
// Salta una sección del juego
|
||||
void skip_section()
|
||||
void skipSection()
|
||||
{
|
||||
switch (section::name)
|
||||
{
|
||||
@@ -167,6 +164,12 @@ namespace globalInputs
|
||||
}
|
||||
}
|
||||
|
||||
// Activa el menu de servicio
|
||||
void toggleServiceMenu()
|
||||
{
|
||||
ServiceMenu::get()->toggle();
|
||||
}
|
||||
|
||||
// Comprueba los inputs que se pueden introducir en cualquier sección del juego
|
||||
void check()
|
||||
{
|
||||
@@ -211,7 +214,7 @@ namespace globalInputs
|
||||
// Saltar sección
|
||||
if (Input::get()->checkAnyButtonPressed())
|
||||
{
|
||||
skip_section();
|
||||
skipSection();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -263,6 +266,14 @@ namespace globalInputs
|
||||
toggleVSync();
|
||||
return;
|
||||
}
|
||||
|
||||
// Service Menu
|
||||
if (Input::get()->checkInput(InputAction::SERVICE, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::KEYBOARD))
|
||||
{
|
||||
toggleServiceMenu();
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
// Debug info
|
||||
if (Input::get()->checkInput(InputAction::SHOW_INFO, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::KEYBOARD))
|
||||
@@ -271,12 +282,6 @@ namespace globalInputs
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
// OnScreenHelp
|
||||
if (Input::get()->checkInput(InputAction::SERVICE, INPUT_ALLOW_REPEAT, InputDeviceToUse::KEYBOARD))
|
||||
{
|
||||
service_pressed = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Mandos
|
||||
@@ -284,49 +289,9 @@ namespace globalInputs
|
||||
for (int i = 0; i < Input::get()->getNumControllers(); ++i)
|
||||
{
|
||||
// Salir
|
||||
if (Input::get()->checkInput(InputAction::SERVICE, INPUT_ALLOW_REPEAT, InputDeviceToUse::CONTROLLER, i) &&
|
||||
Input::get()->checkInput(InputAction::EXIT, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::CONTROLLER, i))
|
||||
{
|
||||
quit(section::Options::QUIT_WITH_CONTROLLER);
|
||||
return;
|
||||
}
|
||||
|
||||
// Reset
|
||||
if (Input::get()->checkInput(InputAction::SERVICE, INPUT_ALLOW_REPEAT, InputDeviceToUse::CONTROLLER, i) &&
|
||||
Input::get()->checkInput(InputAction::RESET, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::CONTROLLER, i))
|
||||
{
|
||||
reset();
|
||||
return;
|
||||
}
|
||||
|
||||
// Audio
|
||||
if (Input::get()->checkInput(InputAction::SERVICE, INPUT_ALLOW_REPEAT, InputDeviceToUse::CONTROLLER, i) &&
|
||||
Input::get()->checkInput(InputAction::TOGGLE_AUDIO, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::CONTROLLER, i))
|
||||
{
|
||||
toggleAudio();
|
||||
return;
|
||||
}
|
||||
|
||||
// Shaders
|
||||
if (Input::get()->checkInput(InputAction::SERVICE, INPUT_ALLOW_REPEAT, InputDeviceToUse::CONTROLLER, i) &&
|
||||
Input::get()->checkInput(InputAction::TOGGLE_VIDEO_SHADERS, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::CONTROLLER, i))
|
||||
{
|
||||
toggleShaders();
|
||||
return;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
// Debug Info
|
||||
if (Input::get()->checkInput(InputAction::SERVICE, INPUT_ALLOW_REPEAT, InputDeviceToUse::CONTROLLER, i) &&
|
||||
Input::get()->checkInput(InputAction::SHOW_INFO, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::CONTROLLER, i))
|
||||
{
|
||||
Screen::get()->toggleDebugInfo();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
// OnScreenHelp
|
||||
if (Input::get()->checkInput(InputAction::SERVICE, INPUT_ALLOW_REPEAT, InputDeviceToUse::CONTROLLER, i))
|
||||
{
|
||||
service_pressed = true;
|
||||
toggleServiceMenu();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user