merdes varies

This commit is contained in:
2025-08-08 21:06:28 +02:00
parent 98f34c0a09
commit 0fc83cf9c1
11 changed files with 34 additions and 26 deletions

View File

@@ -40,12 +40,14 @@ ServiceMenu::ServiceMenu()
void ServiceMenu::toggle() {
if (define_buttons_ && define_buttons_->isEnabled()) {
return; // No se puede mostrar u ocultar el menu de servicio si se estan definiendo los botones
return; // No se puede mostrar u ocultar el menu de servicio si se estan definiendo los botones
}
playBackSound();
enabled_ = !enabled_;
if (!enabled_) {
if (enabled_) {
Options::gamepad_manager.assignAndLinkGamepads();
} else {
reset();
}
}
@@ -546,8 +548,8 @@ void ServiceMenu::handleEvent(const SDL_Event &event) {
// Si DefineButtons está activo, que maneje todos los eventos
if (define_buttons_ && define_buttons_->isEnabled()) {
define_buttons_->checkEvents(event);
//return; // No procesar otros eventos mientras DefineButtons está activo
define_buttons_->handleEvents(event);
// return; // No procesar otros eventos mientras DefineButtons está activo
}
}
@@ -565,16 +567,16 @@ bool ServiceMenu::checkInput() {
using Action = Input::Action;
const std::vector<std::pair<Action, std::function<void()>>> actions = {
{ Action::UP, [this]() { setSelectorUp(); } },
{ Action::DOWN, [this]() { setSelectorDown(); } },
{ Action::RIGHT, [this]() { adjustOption(true); } },
{ Action::LEFT, [this]() { adjustOption(false); } },
{ Action::SM_SELECT, [this]() { selectOption(); } },
{ Action::SM_BACK, [this]() { moveBack(); } },
{Action::UP, [this]() { setSelectorUp(); }},
{Action::DOWN, [this]() { setSelectorDown(); }},
{Action::RIGHT, [this]() { adjustOption(true); }},
{Action::LEFT, [this]() { adjustOption(false); }},
{Action::SM_SELECT, [this]() { selectOption(); }},
{Action::SM_BACK, [this]() { moveBack(); }},
};
// Teclado
for (const auto& [action, func] : actions) {
for (const auto &[action, func] : actions) {
if (input->checkAction(action, Input::DO_NOT_ALLOW_REPEAT, Input::CHECK_KEYBOARD)) {
func();
return true;
@@ -583,7 +585,7 @@ bool ServiceMenu::checkInput() {
// Mandos
for (auto gamepad : input->getGamepads()) {
for (const auto& [action, func] : actions) {
for (const auto &[action, func] : actions) {
if (input->checkAction(action, Input::DO_NOT_ALLOW_REPEAT, Input::DO_NOT_CHECK_KEYBOARD, gamepad)) {
func();
return true;