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); } } }
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); } } } }
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); } } } } }
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); } } } }
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; } } }
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); } } } }