Skip to content

Commit

Permalink
Fix auto-closing msbt containers on delete
Browse files Browse the repository at this point in the history
  • Loading branch information
Amethyst-szs committed Jan 27, 2025
1 parent c101865 commit 6d89d0d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions MoonFlow/scene/editor/msbt/list/container/EntryListBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,21 @@ private void UpdateDropdownMenuContainers()
if (child.GetType() != typeof(MarginContainer))
continue;

// Attempt to find dropdown button connected to this margin
var margin = child as MarginContainer;
margin.Hide();

if (!margin.HasMeta("dropdown"))
continue;

// Update visibility on dropdown button
var dropdown = margin.GetMeta("dropdown").As<Button>();
dropdown.ButtonPressed = false;
dropdown.Visible = IsDropdownMenuVisibleChildren(margin);

// If the dropdown button got hidden, hide the container as well
if (!dropdown.Visible)
{
margin.Hide();
dropdown.ButtonPressed = false;
}
}
}

Expand Down

0 comments on commit 6d89d0d

Please sign in to comment.