Completado el ciclo para pedir el ID online. Añadido sonido a las notificaciones. Agregado control de versión del fichero de configuración

This commit is contained in:
2022-11-23 16:59:40 +01:00
parent 706ad6f9c0
commit a8b467290f
14 changed files with 95 additions and 130 deletions

View File

@@ -4,7 +4,7 @@
#include <iostream>
// Constructor
Notify::Notify(SDL_Renderer *renderer, std::string bitmapFile, std::string textFile)
Notify::Notify(SDL_Renderer *renderer, std::string bitmapFile, std::string textFile, std::string soundFile)
{
// Inicializa variables
this->renderer = renderer;
@@ -14,6 +14,7 @@ Notify::Notify(SDL_Renderer *renderer, std::string bitmapFile, std::string textF
// Crea objetos
texture = new Texture(renderer, bitmapFile);
text = new Text(textFile, texture, renderer);
sound = JA_LoadSound(soundFile.c_str());
}
// Destructor
@@ -22,6 +23,7 @@ Notify::~Notify()
// Libera la memoria de los objetos
delete texture;
delete text;
JA_DeleteSound(sound);
for (auto notification : notifications)
{
@@ -143,6 +145,9 @@ void Notify::showText(std::string text)
// Añade la notificación a la lista
notifications.push_back(n);
// Reproduce el sonido de la notificación
JA_PlaySound(sound);
}
// Indica si hay notificaciones activas