fix: container:setInterval in menu screen

This commit is contained in:
MihailRis 2025-11-09 22:27:37 +03:00
parent 7fc3703ad2
commit 50d520e747

View File

@ -2,6 +2,8 @@
#include "graphics/core/DrawContext.hpp"
#include "graphics/core/Batch2D.hpp"
#include "window/Window.hpp"
#include "../GUI.hpp"
#include <algorithm>
#include <utility>
@ -87,9 +89,12 @@ void Container::act(float delta) {
}
}
}
GUI& gui = this->gui;
intervalEvents.erase(std::remove_if(
intervalEvents.begin(), intervalEvents.end(),
[](const IntervalEvent& event) {
[&gui](const IntervalEvent& event) {
// TODO: make it interval-based
gui.getWindow().setShouldRefresh();
return event.repeat == 0;
}
), intervalEvents.end());