This commit is contained in:
2025-10-27 13:01:11 +01:00
parent 5d8811026d
commit cdb9bde6aa
23 changed files with 392 additions and 392 deletions

View File

@@ -54,8 +54,8 @@ void Notifier::update() {
for (auto& notification : notifications_) {
// Si la notificación anterior está "saliendo", no hagas nada
if (!notifications_.empty() && &notification != &notifications_.front()) {
const auto& PREVIOUS_NOTIFICATION = *(std::prev(&notification));
if (PREVIOUS_NOTIFICATION.state == NotificationStatus::RISING) {
const auto& previous_notification = *(std::prev(&notification));
if (previous_notification.state == NotificationStatus::RISING) {
break;
}
}
@@ -135,13 +135,13 @@ void Notifier::show(std::vector<std::string> texts, NotificationText text_is, Ui
}
// Inicializa variables
const int text_size = 6;
const auto PADDING_IN_H = text_size;
const auto PADDING_IN_V = text_size / 2;
const int TEXT_SIZE = 6;
const auto PADDING_IN_H = TEXT_SIZE;
const auto PADDING_IN_V = TEXT_SIZE / 2;
const int ICON_SPACE = icon >= 0 ? ICON_SIZE + PADDING_IN_H : 0;
text_is = ICON_SPACE > 0 ? NotificationText::LEFT : text_is;
const float WIDTH = Options::game.width - (PADDING_OUT * 2);
const float HEIGHT = (text_size * texts.size()) + (PADDING_IN_V * 2);
const float HEIGHT = (TEXT_SIZE * texts.size()) + (PADDING_IN_V * 2);
const auto SHAPE = NotificationShape::SQUARED;
// Posición horizontal
@@ -170,7 +170,7 @@ void Notifier::show(std::vector<std::string> texts, NotificationText text_is, Ui
// Offset
const auto TRAVEL_DIST = HEIGHT + PADDING_OUT;
const int TRAVEL_MOD = (Options::notifications.getVerticalPosition() == Options::NotificationPosition::TOP) ? 1 : -1;
const int OFFSET = !notifications_.empty() ? notifications_.back().y + TRAVEL_MOD * notifications_.back().travel_dist : DESP_V;
const int OFFSET = !notifications_.empty() ? notifications_.back().y + (TRAVEL_MOD * notifications_.back().travel_dist) : DESP_V;
// Crea la notificacion
Notification n;
@@ -229,10 +229,10 @@ void Notifier::show(std::vector<std::string> texts, NotificationText text_is, Ui
for (const auto& text : texts) {
switch (text_is) {
case NotificationText::LEFT:
text_->writeColored(PADDING_IN_H + ICON_SPACE, PADDING_IN_V + iterator * (text_size + 1), text, COLOR);
text_->writeColored(PADDING_IN_H + ICON_SPACE, PADDING_IN_V + (iterator * (TEXT_SIZE + 1)), text, COLOR);
break;
case NotificationText::CENTER:
text_->writeDX(TEXT_CENTER | TEXT_COLOR, WIDTH / 2, PADDING_IN_V + iterator * (text_size + 1), text, 1, COLOR);
text_->writeDX(TEXT_CENTER | TEXT_COLOR, WIDTH / 2, PADDING_IN_V + (iterator * (TEXT_SIZE + 1)), text, 1, COLOR);
break;
default:
break;