diff --git a/osu.Game/GameModes/Play/BeatmapGroup.cs b/osu.Game/Beatmaps/Drawable/BeatmapGroup.cs similarity index 54% rename from osu.Game/GameModes/Play/BeatmapGroup.cs rename to osu.Game/Beatmaps/Drawable/BeatmapGroup.cs index 826f8e3b0c..f94d267475 100644 --- a/osu.Game/GameModes/Play/BeatmapGroup.cs +++ b/osu.Game/Beatmaps/Drawable/BeatmapGroup.cs @@ -2,24 +2,18 @@ //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Linq; +using osu.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; -using osu.Game.Graphics; -using osu.Game.Beatmaps; -using osu.Game.Database; using osu.Framework.Graphics.Primitives; -using OpenTK; -using System.Linq; -using osu.Framework.Graphics.Transformations; using osu.Framework.Input; +using osu.Game.Database; +using osu.Game.Graphics; +using OpenTK; using OpenTK.Graphics; -using osu.Game.Beatmaps.IO; -using osu.Framework.Graphics.Textures; -using System.Threading.Tasks; -using osu.Framework; - -namespace osu.Game.GameModes.Play + +namespace osu.Game.Beatmaps.Drawable { class BeatmapGroup : Container, IStateful { @@ -44,7 +38,7 @@ namespace osu.Game.GameModes.Play public Action BeatmapSelected; public BeatmapSetInfo BeatmapSet; - private BeatmapSetHeader setBox; + private BeatmapSetHeader header; private FlowContainer difficulties; private bool collapsed; public GroupState State @@ -63,14 +57,14 @@ namespace osu.Game.GameModes.Play difficulties.Hide(); else difficulties.Show(); - setBox.ClearTransformations(); - setBox.Width = collapsed ? collapsedWidth : 1; // TODO: Transform - setBox.BorderColour = new Color4( - setBox.BorderColour.R, - setBox.BorderColour.G, - setBox.BorderColour.B, + header.ClearTransformations(); + header.Width = collapsed ? collapsedWidth : 1; // TODO: Transform + header.BorderColour = new Color4( + header.BorderColour.R, + header.BorderColour.G, + header.BorderColour.B, collapsed ? 0 : 255); - setBox.GlowRadius = collapsed ? 0 : 5; + header.GlowRadius = collapsed ? 0 : 5; } } @@ -89,9 +83,9 @@ namespace osu.Game.GameModes.Play RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FlowDirection.VerticalOnly, - Children = new Drawable[] + Children = new Framework.Graphics.Drawable[] { - setBox = new BeatmapSetHeader(beatmapSet) + header = new BeatmapSetHeader(beatmapSet) { RelativeSizeAxes = Axes.X, Width = collapsedWidth, @@ -142,89 +136,4 @@ namespace osu.Game.GameModes.Play return true; } } - - class BeatmapSetHeader : Container - { - public BeatmapSetHeader(BeatmapSetInfo beatmapSet) - { - AutoSizeAxes = Axes.Y; - Masking = true; - CornerRadius = 5; - BorderThickness = 2; - BorderColour = new Color4(221, 255, 255, 0); - GlowColour = new Color4(166, 221, 251, 0.5f); // TODO: Get actual color for this - Children = new Drawable[] - { - new Box - { - Colour = new Color4(85, 85, 85, 255), - RelativeSizeAxes = Axes.Both, - Size = Vector2.One, - }, - new Container - { - RelativeSizeAxes = Axes.Both, - Size = Vector2.One, - Children = new Drawable[] - { - new Box // TODO: Gradient - { - Colour = new Color4(0, 0, 0, 100), - RelativeSizeAxes = Axes.Both, - Size = Vector2.One, - } - } - }, - new FlowContainer - { - Direction = FlowDirection.VerticalOnly, - Spacing = new Vector2(0, 2), - Padding = new MarginPadding { Top = 3, Left = 20, Right = 20, Bottom = 3 }, - AutoSizeAxes = Axes.Both, - Children = new[] - { - // TODO: Make these italic - new SpriteText - { - Text = beatmapSet.Metadata.Title ?? beatmapSet.Metadata.TitleUnicode, - TextSize = 20 - }, - new SpriteText - { - Text = beatmapSet.Metadata.Artist ?? beatmapSet.Metadata.ArtistUnicode, - TextSize = 16 - }, - new FlowContainer - { - AutoSizeAxes = Axes.Both, - Children = new[] - { - new DifficultyIcon(FontAwesome.dot_circle_o, new Color4(159, 198, 0, 255)), - new DifficultyIcon(FontAwesome.dot_circle_o, new Color4(246, 101, 166, 255)), - } - } - } - } - }; - } - } - - class DifficultyIcon : Container - { - public DifficultyIcon(FontAwesome icon, Color4 color) - { - const float size = 20; - Size = new Vector2(size); - Children = new[] - { - new TextAwesome - { - Anchor = Anchor.Centre, - TextSize = size, - Colour = color, - Icon = icon - } - }; - } - } } diff --git a/osu.Game/GameModes/Play/BeatmapPanel.cs b/osu.Game/Beatmaps/Drawable/BeatmapPanel.cs similarity index 94% rename from osu.Game/GameModes/Play/BeatmapPanel.cs rename to osu.Game/Beatmaps/Drawable/BeatmapPanel.cs index ca37292894..fc658f5fd7 100644 --- a/osu.Game/GameModes/Play/BeatmapPanel.cs +++ b/osu.Game/Beatmaps/Drawable/BeatmapPanel.cs @@ -4,16 +4,16 @@ using System; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Input; using osu.Game.Database; -using osu.Framework.Graphics.Primitives; -using OpenTK.Graphics; -using OpenTK; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; +using OpenTK; +using OpenTK.Graphics; -namespace osu.Game.GameModes.Play +namespace osu.Game.Beatmaps.Drawable { class BeatmapPanel : Container { @@ -49,7 +49,7 @@ namespace osu.Game.GameModes.Play BorderThickness = 2; BorderColour = new Color4(221, 255, 255, 0); GlowColour = new Color4(166, 221, 251, 0.75f); // TODO: Get actual color for this - Children = new Drawable[] + Children = new Framework.Graphics.Drawable[] { new Box { @@ -62,7 +62,7 @@ namespace osu.Game.GameModes.Play Padding = new MarginPadding(5), Direction = FlowDirection.HorizontalOnly, AutoSizeAxes = Axes.Both, - Children = new Drawable[] + Children = new Framework.Graphics.Drawable[] { new DifficultyIcon(FontAwesome.dot_circle_o, new Color4(159, 198, 0, 255)), new FlowContainer @@ -70,7 +70,7 @@ namespace osu.Game.GameModes.Play Padding = new MarginPadding { Left = 10 }, Direction = FlowDirection.VerticalOnly, AutoSizeAxes = Axes.Both, - Children = new Drawable[] + Children = new Framework.Graphics.Drawable[] { new FlowContainer { diff --git a/osu.Game/Beatmaps/Drawable/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawable/BeatmapSetHeader.cs new file mode 100644 index 0000000000..05d8db82af --- /dev/null +++ b/osu.Game/Beatmaps/Drawable/BeatmapSetHeader.cs @@ -0,0 +1,80 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Primitives; +using osu.Framework.Graphics.Sprites; +using osu.Game.Database; +using osu.Game.Graphics; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Beatmaps.Drawable +{ + class BeatmapSetHeader : Container + { + public BeatmapSetHeader(BeatmapSetInfo beatmapSet) + { + AutoSizeAxes = Axes.Y; + Masking = true; + CornerRadius = 5; + BorderThickness = 2; + BorderColour = new Color4(221, 255, 255, 0); + GlowColour = new Color4(166, 221, 251, 0.5f); // TODO: Get actual color for this + Children = new Framework.Graphics.Drawable[] + { + new Box + { + Colour = new Color4(85, 85, 85, 255), + RelativeSizeAxes = Axes.Both, + Size = Vector2.One, + }, + new Container + { + RelativeSizeAxes = Axes.Both, + Size = Vector2.One, + Children = new Framework.Graphics.Drawable[] + { + new Box // TODO: Gradient + { + Colour = new Color4(0, 0, 0, 100), + RelativeSizeAxes = Axes.Both, + Size = Vector2.One, + } + } + }, + new FlowContainer + { + Direction = FlowDirection.VerticalOnly, + Spacing = new Vector2(0, 2), + Padding = new MarginPadding { Top = 3, Left = 20, Right = 20, Bottom = 3 }, + AutoSizeAxes = Axes.Both, + Children = new[] + { + // TODO: Make these italic + new SpriteText + { + Text = beatmapSet.Metadata.Title ?? beatmapSet.Metadata.TitleUnicode, + TextSize = 20 + }, + new SpriteText + { + Text = beatmapSet.Metadata.Artist ?? beatmapSet.Metadata.ArtistUnicode, + TextSize = 16 + }, + new FlowContainer + { + AutoSizeAxes = Axes.Both, + Children = new[] + { + new DifficultyIcon(FontAwesome.dot_circle_o, new Color4(159, 198, 0, 255)), + new DifficultyIcon(FontAwesome.dot_circle_o, new Color4(246, 101, 166, 255)), + } + } + } + } + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Beatmaps/Drawable/DifficultyIcon.cs b/osu.Game/Beatmaps/Drawable/DifficultyIcon.cs new file mode 100644 index 0000000000..aab1e27d3c --- /dev/null +++ b/osu.Game/Beatmaps/Drawable/DifficultyIcon.cs @@ -0,0 +1,30 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Graphics; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Beatmaps.Drawable +{ + class DifficultyIcon : Container + { + public DifficultyIcon(FontAwesome icon, Color4 color) + { + const float size = 20; + Size = new Vector2(size); + Children = new[] + { + new TextAwesome + { + Anchor = Anchor.Centre, + TextSize = size, + Colour = color, + Icon = icon + } + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/GameModes/Play/PlaySongSelect.cs b/osu.Game/GameModes/Play/PlaySongSelect.cs index d988ab79ce..410d3b1e2a 100644 --- a/osu.Game/GameModes/Play/PlaySongSelect.cs +++ b/osu.Game/GameModes/Play/PlaySongSelect.cs @@ -15,6 +15,7 @@ using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics.UserInterface; using System.Threading.Tasks; +using osu.Game.Beatmaps.Drawable; namespace osu.Game.GameModes.Play { diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 1cd073a00e..807a8e6ee4 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -64,6 +64,8 @@ + + @@ -116,8 +118,8 @@ - - + + @@ -218,4 +220,4 @@ --> - + \ No newline at end of file