diff --git a/osu.Game/Screens/Multi/Match/Components/Info.cs b/osu.Game/Screens/Multi/Match/Components/Info.cs index b3de5abf67..fe6343e4db 100644 --- a/osu.Game/Screens/Multi/Match/Components/Info.cs +++ b/osu.Game/Screens/Multi/Match/Components/Info.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Extensions; @@ -14,14 +15,16 @@ using osu.Game.Graphics.UserInterface; using osu.Game.Online.Multiplayer; using osu.Game.Overlays.SearchableList; +using osu.Game.Rulesets.Mods; using osu.Game.Screens.Multi.Components; +using osu.Game.Screens.Play.HUD; using osuTK; namespace osu.Game.Screens.Multi.Match.Components { public class Info : Container { - public const float HEIGHT = 128; + public const float HEIGHT = 156; private readonly OsuSpriteText availabilityStatus; private readonly ReadyButton readyButton; @@ -35,6 +38,7 @@ public class Info : Container public readonly Bindable Status = new Bindable(); public readonly Bindable Beatmap = new Bindable(); public readonly Bindable Type = new Bindable(); + public readonly Bindable> Mods = new Bindable>(); public Info() { @@ -43,6 +47,7 @@ public Info() BeatmapTypeInfo beatmapTypeInfo; OsuSpriteText name; + ModDisplay modDisplay; Children = new Drawable[] { @@ -74,11 +79,23 @@ public Info() availabilityStatus = new OsuSpriteText { TextSize = 14 }, }, }, - beatmapTypeInfo = new BeatmapTypeInfo + new FillFlowContainer { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, - }, + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + beatmapTypeInfo = new BeatmapTypeInfo(), + modDisplay = new ModDisplay + { + Scale = new Vector2(0.75f), + DisplayUnrankedText = false + }, + } + } + }, }, readyButton = new ReadyButton @@ -95,6 +112,7 @@ public Info() beatmapTypeInfo.Beatmap.BindTo(Beatmap); beatmapTypeInfo.Type.BindTo(Type); + modDisplay.Current.BindTo(Mods); Availability.BindValueChanged(_ => updateAvailabilityStatus()); Status.BindValueChanged(_ => updateAvailabilityStatus()); diff --git a/osu.Game/Screens/Multi/Match/MatchScreen.cs b/osu.Game/Screens/Multi/Match/MatchScreen.cs index 755b071f30..ecc5c91be3 100644 --- a/osu.Game/Screens/Multi/Match/MatchScreen.cs +++ b/osu.Game/Screens/Multi/Match/MatchScreen.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using System.Linq; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; @@ -9,6 +10,7 @@ using osu.Game.Beatmaps; using osu.Game.Online.API; using osu.Game.Online.Multiplayer; +using osu.Game.Rulesets.Mods; using osu.Game.Screens.Multi.Match.Components; using osu.Game.Screens.Select; using osu.Game.Users; @@ -33,6 +35,9 @@ public class MatchScreen : MultiplayerScreen public override string ShortTitle => "room"; + [Cached] + private readonly Bindable> mods = new Bindable>(Enumerable.Empty()); + [Cached] private readonly Room room; @@ -101,6 +106,7 @@ public MatchScreen(Room room) info.Status.BindTo(statusBind); info.Availability.BindTo(availabilityBind); info.Type.BindTo(typeBind); + info.Mods.BindTo(mods); participants.Users.BindTo(participantsBind); participants.MaxParticipants.BindTo(maxParticipantsBind); diff --git a/osu.Game/Screens/Play/HUD/ModDisplay.cs b/osu.Game/Screens/Play/HUD/ModDisplay.cs index 9509c7acae..7536501c90 100644 --- a/osu.Game/Screens/Play/HUD/ModDisplay.cs +++ b/osu.Game/Screens/Play/HUD/ModDisplay.cs @@ -20,6 +20,8 @@ public class ModDisplay : Container, IHasCurrentValue> { private const int fade_duration = 1000; + public bool DisplayUnrankedText = true; + private readonly Bindable> mods = new Bindable>(); public Bindable> Current => mods; @@ -29,6 +31,8 @@ public class ModDisplay : Container, IHasCurrentValue> public ModDisplay() { + AutoSizeAxes = Axes.Both; + Children = new Drawable[] { iconsContainer = new ReverseChildIDFillFlowContainer @@ -41,7 +45,6 @@ public ModDisplay() }, unrankedText = new OsuSpriteText { - AlwaysPresent = true, Anchor = Anchor.BottomCentre, Origin = Anchor.TopCentre, Text = @"/ UNRANKED /", @@ -77,7 +80,7 @@ protected override void LoadComplete() private void appearTransform() { - if (mods.Value.Any(m => !m.Ranked)) + if (DisplayUnrankedText && mods.Value.Any(m => !m.Ranked)) unrankedText.FadeInFromZero(fade_duration, Easing.OutQuint); else unrankedText.Hide();