From c34b4d8944ba3d20946f172b819b4fcdce084ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Valor=20Mart=C3=ADnez?= Date: Mon, 9 Oct 2023 22:56:43 +0200 Subject: [PATCH] =?UTF-8?q?La=20secci=C3=B3n=20del=20t=C3=ADtulo=20se=20te?= =?UTF-8?q?rmina=20al=20pasar=20cierto=20tiempo,=20no=20cuando=20se=20term?= =?UTF-8?q?ina=20la=20marquesina?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/title.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/source/title.cpp b/source/title.cpp index c6272f0..3b45acd 100644 --- a/source/title.cpp +++ b/source/title.cpp @@ -119,6 +119,7 @@ void Title::checkEvents() case SDL_SCANCODE_3: runEnterID(); + counter = 0; cheevos->reload(); fillTexture(); createCheevosTexture(); @@ -150,9 +151,14 @@ void Title::checkInput() if (input->checkInput(input_exit, REPEAT_FALSE)) { if (showCheevos) + { hideCheevosList(); + counter = 0; + } else + { section->name = SECTION_PROG_QUIT; + } } else if (input->checkInput(input_toggle_border, REPEAT_FALSE)) @@ -216,6 +222,12 @@ void Title::updateMarquee() } } } + + // Comprueba si ha terminado la marquesina y la reinicia + if (letters[letters.size() - 1].x < -10) + { // Inicializa la marquesina + initMarquee(); + } } // Dibuja la marquesina @@ -261,19 +273,14 @@ void Title::update() // Actualiza las notificaciones screen->updateNotifier(); - // Comprueba si ha terminado la marquesina y acaba con el titulo - if (letters[letters.size() - 1].x < -10) + // Si el contador alcanza cierto valor, termina la seccion + if (counter == 2200) { if (!showCheevos) { section->name = SECTION_PROG_CREDITS; section->subsection = 0; } - else - { - // Inicializa la marquesina - initMarquee(); - } } } }