public static Harmony SetInstance(string name) { var currentMod = SRMod.GetCurrentMod(); currentMod.CreateHarmonyInstance(name); return(currentMod.HarmonyInstance); }
public static object CallIMCMethod(string modid, string methodName, params object[] args) { try { var currentMod = SRMod.GetCurrentMod(); var mod = SRModLoader.GetMod(modid); if (mod == null) { throw new Exception($"Non-Existent modid: '{modid}'"); } if (!TryGetIMCInfo(mod, methodName, out var info)) { throw new Exception($"Non-Existent IMC method '{methodName}' for mod '{modid}'"); } CallingMod = currentMod?.ModInfo.Id ?? "srml"; return(info.Invoke(args)); } finally { CallingMod = null; } }
public static Harmony GetInstance() { return(SRMod.GetCurrentMod().HarmonyInstance); }
/// <summary> /// Gets the current mods config path /// </summary> /// <returns>The config path</returns> public static String GetMyConfigPath() { return(GetConfigPath(SRMod.GetCurrentMod())); }
static void RegisterIntermodMethod(string imcmethodName, IntermodCommunicationInfo info) { RegisterIntermodMethod(SRMod.GetCurrentMod(), imcmethodName, info); }