Ejemplo n.º 1
0
 public SETItem(EditorItemSelection selectionManager)
     : base(selectionManager)
 {
     Position = new Vertex();
     Rotation = new Rotation();
     Scale = new Vertex();
     objdef = LevelData.ObjDefs[id];
     bounds = objdef.GetBounds(this);
 }
Ejemplo n.º 2
0
 public SETItem(byte[] file, int address, EditorItemSelection selectionManager)
     : base(selectionManager)
 {
     ushort _id = ByteConverter.ToUInt16(file, address);
     ID = _id;
     ClipLevel = (byte)(_id >> 12);
     ushort xrot = BitConverter.ToUInt16(file, address + 2);
     ushort yrot = BitConverter.ToUInt16(file, address + 4);
     ushort zrot = BitConverter.ToUInt16(file, address + 6);
     Rotation = new Rotation(xrot, yrot, zrot);
     Position = new Vertex(file, address + 8);
     Scale = new Vertex(file, address + 0x14);
     isLoaded = true;
     objdef = LevelData.ObjDefs[id];
     bounds = objdef.GetBounds(this);
 }
Ejemplo n.º 3
0
        PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
        {
            PropertyDescriptorCollection result = TypeDescriptor.GetProperties(this, attributes, true);

            objdef = LevelData.ObjDefs[ID];
            if (objdef.CustomProperties == null || objdef.CustomProperties.Length == 0) return result;
            List<PropertyDescriptor> props = new List<PropertyDescriptor>(result.Count);
            foreach (PropertyDescriptor item in result)
                props.Add(item);

            foreach (PropertySpec property in objdef.CustomProperties)
            {
                List<Attribute> attrs = new List<Attribute>();

                // Additionally, append the custom attributes associated with the
                // PropertySpec, if any.
                if (property.Attributes != null)
                    attrs.AddRange(property.Attributes);

                // Create a new property descriptor for the property item, and add
                // it to the list.
                PropertySpecDescriptor pd = new PropertySpecDescriptor(property,
                    property.Name, attrs.ToArray());
                props.Add(pd);
            }

            return new PropertyDescriptorCollection(props.ToArray(), true);
        }
Ejemplo n.º 4
0
 static DefaultObjectDefinition()
 {
     DefaultInstance = new DefaultObjectDefinition();
 }