Las notificaciones simultaneas aparecen de forma escalonada
This commit is contained in:
@@ -49,8 +49,29 @@ void Notify::update()
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < (int)notifications.size(); ++i)
|
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++;
|
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
|
// Comprueba los estados
|
||||||
if (notifications[i].state == ns_rising)
|
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
|
// Crea el sprite de la notificación
|
||||||
n.sprite = new Sprite(n.rect, n.texture, renderer);
|
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
|
// Añade la notificación a la lista
|
||||||
notifications.push_back(n);
|
notifications.push_back(n);
|
||||||
|
|
||||||
// Reproduce el sonido de la notificación
|
|
||||||
if (options->notifications.sound)
|
|
||||||
{
|
|
||||||
JA_PlaySound(sound);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Indica si hay notificaciones activas
|
// Indica si hay notificaciones activas
|
||||||
|
|||||||
@@ -153,10 +153,6 @@ void Title::checkEvents()
|
|||||||
showCheevos = !showCheevos;
|
showCheevos = !showCheevos;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_Z:
|
|
||||||
initMarquee();
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user