From 6f081935a06d9ca5e7a2129bbd6751b6fb6fb66d Mon Sep 17 00:00:00 2001 From: ook3D Date: Thu, 8 Jun 2023 15:18:32 -0400 Subject: [PATCH] Fixed Drop Down Menu not changing Flags1 Value thanks again alexguirre :D --- CodeWalker/Project/Panels/EditYndNodePanel.cs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/CodeWalker/Project/Panels/EditYndNodePanel.cs b/CodeWalker/Project/Panels/EditYndNodePanel.cs index 01c9d85..3edad15 100644 --- a/CodeWalker/Project/Panels/EditYndNodePanel.cs +++ b/CodeWalker/Project/Panels/EditYndNodePanel.cs @@ -35,7 +35,6 @@ namespace CodeWalker.Project.Panels Tag = node; UpdateFormTitle(); UpdateYndNodeUI(); - UpdateControls(); } private void UpdateFormTitle() @@ -44,14 +43,6 @@ namespace CodeWalker.Project.Panels Text = sn + " " + CurrentPathNode.NodeID.ToString(); } - private void UpdateControls() - { - if (CurrentPathNode != null) - { - SpecialTypeComboBox.Text = CurrentPathNode.Special.ToString(); - } - } - private void EditYndNodePathPanel_Load(object sender, EventArgs e) { SpecialTypeComboBox.Items.AddRange(Enum.GetNames(typeof(YndNodeSpecialType))); @@ -203,7 +194,6 @@ namespace CodeWalker.Project.Panels var flags4 = CurrentPathNode?.Flags4.Value ?? 0; var flags5 = (uint)(CurrentPathNode?.LinkCountUnk ?? 0); - if (updateCheckboxes) { PathNodeFlags01CheckBox.Checked = BitUtil.IsBitSet(flags0, 0); @@ -218,7 +208,7 @@ namespace CodeWalker.Project.Panels PathNodeFlags11CheckBox.Checked = BitUtil.IsBitSet(flags1, 0); PathNodeFlags12CheckBox.Checked = BitUtil.IsBitSet(flags1, 1); PathNodeFlags13CheckBox.Checked = BitUtil.IsBitSet(flags1, 2); - SpecialTypeComboBox.SelectedItem = (flags1 >> 3); + SpecialTypeComboBox.SelectedItem = ((YndNodeSpecialType)((flags1 >> 3) & 31)).ToString(); PathNodeFlags21CheckBox.Checked = BitUtil.IsBitSet(flags2, 0); PathNodeFlags22CheckBox.Checked = BitUtil.IsBitSet(flags2, 1); @@ -340,7 +330,7 @@ namespace CodeWalker.Project.Panels flags1 = BitUtil.UpdateBit(flags1, 0, PathNodeFlags11CheckBox.Checked); flags1 = BitUtil.UpdateBit(flags1, 1, PathNodeFlags12CheckBox.Checked); flags1 = BitUtil.UpdateBit(flags1, 2, PathNodeFlags13CheckBox.Checked); - flags1 += (((uint)SpecialTypeComboBox.SelectedItem) << 3); + flags1 += ((uint)(YndNodeSpecialType)Enum.Parse(typeof(YndNodeSpecialType), (string)SpecialTypeComboBox.SelectedItem) << 3); flags2 = BitUtil.UpdateBit(flags2, 0, PathNodeFlags21CheckBox.Checked); flags2 = BitUtil.UpdateBit(flags2, 1, PathNodeFlags22CheckBox.Checked); @@ -1275,7 +1265,7 @@ namespace CodeWalker.Project.Panels private void SpecialTypeComboBox_SelectedIndexChanged(object sender, EventArgs e) { - + SetPathNodeFlagsFromCheckBoxes(); } } }