Les notificacions ara accepten un vector de cadenes en lloc de una o dos cadenes

This commit is contained in:
2024-11-03 18:12:46 +01:00
parent 69a92cba66
commit f29eb2f411
6 changed files with 61 additions and 75 deletions

View File

@@ -35,8 +35,7 @@ private:
{
std::shared_ptr<Texture> texture;
std::shared_ptr<Sprite> sprite;
std::string text1;
std::string text2;
std::vector<std::string> texts;
int counter;
NotificationStatus status;
NotificationShape shape;
@@ -47,7 +46,7 @@ private:
// Constructor
explicit Notification()
: texture(nullptr), sprite(nullptr), text1(""), text2(""), counter(0), status(NotificationStatus::RISING),
: texture(nullptr), sprite(nullptr), texts(), counter(0), status(NotificationStatus::RISING),
shape(NotificationShape::SQUARED), rect{0, 0, 0, 0}, y(0), travel_dist(0), code("") {}
};
@@ -95,15 +94,8 @@ public:
// Actualiza el estado de las notificaiones
void update();
/**
* @brief Muestra una notificación de texto por pantalla.
*
* @param text1 Primer texto opcional para mostrar (valor predeterminado: cadena vacía).
* @param text2 Segundo texto opcional para mostrar (valor predeterminado: cadena vacía).
* @param icon Icono opcional para mostrar (valor predeterminado: -1).
* @param code Permite asignar un código a la notificación (valor predeterminado: cadena vacía).
*/
void showText(std::string text1 = std::string(), std::string text2 = std::string(), int icon = -1, const std::string &code = std::string());
// Muestra una notificación de texto por pantalla
void showText(std::vector<std::string> texts, int icon = -1, const std::string &code = std::string());
// Indica si hay notificaciones activas
bool isActive();