EnterName: amb el mando soles tries lletra, amb el primer botó la fixa, qualsevol altre boto la borra, pa saltar el nom quan ja etsà posat val qualsevol botó inclos el start
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -1550,9 +1550,7 @@ void Game::handlePlayerContinue(const std::shared_ptr<Player> &player)
|
||||
void Game::handleNameInput(const std::shared_ptr<Player> &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)
|
||||
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,16 +1587,19 @@ void Game::handleNameInput(const std::shared_ptr<Player> &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))
|
||||
{
|
||||
if (player->isShowingName())
|
||||
{
|
||||
player->setPlayingState(PlayerState::CONTINUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
player->setInput(InputAction::START);
|
||||
addScoreToScoreBoard(player);
|
||||
player->setPlayingState(PlayerState::SHOWING_NAME);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Inicializa las variables para el modo DEMO
|
||||
|
||||
Reference in New Issue
Block a user