Don't show button on self

This commit is contained in:
Dean Herbert
2021-08-11 17:39:23 +09:00
parent 50bda6023c
commit bb51ebd0ef
2 changed files with 5 additions and 5 deletions

View File

@ -165,7 +165,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg", CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg",
})); }));
AddUntilStep("kick buttons visible", () => this.ChildrenOfType<ParticipantPanel.KickButton>().Count(d => d.IsPresent) == 2); AddUntilStep("kick buttons visible", () => this.ChildrenOfType<ParticipantPanel.KickButton>().Count(d => d.IsPresent) == 1);
AddStep("make second user host", () => Client.TransferHost(3)); AddStep("make second user host", () => Client.TransferHost(3));
@ -173,7 +173,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
AddStep("make local user host again", () => Client.TransferHost(API.LocalUser.Value.Id)); AddStep("make local user host again", () => Client.TransferHost(API.LocalUser.Value.Id));
AddUntilStep("kick buttons visible", () => this.ChildrenOfType<ParticipantPanel.KickButton>().Count(d => d.IsPresent) == 2); AddUntilStep("kick buttons visible", () => this.ChildrenOfType<ParticipantPanel.KickButton>().Count(d => d.IsPresent) == 1);
} }
[Test] [Test]
@ -186,7 +186,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg", CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg",
})); }));
AddStep("kick second user", () => this.ChildrenOfType<ParticipantPanel.KickButton>().Last().TriggerClick()); AddStep("kick second user", () => this.ChildrenOfType<ParticipantPanel.KickButton>().Single(d => d.IsPresent).TriggerClick());
AddAssert("second user kicked", () => Client.Room?.Users.Single().UserID == API.LocalUser.Value.Id); AddAssert("second user kicked", () => Client.Room?.Users.Single().UserID == API.LocalUser.Value.Id);
} }

View File

@ -184,7 +184,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
{ {
base.OnRoomUpdated(); base.OnRoomUpdated();
if (Room == null) if (Room == null || Client.LocalUser == null)
return; return;
const double fade_time = 50; const double fade_time = 50;
@ -196,7 +196,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
userStateDisplay.UpdateStatus(User.State, User.BeatmapAvailability); userStateDisplay.UpdateStatus(User.State, User.BeatmapAvailability);
if (Client.LocalUser != null && Room.Host?.Equals(Client.LocalUser) == true) if (Client.IsHost && !User.Equals(Client.LocalUser))
kickButton.FadeIn(fade_time); kickButton.FadeIn(fade_time);
else else
kickButton.FadeOut(fade_time); kickButton.FadeOut(fade_time);