mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-14 03:02:22 +01:00
a lot
fix 1.11 replication, fix some ltm specific stuff, start on shadow stones, fix some events not having foundations, fix s4-s6 gadgets, fix clear inventory on some versions
This commit is contained in:
32
Project Reboot 3.0/TimerManager.h
Normal file
32
Project Reboot 3.0/TimerManager.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include "EngineTypes.h"
|
||||
#include "Function.h"
|
||||
#include "DelegateCombinations.h"
|
||||
|
||||
DECLARE_DELEGATE(FTimerDelegate);
|
||||
|
||||
struct FTimerUnifiedDelegate
|
||||
{
|
||||
/** Holds the delegate to call. */
|
||||
FTimerDelegate FuncDelegate;
|
||||
/** Holds the dynamic delegate to call. */
|
||||
FTimerDynamicDelegate FuncDynDelegate;
|
||||
/** Holds the TFunction callback to call. */
|
||||
TFunction<void(void)> FuncCallback;
|
||||
|
||||
FTimerUnifiedDelegate() {};
|
||||
FTimerUnifiedDelegate(FTimerDelegate const& D) : FuncDelegate(D) {};
|
||||
};
|
||||
|
||||
class FTimerManager // : public FNoncopyable
|
||||
{
|
||||
public:
|
||||
FORCEINLINE void SetTimer(FTimerHandle& InOutHandle, FTimerDelegate const& InDelegate, float InRate, bool InbLoop, float InFirstDelay = -1.f)
|
||||
{
|
||||
static void (*InternalSetTimerOriginal)(__int64 TimerManager, FTimerHandle& InOutHandle, FTimerUnifiedDelegate&& InDelegate, float InRate, bool InbLoop, float InFirstDelay) =
|
||||
decltype(InternalSetTimerOriginal)(Addresses::SetTimer);
|
||||
|
||||
InternalSetTimerOriginal(__int64(this), InOutHandle, FTimerUnifiedDelegate(InDelegate), InRate, InbLoop, InFirstDelay);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user