|
@@ -12,7 +12,7 @@
|
|
|
#pragma newdecls required
|
|
|
#include <round_end_music>
|
|
|
|
|
|
-#define PLUGIN_VERSION "0.5.0"
|
|
|
+#define PLUGIN_VERSION "0.6.0"
|
|
|
public Plugin myinfo = {
|
|
|
name = "[CSRD] Round End Music",
|
|
|
author = "nosoop",
|
|
@@ -39,7 +39,7 @@ public void OnPluginStart() {
|
|
|
g_ActiveSongs = new ArrayList();
|
|
|
g_PlayedSongs = new ArrayList();
|
|
|
|
|
|
- g_RequestSongForward = CreateForward(ET_Ignore);
|
|
|
+ g_RequestSongForward = CreateGlobalForward("OnRoundEndSongsRequested", ET_Ignore);
|
|
|
|
|
|
g_OnREMPlayedForward = CreateGlobalForward("OnRoundEndMusicWillPlay", ET_Event, Param_Cell);
|
|
|
g_OnREMPostPlayedForward = CreateGlobalForward("OnRoundEndMusicPlayed", ET_Ignore,
|
|
@@ -290,23 +290,11 @@ float GetBonusRoundTime() {
|
|
|
public APLRes AskPluginLoad2(Handle self, bool late, char[] error, int err_max) {
|
|
|
RegPluginLibrary("round-end-music");
|
|
|
|
|
|
- CreateNative("REM_RegisterSource", Native_RegisterSource);
|
|
|
CreateNative("REM_AddSong", Native_AddSong);
|
|
|
CreateNative("REM_GetActiveSongCount", Native_GetActiveSongCount);
|
|
|
CreateNative("REM_SongWasRecentlyPlayed", Native_SongWasRecentlyPlayed);
|
|
|
}
|
|
|
|
|
|
-public int Native_RegisterSource(Handle hPlugin, int nArgs) {
|
|
|
- Function callback = GetNativeFunction(1);
|
|
|
-
|
|
|
- // preemptive removal because it could be forwarded multiple times?
|
|
|
- for (int i = 0; i < GetForwardFunctionCount(g_RequestSongForward); i++) {
|
|
|
- RemoveFromForward(g_RequestSongForward, hPlugin, callback);
|
|
|
- }
|
|
|
- AddToForward(g_RequestSongForward, hPlugin, callback);
|
|
|
- return 1;
|
|
|
-}
|
|
|
-
|
|
|
public int Native_AddSong(Handle hPlugin, int nArgs) {
|
|
|
if (g_bQueueLocked) {
|
|
|
ThrowNativeError(1, "Queue is currently locked -- are you calling REM_AddSong outside "
|