forked from jaildesigner-jailgames/jaildoctors_dilemma
Nou engine de notificacions
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint32
|
||||
#include <string> // for string, basic_string
|
||||
#include "screen.h" // for ScreenFilter
|
||||
#include "utils.h" // for Color, Palette
|
||||
#include <SDL2/SDL_stdinc.h> // for Uint32
|
||||
#include <string> // for string, basic_string
|
||||
#include "screen.h" // for ScreenFilter
|
||||
#include "utils.h" // for Color, Palette
|
||||
|
||||
// Secciones del programa
|
||||
enum class Section
|
||||
@@ -36,11 +36,15 @@ enum class NotificationPosition
|
||||
UPPER_LEFT,
|
||||
UPPER_CENTER,
|
||||
UPPER_RIGHT,
|
||||
MIDDLE_LEFT,
|
||||
MIDDLE_RIGHT,
|
||||
BOTTOM_LEFT,
|
||||
BOTTOM_CENTER,
|
||||
BOTTOM_RIGHT
|
||||
BOTTOM_RIGHT,
|
||||
TOP,
|
||||
BOTTOM,
|
||||
LEFT,
|
||||
RIGHT,
|
||||
CENTER,
|
||||
UNKNOWN,
|
||||
};
|
||||
|
||||
// Tipos de control de teclado
|
||||
@@ -72,7 +76,7 @@ constexpr NotificationPosition DEFAULT_NOTIFICATION_POSITION = NotificationPosit
|
||||
constexpr bool DEFAULT_NOTIFICATION_SOUND = true; // Sonido de las notificaciones por defecto
|
||||
const Color DEFAULT_NOTIFICATION_COLOR = Color(48, 48, 48); // Color de las notificaciones por defecto
|
||||
constexpr bool DEFAULT_CONSOLE = false; // Consola desactivada por defecto
|
||||
constexpr std::string DEFAULT_VERSION = "1.09"; // Versión por defecto
|
||||
constexpr const char *DEFAULT_VERSION = "1.09"; // Versión por defecto
|
||||
|
||||
// Estructura para las opciones de las notificaciones
|
||||
struct OptionsNotification
|
||||
@@ -94,43 +98,42 @@ struct OptionsNotification
|
||||
color(c) {}
|
||||
|
||||
// Método que devuelve la posición horizontal
|
||||
std::string getHorizontalPosition() const
|
||||
NotificationPosition getHorizontalPosition() const
|
||||
{
|
||||
switch (pos)
|
||||
{
|
||||
case NotificationPosition::UPPER_LEFT:
|
||||
case NotificationPosition::MIDDLE_LEFT:
|
||||
case NotificationPosition::BOTTOM_LEFT:
|
||||
return "LEFT";
|
||||
return NotificationPosition::LEFT;
|
||||
case NotificationPosition::UPPER_CENTER:
|
||||
case NotificationPosition::BOTTOM_CENTER:
|
||||
return "CENTER";
|
||||
return NotificationPosition::CENTER;
|
||||
case NotificationPosition::UPPER_RIGHT:
|
||||
case NotificationPosition::MIDDLE_RIGHT:
|
||||
case NotificationPosition::BOTTOM_RIGHT:
|
||||
return "RIGHT";
|
||||
return NotificationPosition::RIGHT;
|
||||
default:
|
||||
return NotificationPosition::UNKNOWN;
|
||||
}
|
||||
return "UNKNOWN";
|
||||
return NotificationPosition::UNKNOWN;
|
||||
}
|
||||
|
||||
// Método que devuelve la posición vertical
|
||||
std::string getVerticalPosition() const
|
||||
NotificationPosition getVerticalPosition() const
|
||||
{
|
||||
switch (pos)
|
||||
{
|
||||
case NotificationPosition::UPPER_LEFT:
|
||||
case NotificationPosition::UPPER_CENTER:
|
||||
case NotificationPosition::UPPER_RIGHT:
|
||||
return "UPPER";
|
||||
case NotificationPosition::MIDDLE_LEFT:
|
||||
case NotificationPosition::MIDDLE_RIGHT:
|
||||
return "MIDDLE";
|
||||
return NotificationPosition::TOP;
|
||||
case NotificationPosition::BOTTOM_LEFT:
|
||||
case NotificationPosition::BOTTOM_CENTER:
|
||||
case NotificationPosition::BOTTOM_RIGHT:
|
||||
return "BOTTOM";
|
||||
return NotificationPosition::BOTTOM;
|
||||
default:
|
||||
return NotificationPosition::UNKNOWN;
|
||||
}
|
||||
return "UNKNOWN";
|
||||
return NotificationPosition::UNKNOWN;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user