Quick ability to set the countdown timer length.

This commit is contained in:
Zed A. Shaw 2025-04-23 01:04:00 -04:00
parent d4d8c780a4
commit 8a30fafabb
4 changed files with 21 additions and 6 deletions

View file

@ -16,7 +16,9 @@
using std::string, std::vector;
GUI::GUI(SFMLBackend &backend) : sfml(backend) {
GUI::GUI(SFMLBackend &backend, int timer_seconds) :
sfml(backend), $timer_seconds(timer_seconds)
{
using namespace guecs;
$gui.position(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
@ -44,7 +46,7 @@ GUI::GUI(SFMLBackend &backend) : sfml(backend) {
auto log = $gui.entity("log");
auto& rect = $gui.get<Rectangle>(log);
rect.color = {255,255,255,255};
$gui.set<Effect>(log, {1000.0, "build_status"});
$gui.set<Effect>(log, {(float)$timer_seconds, "build_status"});
auto clock = $gui.entity("clock");
$gui.set<Label>(clock, {L"00:00:00", 110});