Exemple #1
0
        public void Serialize(UndertaleWriter writer)
        {
            writer.WriteUndertaleString(Name);
            writer.Write((uint)Playback);
            writer.Write(PlaybackSpeed);
            writer.Write((uint)PlaybackSpeedType);
            writer.Write(Length);
            writer.Write(OriginX);
            writer.Write(OriginY);
            writer.Write(Volume);

            BroadcastMessages.Serialize(writer);

            Tracks.Serialize(writer);

            foreach (KeyValuePair <int, UndertaleString> kvp in FunctionIDs)
            {
                writer.Write(kvp.Key);
                writer.WriteUndertaleString(kvp.Value);
            }

            Moments.Serialize(writer);
        }
 internal void LoadBroadcastMessages()
 {
     foreach (XmlSprite sprite in SpriteList.Sprites)
     {
         foreach (XmlScript script in sprite.Scripts.Scripts)
         {
             if (script is XmlBroadcastScript)
             {
                 var broadcastScript = script as XmlBroadcastScript;
                 if (!BroadcastMessages.Contains(broadcastScript.ReceivedMessage))
                 {
                     BroadcastMessages.Add(broadcastScript.ReceivedMessage);
                 }
             }
             else
             {
                 foreach (XmlBrick brick in script.Bricks.Bricks)
                 {
                     if (brick is XmlBroadcastBrick)
                     {
                         if (!BroadcastMessages.Contains((brick as XmlBroadcastBrick).BroadcastMessage))
                         {
                             BroadcastMessages.Add((brick as XmlBroadcastBrick).BroadcastMessage);
                         }
                     }
                     if (brick is XmlBroadcastWaitBrick)
                     {
                         if (!BroadcastMessages.Contains((brick as XmlBroadcastWaitBrick).BroadcastMessage))
                         {
                             BroadcastMessages.Add((brick as XmlBroadcastWaitBrick).BroadcastMessage);
                         }
                     }
                 }
             }
         }
     }
 }