Skip to content
Open
Show file tree
Hide file tree
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
20 changes: 20 additions & 0 deletions osu.Game.Tests/Visual/Navigation/TestSceneScreenNavigation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,26 @@ public void TestOpenModSelectOverlayUsingAction()
AddAssert("Overlay was shown", () => Game!.ChildrenOfType<ModSelectOverlay>().Single().State.Value == Visibility.Visible);
}

[Test]
public void TestFooterButtonsAfterModSelectForceExit()
{
Screens.Select.SongSelect songSelect = null;
MainMenu mainMenu = null;

AddUntilStep("get main menu", () => (mainMenu = Game.ScreenStack.CurrentScreen as MainMenu) != null);
PushAndConfirm(() => songSelect = new SoloSongSelect());
AddStep("show mods overlay", () => InputManager.Key(Key.F1));

// follows alt-f4 code path behavior, can't use home or `game.AttemptExit()` as those run `CloseAllOverlays()`
AddStep("force exit song select", () => mainMenu.MakeCurrent());

AddStep("import beatmap", () => BeatmapImportHelper.LoadQuickOszIntoOsu(Game).GetResultSafely());
PushAndConfirm(() => new SoloSongSelect());
AddUntilStep("wait for song select", () => songSelect.CarouselItemsPresented);
AddStep("show options", () => InputManager.Key(Key.F3));
AddAssert("options is shown", () => Game!.ChildrenOfType<FooterButtonOptions.Popover>().Single().State.Value, () => Is.EqualTo(Visibility.Visible));
}

[Test]
public void TestAttemptPlayBeatmapWrongHashFails()
{
Expand Down
1 change: 0 additions & 1 deletion osu.Game/Screens/Footer/ScreenFooter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ protected override void PopOut()

public void SetButtons(IReadOnlyList<ScreenFooterButton> buttons)
{
temporarilyHiddenButtons.Clear();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Subjective, but this change looks incorrect to me and it also behaves incorrectly in my opinion.

When SetButtons() is called with some buttons temporarily hidden this change makes it so that those temporarily hidden buttons are unhidden without transitions and then transitioned out.

master:

Screen.Recording.2026-07-07.at.07.31.27.mov

this PR:

Screen.Recording.2026-07-07.at.07.30.36.mov

test:

diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneScreenFooter.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneScreenFooter.cs
index cc74bcd598..1b04e39519 100644
--- a/osu.Game.Tests/Visual/UserInterface/TestSceneScreenFooter.cs
+++ b/osu.Game.Tests/Visual/UserInterface/TestSceneScreenFooter.cs
@@ -144,6 +144,45 @@ public void TestExternalOverlayContent()
             AddAssert("other buttons returned", () => ScreenFooter.ChildrenOfType<ScreenFooterButton>().Skip(1).All(b => b.ChildrenOfType<Container>().First().Y == 0));
         }
 
+        [Test]
+        public void TestBreakings()
+        {
+            TestScreen screen = null!;
+
+            AddStep("push screen", () =>
+            {
+                ShearedOverlayContainer overlay = new TestShearedOverlayContainer();
+
+                LoadScreen(screen = new TestScreen
+                {
+                    Overlay = overlay,
+                    CreateButtons = () => new[]
+                    {
+                        new ScreenFooterButton(overlay)
+                        {
+                            AccentColour = Dependencies.Get<OsuColour>().Orange1,
+                            Icon = FontAwesome.Solid.Toolbox,
+                            Text = "One",
+                        },
+                        new ScreenFooterButton { Text = "Two", Action = () => { } },
+                        new ScreenFooterButton { Text = "Three", Action = () => { } },
+                    },
+                });
+            });
+            AddUntilStep("wait until screen is loaded", () => screen.IsCurrentScreen(), () => Is.True);
+
+            AddStep("show overlay", () => screen.Overlay.Show());
+
+            AddStep("asd", () => ScreenFooter.SetButtons(
+                [
+                    new ScreenFooterButton
+                    {
+                        Text = "i break things", Action = () => { }
+                    }
+                ]
+            ));
+        }
+
         [Test]
         public void TestButtonsHiddenByExternalOverlayContentCannotBeTriggered()
         {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In master / latest release, a similar visual bug happens when pressing home at mod select overlay or TestShowOverlayHidesOtherOverlays / changing from freestyle mod select to regular:

Screen.Recording.2026-07-15.at.8.27.24.PM.mov
Screen.Recording.2026-07-15.at.8.28.36.PM.mov

Not sure what the FinishTransforms() added in 56d1255 fixes. Removing that or changing it to ClearTransforms() doesn't seem to regress things visually, unless there's an edge case. cc @frenzibyte

overlays.Clear();

this.HidePopover();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ public override bool OnExiting(ScreenExitEvent e)
return true;

addToPlaylistFooterButton.Disappear().Expire();
freeModSelect.Hide();
return false;
}

Expand Down
1 change: 1 addition & 0 deletions osu.Game/Screens/Select/SongSelect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@ private void onLeavingScreen()
modSelectOverlay.SelectedMods.UnbindFrom(Mods);
modSelectOverlay.Ruleset.UnbindFrom(Ruleset);
modSelectOverlay.Beatmap.UnbindFrom(Beatmap);
modSelectOverlay.Hide();

updateWedgeVisibility();

Expand Down
Loading