- canvi en el ordre dels overlays

- les notificacions ja segueixen al resto de elements (no tenen una posició fixa)
This commit is contained in:
2026-04-12 15:52:37 +02:00
parent db3cb06c7a
commit 6644eedfcd
4 changed files with 35 additions and 12 deletions

View File

@@ -114,9 +114,10 @@ void RenderInfo::render() const {
// Fuente: preferir la de la consola si está disponible
auto text_obj = (Console::get() != nullptr) ? Console::get()->getText() : Screen::get()->getText();
// Posición Y: debajo de la consola + offset animado propio
// Posición Y: debajo de la consola + notificaciones + offset animado propio
const int CONSOLE_Y = (Console::get() != nullptr) ? Console::get()->getVisibleHeight() : 0;
const int Y = CONSOLE_Y + static_cast<int>(y_);
const int NOTIFIER_Y = (Notifier::get() != nullptr) ? Notifier::get()->getVisibleHeight() : 0;
const int Y = CONSOLE_Y + NOTIFIER_Y + static_cast<int>(y_);
text_obj->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG,
static_cast<int>(Options::game.width / 2),
@@ -126,17 +127,15 @@ void RenderInfo::render() const {
MSG_COLOR);
}
// Activa o desactiva el overlay y notifica a Notifier del cambio de offset
// Activa o desactiva el overlay
void RenderInfo::toggle() {
switch (status_) {
case Status::HIDDEN:
status_ = Status::RISING;
Screen::get()->updateZoomFactor();
if (Notifier::get() != nullptr) { Notifier::get()->addYOffset(HEIGHT); }
break;
case Status::ACTIVE:
status_ = Status::VANISHING;
if (Notifier::get() != nullptr) { Notifier::get()->removeYOffset(HEIGHT); }
break;
default:
break;