Afegit botó per activar o desactivar el autofire
This commit is contained in:
@@ -30,7 +30,9 @@ Les tecles son les següents:
|
||||
|
||||
- **Tecla F5**: Activa o desactiva l'audio
|
||||
|
||||
- **Tecla F6**: Canvia el idioma del joc i reinicia
|
||||
- **Tecla F6**: Activa o desactiva el dispar automàtic
|
||||
|
||||
- **Tecla F7**: Canvia el idioma del joc i reinicia
|
||||
|
||||
- **Tecla F10**: Reset
|
||||
|
||||
|
||||
@@ -180,8 +180,9 @@ void Director::bindInputs()
|
||||
Input::get()->bindKey(InputType::WINDOW_FULLSCREEN, SDL_SCANCODE_F3);
|
||||
Input::get()->bindKey(InputType::VIDEO_SHADERS, SDL_SCANCODE_F4);
|
||||
Input::get()->bindKey(InputType::MUTE, SDL_SCANCODE_F5);
|
||||
Input::get()->bindKey(InputType::CHANGE_LANG, SDL_SCANCODE_F6);
|
||||
Input::get()->bindKey(InputType::SHOWINFO, SDL_SCANCODE_F7);
|
||||
Input::get()->bindKey(InputType::AUTO_FIRE, SDL_SCANCODE_F6);
|
||||
Input::get()->bindKey(InputType::CHANGE_LANG, SDL_SCANCODE_F7);
|
||||
Input::get()->bindKey(InputType::SHOWINFO, SDL_SCANCODE_F8);
|
||||
Input::get()->bindKey(InputType::RESET, SDL_SCANCODE_F10);
|
||||
|
||||
// Asigna botones a inputs
|
||||
|
||||
@@ -108,6 +108,13 @@ namespace globalInputs
|
||||
Notifier::get()->showText({getLangName(options.game.language)});
|
||||
}
|
||||
|
||||
// Cambia el modo de disparo
|
||||
void toggleFireMode()
|
||||
{
|
||||
options.game.autofire = !options.game.autofire;
|
||||
Notifier::get()->showText({"Autofire " + boolToOnOff(options.game.autofire)});
|
||||
}
|
||||
|
||||
// Comprueba los inputs que se pueden introducir en cualquier sección del juego
|
||||
void check()
|
||||
{
|
||||
@@ -162,6 +169,13 @@ namespace globalInputs
|
||||
return;
|
||||
}
|
||||
|
||||
// Autofire
|
||||
if (Input::get()->checkInput(InputType::AUTO_FIRE, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::KEYBOARD))
|
||||
{
|
||||
toggleFireMode();
|
||||
return;
|
||||
}
|
||||
|
||||
// Idioma
|
||||
if (Input::get()->checkInput(InputType::CHANGE_LANG, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::KEYBOARD))
|
||||
{
|
||||
|
||||
@@ -44,6 +44,7 @@ enum class InputType : int
|
||||
SHOWINFO,
|
||||
CONFIG,
|
||||
SWAP_CONTROLLERS,
|
||||
AUTO_FIRE,
|
||||
|
||||
// Input obligatorio
|
||||
NONE,
|
||||
|
||||
Reference in New Issue
Block a user