mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
26 lines
571 B
C#
26 lines
571 B
C#
using HarmonyLib;
|
|
using MiraAPI.Roles;
|
|
|
|
namespace MiraAPI.Patches.Roles;
|
|
|
|
[HarmonyPatch(typeof(MainMenuManager))]
|
|
public static class GameStartupPatch
|
|
{
|
|
private static bool _runOnce;
|
|
|
|
/// <summary>
|
|
/// This is used for registering roles when the game opens, might be a janky solution, but it works
|
|
/// </summary>
|
|
[HarmonyPostfix]
|
|
[HarmonyPatch("Start")]
|
|
public static void StartPostfix()
|
|
{
|
|
if (_runOnce)
|
|
{
|
|
return;
|
|
}
|
|
|
|
_runOnce = true;
|
|
CustomRoleManager.RegisterInRoleManager();
|
|
}
|
|
} |