private void Add(String[] Pakets, PackageSystem vfs, AssemblyControl assembly, bool loadExtras) { foreach (String pak in Pakets) { Add(pak, vfs, assembly, loadExtras); } }
public bool LoadPackages(string game, PackageSystem vfs, AssemblyControl assembly) { return(Add(game, vfs, assembly, true)); }
public bool LoadPackages(string game, PackageSystem vfs, AssemblyControl assembly, bool loadExtras) { return(Add(game, vfs, assembly, loadExtras)); }
private bool Add(string package, PackageSystem vfs, AssemblyControl assembly, bool loadExtras) { if (package.ToLower() == "burntime") { Burntime.Common.BurntimePath path = new Burntime.Common.BurntimePath(FileSystem.BasePath + "system/"); while (!path.IsValid) { if (!path.ShowSelector()) { Environment.Exit(0); } if (path.IsValid) { path.Save(); } } string burntimePackage = path.Path; if (burntimePackage.EndsWith(".pak")) { burntimePackage = burntimePackage.Substring(0, burntimePackage.Length - 4); } // make absolute path to avoid using basePath from FileSystem string absolutePath = burntimePackage; if (!System.IO.Path.IsPathRooted(absolutePath)) { absolutePath = System.IO.Path.GetFullPath(FileSystem.BasePath + "system/" + absolutePath); } IPackage burntime = FileSystem.OpenPackage(absolutePath, "BURN_GFX/"); if (burntime == null) { // something went wrong throw new Exception("BURN_GFX folder was not found. Please make sure to set the correct path in system/path.txt to where the BURN_GFX and BURN.EXE are!"); } vfs.Mount(package, burntime); return(true); } PackageInfo info = PackageInfo.TryCreate(basePath + package, vfs); if (info == null) { return(false); } if (info.Type == PackageType.Game) { Add(info.Dependencies, vfs, assembly, loadExtras); if (!vfs.ExistsMount(package)) { PackageFactory factory = new PackageFactory(); IPackage p = factory.OpenPackage(basePath + package); vfs.Mount(package, p); } // add language codes to available language list foreach (string lang in info.Languages) { if (!languages.Contains(lang)) { languages.Add(lang); } } ApplyPatches(info, vfs); if (loadExtras) { LoadLanguage(info, vfs, ""); LoadExtras(info, vfs); } if (assembly != null) { assembly.Load(info.Modules, package); } } return(true); }