input: treballant en la nova estructura per als controladors
This commit is contained in:
@@ -163,7 +163,7 @@ void incWindowSize() {
|
||||
// Comprueba el boton de servicio
|
||||
auto checkServiceButton() -> bool {
|
||||
// Teclado
|
||||
if (Input::get()->checkInput(Input::Action::SERVICE, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Input::get()->checkAction(Input::Action::SERVICE, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
toggleServiceMenu();
|
||||
return true;
|
||||
}
|
||||
@@ -171,7 +171,7 @@ auto checkServiceButton() -> bool {
|
||||
// Mandos
|
||||
{
|
||||
for (int i = 0; i < Input::get()->getNumControllers(); ++i) {
|
||||
if (Input::get()->checkInput(Input::Action::SERVICE, Input::DO_NOT_ALLOW_REPEAT, Input::Device::CONTROLLER, i)) {
|
||||
if (Input::get()->checkAction(Input::Action::SERVICE, Input::DO_NOT_ALLOW_REPEAT, Input::Device::CONTROLLER, i)) {
|
||||
toggleServiceMenu();
|
||||
return true;
|
||||
}
|
||||
@@ -189,37 +189,37 @@ auto checkServiceInputs() -> bool {
|
||||
// Teclado
|
||||
{
|
||||
// Arriba
|
||||
if (Input::get()->checkInput(Input::Action::UP, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Input::get()->checkAction(Input::Action::UP, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
ServiceMenu::get()->setSelectorUp();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Abajo
|
||||
if (Input::get()->checkInput(Input::Action::DOWN, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Input::get()->checkAction(Input::Action::DOWN, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
ServiceMenu::get()->setSelectorDown();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Derecha
|
||||
if (Input::get()->checkInput(Input::Action::RIGHT, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Input::get()->checkAction(Input::Action::RIGHT, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
ServiceMenu::get()->adjustOption(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Izquierda
|
||||
if (Input::get()->checkInput(Input::Action::LEFT, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Input::get()->checkAction(Input::Action::LEFT, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
ServiceMenu::get()->adjustOption(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Aceptar
|
||||
if (Input::get()->checkInput(Input::Action::SM_SELECT, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Input::get()->checkAction(Input::Action::SM_SELECT, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
ServiceMenu::get()->selectOption();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Atras
|
||||
if (Input::get()->checkInput(Input::Action::SM_BACK, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Input::get()->checkAction(Input::Action::SM_BACK, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
ServiceMenu::get()->moveBack();
|
||||
return true;
|
||||
}
|
||||
@@ -229,37 +229,37 @@ auto checkServiceInputs() -> bool {
|
||||
{
|
||||
for (int i = 0; i < Input::get()->getNumControllers(); ++i) {
|
||||
// Arriba
|
||||
if (Input::get()->checkInput(Input::Action::UP, Input::DO_NOT_ALLOW_REPEAT, Input::Device::CONTROLLER, i)) {
|
||||
if (Input::get()->checkAction(Input::Action::UP, Input::DO_NOT_ALLOW_REPEAT, Input::Device::CONTROLLER, i)) {
|
||||
ServiceMenu::get()->setSelectorUp();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Abajo
|
||||
if (Input::get()->checkInput(Input::Action::DOWN, Input::DO_NOT_ALLOW_REPEAT, Input::Device::CONTROLLER, i)) {
|
||||
if (Input::get()->checkAction(Input::Action::DOWN, Input::DO_NOT_ALLOW_REPEAT, Input::Device::CONTROLLER, i)) {
|
||||
ServiceMenu::get()->setSelectorDown();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Derecha
|
||||
if (Input::get()->checkInput(Input::Action::RIGHT, Input::DO_NOT_ALLOW_REPEAT, Input::Device::CONTROLLER, i)) {
|
||||
if (Input::get()->checkAction(Input::Action::RIGHT, Input::DO_NOT_ALLOW_REPEAT, Input::Device::CONTROLLER, i)) {
|
||||
ServiceMenu::get()->adjustOption(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Izquierda
|
||||
if (Input::get()->checkInput(Input::Action::LEFT, Input::DO_NOT_ALLOW_REPEAT, Input::Device::CONTROLLER, i)) {
|
||||
if (Input::get()->checkAction(Input::Action::LEFT, Input::DO_NOT_ALLOW_REPEAT, Input::Device::CONTROLLER, i)) {
|
||||
ServiceMenu::get()->adjustOption(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Aceptar
|
||||
if (Input::get()->checkInput(Input::Action::SM_SELECT, Input::DO_NOT_ALLOW_REPEAT, Input::Device::CONTROLLER, i)) {
|
||||
if (Input::get()->checkAction(Input::Action::SM_SELECT, Input::DO_NOT_ALLOW_REPEAT, Input::Device::CONTROLLER, i)) {
|
||||
ServiceMenu::get()->selectOption();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Atras
|
||||
if (Input::get()->checkInput(Input::Action::SM_BACK, Input::DO_NOT_ALLOW_REPEAT, Input::Device::CONTROLLER, i)) {
|
||||
if (Input::get()->checkAction(Input::Action::SM_BACK, Input::DO_NOT_ALLOW_REPEAT, Input::Device::CONTROLLER, i)) {
|
||||
ServiceMenu::get()->moveBack();
|
||||
return true;
|
||||
}
|
||||
@@ -273,7 +273,7 @@ auto checkInputs() -> bool {
|
||||
// Teclado
|
||||
{
|
||||
// Comprueba el teclado para cambiar entre pantalla completa y ventana
|
||||
if (Input::get()->checkInput(Input::Action::WINDOW_FULLSCREEN, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Input::get()->checkAction(Input::Action::WINDOW_FULLSCREEN, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
Screen::get()->toggleFullscreen();
|
||||
const std::string MODE = Options::video.fullscreen ? Lang::getText("[NOTIFICATIONS] 11") : Lang::getText("[NOTIFICATIONS] 10");
|
||||
Notifier::get()->show({MODE});
|
||||
@@ -281,7 +281,7 @@ auto checkInputs() -> bool {
|
||||
}
|
||||
|
||||
// Comprueba el teclado para decrementar el tamaño de la ventana
|
||||
if (Input::get()->checkInput(Input::Action::WINDOW_DEC_SIZE, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Input::get()->checkAction(Input::Action::WINDOW_DEC_SIZE, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Screen::get()->decWindowSize()) {
|
||||
Notifier::get()->show({Lang::getText("[NOTIFICATIONS] 09") + " x" + std::to_string(Options::window.zoom)});
|
||||
}
|
||||
@@ -289,7 +289,7 @@ auto checkInputs() -> bool {
|
||||
}
|
||||
|
||||
// Comprueba el teclado para incrementar el tamaño de la ventana
|
||||
if (Input::get()->checkInput(Input::Action::WINDOW_INC_SIZE, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Input::get()->checkAction(Input::Action::WINDOW_INC_SIZE, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Screen::get()->incWindowSize()) {
|
||||
Notifier::get()->show({Lang::getText("[NOTIFICATIONS] 09") + " x" + std::to_string(Options::window.zoom)});
|
||||
}
|
||||
@@ -297,7 +297,7 @@ auto checkInputs() -> bool {
|
||||
}
|
||||
|
||||
// Salir
|
||||
if (Input::get()->checkInput(Input::Action::EXIT, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Input::get()->checkAction(Input::Action::EXIT, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
quit();
|
||||
return true;
|
||||
}
|
||||
@@ -309,50 +309,50 @@ auto checkInputs() -> bool {
|
||||
}
|
||||
|
||||
// Reset
|
||||
if (Input::get()->checkInput(Input::Action::RESET, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Input::get()->checkAction(Input::Action::RESET, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
reset();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Audio
|
||||
if (Input::get()->checkInput(Input::Action::TOGGLE_AUDIO, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Input::get()->checkAction(Input::Action::TOGGLE_AUDIO, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
toggleAudio();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Autofire
|
||||
if (Input::get()->checkInput(Input::Action::TOGGLE_AUTO_FIRE, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Input::get()->checkAction(Input::Action::TOGGLE_AUTO_FIRE, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
toggleFireMode();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Idioma
|
||||
if (Input::get()->checkInput(Input::Action::CHANGE_LANG, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Input::get()->checkAction(Input::Action::CHANGE_LANG, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
changeLang();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Shaders
|
||||
if (Input::get()->checkInput(Input::Action::TOGGLE_VIDEO_SHADERS, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Input::get()->checkAction(Input::Action::TOGGLE_VIDEO_SHADERS, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
toggleShaders();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Integer Scale
|
||||
if (Input::get()->checkInput(Input::Action::TOGGLE_VIDEO_INTEGER_SCALE, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Input::get()->checkAction(Input::Action::TOGGLE_VIDEO_INTEGER_SCALE, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
toggleIntegerScale();
|
||||
return true;
|
||||
}
|
||||
|
||||
// VSync
|
||||
if (Input::get()->checkInput(Input::Action::TOGGLE_VIDEO_VSYNC, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Input::get()->checkAction(Input::Action::TOGGLE_VIDEO_VSYNC, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
toggleVSync();
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
// Debug info
|
||||
if (Input::get()->checkInput(Input::Action::SHOW_INFO, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
if (Input::get()->checkAction(Input::Action::SHOW_INFO, Input::DO_NOT_ALLOW_REPEAT, Input::Device::KEYBOARD)) {
|
||||
Screen::get()->toggleDebugInfo();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user