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:
1 parent
65ba55aa12
commit
dce9f4305a
2 files changed
+26
-13
No files matched your search
@@ -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.
|
||||
|
||||
+25
-12
@@ -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> &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> &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,15 +1587,18 @@ 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))
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user