Merge branch 'dev' into feat-addressables-2

This commit is contained in:
XtraCube committed 2025-03-30 20:25:39 -04:00
commit 9e6524817a
4 files changed
+23 -1

No files matched your search

+1
View File
@@ -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
{
+19
View File
@@ -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 _);
}
+1 -1
View File
@@ -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");
}
+2
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using Il2CppInterop.Runtime.Attributes;
using Reactor.Utilities.Attributes;
using UnityEngine;
@@ -19,6 +20,7 @@ public class PlayerVoteData(nint cppPtr) : MonoBehaviour(cppPtr)
/// <summary>
/// Gets the list of votes the owner has.
/// </summary>
[HideFromIl2Cpp]
public List<CustomVote> Votes { get; private set; } = [];
/// <summary>