fix: faltava passar el nom dels jugadors al marcador

This commit is contained in:
2024-08-14 14:09:28 +02:00
parent 6a9d0d1b2c
commit 5c7bb842ec
2 changed files with 25 additions and 14 deletions

View File

@@ -20,6 +20,7 @@ Scoreboard::Scoreboard(SDL_Renderer *renderer, Screen *screen, Asset *asset, Lan
stage = 1;
for (int i = 0; i< SCOREBOARD_MAX_PANELS; ++i)
{
name[i] = "";
score[i] = 0;
mult[i] = 0;
continueCounter[i] = 0;
@@ -137,6 +138,12 @@ void Scoreboard::render()
SDL_RenderCopy(renderer, background, nullptr, &rect);
}
// Establece el valor de la variable
void Scoreboard::setName(int panel, std::string name)
{
this->name[panel] = name;
}
// Establece el valor de la variable
void Scoreboard::setScore(int panel, int score)
{
@@ -224,7 +231,7 @@ void Scoreboard::fillPanelTextures()
{
case SCOREBOARD_MODE_SCORE:
// SCORE
textScoreBoard->writeCentered(slot4_1.x, slot4_1.y, lang->getText(53));
textScoreBoard->writeCentered(slot4_1.x, slot4_1.y, name[i]);
textScoreBoard->writeCentered(slot4_2.x, slot4_2.y, updateScoreText(score[i]));
// MULT
@@ -267,7 +274,7 @@ void Scoreboard::fillPanelTextures()
case SCOREBOARD_MODE_CONTINUE:
// SCORE
textScoreBoard->writeCentered(slot4_1.x, slot4_1.y, lang->getText(53));
textScoreBoard->writeCentered(slot4_1.x, slot4_1.y, name[i]);
textScoreBoard->writeCentered(slot4_2.x, slot4_2.y, updateScoreText(score[i]));
// CONTINUE