eliminades les opcions de configuracio de posicio de les notificacions

This commit is contained in:
2025-10-27 13:24:43 +01:00
parent cdb9bde6aa
commit aacb14149f
4 changed files with 22 additions and 91 deletions

View File

@@ -62,7 +62,7 @@ void Notifier::update() {
switch (notification.state) {
case NotificationStatus::RISING: {
const int DIRECTION = (Options::notifications.getVerticalPosition() == Options::NotificationPosition::TOP) ? 1 : -1;
const int DIRECTION = 1;
notification.rect.y += DIRECTION;
if (notification.rect.y == notification.y) {
@@ -80,7 +80,7 @@ void Notifier::update() {
}
case NotificationStatus::VANISHING: {
const int DIRECTION = (Options::notifications.getVerticalPosition() == Options::NotificationPosition::TOP) ? -1 : 1;
const int DIRECTION = -1;
notification.rect.y += DIRECTION;
if (notification.rect.y == notification.y - notification.travel_dist) {
@@ -145,31 +145,15 @@ void Notifier::show(std::vector<std::string> texts, NotificationText text_is, Ui
const auto SHAPE = NotificationShape::SQUARED;
// Posición horizontal
float desp_h = 0;
switch (Options::notifications.getHorizontalPosition()) {
case Options::NotificationPosition::LEFT:
desp_h = PADDING_OUT;
break;
case Options::NotificationPosition::CENTER:
desp_h = ((Options::game.width / 2) - (WIDTH / 2));
break;
case Options::NotificationPosition::RIGHT:
desp_h = Options::game.width - WIDTH - PADDING_OUT;
break;
default:
desp_h = 0;
break;
}
float desp_h = ((Options::game.width / 2) - (WIDTH / 2));
;
// Posición vertical
const int DESP_V = (Options::notifications.getVerticalPosition() == Options::NotificationPosition::TOP) ? PADDING_OUT : Options::game.height - HEIGHT - PADDING_OUT;
const int DESP_V = PADDING_OUT;
// Offset
const auto TRAVEL_DIST = HEIGHT + PADDING_OUT;
const int TRAVEL_MOD = (Options::notifications.getVerticalPosition() == Options::NotificationPosition::TOP) ? 1 : -1;
const int TRAVEL_MOD = 1;
const int OFFSET = !notifications_.empty() ? notifications_.back().y + (TRAVEL_MOD * notifications_.back().travel_dist) : DESP_V;
// Crea la notificacion
@@ -183,7 +167,7 @@ void Notifier::show(std::vector<std::string> texts, NotificationText text_is, Ui
n.texts = texts;
n.shape = SHAPE;
n.display_duration = display_duration;
const float Y_POS = OFFSET + ((Options::notifications.getVerticalPosition() == Options::NotificationPosition::TOP) ? -TRAVEL_DIST : TRAVEL_DIST);
const float Y_POS = OFFSET + -TRAVEL_DIST;
n.rect = {desp_h, Y_POS, WIDTH, HEIGHT};
// Crea la textura