r5sdk/r5dev/public/iframetask.h
Kawe Mazidjatari 6764b5e56e Implement frame tasks
Run all Cbuf_Execute calls in the main thread. This should fix every problem related to (but not only):
* Connecting to server while RUI dialogue is still open.
* Connecting to server while in an active game.
* Running 'weapon_reparse'.
2022-08-19 21:33:31 +02:00

24 lines
456 B
C++

#ifndef TIER0_IFRAMETASK_H
#define TIER0_IFRAMETASK_H
struct DelayedCall_s
{
int m_nDelayedFrames;
std::function<void()> m_rFunctor;
DelayedCall_s(int frames, std::function<void()> functor)
{
m_nDelayedFrames = frames;
m_rFunctor = functor;
}
};
abstract_class IFrameTask
{
public:
virtual ~IFrameTask() {}
virtual void RunFrame() = 0;
virtual bool IsFinished() const = 0;
};
#endif // TIER0_IFRAMETASK_H