diff --git a/.vs/Switch_Toolbox/v15/.suo b/.vs/Switch_Toolbox/v15/.suo index a6d17542..0fb80a19 100644 Binary files a/.vs/Switch_Toolbox/v15/.suo and b/.vs/Switch_Toolbox/v15/.suo differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide index 6593ce2e..85da9cfd 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal index 61facc89..b2c58a13 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal differ diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSKL.cs b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSKL.cs index f580c182..0dd04443 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSKL.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/Bfres Structs/SubFiles/FMDL/FSKL.cs @@ -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); } diff --git a/Switch_FileFormatsMain/GUI/BFRES/Skeleton/BoneInfoPanel.cs b/Switch_FileFormatsMain/GUI/BFRES/Skeleton/BoneInfoPanel.cs index 57a953bf..3bf8be68 100644 --- a/Switch_FileFormatsMain/GUI/BFRES/Skeleton/BoneInfoPanel.cs +++ b/Switch_FileFormatsMain/GUI/BFRES/Skeleton/BoneInfoPanel.cs @@ -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) { diff --git a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache index 2953844a..a47cd96a 100644 Binary files a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache and b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache differ