diff --git a/source/jail_engine/notify.cpp b/source/jail_engine/notify.cpp index fe0b1cb..376ed07 100644 --- a/source/jail_engine/notify.cpp +++ b/source/jail_engine/notify.cpp @@ -49,8 +49,29 @@ void Notify::update() { for (int i = 0; i < (int)notifications.size(); ++i) { + // Si la notificación anterior está "saliendo", no hagas nada + if (i > 0) + { + if (notifications[i - 1].state == ns_rising) + { + break; + } + } + notifications[i].counter++; + // Hace sonar la notificación en el primer frame + if (notifications[i].counter == 1) + { + if (options->notifications.sound) + { + if (notifications[i].state == ns_rising) + { // Reproduce el sonido de la notificación + JA_PlaySound(sound); + } + } + } + // Comprueba los estados if (notifications[i].state == ns_rising) { @@ -245,14 +266,11 @@ void Notify::showText(std::string text1, std::string text2, int icon) // Crea el sprite de la notificación n.sprite = new Sprite(n.rect, n.texture, renderer); + // Deja la notificación invisible + n.texture->setAlpha(0); + // Añade la notificación a la lista notifications.push_back(n); - - // Reproduce el sonido de la notificación - if (options->notifications.sound) - { - JA_PlaySound(sound); - } } // Indica si hay notificaciones activas diff --git a/source/title.cpp b/source/title.cpp index 7a1b5e2..10c600b 100644 --- a/source/title.cpp +++ b/source/title.cpp @@ -153,10 +153,6 @@ void Title::checkEvents() showCheevos = !showCheevos; break; - case SDL_SCANCODE_Z: - initMarquee(); - break; - default: break; }