diff --git a/BeatLeaderInterop.cs b/BeatLeaderInterop.cs new file mode 100644 index 0000000..08bc6b7 --- /dev/null +++ b/BeatLeaderInterop.cs @@ -0,0 +1,31 @@ +using IPA.Loader; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace PlayFirst +{ + internal class BeatLeaderInterop + { + public static bool IsBeatLeaderReplay() + { + PluginMetadata BeatLeader = PluginManager.GetPluginFromId("BeatLeader"); + if (BeatLeader != null) + { + Type ReplayerLauncher = BeatLeader.Assembly.GetType("BeatLeader.Replayer.ReplayerLauncher"); + if (ReplayerLauncher == null) + return false; + + PropertyInfo IsStartedAsReplay = ReplayerLauncher.GetProperty("IsStartedAsReplay", BindingFlags.Static | BindingFlags.Public); + if (IsStartedAsReplay == null) + return false; + + return (bool)IsStartedAsReplay.GetValue(null); + } + return false; + } + } +} diff --git a/PlayFirst.csproj b/PlayFirst.csproj index 0101614..6eeeb31 100644 --- a/PlayFirst.csproj +++ b/PlayFirst.csproj @@ -104,6 +104,7 @@ + diff --git a/SubmitLater.cs b/SubmitLater.cs index 3902742..3110cd5 100644 --- a/SubmitLater.cs +++ b/SubmitLater.cs @@ -52,7 +52,10 @@ public void LateUpdate() if (audiocontroller.songTime >= pausetime) { paused_yet = true; - pausecontroller.Pause(); + if (!BeatLeaderInterop.IsBeatLeaderReplay()) + { + pausecontroller.Pause(); + } // Notes: PauseSong in SongController pauses map but isn't the whole "Pause" functionality // Doesn't bring up menu, continue button won't work either.