corregit: flags estatics en hiscore_tale.cpp
This commit is contained in:
@@ -368,17 +368,14 @@ void HiScoreTable::glowEntryNames() {
|
|||||||
|
|
||||||
// Gestiona el contador
|
// Gestiona el contador
|
||||||
void HiScoreTable::updateCounter() {
|
void HiScoreTable::updateCounter() {
|
||||||
static bool background_changed = false;
|
if (elapsed_time_ >= BACKGROUND_CHANGE_S && !hiscore_flags_.background_changed) {
|
||||||
static bool fade_activated = false;
|
|
||||||
|
|
||||||
if (elapsed_time_ >= BACKGROUND_CHANGE_S && !background_changed) {
|
|
||||||
background_->setColor(background_fade_color_.DARKEN());
|
background_->setColor(background_fade_color_.DARKEN());
|
||||||
background_->setAlpha(96);
|
background_->setAlpha(96);
|
||||||
background_changed = true;
|
hiscore_flags_.background_changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elapsed_time_ >= COUNTER_END_S && !fade_activated) {
|
if (elapsed_time_ >= COUNTER_END_S && !hiscore_flags_.fade_activated) {
|
||||||
fade_->activate();
|
fade_->activate();
|
||||||
fade_activated = true;
|
hiscore_flags_.fade_activated = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -56,6 +56,17 @@ class HiScoreTable {
|
|||||||
Color background_fade_color_; // Color de atenuación del fondo
|
Color background_fade_color_; // Color de atenuación del fondo
|
||||||
std::vector<Color> entry_colors_; // Colores para destacar las entradas en la tabla
|
std::vector<Color> entry_colors_; // Colores para destacar las entradas en la tabla
|
||||||
|
|
||||||
|
// --- Flags para eventos basados en tiempo ---
|
||||||
|
struct HiScoreFlags {
|
||||||
|
bool background_changed = false;
|
||||||
|
bool fade_activated = false;
|
||||||
|
|
||||||
|
void reset() {
|
||||||
|
background_changed = false;
|
||||||
|
fade_activated = false;
|
||||||
|
}
|
||||||
|
} hiscore_flags_;
|
||||||
|
|
||||||
// --- Métodos internos ---
|
// --- Métodos internos ---
|
||||||
void update(float delta_time); // Actualiza las variables
|
void update(float delta_time); // Actualiza las variables
|
||||||
void render(); // Pinta en pantalla
|
void render(); // Pinta en pantalla
|
||||||
|
|||||||
Reference in New Issue
Block a user