Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="data"></param>
        public void LoadData(MEX_Data data)
        {
            bool updated = false;

            // legacy update
            if (data.EffectTable._s.Length != new MEX_EffectData().TrimmedSize)
            {
                var strings = data.EffectTable._s;
                data.EffectTable = new MEX_EffectData();
                var length = strings.Length;
                data.EffectTable.EffectFiles = new HSDArrayAccessor <MEX_EffectFiles>()
                {
                    _s = strings
                };
                data.EffectTable.RuntimeUnk1 = new HSDAccessor()
                {
                    _s = new HSDStruct(0x60)
                };
                data.EffectTable.RuntimeUnk3 = new HSDAccessor()
                {
                    _s = new HSDStruct(4 * length)
                };
                data.EffectTable.RuntimeTexGrNum = new HSDAccessor()
                {
                    _s = new HSDStruct(4 * length)
                };
                data.EffectTable.RuntimeTexGrData = new HSDAccessor()
                {
                    _s = new HSDStruct(4 * length)
                };
                data.EffectTable.RuntimeUnk4 = new HSDAccessor()
                {
                    _s = new HSDStruct(4 * length)
                };
                data.EffectTable.RuntimePtclLast = new HSDAccessor()
                {
                    _s = new HSDStruct(4 * length)
                };
                data.EffectTable.RuntimePtclData = new HSDAccessor()
                {
                    _s = new HSDStruct(4 * length)
                };
                data.EffectTable.RuntimeLookup = new HSDAccessor()
                {
                    _s = new HSDStruct(4 * length)
                };
                updated = true;
            }

            if (updated)
            {
                MessageBox.Show("Effect Node Updated");
            }

            Effects = new MEXEffectEntry[data.EffectTable.EffectFiles.Length];
            for (int i = 0; i < Effects.Length; i++)
            {
                Effects[i] = new MEXEffectEntry()
                {
                    FileName = data.EffectTable.EffectFiles[i].FileName,
                    Symbol   = data.EffectTable.EffectFiles[i].Symbol,
                };
            }
            effectEditor.SetArrayFromProperty(this, "Effects");
        }
Esempio n. 2
0
 /// <summary>
 /// Adds a new MEX effect file to table
 /// </summary>
 /// <param name="item"></param>
 /// <returns>added mex file id</returns>
 public int AddMEXEffectFile(MEXEffectEntry item)
 {
     return(effectEditor.AddItem(item));
 }