Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back button in spectator screen overlapping with bottom-left side of progress bar #26426

Closed
frenzibyte opened this issue Jan 7, 2024 · 7 comments · Fixed by #27414
Closed

Comments

@frenzibyte
Copy link
Member

Type

Cosmetic

Bug description

The hold-to-exit button on the bottom right is already there, so I wouldn't imagine the back button to be visible in the first place.

Screenshots or videos

CleanShot 2024-01-07 at 20 49 31

Version

2023.1231.0-lazer

Logs

@bdach
Copy link
Collaborator

bdach commented Jan 7, 2024

See #25770 for reason why button is there.

As a frequent contributor, I would expect you to generally know to look into the reason behind things by checking blame.

@frenzibyte
Copy link
Member Author

As a frequent contributor, I would expect you to generally know to look into the reason behind things by checking blame.

What purpose does the PR you linked serve for this issue thread? What does blame have anything to do with opening an issue thread about a blatant cosmetic issue here? I'm failing to see your point here sorry.

@bdach
Copy link
Collaborator

bdach commented Jan 7, 2024

From OP:

I wouldn't imagine the back button to be visible in the first place

It was made visible by #25770 to fix #25763. Which explains why the button is visible and would show in history/blame.

@Joehuu
Copy link
Member

Joehuu commented Feb 12, 2024

Is showing just the quit button on fail overlay a solution? The commit a4be28a (#25566) seems to just be focusing on the unexpected behavior of retry, see #25566 (comment).

diff --git a/osu.Game/Screens/Play/FailOverlay.cs b/osu.Game/Screens/Play/FailOverlay.cs
index 210ae5ceb6..00dd072c4e 100644
--- a/osu.Game/Screens/Play/FailOverlay.cs
+++ b/osu.Game/Screens/Play/FailOverlay.cs
@@ -26,21 +26,20 @@ public partial class FailOverlay : GameplayMenuOverlay
 
         public override LocalisableString Header => GameplayMenuOverlayStrings.FailedHeader;
 
-        private readonly bool showButtons;
+        private readonly bool showRetryButton;
 
-        public FailOverlay(bool showButtons = true)
+        public FailOverlay(bool showRetryButton = true)
         {
-            this.showButtons = showButtons;
+            this.showRetryButton = showRetryButton;
         }
 
         [BackgroundDependencyLoader]
         private void load(OsuColour colours)
         {
-            if (showButtons)
-            {
+            if (showRetryButton)
                 AddButton(GameplayMenuOverlayStrings.Retry, colours.YellowDark, () => OnRetry?.Invoke());
-                AddButton(GameplayMenuOverlayStrings.Quit, new Color4(170, 27, 39, 255), () => OnQuit?.Invoke());
-            }
+
+            AddButton(GameplayMenuOverlayStrings.Quit, new Color4(170, 27, 39, 255), () => OnQuit?.Invoke());
 
             // from #10339 maybe this is a better visual effect
             Add(new Container
diff --git a/osu.Game/Screens/Play/SpectatorPlayer.cs b/osu.Game/Screens/Play/SpectatorPlayer.cs
index 2faead0ee1..d1404ac184 100644
--- a/osu.Game/Screens/Play/SpectatorPlayer.cs
+++ b/osu.Game/Screens/Play/SpectatorPlayer.cs
@@ -25,8 +25,6 @@ public abstract partial class SpectatorPlayer : Player
 
         private readonly Score score;
 
-        public override bool AllowBackButton => true;
-
         protected override bool CheckModsAllowFailure()
         {
             if (!allowFail)
Kapture.2024-02-12.at.09.24.34.mp4

@bdach
Copy link
Collaborator

bdach commented Feb 12, 2024

In principle I'm not opposed to the appearance. The code is a bit eh but probably passable.

That said does it actually work correctly? That's not shown on video and I'm a bit skeptical that it will.

@Joehuu
Copy link
Member

Joehuu commented Feb 12, 2024

Yes it does after testing. Comment here should be updated though, probably just removing the text inside the parenthesis:

protected virtual Action BackAction => () =>
{
// We prefer triggering the button click as it will animate...
// but sometimes buttons aren't present (see FailOverlay's constructor as an example).
if (Buttons.Any())
Buttons.Last().TriggerClick();
else
OnQuit?.Invoke();
};

@bdach
Copy link
Collaborator

bdach commented Feb 12, 2024

I'd keep the comment and guard as a safety, and probably allow setting the visibility of all three buttons via an init property or something? Not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants