Exemplo n.º 1
0
        public void ImportChild()
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter   = FileFilters.BONE;
            ofd.FileName = Text;

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                BfresBone bn = new BfresBone(skeletonParent);

                if (BoneU != null)
                {
                    BoneU = new ResU.Bone();
                    BoneU.Import(ofd.FileName, GetResFileU());
                    BoneU.Name = CheckDuplicateBoneNames(BoneU.Name);

                    BfresWiiU.ReadBone(bn, BoneU, false);
                    Nodes.Add(bn);
                    skeletonParent.bones.Add(bn);
                    ((FSKL)skeletonParent).AddBone(BoneU);
                }
                else
                {
                    Bone = new Bone();
                    Bone.Import(ofd.FileName);
                    Bone.Name = CheckDuplicateBoneNames(Bone.Name);

                    BfresSwitch.ReadBone(bn, Bone, false);
                    Nodes.Add(bn);
                    skeletonParent.bones.Add(bn);
                    ((FSKL)skeletonParent).AddBone(Bone);
                }
            }
        }
Exemplo n.º 2
0
            public override void Import(string[] FileNames)
            {
                foreach (var FileName in FileNames)
                {
                    string extension = System.IO.Path.GetExtension(FileName);

                    if (extension == ".bfbon")
                    {
                        BfresBone bn = new BfresBone();

                        if (SkeletonU != null)
                        {
                            ResU.Bone bone = new ResU.Bone();
                            bone.Import(FileName, GetResFileU());

                            BfresWiiU.ReadBone(bn, bone, false);
                        }
                        else
                        {
                            Bone bone = new Bone();
                            bone.Import(FileName);

                            BfresSwitch.ReadBone(bn, bone, false);
                        }
                    }
                }
            }
Exemplo n.º 3
0
            public void ReplaceMatchingFolder()
            {
                FolderSelectDialog ofd = new FolderSelectDialog();

                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    foreach (var file in System.IO.Directory.GetFiles(ofd.SelectedPath))
                    {
                        string extension = System.IO.Path.GetExtension(file);

                        if (extension == ".bfbon")
                        {
                            if (SkeletonU != null)
                            {
                                ResU.Bone BoneTemp = new ResU.Bone();
                                BoneTemp.Import(file, GetResFileU());

                                foreach (BfresBone bone in fskl.bones)
                                {
                                    if (BoneTemp.Name == bone.Text)
                                    {
                                        bone.CopyData(BoneTemp);
                                    }
                                }

                                BfresWiiU.ReadSkeleton(this, SkeletonU, fskl);
                            }
                            else
                            {
                                Bone BoneTemp = new Bone();
                                BoneTemp.Import(file);

                                foreach (BfresBone bone in fskl.bones)
                                {
                                    if (BoneTemp.Name == bone.Text)
                                    {
                                        bone.CopyData(BoneTemp);
                                    }
                                }

                                BfresSwitch.ReadSkeleton(this, Skeleton, fskl);
                            }
                        }
                    }
                }
            }
Exemplo n.º 4
0
            public override void Import(string[] FileNames)
            {
                foreach (var FileName in FileNames)
                {
                    string extension = System.IO.Path.GetExtension(FileName);

                    if (extension == ".bfbon")
                    {
                        BfresBone bn = new BfresBone(fskl);

                        List <string> boneKeys = fskl.bones.Select(i => i.Text).ToList();
                        if (SkeletonU != null)
                        {
                            ResU.Bone bone = new ResU.Bone();
                            bone.Import(FileName, GetResFileU());
                            bone.ParentIndex = -1;
                            bone.Name        = Utils.RenameDuplicateString(boneKeys, bone.Name);

                            BfresWiiU.ReadBone(bn, bone, false);

                            Nodes.Add(bn);
                            fskl.bones.Add(bn);

                            bn.BoneU.ParentIndex = (short)bn.parentIndex;
                            fskl.AddBone(bn.BoneU);
                        }
                        else
                        {
                            Bone bone = new Bone();
                            bone.Import(FileName);
                            bone.ParentIndex = -1;
                            bone.Name        = Utils.RenameDuplicateString(boneKeys, bone.Name);

                            BfresSwitch.ReadBone(bn, bone, false);

                            Nodes.Add(bn);
                            fskl.bones.Add(bn);

                            bn.Bone.ParentIndex = (short)bn.parentIndex;
                            fskl.AddBone(bn.Bone);
                        }
                    }
                }
            }
Exemplo n.º 5
0
        public void Replace()
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter = FileFilters.BONE;

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                if (BoneU != null)
                {
                    BoneU.Import(ofd.FileName, GetResFileU());
                    BoneU.Name = Text;
                }
                else
                {
                    Bone.Import(ofd.FileName);
                    Bone.Name = Text;
                }
            }
        }
Exemplo n.º 6
0
            public override void Import(string[] FileNames)
            {
                foreach (var FileName in FileNames)
                {
                    string extension = System.IO.Path.GetExtension(FileName);

                    if (extension == ".bfbon")
                    {
                        BfresBone bn = new BfresBone(fskl);

                        if (SkeletonU != null)
                        {
                            ResU.Bone bone = new ResU.Bone();
                            bone.Import(FileName, GetResFileU());
                            bone.ParentIndex = -1;

                            BfresWiiU.ReadBone(bn, bone, false);

                            Nodes.Add(bn);
                            fskl.bones.Add(bn);

                            bn.BoneU.ParentIndex = (short)bn.parentIndex;
                            fskl.AddBone(bn.Bone);
                        }
                        else
                        {
                            Bone bone = new Bone();
                            bone.Import(FileName);
                            bone.ParentIndex = -1;

                            BfresSwitch.ReadBone(bn, bone, false);

                            Nodes.Add(bn);
                            fskl.bones.Add(bn);

                            bn.Bone.ParentIndex = (short)bn.parentIndex;
                            fskl.AddBone(bn.Bone);
                        }
                    }
                }
            }