public DATFile GetAsDATFile()
        {
            DATFile d    = new DATFile();
            DATRoot root = new DATRoot();

            root.Text = Text;
            root.Animations.Add(DatAnimation);
            d.AddRoot(root);

            return(d);
        }
Example #2
0
        public void LoadPlayerAJ(string fname)
        {
            DialogResult dialogResult = MessageBox.Show("Import Animations?", "Animation Import", MessageBoxButtons.YesNo);

            if (dialogResult != DialogResult.Yes)
            {
                return;
            }
            FileData d = new FileData(fname);

            //Extract All Animations from the AJ file
            DATRoot r = new DATRoot();

            r.Text = Path.GetFileNameWithoutExtension(fname);
            DatFile.AddRoot(r);

            FileData f = new FileData(fname);

            while (f.Pos() < f.Eof())
            {
                int    size = f.ReadInt();
                byte[] data = f.GetSection(f.Pos() - 4, size);
                f.Skip(size - 4);
                f.Align(0x20);
                DATFile datfile = Decompiler.Decompile(data);
                datfile.Roots[0].Animations[0].Text = datfile.Roots[0].Text;
                r.Animations.Add(datfile.Roots[0].Animations[0]);
            }

            /*foreach (DATRoot root in DatFile.Roots)
             * {
             *  if(root.FighterData.Count > 0)
             *  foreach (DatFighterScript script in root.FighterData[0].Scripts)
             *  {
             *      if(script.AnimationOffset != 0)
             *      {
             *          DATFile datfile = Decompiler.Decompile(d.getSection(script.AnimationOffset, script.AnimationSize));
             *          datfile.Roots[0].Animations[0].Text = script.Text;
             *          r.Animations.Add(datfile.Roots[0].Animations[0]);
             *      }
             *  }
             * }*/
        }