Exemple #1
0
 private static void WriteGMEvent(GMEvent _event, Stream _s, IFF _iff)
 {
     WriteDataList(_event.Actions, _s, _iff, delegate(GMAction _action, Stream __s, IFF __iff, long __index)
     {
         __s.PatchOffset(__index);
         __s.WriteInteger(_action.LibID);
         __s.WriteInteger(_action.ID);
         __s.WriteInteger((int)_action.Kind);
         __s.WriteBoolean(_action.UseRelative);
         __s.WriteBoolean(_action.IsQuestion);
         __s.WriteBoolean(_action.UseApplyTo);
         __s.WriteInteger((int)_action.ExeType);
         __iff.AddString(__s, _action.Name);
         __iff.AddString(__s, _action.Code);
         __s.WriteInteger(_action.ArgumentCount);
         __s.WriteInteger(_action.Who);
         __s.WriteBoolean(_action.Relative);
         __s.WriteBoolean(_action.IsNot);
         if (_action.ArgTypes.Count != _action.Args.Count)
         {
             Console.WriteLine("We have a problem here!!");
         }
         __s.WriteInteger(_action.ArgTypes.Count);
         for (int i = 0; i < _action.ArgTypes.Count; i++)
         {
             __s.WriteInteger((int)_action.ArgTypes[i]);
             __iff.AddString(__s, _action.Args[i]);
         }
     });
 }
Exemple #2
0
        public GMTimeLine(GMAssets _a, Stream _stream)
        {
            _stream.ReadInteger();
            int num = _stream.ReadInteger();

            Entries = new List <KeyValuePair <int, GMEvent> >(num);
            for (int i = 0; i < num; i++)
            {
                int     key   = _stream.ReadInteger();
                GMEvent value = new GMEvent(_a, _stream);
                Entries.Add(new KeyValuePair <int, GMEvent>(key, value));
            }
        }
Exemple #3
0
 private void RemoveEventDND(string _name, GMEvent _ev)
 {
     if (_ev.Actions.Count > 0)
     {
         foreach (GMAction action in _ev.Actions)
         {
             action.Compile(this);
         }
         string text = _ev.CompressEvent(Scripts);
         if (Program.CompileVerbose)
         {
             Console.WriteLine("Compressed event for {0} - {1}", _name, text);
         }
         GMAction item = new GMAction(_ev.Actions[0].ID, text);
         _ev.Actions.Clear();
         _ev.Actions.Add(item);
     }
 }
Exemple #4
0
        public GMObject(GMAssets _a, Stream _stream)
        {
            int num = _stream.ReadInteger();

            if (num != 400 && num != 430 && num != 820)
            {
                return;
            }
            SpriteIndex = _stream.ReadInteger();
            Solid       = _stream.ReadBoolean();
            Visible     = _stream.ReadBoolean();
            Depth       = _stream.ReadInteger();
            Persistent  = _stream.ReadBoolean();
            Parent      = _stream.ReadInteger();
            Mask        = _stream.ReadInteger();
            int num2 = 8;

            if (num == 430 || num >= 820)
            {
                num2 = _stream.ReadInteger();
            }
            Events = new List <IList <KeyValuePair <int, GMEvent> > >(num2);
            for (int i = 0; i <= num2; i++)
            {
                List <KeyValuePair <int, GMEvent> > list = new List <KeyValuePair <int, GMEvent> >();
                int num3;
                do
                {
                    num3 = _stream.ReadInteger();
                    if (num3 >= 0)
                    {
                        GMEvent value = new GMEvent(_a, _stream);
                        KeyValuePair <int, GMEvent> item = new KeyValuePair <int, GMEvent>(num3, value);
                        list.Add(item);
                    }
                }while (num3 >= 0);
                Events.Add(list);
            }
            Console.WriteLine("DEBUG: num var: " + num.ToString() + " !");
        }