Unstable 0.17.1.0

This commit is contained in:
Markus Isberg
2022-03-17 01:25:04 +09:00
parent 3974067915
commit 6d410cc1b7
302 changed files with 5878 additions and 3317 deletions
@@ -1668,11 +1668,7 @@ namespace Barotrauma.CharacterEditor
if (contentPackage == null)
{
#if DEBUG
contentPackage = ContentPackageManager.EnabledPackages.All.LastOrDefault();
#else
contentPackage = ContentPackageManager.EnabledPackages.All.LastOrDefault(cp => cp != vanilla);
#endif
}
if (contentPackage == null)
{
@@ -1680,13 +1676,11 @@ namespace Barotrauma.CharacterEditor
DebugConsole.ThrowError(GetCharacterEditorTranslation("NoContentPackageSelected"));
return false;
}
#if !DEBUG
if (vanilla != null && contentPackage == vanilla)
{
GUI.AddMessage(GetCharacterEditorTranslation("CannotEditVanillaCharacters"), GUIStyle.Red, font: GUIStyle.LargeFont);
return false;
}
#endif
// Content package
if (contentPackage is RegularPackage regular && !ContentPackageManager.EnabledPackages.Regular.Contains(regular))
{
@@ -1721,9 +1715,9 @@ namespace Barotrauma.CharacterEditor
}
else
{
config.SetAttributeValue("speciesname", name);
config.SetAttributeValue("humanoid", isHumanoid);
var ragdollElement = config.Element("ragdolls");
config.SetAttributeValue("speciesname", name, StringComparison.OrdinalIgnoreCase);
config.SetAttributeValue("humanoid", isHumanoid, StringComparison.OrdinalIgnoreCase);
var ragdollElement = config.GetChildElement("ragdolls");
if (ragdollElement == null)
{
config.Add(new XElement("ragdolls", CreateRagdollPath()));
@@ -1736,7 +1730,7 @@ namespace Barotrauma.CharacterEditor
ragdollElement.ReplaceWith(new XElement("ragdolls", CreateRagdollPath()));
}
}
var animationElement = config.Element("animations");
var animationElement = config.GetChildElement("animations");
if (animationElement == null)
{
config.Add(new XElement("animations", CreateAnimationPath()));
@@ -160,8 +160,7 @@ namespace Barotrauma.CharacterEditor
bool isTextureSelected = false;
void UpdatePaths()
{
string pathBase = ContentPackage == GameMain.VanillaContent ? $"Content/Characters/{Name}/{Name}"
: $"{ContentPath.ModDirStr}/Characters/{Name}/{Name}";
string pathBase = $"{ContentPath.ModDirStr}/Characters/{Name}/{Name}";
XMLPath = $"{pathBase}.xml";
xmlPathElement.Text = XMLPath;
if (updateTexturePath)
@@ -307,10 +306,10 @@ namespace Barotrauma.CharacterEditor
contentPackageDropDown = new GUIDropDown(new RectTransform(new Vector2(1.0f, 0.5f), rightContainer.RectTransform, Anchor.TopRight));
foreach (ContentPackage contentPackage in ContentPackageManager.EnabledPackages.All)
{
#if !DEBUG
if (contentPackage == GameMain.VanillaContent) { continue; }
#endif
contentPackageDropDown.AddItem(contentPackage.Name, userData: contentPackage, toolTip: contentPackage.Path);
if (contentPackage != GameMain.VanillaContent)
{
contentPackageDropDown.AddItem(contentPackage.Name, userData: contentPackage, toolTip: contentPackage.Path);
}
}
contentPackageDropDown.OnSelected = (obj, userdata) =>
{