public static bool DetectConfig(Mod mod) { if (ModFeaturesHelpers.GetConfigFilePathProp(mod) == null) { return(false); } if (ModFeaturesHelpers.GetConfigFileLoadMethod(mod) == null) { return(false); } return(true); }
/*public static void SetConfigRelativePath( Mod mod, string path ) { * if( !ExtendedModManager.ConfigMods.ContainsKey( mod.Name ) ) { * throw new HamstarException( "Not a recognized configurable mod." ); * } * * FieldInfo configPathField = mod.GetType().GetField( "ConfigFileRelativePath", BindingFlags.Static | BindingFlags.Public ); * configPathField.SetValue( null, path ); * }*/ public static void ReloadConfigFromFile(Mod mod) { var self = ModHelpersMod.Instance.ModFeaturesHelpers; if (!self.ConfigMods.ContainsKey(mod.Name)) { throw new HamstarException("Not a recognized configurable mod."); } MethodInfo configReloadMethod = ModFeaturesHelpers.GetConfigFileLoadMethod(mod); configReloadMethod.Invoke(null, new object[] { }); }