Add proper boen rename check
This commit is contained in:
parent
7632cc10da
commit
7f35cce88f
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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);
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user