Unstable 0.1500.5.0 (almost forgor edition 💀)

This commit is contained in:
Markus Isberg
2021-10-01 23:56:14 +09:00
parent 3043a9a7bc
commit 08bdfc6cea
150 changed files with 5669 additions and 4403 deletions
@@ -146,6 +146,7 @@ namespace Barotrauma
{ typeof(Vector4), "vector4" },
{ typeof(Rectangle), "rectangle" },
{ typeof(Color), "color" },
{ typeof(string[]), "stringarray" }
};
private static readonly Dictionary<Type, Dictionary<string, SerializableProperty>> cachedProperties =
@@ -273,6 +274,9 @@ namespace Barotrauma
case "rectangle":
PropertyInfo.SetValue(parentObject, XMLExtensions.ParseRect(value, true));
break;
case "stringarray":
PropertyInfo.SetValue(parentObject, XMLExtensions.ParseStringArray(value));
break;
}
}
@@ -345,6 +349,9 @@ namespace Barotrauma
case "rectangle":
PropertyInfo.SetValue(parentObject, XMLExtensions.ParseRect((string)value, false));
return true;
case "stringarray":
PropertyInfo.SetValue(parentObject, XMLExtensions.ParseStringArray((string)value));
break;
default:
DebugConsole.ThrowError("Failed to set the value of the property \"" + Name + "\" of \"" + parentObject.ToString() + "\" to " + value.ToString());
DebugConsole.ThrowError("(Cannot convert a string to a " + PropertyType.ToString() + ")");
@@ -723,6 +730,10 @@ namespace Barotrauma
case "rectangle":
stringValue = XMLExtensions.RectToString((Rectangle)value);
break;
case "stringarray":
string[] stringArray = (string[])value;
stringValue = stringArray != null ? string.Join(';', stringArray) : "";
break;
default:
stringValue = value.ToString();
break;