mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Split out IPerformFromScreenRunner
to allow for easier testing
This commit is contained in:
@ -14,6 +14,7 @@ using osu.Game.Database;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Spectator;
|
||||
using osu.Game.Screens;
|
||||
using osu.Game.Screens.OnlinePlay.Match.Components;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Users;
|
||||
@ -106,7 +107,7 @@ namespace osu.Game.Overlays.Dashboard
|
||||
public readonly APIUser User;
|
||||
|
||||
[Resolved(canBeNull: true)]
|
||||
private OsuGame game { get; set; }
|
||||
private IPerformFromScreenRunner performer { get; set; }
|
||||
|
||||
public PlayingUserPanel(APIUser user)
|
||||
{
|
||||
@ -140,7 +141,7 @@ namespace osu.Game.Overlays.Dashboard
|
||||
Text = "Watch",
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
Action = () => game?.PerformFromScreen(s => s.Push(new SoloSpectator(User))),
|
||||
Action = () => performer?.PerformFromScreen(s => s.Push(new SoloSpectator(User))),
|
||||
Enabled = { Value = User.Id != api.LocalUser.Value.Id }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user