diff --git a/osu.Game/Online/Multiplayer/GameType.cs b/osu.Game/Online/Multiplayer/GameType.cs index 4d1a6c4839..22e2ffac31 100644 --- a/osu.Game/Online/Multiplayer/GameType.cs +++ b/osu.Game/Online/Multiplayer/GameType.cs @@ -52,10 +52,32 @@ namespace osu.Game.Online.Multiplayer public override string Name => "Tag Team"; public override Drawable GetIcon(OsuColour colours, float size) { - return new VersusRow(colours.Blue, colours.Blue, size * 0.6f) + return new FillFlowContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, + Spacing = new Vector2(2f), + Children = new[] + { + new TextAwesome + { + Icon = FontAwesome.fa_refresh, + TextSize = size * 0.75f, + Colour = colours.Blue, + Shadow = false, + UseFullGlyphHeight = false, + }, + new TextAwesome + { + Icon = FontAwesome.fa_refresh, + TextSize = size * 0.75f, + Colour = colours.Pink, + Shadow = false, + UseFullGlyphHeight = false, + }, + }, }; } } diff --git a/osu.Game/Screens/Multiplayer/DrawableRoom.cs b/osu.Game/Screens/Multiplayer/DrawableRoom.cs index 507e0039e1..8a970427e5 100644 --- a/osu.Game/Screens/Multiplayer/DrawableRoom.cs +++ b/osu.Game/Screens/Multiplayer/DrawableRoom.cs @@ -27,12 +27,12 @@ namespace osu.Game.Screens.Multiplayer private const float height = 100; private const float side_strip_width = 5; private const float cover_width = 145; - private const float ruleset_height = 30; private readonly Box sideStrip; - private readonly Container coverContainer, rulesetContainer, gameTypeContainer; + private readonly Container coverContainer; private readonly OsuSpriteText name; private readonly ParticipantInfo participantInfo; + private readonly ModeTypeInfo modeTypeInfo; private readonly OsuSpriteText status; private readonly FillFlowContainer beatmapInfoFlow; private readonly OsuSpriteText beatmapTitle; @@ -159,29 +159,10 @@ namespace osu.Game.Screens.Multiplayer }, }, }, - new FillFlowContainer + modeTypeInfo = new ModeTypeInfo { Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, - Height = ruleset_height, - Direction = FillDirection.Horizontal, - LayoutDuration = transition_duration, - Spacing = new Vector2(5f, 0f), - Children = new[] - { - rulesetContainer = new Container - { - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight, - AutoSizeAxes = Axes.Both, - }, - gameTypeContainer = new Container - { - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight, - AutoSizeAxes = Axes.Both, - }, - }, }, }, }, @@ -239,17 +220,13 @@ namespace osu.Game.Screens.Multiplayer private void displayGameType(GameType value) { - gameTypeContainer.Children = new[] - { - new DrawableGameType(value) - { - Size = new Vector2(ruleset_height), - }, - }; + modeTypeInfo.Type = value; } private void displayBeatmap(BeatmapInfo value) { + modeTypeInfo.Beatmap = value; + if (value != null) { coverContainer.FadeIn(transition_duration); @@ -264,15 +241,6 @@ namespace osu.Game.Screens.Multiplayer }) { RelativeSizeAxes = Axes.Both } }; - rulesetContainer.FadeIn(transition_duration); - rulesetContainer.Children = new[] - { - new DifficultyIcon(value) - { - Size = new Vector2(ruleset_height), - } - }; - beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title); beatmapDash.Text = @" - "; beatmapArtist.Current = localisation.GetUnicodePreference(value.Metadata.ArtistUnicode, value.Metadata.Artist); @@ -280,7 +248,6 @@ namespace osu.Game.Screens.Multiplayer else { coverContainer.FadeOut(transition_duration); - rulesetContainer.FadeOut(transition_duration); beatmapTitle.Current = null; beatmapArtist.Current = null; diff --git a/osu.Game/Screens/Multiplayer/ModeTypeInfo.cs b/osu.Game/Screens/Multiplayer/ModeTypeInfo.cs new file mode 100644 index 0000000000..07e62d4d2f --- /dev/null +++ b/osu.Game/Screens/Multiplayer/ModeTypeInfo.cs @@ -0,0 +1,82 @@ +using OpenTK; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Beatmaps.Drawables; +using osu.Game.Database; +using osu.Game.Online.Multiplayer; + +namespace osu.Game.Screens.Multiplayer +{ + public class ModeTypeInfo : Container + { + private const float height = 30; + private const float transition_duration = 100; + + private readonly Container rulesetContainer, gameTypeContainer; + + public BeatmapInfo Beatmap + { + set + { + if (value != null) + { + rulesetContainer.FadeIn(transition_duration); + rulesetContainer.Children = new[] + { + new DifficultyIcon(value) + { + Size = new Vector2(height), + } + }; + } + else + { + rulesetContainer.FadeOut(transition_duration); + } + } + } + + public GameType Type + { + set + { + gameTypeContainer.Children = new[] + { + new DrawableGameType(value) + { + Size = new Vector2(height), + }, + }; + } + } + + public ModeTypeInfo() + { + AutoSizeAxes = Axes.Both; + + Children = new[] + { + new FillFlowContainer + { + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomRight, + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, + LayoutDuration = transition_duration, + Spacing = new Vector2(5f, 0f), + Children = new[] + { + rulesetContainer = new Container + { + AutoSizeAxes = Axes.Both, + }, + gameTypeContainer = new Container + { + AutoSizeAxes = Axes.Both, + }, + }, + }, + }; + } + } +} diff --git a/osu.Game/Screens/Multiplayer/RoomInspector.cs b/osu.Game/Screens/Multiplayer/RoomInspector.cs index d840495765..3ed0b78f36 100644 --- a/osu.Game/Screens/Multiplayer/RoomInspector.cs +++ b/osu.Game/Screens/Multiplayer/RoomInspector.cs @@ -27,11 +27,11 @@ namespace osu.Game.Screens.Multiplayer { private readonly MarginPadding contentPadding = new MarginPadding { Horizontal = 20, Vertical = 10 }; private const float transition_duration = 100; - private const float ruleset_height = 30; private readonly Box statusStrip; private readonly Container coverContainer, rulesetContainer, gameTypeContainer; private readonly FillFlowContainer topFlow, participantsFlow; + private readonly ModeTypeInfo modeTypeInfo; private readonly OsuSpriteText participants, participantsSlash, maxParticipants, name, status, beatmapTitle, beatmapDash, beatmapArtist, beatmapAuthor; private readonly ParticipantInfo participantInfo; private readonly ScrollContainer participantsScroll; @@ -191,20 +191,13 @@ namespace osu.Game.Screens.Multiplayer new FillFlowContainer { AutoSizeAxes = Axes.X, - Height = ruleset_height, + Height = 30, Direction = FillDirection.Horizontal, LayoutDuration = transition_duration, Spacing = new Vector2(5f, 0f), Children = new Drawable[] { - rulesetContainer = new Container - { - AutoSizeAxes = Axes.Both, - }, - gameTypeContainer = new Container - { - AutoSizeAxes = Axes.Both, - }, + modeTypeInfo = new ModeTypeInfo(), new Container { AutoSizeAxes = Axes.X, @@ -329,17 +322,13 @@ namespace osu.Game.Screens.Multiplayer private void displayGameType(GameType value) { - gameTypeContainer.Children = new[] - { - new DrawableGameType(value) - { - Size = new Vector2(ruleset_height), - }, - }; + modeTypeInfo.Type = value; } private void displayBeatmap(BeatmapInfo value) { + modeTypeInfo.Beatmap = value; + if (value != null) { coverContainer.FadeIn(transition_duration); @@ -354,15 +343,6 @@ namespace osu.Game.Screens.Multiplayer }) { RelativeSizeAxes = Axes.Both } }; - rulesetContainer.FadeIn(transition_duration); - rulesetContainer.Children = new[] - { - new DifficultyIcon(value) - { - Size = new Vector2(ruleset_height), - } - }; - beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title); beatmapDash.Text = @" - "; beatmapArtist.Current = localisation.GetUnicodePreference(value.Metadata.ArtistUnicode, value.Metadata.Artist); @@ -371,7 +351,6 @@ namespace osu.Game.Screens.Multiplayer else { coverContainer.FadeOut(transition_duration); - rulesetContainer.FadeOut(transition_duration); beatmapTitle.Current = null; beatmapArtist.Current = null; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 4e015242e2..553e55c83e 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -491,6 +491,7 @@ +