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); + } } }