mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 11:39:45 +00:00
expose custom roles in CustomRoleManager.cs
This commit is contained in:
1 parent
bf652b68c3
commit
ab54c44434
2 files changed
+18
-1
No files matched your search
@@ -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);
|
||||
|
||||
@@ -35,6 +35,16 @@ public static class CustomRoleManager
|
||||
public static readonly LoadableAsset<AudioClip> ImpostorIntroSound =
|
||||
CustomRoleUtils.GetIntroSound(RoleTypes.Impostor)!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of custom roles as RoleBehaviour objects.
|
||||
/// </summary>
|
||||
public static IReadOnlyList<RoleBehaviour> CustomRoleBehaviours { get; private set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of custom roles as ICustomRole objects.
|
||||
/// </summary>
|
||||
public static IReadOnlyList<ICustomRole> CustomMiraRoles { get; private set; } = [];
|
||||
|
||||
internal static readonly Dictionary<ushort, RoleBehaviour> CustomRoles = [];
|
||||
internal static readonly Dictionary<Type, ushort> RoleIds = [];
|
||||
|
||||
@@ -53,6 +63,9 @@ public static class CustomRoleManager
|
||||
{
|
||||
RoleManager.GhostRoles.Add(role.Role);
|
||||
}
|
||||
|
||||
CustomRoleBehaviours = CustomRoles.Values.ToList();
|
||||
CustomMiraRoles = CustomRoles.Values.OfType<ICustomRole>().ToList();
|
||||
}
|
||||
|
||||
internal static void RegisterRoleTypes(List<Type> roles, MiraPluginInfo pluginInfo)
|
||||
|
||||
Reference in new issue
Block a user