Example #1
0
            private void New(object sender, EventArgs args)
            {
                BNTX bntx = new BNTX();

                bntx.FileName = "textures.bntx";
                bntx.Data     = CreateNewBNTX("textures.bntx");
                bntx.Load();

                ObjectList.Instance.treeView1.Nodes.Add(bntx);
            }
Example #2
0
        public void Load(ResFile res)
        {
            resFile = res;

            Text = resFile.Name;
            UpdateTree(resFile);

            foreach (ShapeAnim anim in resFile.ShapeAnims)
            {
                Nodes["FSHPA"].Nodes.Add(anim.Name);
            }
            foreach (VisibilityAnim anim in resFile.BoneVisibilityAnims)
            {
                Nodes["FBNV"].Nodes.Add(anim.Name);
            }

            int ext = 0;

            foreach (ExternalFile extfile in resFile.ExternalFiles)
            {
                string Name = resFile.ExternalFileDict.GetKey(ext);

                FileReader f     = new FileReader(extfile.Data);
                string     Magic = f.ReadMagic(0, 4);
                if (Magic == "BNTX")
                {
                    BNTX bntx = new BNTX();
                    bntx.Data     = extfile.Data;
                    bntx.FileName = Name;
                    bntx.Load();
                    bntx.IFileInfo.InArchive = true;
                    Nodes["EXT"].Nodes.Add(bntx);
                }
                else if (Magic == "FSHA")
                {
                    Nodes["EXT"].Nodes.Add(new BfshaFileData(extfile.Data, Name));
                }
                else
                {
                    Nodes["EXT"].Nodes.Add(new ExternalFileData(extfile.Data, Name));
                }

                f.Dispose();
                f.Close();

                ext++;
            }
        }