1
0
mirror of synced 2024-11-29 09:44:32 +01:00

Add proper boen rename check

This commit is contained in:
KillzXGaming 2019-05-11 12:38:24 -04:00
parent 7632cc10da
commit 7f35cce88f
6 changed files with 15 additions and 3 deletions

Binary file not shown.

View File

@ -558,12 +558,23 @@ namespace Bfres.Structs
{
if (((FSKL)skeletonParent).node.SkeletonU != null)
{
var Skeleton = ((FSKL)skeletonParent).node.SkeletonU;
Skeleton.Bones.Remove(BoneU);
if (Skeleton.Bones.ContainsKey(Name))
{
MessageBox.Show("A bone with the same name exits! Make sure to use a unique name!",
"Bone Rename", MessageBoxButtons.OK, MessageBoxIcon.Error);
Skeleton.Bones.Add(BoneName, BoneU);
return;
}
BoneU.Name = Name;
Text = Name;
BoneName = Name;
//Adjust dictionaries
var Skeleton = ((FSKL)skeletonParent).node.SkeletonU;
Skeleton.Bones.Remove(BoneU);
Skeleton.Bones.Add(Name, BoneU);
}

View File

@ -30,7 +30,7 @@ namespace FirstPlugin
nameIndexUD.Value = bn.GetIndex();
nameTB.Bind(bn, "BoneName");
nameTB.Text = bn.BoneName;
parentIndexUD.Bind(bn, "parentIndex");
visibleChk.Bind(bn, "Visible");
@ -39,7 +39,8 @@ namespace FirstPlugin
private void nameTB_TextChanged(object sender, EventArgs e)
{
if (Loaded)
activeBone.RenameBone(nameTB.Text);
}
private void visibleChk_CheckedChanged(object sender, EventArgs e) {