Пример #1
0
        ////

        private static bool DetectGithub(Mod mod)
        {
            if (ModMetaDataLibraries.GetGithubUserNameProp(mod) == null)
            {
                return(false);
            }
            if (ModMetaDataLibraries.GetGitubProjectNameProp(mod) == null)
            {
                return(false);
            }
            return(true);
        }
Пример #2
0
        ////////////////

        /// <summary>
        /// Gets a mod's github user name, if defined.
        /// </summary>
        /// <param name="mod"></param>
        /// <returns></returns>
        public static string GetGithubUserName(Mod mod)
        {
            var self = ModContent.GetInstance <ModMetaDataLibraries>();

            if (!self.GithubMods.ContainsKey(mod.Name))
            {
                return(null);
            }

            PropertyInfo gitUserProp = ModMetaDataLibraries.GetGithubUserNameProp(mod);

            return((string)gitUserProp.GetValue(null));
        }