using System.Collections.Generic; using HarmonyLib; using JetBrains.Annotations; namespace Webserver.Permissions { [HarmonyPatch(typeof(AdminTools))] [HarmonyPatch("registerModules")] public static class RegisterModules { [UsedImplicitly] private static void Postfix (AdminTools __instance, Dictionary ___modules) { if (AdminApiTokens.Instance != null) { return; } AdminApiTokens apiTokens = new AdminApiTokens (__instance); AdminWebModules webModules = new AdminWebModules (__instance); AdminWebUsers webUsers = new AdminWebUsers (__instance); ___modules.Add (apiTokens.SectionTypeName, apiTokens); ___modules.Add (webModules.SectionTypeName, webModules); ___modules.Add (webUsers.SectionTypeName, webUsers); } } }