mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 13:37:25 +08:00
Disable watch button on the local user
This commit is contained in:
parent
d7c30f9b42
commit
c671d97e6f
@ -102,6 +102,8 @@ namespace osu.Game.Overlays.Dashboard
|
||||
{
|
||||
public readonly User User;
|
||||
|
||||
private PurpleTriangleButton watchButton;
|
||||
|
||||
[Resolved(canBeNull: true)]
|
||||
private OsuGame game { get; set; }
|
||||
|
||||
@ -127,7 +129,7 @@ namespace osu.Game.Overlays.Dashboard
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
},
|
||||
new PurpleTriangleButton
|
||||
watchButton = new PurpleTriangleButton
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user