v0.12.0.2

This commit is contained in:
Joonas Rikkonen
2021-02-10 17:08:21 +02:00
parent 5c80a59bdd
commit 694cdfee7b
353 changed files with 12897 additions and 5028 deletions
@@ -110,7 +110,7 @@ namespace Barotrauma
{
folder = Path.Combine(Path.GetDirectoryName(filePath), "Ragdolls") + Path.DirectorySeparatorChar;
}
return folder;
return folder.CleanUpPathCrossPlatform(correctFilenameCase: true);
}
public static T GetDefaultRagdollParams<T>(string speciesName) where T : RagdollParams, new() => GetRagdollParams<T>(speciesName, GetDefaultFileName(speciesName));
@@ -136,7 +136,7 @@ namespace Barotrauma
string folder = GetFolder(speciesName);
if (Directory.Exists(folder))
{
var files = Directory.GetFiles(folder);
List<string> files = Directory.GetFiles(folder).ToList();
if (files.None())
{
DebugConsole.ThrowError($"[RagdollParams] Could not find any ragdoll files from the folder: {folder}. Using the default ragdoll.");
@@ -364,6 +364,21 @@ namespace Barotrauma
}
}
#endif
private bool variantScaleApplied;
public void ApplyVariantScale(XDocument variantFile)
{
if (variantScaleApplied) { return; }
if (variantFile == null) { return; }
var scaleMultiplier = variantFile.Root.GetChildElement("ragdoll")?.GetAttributeFloat("scalemultiplier", 1f);
if (scaleMultiplier.HasValue)
{
JointScale *= scaleMultiplier.Value;
LimbScale *= scaleMultiplier.Value;
}
variantScaleApplied = true;
}
#endregion
#region Memento