MVP completed: Hook into Playlistmanager to post updates to beatleader maps owned by the user
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using BeatSaberPlaylistsLib.Types;
|
||||
using UnityEngine;
|
||||
using IPALogger = IPA.Logging.Logger;
|
||||
|
||||
namespace Setlist
|
||||
{
|
||||
/// <summary>
|
||||
/// Persists for <see cref="UnityEngine.MonoBehaviour.StartCoroutine"/> (e.g. BeatLeader POST after UI adds a song).
|
||||
/// </summary>
|
||||
internal sealed class SetlistSyncHost : MonoBehaviour
|
||||
{
|
||||
internal static SetlistSyncHost Instance { get; private set; }
|
||||
|
||||
internal static void Ensure()
|
||||
{
|
||||
if (Instance != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var go = new GameObject("Setlist.SyncHost");
|
||||
UnityEngine.Object.DontDestroyOnLoad(go);
|
||||
go.hideFlags = HideFlags.HideAndDontSave;
|
||||
Instance = go.AddComponent<SetlistSyncHost>();
|
||||
}
|
||||
|
||||
internal void StartPostOwnedBeatLeaderPlaylist(IPlaylist playlist, IPALogger log)
|
||||
{
|
||||
StartCoroutine(BeatLeaderPlaylistSync.CoPostOwnedPlaylistToBeatLeader(playlist, log));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user