Esempio n. 1
0
 public static void WriteDelegateProperty(this EndianWriter stream, IMEPackage pcc, NameReference propName, ScriptDelegate value, int staticArrayIndex)
 {
     stream.WritePropHeader(pcc, propName, PropertyType.DelegateProperty, 12, staticArrayIndex);
     stream.WriteInt32(value.Object);
     stream.WriteNameReference(value.FunctionName, pcc);
 }
Esempio n. 2
0
 public static StructProperty ToGuidStructProp(this Guid guid, NameReference propName) => CommonStructs.GuidProp(guid, propName);
Esempio n. 3
0
        public static void WriteStringProperty(this EndianWriter stream, IMEPackage pcc, NameReference propName, string value, int staticArrayIndex)
        {
            //Debug.WriteLine("Writing string property " + propName + ", value: " + value + " at 0x" + stream.Position.ToString("X6"));
            int strLen = value.Length == 0 ? 0 : value.Length + 1;

            if (pcc.Game == MEGame.ME3)
            {
                stream.WritePropHeader(pcc, propName, PropertyType.StrProperty, (strLen * 2) + 4, staticArrayIndex);
                stream.WriteUnrealStringUnicode(value);
            }
            else
            {
                stream.WritePropHeader(pcc, propName, PropertyType.StrProperty, strLen + 4, staticArrayIndex);
                stream.WriteUnrealStringASCII(value);
            }
        }
Esempio n. 4
0
        public static void WriteStringRefProperty(this EndianWriter stream, IMEPackage pcc, NameReference propName, int value, int staticArrayIndex)
        {
            //Debug.WriteLine("Writing stringref property " + propName + ", value: " + value + " at 0x" + stream.Position.ToString("X6"));

            stream.WritePropHeader(pcc, propName, PropertyType.StringRefProperty, 4, staticArrayIndex);
            stream.WriteInt32(value);
        }
Esempio n. 5
0
 public static void WriteArrayProperty(this EndianWriter stream, IMEPackage pcc, NameReference propName, int count, Stream value, int staticArrayIndex)
 {
     //Debug.WriteLine("Writing array property " + propName + ", count: " + count + " at 0x" + stream.Position.ToString("X6")+", length: "+value.Length);
     stream.WritePropHeader(pcc, propName, PropertyType.ArrayProperty, 4 + (int)value.Length, staticArrayIndex);
     stream.WriteInt32(count);
     stream.BaseStream.WriteStream(value);
 }
Esempio n. 6
0
 public static void WriteArrayProperty(this EndianWriter stream, IMEPackage pcc, NameReference propName, int count, Func <Stream> func, int staticArrayIndex)
 {
     stream.WriteArrayProperty(pcc, propName, count, func(), staticArrayIndex);
 }
Esempio n. 7
0
 public static void WriteEnumProperty(this EndianWriter stream, IMEPackage pcc, NameReference propName, NameReference enumName, NameReference enumValue, int staticArrayIndex)
 {
     stream.WritePropHeader(pcc, propName, PropertyType.ByteProperty, 8, staticArrayIndex);
     if (pcc.Game >= MEGame.ME3)
     {
         stream.WriteNameReference(enumName, pcc);
     }
     stream.WriteNameReference(enumValue, pcc);
 }
Esempio n. 8
0
 public static void WriteByteProperty(this EndianWriter stream, IMEPackage pcc, NameReference propName, byte value, int staticArrayIndex)
 {
     //Debug.WriteLine("Writing byte property " + propName + ", value: " + value + " at 0x" + stream.Position.ToString("X6"));
     stream.WritePropHeader(pcc, propName, PropertyType.ByteProperty, 1, staticArrayIndex);
     if (pcc.Game >= MEGame.ME3)
     {
         stream.WriteNameReference("None", pcc);
     }
     stream.WriteByte(value);
 }
Esempio n. 9
0
        public static void WriteNameProperty(this EndianWriter stream, IMEPackage pcc, NameReference propName, NameReference value, int staticArrayIndex)
        {
            //Debug.WriteLine("Writing name property " + propName + ", value: " + value + " at 0x" + stream.Position.ToString("X6"));

            stream.WritePropHeader(pcc, propName, PropertyType.NameProperty, 8, staticArrayIndex);
            stream.WriteNameReference(value, pcc);
        }
Esempio n. 10
0
        public static void WriteStructProperty(this EndianWriter stream, IMEPackage pcc, NameReference propName, NameReference structName, Stream value, int staticArrayIndex)
        {
            //Debug.WriteLine("Writing struct property " + propName + ", value: " + value + " at 0x" + stream.Position.ToString("X6"));

            stream.WritePropHeader(pcc, propName, PropertyType.StructProperty, (int)value.Length, staticArrayIndex);
            stream.WriteNameReference(structName, pcc);
            stream.BaseStream.WriteStream(value);
        }
Esempio n. 11
0
 public ScriptDelegate(int _object, NameReference functionName)
 {
     Object       = _object;
     FunctionName = functionName;
 }