define_buttons: modificada logica de final per a poder mostrar la animació d'eixida

This commit is contained in:
2025-08-08 17:32:30 +02:00
parent a191a296f8
commit 3b07b2e130
4 changed files with 64 additions and 28 deletions

View File

@@ -86,15 +86,9 @@ void ServiceMenu::update() {
if (define_buttons_) {
define_buttons_->update();
// Si DefineButtons ha terminado, deshabilitarlo
if (define_buttons_->isEnabled() && define_buttons_->isFinished()) {
// Pequeño delay antes de cerrar
static size_t finish_delay = 0;
finish_delay++;
if (finish_delay > DEFINE_BUTTONS_FINISH_DELAY_FRAMES) {
define_buttons_->disable();
finish_delay = 0;
}
// Si DefineButtons ha terminado y está listo para cerrar completamente
if (define_buttons_->isEnabled() && define_buttons_->isReadyToClose()) {
define_buttons_->disable();
}
}
}

View File

@@ -34,7 +34,6 @@ class ServiceMenu {
static constexpr size_t MIN_WIDTH = 240;
static constexpr size_t MIN_GAP_OPTION_VALUE = 30;
static constexpr size_t SETTINGS_GROUP_SIZE = 6;
static constexpr size_t DEFINE_BUTTONS_FINISH_DELAY_FRAMES = 60 * 3; // 3 segundo a 60 FPS
// --- Métodos de singleton ---
static void init();