1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 00:37:15 +01:00

Expose the signals for the loading stages.

This commit is contained in:
Sandu Liviu Catalin 2017-02-22 18:08:33 +02:00
parent c5b509dcb3
commit 76759118cc
2 changed files with 45 additions and 0 deletions

View File

@ -817,6 +817,30 @@ public:
return m_CircularLocks;
}
/* --------------------------------------------------------------------------------------------
* Retrieve the preload signal if not complete.
*/
LightObj & GetPreLoadEvent()
{
return m_LockPreLoadSignal ? NullLightObj() : mOnPreLoad.second;
}
/* --------------------------------------------------------------------------------------------
* Retrieve the postload signal if not complete.
*/
LightObj & GetPostLoadEvent()
{
return m_LockPostLoadSignal ? NullLightObj() : mOnPostLoad.second;
}
/* --------------------------------------------------------------------------------------------
* Retrieve the unload signal if not complete.
*/
LightObj & GetUnloadEvent()
{
return m_LockUnloadSignal ? NullLightObj() : mOnUnload.second;
}
/* --------------------------------------------------------------------------------------------
* See if certain circular locks are enabled.
*/

View File

@ -50,6 +50,24 @@ static SQInteger SqGetEvents(HSQUIRRELVM vm)
return 1;
}
// ------------------------------------------------------------------------------------------------
static LightObj & SqGetPreLoadEvent()
{
return Core::Get().GetPreLoadEvent();
}
// ------------------------------------------------------------------------------------------------
static LightObj & SqGetPostLoadEvent()
{
return Core::Get().GetPostLoadEvent();
}
// ------------------------------------------------------------------------------------------------
static LightObj & SqGetUnloadEvent()
{
return Core::Get().GetUnloadEvent();
}
// ------------------------------------------------------------------------------------------------
static bool SqGetReloadStatus()
{
@ -304,6 +322,9 @@ void Register_Core(HSQUIRRELVM vm)
.Func(_SC("DestroyObject"), &DelObject)
.Func(_SC("DestroyPickup"), &DelPickup)
.Func(_SC("DestroyVehicle"), &DelVehicle)
.Func(_SC("OnPreLoad"), &SqGetPreLoadEvent)
.Func(_SC("OnPostLoad"), &SqGetPostLoadEvent)
.Func(_SC("OnUnload"), &SqGetUnloadEvent)
.SquirrelFunc(_SC("LoadScript"), &SqLoadScript)
.SquirrelFunc(_SC("On"), &SqGetEvents)
);