mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
proper submerged compat
This commit is contained in:
1 parent
a0d3afc7c7
commit
5e2ca191ba
3 files changed
+21
-1
No files matched your search
@@ -16,6 +16,7 @@ namespace MiraAPI;
|
||||
[BepInAutoPlugin("mira.api", "MiraAPI")]
|
||||
[BepInProcess("Among Us.exe")]
|
||||
[BepInDependency(ReactorPlugin.Id)]
|
||||
[BepInDependency(ModCompatibility.SubmergedId, BepInDependency.DependencyFlags.SoftDependency)]
|
||||
[ReactorModFlags(ModFlags.RequireOnAllClients)]
|
||||
public partial class MiraApiPlugin : BasePlugin
|
||||
{
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
using BepInEx.Unity.IL2CPP;
|
||||
|
||||
namespace MiraAPI;
|
||||
|
||||
/// <summary>
|
||||
/// Mod compatibility tools.
|
||||
/// </summary>
|
||||
public static class ModCompatibility
|
||||
{
|
||||
/// <summary>
|
||||
/// The ID for the Submerged mod.
|
||||
/// </summary>
|
||||
public const string SubmergedId = "Submerged";
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the Submerged mod is loaded.
|
||||
/// </summary>
|
||||
public static bool SubmergedLoaded => IL2CPPChainloader.Instance.Plugins.TryGetValue(SubmergedId, out _);
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public static class EjectionPatches
|
||||
{
|
||||
yield return AccessTools.Method(typeof(ExileController), nameof(ExileController.WrapUp));
|
||||
yield return AccessTools.Method(typeof(AirshipExileController), nameof(AirshipExileController.WrapUpAndSpawn));
|
||||
if (AccessTools.TypeByName("Submerged.ExileCutscene.SubmergedExileController") is { } type)
|
||||
if (ModCompatibility.SubmergedLoaded && AccessTools.TypeByName("Submerged.ExileCutscene.SubmergedExileController") is { } type)
|
||||
{
|
||||
yield return AccessTools.Method(type, "WrapUpAndSpawn");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user