/*
         *  ---------
         *  Overrides
         *  ---------
         */

        /* For maintaining consistency. */
        public void CleanupConfig(string thisPath)
        {
            if (String.IsNullOrEmpty(AppName))
            {
                AppName = "Reloaded Application Name";
            }

            if (String.IsNullOrEmpty(AppId))
            {
                AppId = AppName.Replace(" ", ".");
            }

            if (!String.IsNullOrEmpty(thisPath))
            {
                string imagePath = Path.Combine(Path.GetDirectoryName(thisPath), AppIcon);
                if (!File.Exists(imagePath))
                {
                    AppIcon = "";
                }
            }

            if (!File.Exists(AppLocation))
            {
                AppLocation  = "";
                AppArguments = "";
            }

            EnabledMods = ConfigCleanupUtility.FilterNonexistingModIds(EnabledMods).ToArray();
        }
示例#2
0
        public void CleanupConfig(string thisPath)
        {
            ResetMissingDirectories();

            // Cleanup application list.
            var newApplicationSet = ConfigCleanupUtility.FilterNonexistingAppIds(ModSupportMatrix.Keys);

            foreach (var key in ModSupportMatrix.Keys.ToArray())
            {
                // Remove key it does not exist.
                if (!newApplicationSet.Contains(key))
                {
                    ModSupportMatrix.Remove(key);
                    continue;
                }

                // If key exists, try to remove nonexisting mods.
                ModSupportMatrix[key] = ConfigCleanupUtility.FilterNonexistingModIds(ModSupportMatrix[key]).ToArray();
            }
        }
示例#3
0
        public void CleanupConfig(string thisPath)
        {
            if (String.IsNullOrEmpty(ModName))
            {
                ModName = "Reloaded Application Name";
            }

            if (String.IsNullOrEmpty(ModId))
            {
                ModId = ModName.Replace(" ", ".");
            }

            if (!String.IsNullOrEmpty(thisPath))
            {
                string imagePath = Path.Combine(Path.GetDirectoryName(thisPath), ModImage);
                if (!File.Exists(imagePath))
                {
                    ModImage = "";
                }
            }

            ModDependencies = ConfigCleanupUtility.FilterNonexistingModIds(ModDependencies).ToArray();
        }