Corregido bug en el calculo del color del marcador

This commit is contained in:
2022-11-08 19:32:28 +01:00
parent 977e134172
commit db56185be2
4 changed files with 10 additions and 12 deletions

View File

@@ -500,15 +500,13 @@ void Game::renderBlackScreen()
void Game::setScoreBoardColor()
{
// Obtiene el color del borde
const color_t c = room->getBorderColor();
const color_t colorBorder = room->getBorderColor();
// Si el color es negro lo cambia a blanco
const color_t cBlack = stringToColor(options->palette, "black");
board.color = colorAreEqual(c, cBlack) ? stringToColor(options->palette, "white") : c;
const bool isBlack = colorAreEqual(colorBorder, stringToColor(options->palette, "black"));
const bool isBrightBlack = colorAreEqual(colorBorder, stringToColor(options->palette, "bright_black"));
// Si el color es negro brillante lo cambia a blanco
const color_t cBrightBlack = stringToColor(options->palette, "bright_black");
board.color = colorAreEqual(c, cBrightBlack) ? stringToColor(options->palette, "white") : c;
// Si el color del borde es negro o negro brillante cambia el texto del marcador a blanco
board.color = isBlack || isBrightBlack? stringToColor(options->palette, "white") : colorBorder;
}
// Comprueba si ha finalizado el juego

View File

@@ -77,7 +77,7 @@ void ScoreBoard::render()
}
// Escribe los textos
const std::string timeTxt = std::to_string((clock.minutes % 60) / 10) + std::to_string(clock.minutes % 10) + clock.separator + std::to_string((clock.seconds % 60) / 10) + std::to_string(clock.seconds % 10);
const std::string timeTxt = std::to_string((clock.minutes % 100) / 10) + std::to_string(clock.minutes % 10) + clock.separator + std::to_string((clock.seconds % 60) / 10) + std::to_string(clock.seconds % 10);
const std::string itemsTxt = std::to_string(board->items / 100) + std::to_string((board->items % 100) / 10) + std::to_string(board->items % 10);
this->text->writeColored(BLOCK, line1, "Items collected ", board->color);
this->text->writeColored(17 * BLOCK, line1, itemsTxt, itemsColor);