Unstable 0.17.2.0

This commit is contained in:
Markus Isberg
2022-03-30 00:06:59 +09:00
parent 4206f6db42
commit 2968e23ae8
100 changed files with 654 additions and 1379 deletions
@@ -12,30 +12,22 @@ namespace Barotrauma
{
public sealed partial class PackageSource : ICollection<ContentPackage>
{
public string SaveRegularMod(ModProject modProject)
public ContentPackage SaveAndEnableRegularMod(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);
return fileListPath;
}
//enable it
EnabledPackages.EnableRegular(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;
return newPackage;
}
}