(3a5d98b) v0.9.6.0

This commit is contained in:
Regalis
2019-12-17 14:38:24 +01:00
parent 5c95c53118
commit a3569b8bf0
95 changed files with 1579 additions and 728 deletions
@@ -40,6 +40,10 @@ namespace Barotrauma.CharacterEditor
canEnterSubmarine = ragdoll.CanEnterSubmarine;
canWalk = ragdoll.CanWalk;
texturePath = ragdoll.Texture;
if (string.IsNullOrEmpty(texturePath) && !name.Equals(Character.HumanSpeciesName, StringComparison.OrdinalIgnoreCase))
{
texturePath = ragdoll.Limbs.FirstOrDefault()?.GetSprite().Texture;
}
}
public static Wizard instance;
@@ -265,8 +269,30 @@ namespace Barotrauma.CharacterEditor
};
if (ofd.ShowDialog() == DialogResult.OK)
{
string file = ofd.FileName;
string relativePath = UpdaterUtil.GetRelativePath(Path.GetFullPath(file), Environment.CurrentDirectory);
string destinationPath = relativePath;
//copy file to XML path if it's not located relative to the game's files
if (relativePath.StartsWith("..") ||
Path.GetPathRoot(Environment.CurrentDirectory) != Path.GetPathRoot(file))
{
destinationPath = Path.Combine(Path.GetDirectoryName(XMLPath), Path.GetFileName(file));
string destinationDir = Path.GetDirectoryName(destinationPath);
if (!Directory.Exists(destinationDir))
{
Directory.CreateDirectory(destinationDir);
}
if (!File.Exists(destinationPath))
{
File.Copy(file, Path.GetFullPath(destinationPath), overwrite: true);
}
}
isTextureSelected = true;
texturePathElement.Text = ToolBox.ConvertAbsoluteToRelativePath(ofd.FileName);
texturePathElement.Text = destinationPath;
}
return true;
}