Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions osu.Game/Screens/Footer/ScreenFooter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,16 @@ public void SetButtons(IReadOnlyList<ScreenFooterButton> buttons)

var oldButtons = buttonsFlow.ToArray();

foreach (var b in oldButtons)
b.FinishTransforms();

buttonsFlow.UpdateSubTree();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cannot exist without inline commenting precisely explaining what it's doing.


for (int i = 0; i < oldButtons.Length; i++)
{
var oldButton = oldButtons[i];
oldButton.Enabled.Value = false;
oldButton.X = oldButton.DrawPosition.X;

buttonsFlow.Remove(oldButton, false);
hiddenButtonsContainer.Add(oldButton);
Expand Down Expand Up @@ -259,9 +265,16 @@ public IDisposable RegisterActiveOverlayContainer(ShearedOverlayContainer overla
? buttonsFlow.SkipWhile(b => b != targetButton).Skip(1)
: buttonsFlow);

foreach (var b in buttonsFlow)
b.FinishTransforms();

buttonsFlow.UpdateSubTree();

for (int i = temporarilyHiddenButtons.Count - 1; i >= 0; i--)
{
var button = temporarilyHiddenButtons[i];
button.X = button.DrawPosition.X;

buttonsFlow.Remove(button, false);
hiddenButtonsContainer.Add(button);

Expand Down
Loading