mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 12:22:57 +08:00
Fix TeamDisplay
not showing after changing to team versus
This commit is contained in:
parent
52c740b377
commit
328c72c358
@ -29,52 +29,51 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuColour colours { get; set; }
|
private OsuColour colours { get; set; }
|
||||||
|
|
||||||
|
private OsuClickableContainer clickableContent;
|
||||||
|
|
||||||
public TeamDisplay(MultiplayerRoomUser user)
|
public TeamDisplay(MultiplayerRoomUser user)
|
||||||
{
|
{
|
||||||
this.user = user;
|
this.user = user;
|
||||||
|
|
||||||
RelativeSizeAxes = Axes.Y;
|
RelativeSizeAxes = Axes.Y;
|
||||||
Width = 15;
|
|
||||||
|
AutoSizeAxes = Axes.X;
|
||||||
|
|
||||||
Margin = new MarginPadding { Horizontal = 3 };
|
Margin = new MarginPadding { Horizontal = 3 };
|
||||||
|
|
||||||
Alpha = 0;
|
|
||||||
Scale = new Vector2(0, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio)
|
private void load(AudioManager audio)
|
||||||
{
|
{
|
||||||
box = new Container
|
InternalChild = clickableContent = new OsuClickableContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
Width = 15,
|
||||||
CornerRadius = 5,
|
Alpha = 0,
|
||||||
Masking = true,
|
|
||||||
Scale = new Vector2(0, 1),
|
Scale = new Vector2(0, 1),
|
||||||
Anchor = Anchor.Centre,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Origin = Anchor.Centre,
|
Action = changeTeam,
|
||||||
Child = new Box
|
Child = box = new Container
|
||||||
{
|
{
|
||||||
Colour = Color4.White,
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
CornerRadius = 5,
|
||||||
|
Masking = true,
|
||||||
|
Scale = new Vector2(0, 1),
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
Child = new Box
|
||||||
|
{
|
||||||
|
Colour = Color4.White,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Client.LocalUser?.Equals(user) == true)
|
if (Client.LocalUser?.Equals(user) == true)
|
||||||
{
|
{
|
||||||
InternalChild = new OsuClickableContainer
|
clickableContent.Action = changeTeam;
|
||||||
{
|
clickableContent.TooltipText = "Change team";
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
TooltipText = "Change team",
|
|
||||||
Action = changeTeam,
|
|
||||||
Child = box
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
InternalChild = box;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sampleTeamSwap = audio.Samples.Get(@"Multiplayer/team-swap");
|
sampleTeamSwap = audio.Samples.Get(@"Multiplayer/team-swap");
|
||||||
@ -117,13 +116,13 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
|||||||
box.FadeColour(getColourForTeam(DisplayedTeam.Value), duration, Easing.OutQuint);
|
box.FadeColour(getColourForTeam(DisplayedTeam.Value), duration, Easing.OutQuint);
|
||||||
box.ScaleTo(new Vector2(box.Scale.X < 0 ? 1 : -1, 1), duration, Easing.OutQuint);
|
box.ScaleTo(new Vector2(box.Scale.X < 0 ? 1 : -1, 1), duration, Easing.OutQuint);
|
||||||
|
|
||||||
this.ScaleTo(Vector2.One, duration, Easing.OutQuint);
|
clickableContent.ScaleTo(Vector2.One, duration, Easing.OutQuint);
|
||||||
this.FadeIn(duration);
|
clickableContent.FadeIn(duration);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.ScaleTo(new Vector2(0, 1), duration, Easing.OutQuint);
|
clickableContent.ScaleTo(new Vector2(0, 1), duration, Easing.OutQuint);
|
||||||
this.FadeOut(duration);
|
clickableContent.FadeOut(duration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user