mirror of
https://github.com/osukey/osukey.git
synced 2025-05-09 23:57:18 +09:00
Add team display to participant list
This commit is contained in:
parent
b956d32587
commit
5e59b1325c
@ -17,6 +17,7 @@ using osu.Game.Graphics.Sprites;
|
|||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
|
using osu.Game.Online.Multiplayer.MatchRulesets.TeamVs;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Screens.Play.HUD;
|
using osu.Game.Screens.Play.HUD;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
@ -37,6 +38,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
|||||||
private RulesetStore rulesets { get; set; }
|
private RulesetStore rulesets { get; set; }
|
||||||
|
|
||||||
private SpriteIcon crown;
|
private SpriteIcon crown;
|
||||||
|
private Box teamDisplay;
|
||||||
|
|
||||||
private OsuSpriteText userRankText;
|
private OsuSpriteText userRankText;
|
||||||
private ModDisplay userModsDisplay;
|
private ModDisplay userModsDisplay;
|
||||||
private StateDisplay userStateDisplay;
|
private StateDisplay userStateDisplay;
|
||||||
@ -67,6 +70,13 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
|||||||
Colour = Color4Extensions.FromHex("#F7E65D"),
|
Colour = Color4Extensions.FromHex("#F7E65D"),
|
||||||
Alpha = 0
|
Alpha = 0
|
||||||
},
|
},
|
||||||
|
teamDisplay = new Box
|
||||||
|
{
|
||||||
|
Colour = Color4.Black,
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
Width = 15,
|
||||||
|
Alpha = 0,
|
||||||
|
},
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
@ -174,11 +184,36 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
|
|||||||
else
|
else
|
||||||
crown.FadeOut(fade_time);
|
crown.FadeOut(fade_time);
|
||||||
|
|
||||||
|
if (User.MatchRulesetState is TeamVsMatchUserState teamState)
|
||||||
|
{
|
||||||
|
teamDisplay.Show();
|
||||||
|
teamDisplay.FadeColour(getColourForTeam(teamState.TeamID), 100, Easing.OutQuint);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
teamDisplay.Hide();
|
||||||
|
}
|
||||||
|
|
||||||
// If the mods are updated at the end of the frame, the flow container will skip a reflow cycle: https://github.com/ppy/osu-framework/issues/4187
|
// If the mods are updated at the end of the frame, the flow container will skip a reflow cycle: https://github.com/ppy/osu-framework/issues/4187
|
||||||
// This looks particularly jarring here, so re-schedule the update to that start of our frame as a fix.
|
// This looks particularly jarring here, so re-schedule the update to that start of our frame as a fix.
|
||||||
Schedule(() => userModsDisplay.Current.Value = User.Mods.Select(m => m.ToMod(ruleset)).ToList());
|
Schedule(() => userModsDisplay.Current.Value = User.Mods.Select(m => m.ToMod(ruleset)).ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OsuColour colours { get; set; }
|
||||||
|
|
||||||
|
private ColourInfo getColourForTeam(int id)
|
||||||
|
{
|
||||||
|
switch (id)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
return colours.Red;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
return colours.Blue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public MenuItem[] ContextMenuItems
|
public MenuItem[] ContextMenuItems
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
Loading…
x
Reference in New Issue
Block a user