forked from jaildesigner-jailgames/jaildoctors_dilemma
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user