timer fixes: timers managed by engine can run in the background. Closes #180

This commit is contained in:
John McCardle 2026-01-06 20:13:51 -05:00
commit b0b17f4633
4 changed files with 57 additions and 22 deletions

View file

@ -4,9 +4,9 @@
#include "McRFPy_API.h"
#include "GameEngine.h"
Timer::Timer(PyObject* _target, int _interval, int now, bool _once, bool _start)
Timer::Timer(PyObject* _target, int _interval, int now, bool _once, bool _start, const std::string& _name)
: callback(std::make_shared<PyCallable>(_target)), interval(_interval), last_ran(now),
paused(false), pause_start_time(0), total_paused_time(0), once(_once), stopped(!_start)
paused(false), pause_start_time(0), total_paused_time(0), once(_once), stopped(!_start), name(_name)
{}
Timer::Timer()