Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions BeatLeaderInterop.cs
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
1 change: 1 addition & 0 deletions PlayFirst.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="BeatLeaderInterop.cs" />
<Compile Include="SubmitLater.cs" />
<Compile Include="CancelButtonViewController.cs" />
<Compile Include="CancelButtonView.cs" />
Expand Down
5 changes: 4 additions & 1 deletion SubmitLater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down