mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Let TeamDisplay
take the full MultiplayerRoomUser
rather than the underlying User
This commit is contained in:
@ -83,7 +83,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
|||||||
Colour = Color4Extensions.FromHex("#F7E65D"),
|
Colour = Color4Extensions.FromHex("#F7E65D"),
|
||||||
Alpha = 0
|
Alpha = 0
|
||||||
},
|
},
|
||||||
new TeamDisplay(user),
|
new TeamDisplay(User),
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
@ -11,7 +11,6 @@ using osu.Game.Graphics;
|
|||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
using osu.Game.Online.Multiplayer.MatchTypes.TeamVersus;
|
using osu.Game.Online.Multiplayer.MatchTypes.TeamVersus;
|
||||||
using osu.Game.Users;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -19,16 +18,14 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
|||||||
{
|
{
|
||||||
internal class TeamDisplay : MultiplayerRoomComposite
|
internal class TeamDisplay : MultiplayerRoomComposite
|
||||||
{
|
{
|
||||||
private readonly User user;
|
private readonly MultiplayerRoomUser user;
|
||||||
|
|
||||||
private Drawable box;
|
private Drawable box;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuColour colours { get; set; }
|
private OsuColour colours { get; set; }
|
||||||
|
|
||||||
[Resolved]
|
public TeamDisplay(MultiplayerRoomUser user)
|
||||||
private MultiplayerClient client { get; set; }
|
|
||||||
|
|
||||||
public TeamDisplay(User user)
|
|
||||||
{
|
{
|
||||||
this.user = user;
|
this.user = user;
|
||||||
|
|
||||||
@ -61,7 +58,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (user.Id == client.LocalUser?.UserID)
|
if (Client.LocalUser?.Equals(user) == true)
|
||||||
{
|
{
|
||||||
InternalChild = new OsuClickableContainer
|
InternalChild = new OsuClickableContainer
|
||||||
{
|
{
|
||||||
@ -79,9 +76,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
|||||||
|
|
||||||
private void changeTeam()
|
private void changeTeam()
|
||||||
{
|
{
|
||||||
client.SendMatchRequest(new ChangeTeamRequest
|
Client.SendMatchRequest(new ChangeTeamRequest
|
||||||
{
|
{
|
||||||
TeamID = ((client.LocalUser?.MatchState as TeamVersusUserState)?.TeamID + 1) % 2 ?? 0,
|
TeamID = ((Client.LocalUser?.MatchState as TeamVersusUserState)?.TeamID + 1) % 2 ?? 0,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,7 +90,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
|||||||
|
|
||||||
// we don't have a way of knowing when an individual user's state has updated, so just handle on RoomUpdated for now.
|
// we don't have a way of knowing when an individual user's state has updated, so just handle on RoomUpdated for now.
|
||||||
|
|
||||||
var userRoomState = Room?.Users.FirstOrDefault(u => u.UserID == user.Id)?.MatchState;
|
var userRoomState = Room?.Users.FirstOrDefault(u => u.Equals(user))?.MatchState;
|
||||||
|
|
||||||
const double duration = 400;
|
const double duration = 400;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user