Unstable v0.1100.0.4 (November 11th 2020)

This commit is contained in:
Joonas Rikkonen
2020-11-06 20:12:15 +02:00
parent 6b36bf809d
commit b772654326
297 changed files with 12502 additions and 4277 deletions
@@ -471,6 +471,9 @@ namespace Barotrauma
[Serialize(true, false)]
public bool CanFlipY { get; private set; }
[Serialize(false, false)]
public bool IsDangerous { get; private set; }
public bool CanSpriteFlipX { get; private set; }
@@ -594,7 +597,6 @@ namespace Barotrauma
originalName = element.GetAttributeString("name", "");
name = originalName;
identifier = element.GetAttributeString("identifier", "");
if (!Enum.TryParse(element.GetAttributeString("category", "Misc"), true, out MapEntityCategory category))
{
category = MapEntityCategory.Misc;
@@ -648,7 +650,7 @@ namespace Barotrauma
if (string.IsNullOrEmpty(name))
{
DebugConsole.ThrowError($"Unnamed item ({identifier})in {filePath}!");
DebugConsole.ThrowError($"Unnamed item ({identifier}) in {filePath}!");
}
DebugConsole.Log(" " + name);
@@ -771,6 +773,28 @@ namespace Barotrauma
MinimapIcon = new Sprite(subElement, iconFolder, lazyLoad: true);
}
break;
case "infectedsprite":
{
string iconFolder = "";
if (!subElement.GetAttributeString("texture", "").Contains("/"))
{
iconFolder = Path.GetDirectoryName(filePath);
}
InfectedSprite = new Sprite(subElement, iconFolder, lazyLoad: true);
}
break;
case "damagedinfectedsprite":
{
string iconFolder = "";
if (!subElement.GetAttributeString("texture", "").Contains("/"))
{
iconFolder = Path.GetDirectoryName(filePath);
}
DamagedInfectedSprite = new Sprite(subElement, iconFolder, lazyLoad: true);
}
break;
case "brokensprite":
string brokenSpriteFolder = "";
if (!subElement.GetAttributeString("texture", "").Contains("/"))
@@ -876,7 +900,7 @@ namespace Barotrauma
case "levelresource":
foreach (XElement levelCommonnessElement in subElement.Elements())
{
string levelName = levelCommonnessElement.GetAttributeString("levelname", "").ToLowerInvariant();
string levelName = levelCommonnessElement.GetAttributeString("leveltype", "").ToLowerInvariant();
if (!LevelCommonness.ContainsKey(levelName))
{
LevelCommonness.Add(levelName, levelCommonnessElement.GetAttributeFloat("commonness", 0.0f));
@@ -927,6 +951,16 @@ namespace Barotrauma
"Item prefab \"" + name + "\" has no identifier. All item prefabs have a unique identifier string that's used to differentiate between items during saving and loading.");
}
#if DEBUG
if (!Category.HasFlag(MapEntityCategory.Legacy) && !HideInMenus)
{
if (!string.IsNullOrEmpty(originalName))
{
DebugConsole.AddWarning($"Item \"{(string.IsNullOrEmpty(identifier) ? name : identifier)}\" has a hard-coded name, and won't be localized to other languages.");
}
}
#endif
AllowedLinks = element.GetAttributeStringArray("allowedlinks", new string[0], convertToLowerInvariant: true).ToList();
Prefabs.Add(this, allowOverriding);