fix: al voler definir els botons dels mandos sense tindre cap mando conectat, petava tot

This commit is contained in:
2024-07-26 11:58:03 +02:00
parent 1632441c31
commit 5e5d7f5f27
3 changed files with 14 additions and 11 deletions

View File

@@ -125,11 +125,14 @@ void DefineButtons::checkInput()
// Habilita el objeto
void DefineButtons::enable(int index)
{
if (input->getNumControllers() > 0)
{
enabled = true;
indexController = index;
indexButton = 0;
}
}
// Comprueba si está habilitado
bool DefineButtons::isEnabled()

View File

@@ -215,7 +215,7 @@ void Scoreboard::fillBackgroundTexture()
else if (mode[SCOREBOARD_LEFT_SIDE] == SCOREBOARD_MODE_DEMO)
{
if (counter % 2 == 0)
if (counter % 10 < 8)
{
textScoreBoard->writeCentered(offsetScoreP1.x, offsetScoreP1.y, "Mode");
textScoreBoard->writeCentered(offsetMultP1Label.x, offsetMultP1Label.y, "Demo");
@@ -235,7 +235,7 @@ void Scoreboard::fillBackgroundTexture()
else if (mode[SCOREBOARD_RIGHT_SIDE] == SCOREBOARD_MODE_DEMO)
{
if (counter % 2 == 0)
if (counter % 10 < 8)
{
textScoreBoard->writeCentered(offsetScoreP2.x, offsetScoreP2.y, "Mode");
textScoreBoard->writeCentered(offsetMultP2Label.x, offsetMultP2Label.y, "Demo");

View File

@@ -19,7 +19,7 @@ enum scoreboard_modes_e
#define SCOREBOARD_LEFT_SIDE 0
#define SCOREBOARD_RIGHT_SIDE 1
#define SCOREBOARD_TICK_SPEED 1000
#define SCOREBOARD_TICK_SPEED 100
// Clase Scoreboard
class Scoreboard