statuseffect setvalue, new diving suit sprite & character slowdown, welded door sprite

This commit is contained in:
Regalis
2015-09-26 00:41:43 +03:00
parent 53e729ea11
commit da00b083ed
21 changed files with 137 additions and 57 deletions

View File

@@ -158,12 +158,21 @@ namespace Subsurface
return val;
}
public static bool GetAttributeBool(XElement element, string name, bool defaultValue)
{
if (element.Attribute(name) == null) return defaultValue;
var attribute = element.Attribute(name);
if (attribute == null) return defaultValue;
string val = element.Attribute(name).Value.ToLower().Trim();
string val = attribute.Value.ToLower().Trim();
return GetAttributeBool(attribute, defaultValue);
}
public static bool GetAttributeBool(XAttribute attribute, bool defaultValue)
{
if (attribute == null) return defaultValue;
string val = attribute.Value.ToLower().Trim();
if (val == "true")
{
return true;
@@ -174,10 +183,13 @@ namespace Subsurface
}
else
{
DebugConsole.ThrowError("Error in " + element + "! ''" + val + "'' is not a valid boolean value");
DebugConsole.ThrowError("Error in " + attribute.Value.ToString() + "! ''" + val + "'' is not a valid boolean value");
return false;
}
}
public static Vector2 GetAttributeVector2(XElement element, string name, Vector2 defaultValue)
{
if (element.Attribute(name) == null) return defaultValue;