internal static List <string> GetInstalledDLC(GameTarget target, bool includeDisabled = false) { var dlcDirectory = MEDirectories.DLCPath(target); if (Directory.Exists(dlcDirectory)) { return(Directory.GetDirectories(dlcDirectory).Where(x => Path.GetFileName(x).StartsWith("DLC_") || (includeDisabled && Path.GetFileName(x).StartsWith("xDLC_"))).Select(x => Path.GetFileName(x)).ToList()); } return(new List <string>()); }
public static Dictionary <string, int> GetMountPriorities(GameTarget selectedTarget) { //make dictionary from basegame files var dlcmods = VanillaDatabaseService.GetInstalledDLCMods(selectedTarget); var mountMapping = new Dictionary <string, int>(); foreach (var dlc in dlcmods) { var mountpath = Path.Combine(MEDirectories.DLCPath(selectedTarget), dlc); try { mountMapping[dlc] = MELoadedFiles.GetMountPriority(mountpath, selectedTarget.Game); } catch (Exception e) { Log.Error($"Exception getting mount priority from file: {mountpath}: {e.Message}"); } } return(mountMapping); }
/// <summary> /// Gets the base DLC directory of each unpacked DLC/mod that will load in game (eg. C:\Program Files (x86)\Origin Games\Mass Effect 3\BIOGame\DLC\DLC_EXP_Pack001) /// Directory Override is used to use a custom path, for things like TFC Compactor, where the directory ME3Exp is pointing to may not be the one you want to use. /// </summary> /// <returns></returns> public static IEnumerable <string> GetEnabledDLC(GameTarget target, string directoryOverride = null) => Directory.Exists(MEDirectories.DLCPath(target)) ? Directory.EnumerateDirectories(directoryOverride ?? MEDirectories.DLCPath(target)).Where(dir => IsEnabledDLC(dir, target.Game)) : Enumerable.Empty <string>();
/// <summary> /// Gets the base DLC directory of each unpacked DLC/mod that will load in game (eg. C:\Program Files (x86)\Origin Games\Mass Effect 3\BIOGame\DLC\DLC_EXP_Pack001) /// Directory Override is used to use a custom path, for things like TFC Compactor, where the directory ME3Exp is pointing to may not be the one you want to use. /// </summary> /// <returns></returns> public static IEnumerable <string> GetEnabledDLC(Mod.MEGame game, string directoryOverride = null) => Directory.Exists(MEDirectories.DLCPath(game)) ? Directory.EnumerateDirectories(directoryOverride ?? MEDirectories.DLCPath(game)).Where(dir => IsEnabledDLC(dir, game)) : Enumerable.Empty <string>();