commit de moure a un Linux a gastar eines de home

This commit is contained in:
2025-02-25 19:37:08 +01:00
parent c9da5135b2
commit 32c31a8cb6
28 changed files with 145 additions and 647 deletions

View File

@@ -198,20 +198,20 @@ void Notifier::show(std::vector<std::string> texts, int icon, const std::string
}
else if (options.notifications.getHorizontalPosition() == "CENTER")
{
desp_h = ((param.game.width / 2) - (width / 2));
desp_h = ((options.game.width / 2) - (width / 2));
}
else
{
desp_h = param.game.width - width - padding_out;
desp_h = options.game.width - width - padding_out;
}
// Posición vertical
const int desp_v = (param.notification.pos_v == NotifyPosition::TOP) ? padding_out : (param.game.height - height - padding_out);
const int desp_v = (options.notifications.getVerticalPosition() == "TOP") ? padding_out : (options.game.height - height - padding_out);
// Offset
const auto travel_dist = height + padding_out;
auto offset = 0;
if (param.notification.pos_v == NotifyPosition::TOP)
if (options.notifications.getVerticalPosition() == "TOP")
{
offset = !notifications_.empty() ? notifications_.back().y + travel_dist : desp_v;
}
@@ -229,7 +229,7 @@ void Notifier::show(std::vector<std::string> texts, int icon, const std::string
n.travel_dist = travel_dist;
n.texts = texts;
n.shape = shape;
auto y_pos = offset + (param.notification.pos_v == NotifyPosition::TOP ? -travel_dist : travel_dist);
int y_pos = offset + ((options.notifications.getVerticalPosition() == "TOP") ? -travel_dist : travel_dist);
n.rect = {desp_h, y_pos, width, height};
// Crea la textura
@@ -268,7 +268,7 @@ void Notifier::show(std::vector<std::string> texts, int icon, const std::string
{
auto sp = std::make_unique<Sprite>(icon_texture_, (SDL_Rect){0, 0, icon_size, icon_size});
sp->setPosition({padding_in_h, padding_in_v, icon_size, icon_size});
sp->setSpriteClip({icon_size * (icon % 10), icon_size * (icon / 10), icon_size, icon_size});
sp->setClip({icon_size * (icon % 10), icon_size * (icon / 10), icon_size, icon_size});
sp->render();
}