Public static MethodInfo combatExtendedHasAmmoMethod = Compatibility.GetMethod("CombatExtended.CE_Utility", "HasAmmo") MethodInfo GetConsistentMethod(string modPackageId, string typeColonMethodName, Type correctMethodTypes, bool logError = false)Įxamples public static bool combatExtendedActive = Compatibility.IsModActive("batextended") If the specified mod and method both exist and the specified method is consistent, returns the MethodInfo of the specified method otherwise returns null. MethodInfo GetConsistentMethod(string modPackageId, string className, string methodName, Type correctMethodTypes, bool logError = false)Ĭhecks whether a mod is active, and if so gets the specified method and runs IsMethodConsistent on it. The detailed error message will also give the name of the mod at fault if modPackageIdForLog is specified.Ī bool representing whether or not the specified method's types are all the same. May print a detailed error message to RimWorld's console if logError is set to true. MethodInfo GetMethod(string typeColonMethodName, Type parameters = null, Type generics = null)īool IsMethodConsistent(MethodInfo methodInfo, Type correctMethodTypes, bool logError = false, string modPackageIdForLog = null)Ĭhecks all of the specified method's types in order to make sure the method hasn't been changed from your current implementation of it. The MethodInfo of the specified method if found, otherwise null. Uses Harmony's AccessTools to get the reflection information for the specified method. MethodInfo GetMethod(string className, string methodName, Type parameters = null, Type generics = null) Goes through all installed mods checking for a mod with the specified PackageID and returns that mod's name if found.Ī string representing the name of the mod with the specified PackageID, or null if no mod with the specified PackageID is active. Goes through all installed mods checking for a mod with the specified PackageID and returns whether the mod is active.Ī bool representing whether or not a mod with the specified PackageID is active. Methods bool IsModActive(string modPackageId) All methods can be accessed via the CompatUtils.Compatibility class: using CompatUtils īool combatExtendedActive = Compatibility.IsModActive("batextended")
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |