Fix song select buttons not working after attempting to force-exit when mod select is open - #38221
Fix song select buttons not working after attempting to force-exit when mod select is open#38221Joehuu wants to merge 3 commits into
Conversation
|
|
||
| public void SetButtons(IReadOnlyList<ScreenFooterButton> buttons) | ||
| { | ||
| temporarilyHiddenButtons.Clear(); |
There was a problem hiding this comment.
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()
{
There was a problem hiding this comment.
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
When pressing Alt-F4, the mod select overlay never closes and does this in order:
Pressing home or exiting via Esc runs
clearActiveOverlayContainer()first, and it doesn't trigger the bug because thehiddenButtonsContainercontainer gets cleared before thetemporarilyHiddenButtonslist does. Unsure whySetButtons()needs to cleartemporarilyHiddenButtons. There's no regression when I tested.Hide()ing the overlay on the screen'sOnExiting()is also a fix.MultiplayerMatchSongSelectalready hasfreeModSelect.Hide().I've applied both above as one makes sure the bug doesn't happen anymore when forgetting to
Hide()the overlay on the screen'sOnExiting()and the other fixes the no pop out animation.