public bool HasFile(string file) { if (_archive != null) { return(_archive.HasFile(file)); } else { return(System.IO.File.Exists(System.IO.Path.Combine(BaseFolder, file))); } }
public _7thWrapperLib.RuntimeMod GetRuntime(_7thWrapperLib.LoaderContext context) { var mod = Sys.Library.GetItem(ModID); if (mod == null) { return(null); } string location = System.IO.Path.Combine(Sys.Settings.LibraryLocation, mod.LatestInstalled.InstalledLocation); _7thWrapperLib.ModInfo modinfo = null; if (mod.LatestInstalled.InstalledLocation.EndsWith(".iro")) { using (var arc = new _7thWrapperLib.IrosArc(location)) { if (arc.HasFile("mod.xml")) { var doc = new System.Xml.XmlDocument(); doc.Load(arc.GetData("mod.xml")); modinfo = new _7thWrapperLib.ModInfo(doc, context); } } } else { string mfile = System.IO.Path.Combine(location, "mod.xml"); if (System.IO.File.Exists(mfile)) { modinfo = new _7thWrapperLib.ModInfo(mfile, context); } } modinfo = modinfo ?? new _7thWrapperLib.ModInfo(); foreach (var opt in modinfo.Options) { if (!Settings.Any(s => s.ID.Equals(opt.ID, StringComparison.InvariantCultureIgnoreCase))) { Settings.Add(new ProfileSetting() { ID = opt.ID, Value = opt.Default }); } } return(new _7thWrapperLib.RuntimeMod( location, modinfo.Conditionals.Where(f => IsActive(f.ActiveWhen)), modinfo.ModFolders.Where(f => IsActive(f.ActiveWhen)).Select(f => f.Folder), modinfo )); }
public bool HasFile(string name) { string path = Path.Combine(Sys.Settings.LibraryLocation, InstalledLocation); if (InstalledLocation.EndsWith(".iro", StringComparison.InvariantCultureIgnoreCase) && File.Exists(path)) { using (var arc = new _7thWrapperLib.IrosArc(path)) return(arc.HasFile(name)); } else { path = Path.Combine(path, name); return(File.Exists(path)); } }