1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-28 10:17:19 +08:00

Disable watch button on the local user

This commit is contained in:
Joehu 2020-11-09 18:39:35 -08:00
parent d7c30f9b42
commit c671d97e6f

View File

@ -102,6 +102,8 @@ namespace osu.Game.Overlays.Dashboard
{ {
public readonly User User; public readonly User User;
private PurpleTriangleButton watchButton;
[Resolved(canBeNull: true)] [Resolved(canBeNull: true)]
private OsuGame game { get; set; } private OsuGame game { get; set; }
@ -127,7 +129,7 @@ namespace osu.Game.Overlays.Dashboard
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
}, },
new PurpleTriangleButton watchButton = new PurpleTriangleButton
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Text = "Watch", Text = "Watch",
@ -139,6 +141,12 @@ namespace osu.Game.Overlays.Dashboard
}, },
}; };
} }
[BackgroundDependencyLoader]
private void load(IAPIProvider api)
{
watchButton.Enabled.Value = User.Id != api.LocalUser.Value.Id;
}
} }
} }
} }