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)
|
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;
|
BoneU.Name = Name;
|
||||||
Text = Name;
|
Text = Name;
|
||||||
BoneName = Name;
|
BoneName = Name;
|
||||||
|
|
||||||
//Adjust dictionaries
|
//Adjust dictionaries
|
||||||
var Skeleton = ((FSKL)skeletonParent).node.SkeletonU;
|
|
||||||
Skeleton.Bones.Remove(BoneU);
|
Skeleton.Bones.Remove(BoneU);
|
||||||
Skeleton.Bones.Add(Name, BoneU);
|
Skeleton.Bones.Add(Name, BoneU);
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ namespace FirstPlugin
|
|||||||
|
|
||||||
nameIndexUD.Value = bn.GetIndex();
|
nameIndexUD.Value = bn.GetIndex();
|
||||||
|
|
||||||
nameTB.Bind(bn, "BoneName");
|
nameTB.Text = bn.BoneName;
|
||||||
parentIndexUD.Bind(bn, "parentIndex");
|
parentIndexUD.Bind(bn, "parentIndex");
|
||||||
visibleChk.Bind(bn, "Visible");
|
visibleChk.Bind(bn, "Visible");
|
||||||
|
|
||||||
@ -39,7 +39,8 @@ namespace FirstPlugin
|
|||||||
|
|
||||||
private void nameTB_TextChanged(object sender, EventArgs e)
|
private void nameTB_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
if (Loaded)
|
||||||
|
activeBone.RenameBone(nameTB.Text);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void visibleChk_CheckedChanged(object sender, EventArgs e) {
|
private void visibleChk_CheckedChanged(object sender, EventArgs e) {
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user