diff --git a/MiraAPI/Patches/Roles/GameStartupPatch.cs b/MiraAPI/Patches/Roles/GameStartupPatch.cs index 6ab234d..9f88bdd 100644 --- a/MiraAPI/Patches/Roles/GameStartupPatch.cs +++ b/MiraAPI/Patches/Roles/GameStartupPatch.cs @@ -23,7 +23,11 @@ public static class GameStartupPatch _runOnce = true; - if (MiraPluginManager.Instance.QueuedRoleRegistrations.Count <= 0) return; + if (MiraPluginManager.Instance.QueuedRoleRegistrations.Count <= 0) + { + return; + } + foreach (var queue in MiraPluginManager.Instance.QueuedRoleRegistrations) { CustomRoleManager.RegisterRoleTypes(queue.Value, queue.Key); diff --git a/MiraAPI/Roles/CustomRoleManager.cs b/MiraAPI/Roles/CustomRoleManager.cs index 20d61d0..5e1c3ae 100644 --- a/MiraAPI/Roles/CustomRoleManager.cs +++ b/MiraAPI/Roles/CustomRoleManager.cs @@ -35,6 +35,16 @@ public static class CustomRoleManager public static readonly LoadableAsset ImpostorIntroSound = CustomRoleUtils.GetIntroSound(RoleTypes.Impostor)!; + /// + /// Gets the list of custom roles as RoleBehaviour objects. + /// + public static IReadOnlyList CustomRoleBehaviours { get; private set; } = []; + + /// + /// Gets the list of custom roles as ICustomRole objects. + /// + public static IReadOnlyList CustomMiraRoles { get; private set; } = []; + internal static readonly Dictionary CustomRoles = []; internal static readonly Dictionary RoleIds = []; @@ -53,6 +63,9 @@ public static class CustomRoleManager { RoleManager.GhostRoles.Add(role.Role); } + + CustomRoleBehaviours = CustomRoles.Values.ToList(); + CustomMiraRoles = CustomRoles.Values.OfType().ToList(); } internal static void RegisterRoleTypes(List roles, MiraPluginInfo pluginInfo)