public static bool IsModLoaded(string modID) { if (modID.StartsWith("srml:")) { if (GuuCore.srmlBridge == null) { return(false); } string trueID = modID.Replace("srml:", ""); MethodInfo method = srmlLoaderBridge?.GetMethod("IsModLoaded", BindingFlags.NonPublic | BindingFlags.Static); object result = method?.Invoke(null, new object[] { trueID }); return(result != null && (bool)result); } if (modID.StartsWith("assem:")) { string trueID = modID.Replace("assem:", ""); return(IsAssemblyLoaded(trueID)); } return(MODS.ContainsKey(modID)); }
//+ INTERACTIONS /// <summary>Gets the mod context for the given mod ID. Or null if none if found</summary> public static ModContext GetModContext(string modID) => MODS.ContainsKey(modID) ? GetModContext(MODS[modID].Assembly) : null;