mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
oops, ordering issues
This commit is contained in:
1 parent
26b70ae65e
commit
0a855c602d
2 files changed
+17
-2
No files matched your search
@@ -34,9 +34,9 @@ public class MiraPluginManager
|
||||
var id = MetadataHelper.GetMetadata(plugin.GetType()).GUID;
|
||||
var info = new MiraPluginInfo(id, plugin as IMiraPlugin, IL2CPPChainloader.Instance.Plugins[id]);
|
||||
|
||||
RegisterRoleAttribute(assembly, info);
|
||||
RegisterOptionsGroups(assembly, info);
|
||||
RegisterOptionsAttributes(assembly, info);
|
||||
RegisterRoleAttribute(assembly, info);
|
||||
RegisterButtonAttribute(assembly);
|
||||
|
||||
RegisteredPlugins.Add(assembly, info);
|
||||
@@ -103,7 +103,21 @@ public class MiraPluginManager
|
||||
|
||||
var role = CustomRoleManager.RegisterRole(type, attribute.RoleId);
|
||||
|
||||
pluginInfo.CustomRoles.Add((ushort)role.Role, role);
|
||||
try
|
||||
{
|
||||
pluginInfo.CustomRoles.Add((ushort)role.Role, role);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger<MiraApiPlugin>.Error("Failed to register role: " + type.Name);
|
||||
|
||||
foreach (var (k, v) in pluginInfo.CustomRoles)
|
||||
{
|
||||
Logger<MiraApiPlugin>.Error($"{k}: {v}");
|
||||
}
|
||||
|
||||
Logger<MiraApiPlugin>.Error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ public static class CustomRoleManager
|
||||
{
|
||||
while (CustomRoles.ContainsKey(requestedId) || requestedId <= Enum.GetNames<RoleTypes>().Length)
|
||||
{
|
||||
Logger<MiraApiPlugin>.Error(requestedId + ", " + (requestedId+1));
|
||||
requestedId++;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user