コード例 #1
0
ファイル: MeleeRootNode.cs プロジェクト: nnn1590/Smash-Forge
        public MeleeRootNode(DATRoot Root)
        {
            this.Root = Root;
            Text      = Root.Text;

            SelectedImageKey = "folder";
            ImageKey         = "folder";

            Checked = true;

            ContextMenu = new ContextMenu();

            MenuItem exportAs = new MenuItem("Export As");

            exportAs.Click += ExportAs;
            ContextMenu.MenuItems.Add(exportAs);

            MenuItem exportMaterialXml = new MenuItem("Export Material XML");

            exportMaterialXml.Click += ExportMaterialXml_Click;
            ContextMenu.MenuItems.Add(exportMaterialXml);

            DataObjects.ContextMenu = new ContextMenu();

            MenuItem removeTex = new MenuItem("Remove Unused Textures");

            removeTex.Click += RemoveAllTextures;
            DataObjects.ContextMenu.MenuItems.Add(removeTex);
        }
コード例 #2
0
        public DATFile GetAsDATFile()
        {
            DATFile d    = new DATFile();
            DATRoot root = new DATRoot();

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

            return(d);
        }
コード例 #3
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]);
             *      }
             *  }
             * }*/
        }