eliminades referencies antigues
This commit is contained in:
@@ -45,19 +45,6 @@ Cheevos::~Cheevos() {
|
||||
// Inicializa los logros
|
||||
void Cheevos::init() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
cheevos_list_.clear();
|
||||
auto* loc = Locale::get();
|
||||
cheevos_list_.emplace_back(Achievement{.id = 1, .caption = loc->get("achievements.c1"), .description = loc->get("achievements.d1"), .icon = 2});
|
||||
cheevos_list_.emplace_back(Achievement{.id = 2, .caption = loc->get("achievements.c2"), .description = loc->get("achievements.d2"), .icon = 2});
|
||||
cheevos_list_.emplace_back(Achievement{.id = 3, .caption = loc->get("achievements.c3"), .description = loc->get("achievements.d3"), .icon = 2});
|
||||
cheevos_list_.emplace_back(Achievement{.id = 4, .caption = loc->get("achievements.c4"), .description = loc->get("achievements.d4"), .icon = 2});
|
||||
cheevos_list_.emplace_back(Achievement{.id = 5, .caption = loc->get("achievements.c5"), .description = loc->get("achievements.d5"), .icon = 2});
|
||||
cheevos_list_.emplace_back(Achievement{.id = 6, .caption = loc->get("achievements.c6"), .description = loc->get("achievements.d6"), .icon = 2});
|
||||
cheevos_list_.emplace_back(Achievement{.id = 7, .caption = loc->get("achievements.c7"), .description = loc->get("achievements.d7"), .icon = 2});
|
||||
cheevos_list_.emplace_back(Achievement{.id = 8, .caption = loc->get("achievements.c8"), .description = loc->get("achievements.d8"), .icon = 2});
|
||||
cheevos_list_.emplace_back(Achievement{.id = 9, .caption = loc->get("achievements.c9"), .description = loc->get("achievements.d9"), .icon = 2});
|
||||
cheevos_list_.emplace_back(Achievement{.id = 10, .caption = loc->get("achievements.c10"), .description = loc->get("achievements.d10"), .icon = 2});
|
||||
cheevos_list_.emplace_back(Achievement{.id = 11, .caption = loc->get("achievements.c11"), .description = loc->get("achievements.d11"), .icon = 2});
|
||||
cheevos_list_.emplace_back(Achievement{.id = 12, .caption = loc->get("achievements.c12"), .description = loc->get("achievements.d12"), .icon = 2});
|
||||
}
|
||||
|
||||
// Busca un logro por id y devuelve el indice
|
||||
|
||||
@@ -31,7 +31,6 @@ void Scoreboard::render() {
|
||||
|
||||
// Actualiza las variables del objeto
|
||||
void Scoreboard::update(float delta_time) {
|
||||
updateItemsColor(delta_time);
|
||||
fillTexture();
|
||||
|
||||
if (!is_paused_) {
|
||||
@@ -64,17 +63,6 @@ void Scoreboard::setPaused(bool value) {
|
||||
}
|
||||
}
|
||||
|
||||
// Actualiza el color de la cantidad de items recogidos
|
||||
void Scoreboard::updateItemsColor(float delta_time) {
|
||||
if (!data_->jail_is_open) { return; }
|
||||
|
||||
items_color_timer_ += delta_time;
|
||||
if (items_color_timer_ >= ITEMS_COLOR_BLINK_DURATION * 2.0F) {
|
||||
items_color_timer_ = 0.0F;
|
||||
}
|
||||
items_color_ = (items_color_timer_ < ITEMS_COLOR_BLINK_DURATION) ? VALUE_COLOR : 6;
|
||||
}
|
||||
|
||||
// Devuelve la cantidad de minutos de juego transcurridos
|
||||
auto Scoreboard::getMinutes() -> int {
|
||||
return getTime().minutes;
|
||||
@@ -114,7 +102,7 @@ void Scoreboard::fillTexture() {
|
||||
x += text->length(SEP);
|
||||
text->writeColored(x, LINE1_Y, ITEMS_LABEL, LABEL_COLOR);
|
||||
x += text->length(ITEMS_LABEL);
|
||||
text->writeColoredMono(x, LINE1_Y, ITEMS_STR, items_color_, MONO_W);
|
||||
text->writeColoredMono(x, LINE1_Y, ITEMS_STR, VALUE_COLOR, MONO_W);
|
||||
x += text->lengthMono(ITEMS_STR, MONO_W);
|
||||
text->writeColored(x, LINE1_Y, SEP, LABEL_COLOR);
|
||||
x += text->length(SEP);
|
||||
|
||||
@@ -18,7 +18,6 @@ class Scoreboard {
|
||||
bool music{true}; // Indica si ha de sonar la música durante el juego
|
||||
Uint8 color{0}; // Color para escribir el texto del marcador
|
||||
Uint32 ini_clock{0}; // Tiempo inicial para calcular el tiempo transcurrido
|
||||
bool jail_is_open{false}; // Indica si se puede entrar a la Jail
|
||||
};
|
||||
|
||||
// Métodos públicos
|
||||
@@ -39,8 +38,6 @@ class Scoreboard {
|
||||
};
|
||||
|
||||
// Constantes de tiempo
|
||||
static constexpr float ITEMS_COLOR_BLINK_DURATION = 0.333F;
|
||||
|
||||
// Posición de los elementos (2 líneas centradas verticalmente en surface de 24px)
|
||||
static constexpr int LINE1_Y = 5;
|
||||
static constexpr int LINE2_Y = 13;
|
||||
@@ -51,7 +48,6 @@ class Scoreboard {
|
||||
|
||||
// Métodos privados
|
||||
auto getTime() -> ClockData;
|
||||
void updateItemsColor(float delta_time);
|
||||
void fillTexture();
|
||||
|
||||
// Objetos y punteros
|
||||
@@ -63,7 +59,5 @@ class Scoreboard {
|
||||
Uint32 paused_time_{0};
|
||||
Uint32 paused_time_elapsed_{0};
|
||||
ClockData clock_{};
|
||||
Uint8 items_color_{VALUE_COLOR};
|
||||
SDL_FRect surface_dest_{};
|
||||
float items_color_timer_{0.0F};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user