json: reordenades les cadenes de text

This commit is contained in:
2025-06-07 12:00:45 +02:00
parent d8ce5fb5ac
commit 1bd488e3e3
18 changed files with 355 additions and 338 deletions

View File

@@ -41,7 +41,7 @@ Scoreboard::Scoreboard()
text_scoreboard_(Resource::get()->getText("8bithud"))
{
// Inicializa variables
for (int i = 0; i < SCOREBOARD_MAX_PANELS; ++i)
for (int i = 0; i < [SCOREBOARD] MAX_PANELS; ++i)
{
name_[i].clear();
record_name_[i].clear();
@@ -51,9 +51,9 @@ Scoreboard::Scoreboard()
continue_counter_[i] = 0;
}
panel_[SCOREBOARD_LEFT_PANEL].mode = ScoreboardMode::SCORE;
panel_[SCOREBOARD_RIGHT_PANEL].mode = ScoreboardMode::SCORE;
panel_[SCOREBOARD_CENTER_PANEL].mode = ScoreboardMode::STAGE_INFO;
panel_[[SCOREBOARD] LEFT_PANEL].mode = ScoreboardMode::SCORE;
panel_[[SCOREBOARD] RIGHT_PANEL].mode = ScoreboardMode::SCORE;
panel_[[SCOREBOARD] CENTER_PANEL].mode = ScoreboardMode::STAGE_INFO;
// Recalcula las anclas de los elementos
recalculateAnchors();
@@ -159,7 +159,7 @@ void Scoreboard::fillPanelTextures()
auto temp = SDL_GetRenderTarget(renderer_);
// Genera el contenido de cada panel_
for (size_t i = 0; i < SCOREBOARD_MAX_PANELS; ++i)
for (size_t i = 0; i < [SCOREBOARD] MAX_PANELS; ++i)
{
// Cambia el destino del renderizador
SDL_SetRenderTarget(renderer_, panel_texture_[i]);
@@ -177,7 +177,7 @@ void Scoreboard::fillPanelTextures()
text_scoreboard_->writeCentered(slot4_2_.x, slot4_2_.y, updateScoreText(score_[i]));
// MULT
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y, lang::getText("SCOREBOARD_55"));
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y, lang::getText("[SCOREBOARD] 3"));
text_scoreboard_->writeCentered(slot4_4_.x, slot4_4_.y, "x" + std::to_string(mult_[i]).substr(0, 3));
break;
}
@@ -185,13 +185,13 @@ void Scoreboard::fillPanelTextures()
case ScoreboardMode::DEMO:
{
// DEMO MODE
text_scoreboard_->writeCentered(slot4_1_.x, slot4_1_.y + 4, lang::getText("SCOREBOARD_101"));
text_scoreboard_->writeCentered(slot4_1_.x, slot4_1_.y + 4, lang::getText("[SCOREBOARD] 6"));
// PRESS START TO PLAY
if (time_counter_ % 10 < 8)
{
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y - 2, lang::getText("SCOREBOARD_103"));
text_scoreboard_->writeCentered(slot4_4_.x, slot4_4_.y - 2, lang::getText("SCOREBOARD_104"));
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y - 2, lang::getText("[SCOREBOARD] 8"));
text_scoreboard_->writeCentered(slot4_4_.x, slot4_4_.y - 2, lang::getText("[SCOREBOARD] 9"));
}
break;
}
@@ -199,13 +199,13 @@ void Scoreboard::fillPanelTextures()
case ScoreboardMode::WAITING:
{
// GAME OVER
text_scoreboard_->writeCentered(slot4_1_.x, slot4_1_.y + 4, lang::getText("SCOREBOARD_102"));
text_scoreboard_->writeCentered(slot4_1_.x, slot4_1_.y + 4, lang::getText("[SCOREBOARD] 7"));
// PRESS START TO PLAY
if (time_counter_ % 10 < 8)
{
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y - 2, lang::getText("SCOREBOARD_103"));
text_scoreboard_->writeCentered(slot4_4_.x, slot4_4_.y - 2, lang::getText("SCOREBOARD_104"));
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y - 2, lang::getText("[SCOREBOARD] 8"));
text_scoreboard_->writeCentered(slot4_4_.x, slot4_4_.y - 2, lang::getText("[SCOREBOARD] 9"));
}
break;
}
@@ -213,13 +213,13 @@ void Scoreboard::fillPanelTextures()
case ScoreboardMode::GAME_OVER:
{
// GAME OVER
text_scoreboard_->writeCentered(slot4_1_.x, slot4_1_.y + 4, lang::getText("SCOREBOARD_102"));
text_scoreboard_->writeCentered(slot4_1_.x, slot4_1_.y + 4, lang::getText("[SCOREBOARD] 7"));
// PLEASE WAIT
if (time_counter_ % 10 < 8)
{
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y - 2, lang::getText("SCOREBOARD_114"));
text_scoreboard_->writeCentered(slot4_4_.x, slot4_4_.y - 2, lang::getText("SCOREBOARD_115"));
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y - 2, lang::getText("[SCOREBOARD] 12"));
text_scoreboard_->writeCentered(slot4_4_.x, slot4_4_.y - 2, lang::getText("[SCOREBOARD] 13"));
}
break;
}
@@ -227,7 +227,7 @@ void Scoreboard::fillPanelTextures()
case ScoreboardMode::STAGE_INFO:
{
// STAGE
text_scoreboard_->writeCentered(slot4_1_.x, slot4_1_.y, lang::getText("SCOREBOARD_57") + std::to_string(stage_));
text_scoreboard_->writeCentered(slot4_1_.x, slot4_1_.y, lang::getText("[SCOREBOARD] 5") + std::to_string(stage_));
// POWERMETER
power_meter_sprite_->setSpriteClip(0, 0, 40, 7);
@@ -236,7 +236,7 @@ void Scoreboard::fillPanelTextures()
power_meter_sprite_->render();
// HI-SCORE
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y, lang::getText("SCOREBOARD_56"));
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y, lang::getText("[SCOREBOARD] 4"));
const std::string name = hi_score_name_ == "" ? "" : hi_score_name_ + " - ";
text_scoreboard_->writeCentered(slot4_4_.x, slot4_4_.y, name + updateScoreText(hi_score_));
break;
@@ -249,7 +249,7 @@ void Scoreboard::fillPanelTextures()
text_scoreboard_->writeCentered(slot4_2_.x, slot4_2_.y, updateScoreText(score_[i]));
// CONTINUE
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y, lang::getText("SCOREBOARD_105"));
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y, lang::getText("[SCOREBOARD] 10"));
text_scoreboard_->writeCentered(slot4_4_.x, slot4_4_.y, std::to_string(continue_counter_[i]));
break;
}
@@ -262,7 +262,7 @@ void Scoreboard::fillPanelTextures()
// ENTER NAME
{
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y, lang::getText("SCOREBOARD_106"));
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y, lang::getText("[SCOREBOARD] 11"));
SDL_FRect rect = {enter_name_pos_.x, enter_name_pos_.y, 5.0f, 7.0f};
// Recorre todos los slots de letras del nombre
@@ -298,7 +298,7 @@ void Scoreboard::fillPanelTextures()
text_scoreboard_->writeCentered(slot4_2_.x, slot4_2_.y, updateScoreText(score_[i]));
// NAME
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y, lang::getText("SCOREBOARD_106"));
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y, lang::getText("[SCOREBOARD] 11"));
/* TEXTO CENTRADO */
// text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_4_.x, slot4_4_.y, record_name_[i], 1, getColorLikeKnightRider(name_colors_, loop_counter_ / 5));
@@ -309,12 +309,12 @@ void Scoreboard::fillPanelTextures()
case ScoreboardMode::GAME_COMPLETED:
{
// GAME OVER
text_scoreboard_->writeCentered(slot4_1_.x, slot4_1_.y + 4, lang::getText("SCOREBOARD_102"));
text_scoreboard_->writeCentered(slot4_1_.x, slot4_1_.y + 4, lang::getText("[SCOREBOARD] 7"));
// SCORE
if (time_counter_ % 10 < 8)
{
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y - 2, lang::getText("SCOREBOARD_120"));
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y - 2, lang::getText("[SCOREBOARD] 14"));
text_scoreboard_->writeCentered(slot4_4_.x, slot4_4_.y - 2, updateScoreText(score_[i]));
}
}
@@ -342,7 +342,7 @@ void Scoreboard::fillBackgroundTexture()
SDL_RenderClear(renderer_);
// Copia las texturas de los paneles
for (int i = 0; i < SCOREBOARD_MAX_PANELS; ++i)
for (int i = 0; i < [SCOREBOARD] MAX_PANELS; ++i)
{
SDL_RenderTexture(renderer_, panel_texture_[i], nullptr, &panel_[i].pos);
}
@@ -358,8 +358,8 @@ void Scoreboard::fillBackgroundTexture()
void Scoreboard::recalculateAnchors()
{
// Recalcula la posición y el tamaño de los paneles
const float panel_width = (float)rect_.w / (float)SCOREBOARD_MAX_PANELS;
for (int i = 0; i < SCOREBOARD_MAX_PANELS; ++i)
const float panel_width = (float)rect_.w / (float)[SCOREBOARD] MAX_PANELS;
for (int i = 0; i < [SCOREBOARD] MAX_PANELS; ++i)
{
panel_[i].pos.x = roundf(panel_width * i);
panel_[i].pos.y = 0;
@@ -427,7 +427,7 @@ void Scoreboard::createPanelTextures()
panel_texture_.clear();
// Crea las texturas para cada panel_
for (int i = 0; i < SCOREBOARD_MAX_PANELS; ++i)
for (int i = 0; i < [SCOREBOARD] MAX_PANELS; ++i)
{
SDL_Texture *tex = SDL_CreateTexture(renderer_, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, panel_[i].pos.w, panel_[i].pos.h);
SDL_SetTextureBlendMode(tex, SDL_BLENDMODE_BLEND);