Пример #1
0
        public void Serialize(UndertaleWriter writer)
        {
            writer.WriteUndertaleString(Name);

            writer.WriteUndertaleObjectPointer(TexturePages);
            writer.WriteUndertaleObjectPointer(Sprites);
            writer.WriteUndertaleObjectPointer(SpineSprites);
            writer.WriteUndertaleObjectPointer(Fonts);
            writer.WriteUndertaleObjectPointer(Tilesets);

            writer.WriteUndertaleObject(TexturePages);
            writer.WriteUndertaleObject(Sprites);
            writer.WriteUndertaleObject(SpineSprites);
            writer.WriteUndertaleObject(Fonts);
            writer.WriteUndertaleObject(Tilesets);
        }
Пример #2
0
    /// <inheritdoc />
    public void Serialize(UndertaleWriter writer)
    {
        writer.WriteUndertaleString(Name);
        writer.WriteUndertaleString(DisplayName);
        if (EmSizeIsFloat)
        {
            // cast to a float and negate.
            writer.Write(0.0f - EmSize);
        }
        else
        {
            // pre-GMS2.3
            writer.Write(EmSize);
        }

        writer.Write(Bold);
        writer.Write(Italic);
        writer.Write(RangeStart);
        writer.Write(Charset);
        writer.Write(AntiAliasing);
        writer.Write(RangeEnd);
        writer.WriteUndertaleObjectPointer(Texture);
        writer.Write(ScaleX);
        writer.Write(ScaleY);
        if (writer.undertaleData.GeneralInfo?.BytecodeVersion >= 17)
        {
            writer.Write(AscenderOffset);
        }
        if (writer.undertaleData.GMS2022_2)
        {
            writer.Write(Ascender);
        }
        writer.WriteUndertaleObject(Glyphs);
    }
Пример #3
0
 public void Serialize(UndertaleWriter writer)
 {
     writer.Write((uint)Count);
     foreach (T obj in this)
     {
         writer.WriteUndertaleObjectPointer <T>(obj);
     }
     for (int i = 0; i < Count; i++)
     {
         try
         {
             (this[i] as UndertaleObjectWithBlobs)?.SerializeBlobBefore(writer);
         }
         catch (UndertaleSerializationException e)
         {
             throw new UndertaleSerializationException(e.Message + "\nwhile writing blob for item " + (i + 1) + " of " + Count + " in a list of " + typeof(T).FullName, e);
         }
     }
     for (int i = 0; i < Count; i++)
     {
         try
         {
             writer.WriteUndertaleObject <T>(this[i]);
             // The last object does NOT get padding (TODO: at least in AUDO)
             if (IndexOf(this[i]) != Count - 1)
             {
                 (this[i] as PaddedObject)?.SerializePadding(writer);
             }
         }
         catch (UndertaleSerializationException e)
         {
             throw new UndertaleSerializationException(e.Message + "\nwhile writing item " + (i + 1) + " of " + Count + " in a list of " + typeof(T).FullName, e);
         }
     }
 }
 public void Serialize(UndertaleWriter writer)
 {
     writer.Write(Scaled);
     if (writer.undertaleData.GeneralInfo.Major >= 2)
     {
         writer.Write(GeneratedMips);
     }
     writer.WriteUndertaleObjectPointer(TextureData);
 }
Пример #5
0
        public void Serialize(UndertaleWriter writer)
        {
            writer.WriteUndertaleString(Name);

            writer.Write(Moments.Count);
            for (int i = 0; i < Moments.Count; i++)
            {
                // Write the time point
                writer.Write(Moments[i].Step);

                // Unnecessary pointer to next array
                writer.WriteUndertaleObjectPointer(Moments[i].Event);
            }

            for (int i = 0; i < Moments.Count; i++)
            {
                // Write the actions for this moment
                writer.WriteUndertaleObject(Moments[i].Event);
            }
        }
Пример #6
0
 /// <inheritdoc />
 public void Serialize(UndertaleWriter writer)
 {
     writer.WriteUndertaleString(Name);
     writer.WriteUndertaleObjectPointer(TextureEntry);
 }