[AutoRecorder] Add native to determine if recording.

This commit is contained in:
zaCade 2023-07-07 13:58:47 +02:00
parent 5e45af2f68
commit 5cca9ae651
2 changed files with 10 additions and 0 deletions

View File

@ -32,6 +32,8 @@ public Plugin myinfo =
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
CreateNative("IsDemoRecording", Native_IsDemoRecording);
CreateNative("GetDemoRecordingNumber", Native_GetDemoRecordingNumber);
CreateNative("GetDemoRecordingTick", Native_GetDemoRecordingTick);
@ -236,6 +238,11 @@ void StopRecord()
}
}
public int Native_IsDemoRecording(Handle hPlugin, int numParams)
{
return g_bIsRecording;
}
public int Native_GetDemoRecordingNumber(Handle hPlugin, int numParams)
{
return g_iRecordingNumber;

View File

@ -3,6 +3,8 @@
#endif
#define AutoRecorder_included
native bool IsDemoRecording();
native int GetDemoRecordingNumber();
native int GetDemoRecordingTick();
@ -20,6 +22,7 @@ public SharedPlugin __pl_AutoRecorder =
#if !defined REQUIRE_PLUGIN
public void __pl_AutoRecorder_SetNTVOptional()
{
MarkNativeAsOptional("IsDemoRecording");
MarkNativeAsOptional("GetDemoRecordingNumber");
MarkNativeAsOptional("GetDemoRecordingTick");
}