From dce9f4305a94d0abee53249153c99eb02b176496 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Sat, 28 Jun 2025 11:18:11 +0200 Subject: [PATCH] =?UTF-8?q?EnterName:=20amb=20el=20mando=20soles=20tries?= =?UTF-8?q?=20lletra,=20amb=20el=20primer=20bot=C3=B3=20la=20fixa,=20quals?= =?UTF-8?q?evol=20altre=20boto=20la=20borra,=20pa=20saltar=20el=20nom=20qu?= =?UTF-8?q?an=20ja=20ets=C3=A0=20posat=20val=20qualsevol=20bot=C3=B3=20inc?= =?UTF-8?q?los=20el=20start?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/enter_name.cpp | 2 +- source/game.cpp | 37 +++++++++++++++++++++++++------------ 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/source/enter_name.cpp b/source/enter_name.cpp index f6de6db..b212275 100644 --- a/source/enter_name.cpp +++ b/source/enter_name.cpp @@ -84,7 +84,7 @@ void EnterName::decPosition() { // Si position_ es 0, aseguramos que no vaya a ser negativo y limpiamos el carácter actual. position_ = 0; - character_index_[position_] = 0; + //character_index_[position_] = 0; } // Si position_ es menor que NAME_LENGHT, aseguramos que el overflow esté desactivado. diff --git a/source/game.cpp b/source/game.cpp index 78566de..02d8789 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -28,7 +28,7 @@ #include "scoreboard.h" // Para Scoreboard, ScoreboardMode, SCOREB... #include "screen.h" // Para Screen #include "section.h" // Para Name, name, AttractMode, Options -#include "ui/service_menu.h" // Para ServiceMenu +#include "ui/service_menu.h" // Para ServiceMenu #include "smart_sprite.h" // Para SmartSprite #include "stage.h" // Para number, get, Stage, total_power #include "tabe.h" // Para Tabe, TabeState @@ -1439,7 +1439,7 @@ void Game::handleFireInput(const std::shared_ptr &player, BulletType bul // Establece un tiempo de espera para el próximo disparo. const int cooldown = player->isPowerUp() ? 5 : Options::settings.autofire ? 10 - : 7; + : 7; player->setFireCooldown(cooldown); } } @@ -1550,9 +1550,7 @@ void Game::handlePlayerContinue(const std::shared_ptr &player) void Game::handleNameInput(const std::shared_ptr &player) { const auto controllerIndex = player->getController(); - if (input_->checkInput(InputAction::FIRE_LEFT, INPUT_DO_NOT_ALLOW_REPEAT, Options::controllers[controllerIndex].type, Options::controllers[controllerIndex].index) || - input_->checkInput(InputAction::FIRE_CENTER, INPUT_DO_NOT_ALLOW_REPEAT, Options::controllers[controllerIndex].type, Options::controllers[controllerIndex].index) || - input_->checkInput(InputAction::FIRE_RIGHT, INPUT_DO_NOT_ALLOW_REPEAT, Options::controllers[controllerIndex].type, Options::controllers[controllerIndex].index)) + if (input_->checkInput(InputAction::FIRE_LEFT, INPUT_DO_NOT_ALLOW_REPEAT, Options::controllers[controllerIndex].type, Options::controllers[controllerIndex].index)) { if (player->isShowingName()) { @@ -1569,6 +1567,18 @@ void Game::handleNameInput(const std::shared_ptr &player) player->setInput(InputAction::RIGHT); } } + else if (input_->checkInput(InputAction::FIRE_CENTER, INPUT_DO_NOT_ALLOW_REPEAT, Options::controllers[controllerIndex].type, Options::controllers[controllerIndex].index) || + input_->checkInput(InputAction::FIRE_RIGHT, INPUT_DO_NOT_ALLOW_REPEAT, Options::controllers[controllerIndex].type, Options::controllers[controllerIndex].index)) + { + if (player->isShowingName()) + { + player->setPlayingState(PlayerState::CONTINUE); + } + else + { + player->setInput(InputAction::LEFT); + } + } else if (input_->checkInput(InputAction::UP, INPUT_DO_NOT_ALLOW_REPEAT, Options::controllers[controllerIndex].type, Options::controllers[controllerIndex].index)) { player->setInput(InputAction::UP); @@ -1577,15 +1587,18 @@ void Game::handleNameInput(const std::shared_ptr &player) { player->setInput(InputAction::DOWN); } - else if (input_->checkInput(InputAction::LEFT, INPUT_DO_NOT_ALLOW_REPEAT, Options::controllers[controllerIndex].type, Options::controllers[controllerIndex].index)) - { - player->setInput(InputAction::LEFT); - } else if (input_->checkInput(InputAction::START, INPUT_DO_NOT_ALLOW_REPEAT, Options::controllers[controllerIndex].type, Options::controllers[controllerIndex].index)) { - player->setInput(InputAction::START); - addScoreToScoreBoard(player); - player->setPlayingState(PlayerState::SHOWING_NAME); + if (player->isShowingName()) + { + player->setPlayingState(PlayerState::CONTINUE); + } + else + { + player->setInput(InputAction::START); + addScoreToScoreBoard(player); + player->setPlayingState(PlayerState::SHOWING_NAME); + } } }