Unstable 0.17.3.0

This commit is contained in:
Juan Pablo Arce
2022-03-22 14:44:12 -03:00
parent cefac171f5
commit 4206f6db42
100 changed files with 1380 additions and 655 deletions
@@ -12,22 +12,30 @@ namespace Barotrauma
{
public sealed partial class PackageSource : ICollection<ContentPackage>
{
public ContentPackage SaveAndEnableRegularMod(ModProject modProject)
public string SaveRegularMod(ModProject modProject)
{
if (modProject.IsCore) { throw new ArgumentException("ModProject must not be a core package"); }
//save the content package
string fileListPath = Path.Combine(directory, ToolBox.RemoveInvalidFileNameChars(modProject.Name), ContentPackage.FileListFileName)
.CleanUpPathCrossPlatform(correctFilenameCase: false);
Directory.CreateDirectory(Path.GetDirectoryName(fileListPath)!);
modProject.Save(fileListPath);
Refresh(); EnabledPackages.DisableRemovedMods();
var newPackage = Regular.First(p => p.Path == fileListPath);
//enable it
EnabledPackages.EnableRegular(newPackage);
return fileListPath;
}
return newPackage;
public RegularPackage GetRegularModByPath(string fileListPath)
{
return Regular.First(p => p.Path == fileListPath);
}
public RegularPackage SaveAndEnableRegularMod(ModProject modProject)
{
string fileListPath = SaveRegularMod(modProject);
var package = GetRegularModByPath(fileListPath);
EnabledPackages.EnableRegular(package);
return package;
}
}