(9122340aa) Fixed inability to enable content packages if some of the files included in the package are already in the game folder (which may happen, for example, if enabling a content package fails)

This commit is contained in:
Joonas Rikkonen
2019-04-29 21:10:20 +03:00
parent 4d1c3b1ed4
commit d3ef770243
4 changed files with 125 additions and 51 deletions
@@ -162,6 +162,23 @@ namespace Barotrauma
}
}
/// <summary>
/// Returns the file paths of all files of the given type in the content packages.
/// </summary>
/// <param name="type"></param>
/// <param name="searchAllContentPackages">If true, also returns files in content packages that are installed but not currently selected.</param>
public IEnumerable<string> GetFilesOfType(ContentType type, bool searchAllContentPackages = false)
{
if (searchAllContentPackages)
{
return ContentPackage.GetFilesOfType(ContentPackage.List, type);
}
else
{
return ContentPackage.GetFilesOfType(SelectedPackages, type);
}
}
/// <summary>
/// Returns the file paths of all files of the given type in the currently selected content packages.
/// </summary>