2019-01-30 06:36:56 +00:00
|
|
|
|
using System.Xml;
|
2019-02-01 17:19:20 +00:00
|
|
|
|
using RobloxFiles.DataTypes;
|
2019-01-30 06:36:56 +00:00
|
|
|
|
|
2019-02-01 17:19:20 +00:00
|
|
|
|
namespace RobloxFiles.XmlFormat.PropertyTokens
|
2019-01-30 06:36:56 +00:00
|
|
|
|
{
|
|
|
|
|
public class UDim2Token : IXmlPropertyToken
|
|
|
|
|
{
|
|
|
|
|
public string Token => "UDim2";
|
|
|
|
|
|
|
|
|
|
public bool ReadToken(Property property, XmlNode token)
|
|
|
|
|
{
|
|
|
|
|
UDim? xDim = UDimToken.ReadUDim(token, "X");
|
|
|
|
|
UDim? yDim = UDimToken.ReadUDim(token, "Y");
|
|
|
|
|
|
|
|
|
|
if (xDim != null && yDim != null)
|
|
|
|
|
{
|
|
|
|
|
property.Type = PropertyType.UDim2;
|
|
|
|
|
property.Value = new UDim2(xDim.Value, yDim.Value);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|