Osu: You can spectate yourself

Created on 9 Nov 2020  路  3Comments  路  Source: ppy/osu

Describe the bug:
You can spectate yourself on lazer, and that shouldn't be possible
Screenshots or videos showing encountered issue:
https://youtu.be/fQbsFrqY50o
osu!lazer version:
2020.1109.0

low-priority online

Most helpful comment

A temporary solution is to avoid doing so for the time being.

All 3 comments

A temporary solution is to avoid doing so for the time being.

I think just disabling the button, but leaving the local user there works right now.
dotnet_Q2oF7B3Fj8

diff --git a/osu.Game/Overlays/Dashboard/CurrentlyPlayingDisplay.cs b/osu.Game/Overlays/Dashboard/CurrentlyPlayingDisplay.cs
index c3ab9e86d..daed66533 100644
--- a/osu.Game/Overlays/Dashboard/CurrentlyPlayingDisplay.cs
+++ b/osu.Game/Overlays/Dashboard/CurrentlyPlayingDisplay.cs
@@ -42,9 +42,6 @@ private void load()
             };
         }

-        [Resolved]
-        private IAPIProvider api { get; set; }
-
         [Resolved]
         private UserLookupCache users { get; set; }

@@ -102,6 +99,8 @@ private class PlayingUserPanel : CompositeDrawable
         {
             public readonly User User;

+            private PurpleTriangleButton watchButton;
+
             [Resolved(canBeNull: true)]
             private OsuGame game { get; set; }

@@ -127,7 +126,7 @@ public PlayingUserPanel(User user)
                                 Anchor = Anchor.TopCentre,
                                 Origin = Anchor.TopCentre,
                             },
-                            new PurpleTriangleButton
+                            watchButton = new PurpleTriangleButton
                             {
                                 RelativeSizeAxes = Axes.X,
                                 Text = "Watch",
@@ -139,6 +138,12 @@ public PlayingUserPanel(User user)
                     },
                 };
             }
+
+            [BackgroundDependencyLoader]
+            private void load(IAPIProvider api)
+            {
+                watchButton.Enabled.Value = User.Id != api.LocalUser.Value.Id;
+            }
         }
     }
 }

You're welcome to PR that change (although the DI'd prop likely needs to remain where it is).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GameBoyYeet picture GameBoyYeet  路  3Comments

czapek1337 picture czapek1337  路  3Comments

Gonzalo-Bruna picture Gonzalo-Bruna  路  3Comments

LanTenDragon picture LanTenDragon  路  3Comments

smileyhead picture smileyhead  路  3Comments