Пример #1
0
        public void Load()
        {
            IsActive = true;
            CanSave  = true;

            using (FileReader reader = new FileReader(new MemoryStream(Data)))
            {
                reader.Seek(4);
                if (reader.ReadInt32() != 0x20202020)
                {
                    IsWiiU = true;
                }
                reader.Close();
            }

            bfres                         = new BFRESRender();
            bfres.ResFileNode             = new ResourceFile(this);
            bfres.ResFileNode.BFRESRender = bfres;

            EditorRoot = bfres.ResFileNode;

            if (IsWiiU)
            {
                bfres.LoadFile(new Syroot.NintenTools.Bfres.ResFile(new System.IO.MemoryStream(Data)));
            }
            else
            {
                bfres.LoadFile(new Syroot.NintenTools.NSW.Bfres.ResFile(new System.IO.MemoryStream(Data)));
            }

            Runtime.abstractGlDrawables.Add(bfres);
        }
Пример #2
0
        public void Load()
        {
            IsActive = true;
            CanSave  = true;



            ImageKey         = "bfres";
            SelectedImageKey = "bfres";

            ContextMenu = new ContextMenu();
            MenuItem save = new MenuItem("Save");

            ContextMenu.MenuItems.Add(save);
            save.Click += Save;

            MenuItem newMenu = new MenuItem("New");
            MenuItem import  = new MenuItem("Import");
            //       ContextMenu.MenuItems.Add(newMenu);
            //       ContextMenu.MenuItems.Add(import);

            MenuItem rename = new MenuItem("Rename");

            ContextMenu.MenuItems.Add(rename);
            rename.Click += Rename;
            MenuItem remove = new MenuItem("Remove");

            ContextMenu.MenuItems.Add(remove);
            remove.Click += Remove;

            if (Parent == null)
            {
                remove.Enabled = false;
            }

            if (IsWiiU)
            {
            }
            else
            {
                MenuItem model    = new MenuItem("Model");
                MenuItem fska     = new MenuItem("Skeletal Animation");
                MenuItem fmaa     = new MenuItem("Material Animation");
                MenuItem bonevis  = new MenuItem("Bone Visual Animation");
                MenuItem shape    = new MenuItem("Shape Animation");
                MenuItem scene    = new MenuItem("Scene Animation");
                MenuItem embedded = new MenuItem("Embedded File");
                MenuItem texture  = new MenuItem("Texture File");
                texture.Click += NewTextureFile;
                newMenu.MenuItems.Add(model);
                newMenu.MenuItems.Add(fska);
                newMenu.MenuItems.Add(fmaa);
                newMenu.MenuItems.Add(bonevis);
                newMenu.MenuItems.Add(shape);
                newMenu.MenuItems.Add(scene);
                newMenu.MenuItems.Add(embedded);
                newMenu.MenuItems.Add(texture);

                MenuItem importmodel    = new MenuItem("Model");
                MenuItem importfska     = new MenuItem("Skeletal Animation");
                MenuItem importfmaa     = new MenuItem("Material Animation");
                MenuItem importbonevis  = new MenuItem("Bone Visual Animation");
                MenuItem importshape    = new MenuItem("Shape Animation");
                MenuItem importscene    = new MenuItem("Scene Animation");
                MenuItem importembedded = new MenuItem("Embedded File");
                MenuItem importtexture  = new MenuItem("Texture File");
                import.MenuItems.Add(importmodel);
                import.MenuItems.Add(importfska);
                import.MenuItems.Add(importfmaa);
                import.MenuItems.Add(importbonevis);
                import.MenuItems.Add(importshape);
                import.MenuItems.Add(importscene);
                import.MenuItems.Add(importembedded);
                import.MenuItems.Add(importtexture);
            }

            BFRESRender             = new BFRESRender();
            BFRESRender.ResFileNode = this;

            if (IsWiiU)
            {
                BFRESRender.LoadFile(new Syroot.NintenTools.Bfres.ResFile(new System.IO.MemoryStream(Data)));
            }
            else
            {
                BFRESRender.LoadFile(new Syroot.NintenTools.NSW.Bfres.ResFile(new System.IO.MemoryStream(Data)));
            }

            Runtime.abstractGlDrawables.Add(BFRESRender);
        }