This commit is contained in:
2024-10-10 20:59:39 +02:00
parent d6c3c89872
commit 117b80bdfc
18 changed files with 197 additions and 197 deletions

View File

@@ -80,7 +80,7 @@ void Notify::update()
const float step = ((float)notifications[i].counter / notifications[i].travelDist);
const int alpha = 255 * step;
if (options.notification.posV == pos_top)
if (options.notification.pos_v == NotifyPosition::TOP)
{
notifications[i].rect.y++;
}
@@ -112,7 +112,7 @@ void Notify::update()
const float step = (notifications[i].counter / (float)notifications[i].travelDist);
const int alpha = 255 * (1 - step);
if (options.notification.posV == pos_top)
if (options.notification.pos_v == NotifyPosition::TOP)
{
notifications[i].rect.y--;
}
@@ -182,11 +182,11 @@ void Notify::showText(std::string text1, std::string text2, int icon)
// Posición horizontal
auto despH = 0;
if (options.notification.posH == pos_left)
if (options.notification.pos_h == NotifyPosition::LEFT)
{
despH = paddingOut;
}
else if (options.notification.posH == pos_middle)
else if (options.notification.pos_h == NotifyPosition::MIDDLE)
{
despH = ((param.game.width / 2) - (width / 2));
}
@@ -196,12 +196,12 @@ void Notify::showText(std::string text1, std::string text2, int icon)
}
// Posición vertical
const int despV = (options.notification.posV == pos_top) ? paddingOut : (param.game.height - height - paddingOut);
const int despV = (options.notification.pos_v == NotifyPosition::TOP) ? paddingOut : (param.game.height - height - paddingOut);
// Offset
const auto travelDist = height + paddingOut;
auto offset = 0;
if (options.notification.posV == pos_top)
if (options.notification.pos_v == NotifyPosition::TOP)
{
offset = (int)notifications.size() > 0 ? notifications.back().y + travelDist : despV;
}
@@ -221,7 +221,7 @@ void Notify::showText(std::string text1, std::string text2, int icon)
n.text1 = text1;
n.text2 = text2;
n.shape = shape;
auto yPos = offset + (options.notification.posV == pos_top ? -travelDist : travelDist);
auto yPos = offset + (options.notification.pos_v == NotifyPosition::TOP ? -travelDist : travelDist);
n.rect = {despH, yPos, width, height};
// Crea la textura