From 2629f78afc2fd04898010f0f5e945ba0f6c106e0 Mon Sep 17 00:00:00 2001 From: Kelvin <2yangk23@gmail.com> Date: Sat, 4 Mar 2017 20:07:47 -0800 Subject: [PATCH 01/74] Add FilterControl and FilterTabControl --- osu-resources | 2 +- .../Tests/TestCasePlaySongSelect.cs | 9 +- .../Graphics/UserInterface/OsuDropDownMenu.cs | 2 +- osu.Game/Screens/Select/CarouselContainer.cs | 11 +- osu.Game/Screens/Select/Filter/GroupMode.cs | 42 ++++ osu.Game/Screens/Select/Filter/SortMode.cs | 28 +++ osu.Game/Screens/Select/FilterControl.cs | 225 +++--------------- .../Screens/Select/Tab/FilterTabControl.cs | 14 ++ .../Select/Tab/FilterTabDropDownHeader.cs | 40 ++++ .../Select/Tab/FilterTabDropDownMenu.cs | 70 ++++++ .../Select/Tab/FilterTabDropDownMenuItem.cs | 39 +++ osu.Game/Screens/Select/Tab/FilterTabItem.cs | 105 ++++++++ osu.Game/osu.Game.csproj | 7 + 13 files changed, 397 insertions(+), 197 deletions(-) create mode 100644 osu.Game/Screens/Select/Filter/GroupMode.cs create mode 100644 osu.Game/Screens/Select/Filter/SortMode.cs create mode 100644 osu.Game/Screens/Select/Tab/FilterTabControl.cs create mode 100644 osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs create mode 100644 osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs create mode 100644 osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs create mode 100644 osu.Game/Screens/Select/Tab/FilterTabItem.cs diff --git a/osu-resources b/osu-resources index 4f9ed4e703..51f2b9b37f 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 4f9ed4e703777ede98737c7e2af31efa4694c395 +Subproject commit 51f2b9b37f38cd349a3dd728a78f8fffcb3a54f5 diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs b/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs index 84bb1cfde6..cb5ff53646 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlaySongSelect.cs @@ -8,6 +8,7 @@ using osu.Framework.MathUtils; using osu.Game.Database; using osu.Game.Modes; using osu.Game.Screens.Select; +using osu.Game.Screens.Select.Filter; namespace osu.Desktop.VisualTests.Tests { @@ -39,10 +40,10 @@ namespace osu.Desktop.VisualTests.Tests Add(songSelect = new PlaySongSelect()); - AddButton(@"Sort by Artist", delegate { songSelect.Filter.Sort = FilterControl.SortMode.Artist; }); - AddButton(@"Sort by Title", delegate { songSelect.Filter.Sort = FilterControl.SortMode.Title; }); - AddButton(@"Sort by Author", delegate { songSelect.Filter.Sort = FilterControl.SortMode.Author; }); - AddButton(@"Sort by Difficulty", delegate { songSelect.Filter.Sort = FilterControl.SortMode.Difficulty; }); + AddButton(@"Sort by Artist", delegate { songSelect.Filter.Sort = SortMode.Artist; }); + AddButton(@"Sort by Title", delegate { songSelect.Filter.Sort = SortMode.Title; }); + AddButton(@"Sort by Author", delegate { songSelect.Filter.Sort = SortMode.Author; }); + AddButton(@"Sort by Difficulty", delegate { songSelect.Filter.Sort = SortMode.Difficulty; }); } protected override void Dispose(bool isDisposing) diff --git a/osu.Game/Graphics/UserInterface/OsuDropDownMenu.cs b/osu.Game/Graphics/UserInterface/OsuDropDownMenu.cs index 786636ce1a..6ca44034c6 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropDownMenu.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropDownMenu.cs @@ -11,7 +11,7 @@ namespace osu.Game.Graphics.UserInterface { public class OsuDropDownMenu : DropDownMenu { - protected override DropDownHeader CreateHeader() => new OsuDropDownHeader(); + protected override BasicDropDownHeader CreateHeader() => new OsuDropDownHeader(); public OsuDropDownMenu() { diff --git a/osu.Game/Screens/Select/CarouselContainer.cs b/osu.Game/Screens/Select/CarouselContainer.cs index 6a5bb2dc94..c0340acbd5 100644 --- a/osu.Game/Screens/Select/CarouselContainer.cs +++ b/osu.Game/Screens/Select/CarouselContainer.cs @@ -15,6 +15,7 @@ using OpenTK.Input; using System.Collections; using osu.Framework.MathUtils; using System.Diagnostics; +using osu.Game.Screens.Select.Filter; namespace osu.Game.Screens.Select { @@ -157,21 +158,21 @@ namespace osu.Game.Screens.Select ScrollTo(selectedY, animated); } - public void Sort(FilterControl.SortMode mode) + public void Sort(SortMode mode) { List sortedGroups = new List(groups); switch (mode) { - case FilterControl.SortMode.Artist: + case SortMode.Artist: sortedGroups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Artist, y.BeatmapSet.Metadata.Artist, StringComparison.InvariantCultureIgnoreCase)); break; - case FilterControl.SortMode.Title: + case SortMode.Title: sortedGroups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Title, y.BeatmapSet.Metadata.Title, StringComparison.InvariantCultureIgnoreCase)); break; - case FilterControl.SortMode.Author: + case SortMode.Author: sortedGroups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Author, y.BeatmapSet.Metadata.Author, StringComparison.InvariantCultureIgnoreCase)); break; - case FilterControl.SortMode.Difficulty: + case SortMode.Difficulty: sortedGroups.Sort((x, y) => { float xAverage = 0, yAverage = 0; diff --git a/osu.Game/Screens/Select/Filter/GroupMode.cs b/osu.Game/Screens/Select/Filter/GroupMode.cs new file mode 100644 index 0000000000..a0e343b164 --- /dev/null +++ b/osu.Game/Screens/Select/Filter/GroupMode.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using System.ComponentModel; + +namespace osu.Game.Screens.Select.Filter +{ + public enum GroupMode + { + None = 0, + [Description("All")] + All, + [Description("Artist")] + Artist, + [Description("Author")] + Author, + [Description("BPM")] + BPM, + [Description("Collections")] + Collections, + [Description("Date Added")] + DateAdded, + [Description("Difficulty")] + Difficulty, + [Description("Favorites")] + Favorites, + [Description("Length")] + Length, + [Description("My Maps")] + MyMaps, + [Description("No Grouping")] + NoGrouping, + [Description("Rank Achieved")] + RankAchieved, + [Description("Ranked Status")] + RankedStatus, + [Description("Recently Played")] + RecentlyPlayed, + [Description("Title")] + Title + } +} diff --git a/osu.Game/Screens/Select/Filter/SortMode.cs b/osu.Game/Screens/Select/Filter/SortMode.cs new file mode 100644 index 0000000000..d0b7f3e614 --- /dev/null +++ b/osu.Game/Screens/Select/Filter/SortMode.cs @@ -0,0 +1,28 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using System.ComponentModel; + +namespace osu.Game.Screens.Select.Filter +{ + public enum SortMode + { + None = 0, + [Description("Artist")] + Artist, + [Description("Author")] + Author, + [Description("BPM")] + BPM, + [Description("Date Added")] + DateAdded, + [Description("Difficulty")] + Difficulty, + [Description("Length")] + Length, + [Description("Rank Achieved")] + RankAchieved, + [Description("Title")] + Title + } +} diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index e20c170e3f..2d1ab6cf7b 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -2,16 +2,19 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using osu.Framework.Allocation; using OpenTK; using OpenTK.Graphics; -using osu.Framework.Allocation; 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.Framework.Graphics.UserInterface.Tab; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using osu.Game.Screens.Select.Filter; +using osu.Game.Screens.Select.Tab; +using Container = osu.Framework.Graphics.Containers.Container; namespace osu.Game.Screens.Select { @@ -23,7 +26,8 @@ namespace osu.Game.Screens.Select private SortMode sort = SortMode.Title; public SortMode Sort { get { return sort; } - set { + set + { if (sort != value) { sort = value; @@ -36,7 +40,7 @@ namespace osu.Game.Screens.Select private SearchTextBox searchTextBox; - public FilterControl() + public FilterControl(float height) { Children = new Drawable[] { @@ -44,7 +48,8 @@ namespace osu.Game.Screens.Select { Colour = Color4.Black, Alpha = 0.8f, - RelativeSizeAxes = Axes.Both, + RelativeSizeAxes = Axes.X, + Height = height }, new FillFlowContainer { @@ -57,7 +62,8 @@ namespace osu.Game.Screens.Select Direction = FillDirection.Vertical, Children = new Drawable[] { - searchTextBox = new SearchTextBox { + searchTextBox = new SearchTextBox + { RelativeSizeAxes = Axes.X, OnChange = (sender, newText) => { @@ -83,97 +89,20 @@ namespace osu.Game.Screens.Select searchTextBox.HoldFocus = true; } - private class TabItem : ClickableContainer + private class GroupSortTabs : Container { - public string Text - { - get { return text.Text; } - set { text.Text = value; } - } + private TabControl groupTabs; + private TabControl sortTabs; - private void fadeActive() + public GroupSortTabs() { - box.FadeIn(300); - text.FadeColour(Color4.White, 300); - } - - private void fadeInactive() - { - box.FadeOut(300); - text.FadeColour(fadeColour, 300); - } - - private bool active; - public bool Active - { - get { return active; } - set - { - active = value; - if (active) - fadeActive(); - else - fadeInactive(); - } - } - - private SpriteText text; - private Box box; - private Color4 fadeColour; - - protected override bool OnHover(InputState state) - { - if (!active) - fadeActive(); - return true; - } - - protected override void OnHoverLost(InputState state) - { - if (!active) - fadeInactive(); - } - - public TabItem() - { - AutoSizeAxes = Axes.Both; - Children = new Drawable[] - { - text = new OsuSpriteText - { - Margin = new MarginPadding(5), - TextSize = 14, - Font = @"Exo2.0-Bold", - }, - box = new Box - { - RelativeSizeAxes = Axes.X, - Height = 1, - Alpha = 0, - Colour = Color4.White, - Origin = Anchor.BottomLeft, - Anchor = Anchor.BottomLeft, - } - }; + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; } [BackgroundDependencyLoader] private void load(OsuColour colours) { - text.Colour = colours.Blue; - fadeColour = colours.Blue; - } - } - - private class GroupSortTabs : Container - { - private TextAwesome groupsEllipsis, sortEllipsis; - private SpriteText sortLabel; - - public GroupSortTabs() - { - RelativeSizeAxes = Axes.X; - AutoSizeAxes = Axes.Y; Children = new Drawable[] { new Box @@ -181,110 +110,34 @@ namespace osu.Game.Screens.Select RelativeSizeAxes = Axes.X, Height = 1, Colour = OsuColour.Gray(80), - Origin = Anchor.BottomLeft, - Anchor = Anchor.BottomLeft, + Origin = Anchor.TopLeft, + Anchor = Anchor.TopLeft, + Position = new Vector2(0, 23) }, - new FillFlowContainer + groupTabs = new FilterTabControl { - AutoSizeAxes = Axes.Both, - Direction = FillDirection.Horizontal, - Spacing = new Vector2(10, 0), - Children = new Drawable[] - { - new TabItem - { - Text = "All", - Active = true, - }, - new TabItem - { - Text = "Recently Played", - Active = false, - }, - new TabItem - { - Text = "Collections", - Active = false, - }, - groupsEllipsis = new TextAwesome - { - Icon = FontAwesome.fa_ellipsis_h, - Origin = Anchor.TopLeft, - TextSize = 14, - Margin = new MarginPadding { Top = 5, Bottom = 5 }, - } - } + Width = 210 }, - new FillFlowContainer + sortTabs = new FilterTabControl { - AutoSizeAxes = Axes.Both, - Direction = FillDirection.Horizontal, - Spacing = new Vector2(10, 0), - Origin = Anchor.TopRight, + Width = 180, Anchor = Anchor.TopRight, - Children = new Drawable[] - { - sortLabel = new OsuSpriteText - { - Font = @"Exo2.0-Bold", - Text = "Sort results by", - TextSize = 14, - Margin = new MarginPadding { Top = 5, Bottom = 5 }, - }, - new TabItem - { - Text = "Artist", - Active = true, - }, - sortEllipsis = new TextAwesome - { - Icon = FontAwesome.fa_ellipsis_h, - Origin = Anchor.TopLeft, - TextSize = 14, - Margin = new MarginPadding { Top = 5, Bottom = 5 }, - } - } - }, + Origin = Anchor.TopRight + } }; + sortTabs.Prefix.Children = new Drawable[] + { + new OsuSpriteText + { + Font = @"Exo2.0-Bold", + Text = "Sort results by", + TextSize = 14, + Margin = new MarginPadding { Top = 5, Bottom = 5 }, + } + }; + groupTabs.Pin(GroupMode.All); + groupTabs.Pin(GroupMode.RecentlyPlayed); } - - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - groupsEllipsis.Colour = colours.Blue; - sortLabel.Colour = colours.GreenLight; - sortEllipsis.Colour = colours.GreenLight; - } - } - - public enum SortMode - { - Artist, - BPM, - Author, - DateAdded, - Difficulty, - Length, - RankAchieved, - Title - } - - public enum GroupMode - { - NoGrouping, - Artist, - BPM, - Author, - DateAdded, - Difficulty, - Length, - RankAchieved, - Title, - Collections, - Favorites, - MyMaps, - RankedStatus, - RecentlyPlayed } } } \ No newline at end of file diff --git a/osu.Game/Screens/Select/Tab/FilterTabControl.cs b/osu.Game/Screens/Select/Tab/FilterTabControl.cs new file mode 100644 index 0000000000..b076f66bde --- /dev/null +++ b/osu.Game/Screens/Select/Tab/FilterTabControl.cs @@ -0,0 +1,14 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics.UserInterface.Tab; + +namespace osu.Game.Screens.Select.Tab +{ + public class FilterTabControl : TabControl + { + protected override TabDropDownMenu CreateDropDownMenu() => new FilterTabDropDownMenu(); + + protected override TabItem CreateTabItem(T value) => new FilterTabItem { Value = value }; + } +} diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs b/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs new file mode 100644 index 0000000000..7d90dea594 --- /dev/null +++ b/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs @@ -0,0 +1,40 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Primitives; +using osu.Framework.Graphics.UserInterface; +using osu.Game.Graphics; + +namespace osu.Game.Screens.Select.Tab +{ + public class FilterTabDropDownHeader : BasicDropDownHeader + { + protected override string Label { get; set; } + + private TextAwesome ellipses; + + public FilterTabDropDownHeader() + { + AutoSizeAxes = Axes.Both; + Children = new Drawable[] + { + ellipses = new TextAwesome + { + Icon = FontAwesome.fa_ellipsis_h, + TextSize = 14, + Margin = new MarginPadding{ Top = 6, Bottom = 4 }, + Origin = Anchor.BottomLeft, + Anchor = Anchor.BottomLeft, + } + }; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + ellipses.Colour = colours.Blue; + } + } +} diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs new file mode 100644 index 0000000000..7555a59d25 --- /dev/null +++ b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs @@ -0,0 +1,70 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Linq; +using osu.Framework.Allocation; +using osu.Framework.Extensions; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics.Transforms; +using osu.Framework.Graphics.UserInterface; +using osu.Framework.Graphics.UserInterface.Tab; +using osu.Game.Graphics; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Screens.Select.Tab +{ + public class FilterTabDropDownMenu : TabDropDownMenu + { + protected override BasicDropDownHeader CreateHeader() => new FilterTabDropDownHeader(); + + protected override IEnumerable> GetDropDownItems(IEnumerable> values) + => values.Select(v => new FilterTabDropDownMenuItem(v.Key, v.Value)); + + public FilterTabDropDownMenu() + { + ContentContainer.CornerRadius = 4; + MaxDropDownHeight = int.MaxValue; + ContentBackground.Colour = Color4.Black.Opacity(0.5f); + + if (!typeof(T).IsEnum) + throw new InvalidOperationException("TabControl only supports enums as the generic type argument"); + + List> items = new List>(); + foreach (var val in (T[])Enum.GetValues(typeof(T))) + { + if (!val.Equals(default(T))) + items.Add(new KeyValuePair((val as Enum)?.GetDescription(), val)); + } + + Items = items; + // TODO: ValueChanged Handling + } + + protected override void AnimateOpen() + { + ContentContainer.FadeIn(300, EasingTypes.OutQuint); + } + + protected override void AnimateClose() + { + ContentContainer.FadeOut(300, EasingTypes.OutQuint); + } + + protected override void UpdateContentHeight() + { + if (State == DropDownMenuState.Opened) + ContentContainer.ResizeTo(new Vector2(1, ContentHeight), 300, EasingTypes.OutQuint); + else + ContentContainer.ResizeTo(new Vector2(1, 0), 300, EasingTypes.OutQuint); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) { + //Colour = colours.White; + //SelectedItem.Colour = colours.Blue; + } + } +} diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs new file mode 100644 index 0000000000..42ab12e1e4 --- /dev/null +++ b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs @@ -0,0 +1,39 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Primitives; +using osu.Framework.Graphics.UserInterface; +using osu.Game.Graphics; +using OpenTK.Graphics; +using osu.Game.Graphics.Sprites; + +namespace osu.Game.Screens.Select.Tab +{ + public class FilterTabDropDownMenuItem : DropDownMenuItem + { + public FilterTabDropDownMenuItem(string text, T value) : base(text, value) + { + Foreground.Padding = new MarginPadding(5); + Background.Colour = Color4.Red; + Foreground.Margin = new MarginPadding { Left = 7 }; + Foreground.Add(new OsuSpriteText + { + Text = text, + Origin = Anchor.CentreLeft, + Anchor = Anchor.CentreLeft, + }); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + BackgroundColour = Color4.Black.Opacity(0.8f); + BackgroundColourHover = new Color4(124, 200, 253, 255); + BackgroundColourSelected = new Color4(124, 200, 253, 255); + //BackgroundColourSelected = new Color4(163, 196, 36, 255); // Green + } + } +} diff --git a/osu.Game/Screens/Select/Tab/FilterTabItem.cs b/osu.Game/Screens/Select/Tab/FilterTabItem.cs new file mode 100644 index 0000000000..c24dbd7e15 --- /dev/null +++ b/osu.Game/Screens/Select/Tab/FilterTabItem.cs @@ -0,0 +1,105 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using osu.Framework.Allocation; +using osu.Framework.Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Primitives; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface.Tab; +using osu.Framework.Input; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using OpenTK.Graphics; + +namespace osu.Game.Screens.Select.Tab +{ + public class FilterTabItem : TabItem + { + private SpriteText text; + private Box box; + private Color4 fadeColour; + + public new T Value + { + get { return base.Value; } + set + { + base.Value = value; + text.Text = (value as Enum)?.GetDescription(); + } + } + + public override bool Active + { + get { return base.Active; } + set + { + if (value) + fadeActive(); + else + fadeInactive(); + base.Active = value; + } + } + + private void fadeActive() + { + box.FadeIn(300); + text.FadeColour(Color4.White, 300); + } + + private void fadeInactive() + { + box.FadeOut(300); + text.FadeColour(fadeColour, 300); + } + + protected override bool OnHover(InputState state) { + if (!Active) + fadeActive(); + return true; + } + + protected override void OnHoverLost(InputState state) { + if (!Active) + fadeInactive(); + } + + public FilterTabItem() + { + AutoSizeAxes = Axes.Both; + Children = new Drawable[] + { + text = new OsuSpriteText + { + Margin = new MarginPadding(5), + TextSize = 14, + Font = @"Exo2.0-Bold", // Font should only turn bold when active? + }, + box = new Box + { + RelativeSizeAxes = Axes.X, + Height = 1, + Alpha = 0, + Colour = Color4.White, + Origin = Anchor.BottomLeft, + Anchor = Anchor.BottomLeft, + } + }; + } + + // TODO: Remove this (for debugging) + public override string ToString() { + return Value.ToString(); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + fadeColour = colours.Blue; + text.Colour = colours.Blue; + } + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index b377ba6096..a427a68555 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -84,6 +84,11 @@ + + + + + @@ -175,6 +180,8 @@ + + From 40bcc63a9091aa1878b95ae56310a311a6d1f9eb Mon Sep 17 00:00:00 2001 From: Kelvin <2yangk23@gmail.com> Date: Wed, 8 Mar 2017 01:19:00 -0800 Subject: [PATCH 02/74] Added and styled FilterTabControls --- .../Tests/TestCaseTabControl.cs | 60 +++++++++++++++++++ .../osu.Desktop.VisualTests.csproj | 1 + osu.Game/Screens/Select/FilterControl.cs | 53 +++++++++------- .../Screens/Select/Tab/FilterTabControl.cs | 8 +++ .../Select/Tab/FilterTabDropDownHeader.cs | 7 --- .../Select/Tab/FilterTabDropDownMenu.cs | 20 +++++-- .../Select/Tab/FilterTabDropDownMenuItem.cs | 25 ++++++-- osu.Game/Screens/Select/Tab/FilterTabItem.cs | 22 ++++--- 8 files changed, 148 insertions(+), 48 deletions(-) create mode 100644 osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs b/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs new file mode 100644 index 0000000000..d534acbdc8 --- /dev/null +++ b/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs @@ -0,0 +1,60 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Primitives; +using osu.Framework.Graphics.UserInterface.Tab; +using osu.Framework.Screens.Testing; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Screens.Select.Filter; +using osu.Game.Screens.Select.Tab; + +namespace osu.Desktop.VisualTests.Tests +{ + public class TestCaseTabControl : TestCase + { + public override string Description => @"Filter for song select"; + + public override void Reset() + { + base.Reset(); + + OsuSpriteText text; + FilterTabControl filter; + + Add(new FillFlowContainer + { + Direction = FillDirection.Horizontal, + AutoSizeAxes = Axes.Both, + Children = new Drawable[] + { + filter = new FilterTabControl(GroupMode.All, GroupMode.RecentlyPlayed) + { + Width = 229, + AutoSort = true + }, + text = new OsuSpriteText + { + Text = "None", + Margin = new MarginPadding(4) + } + } + }); + + filter.ValueChanged += (sender, mode) => + { + Debug.WriteLine($"Selected {mode}"); + text.Text = mode.ToString(); + }; + } + } +} diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index 81ee7185bb..68aed38b34 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -193,6 +193,7 @@ + diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index 2d1ab6cf7b..06e909924a 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -93,16 +93,12 @@ namespace osu.Game.Screens.Select { private TabControl groupTabs; private TabControl sortTabs; + private OsuSpriteText spriteText; public GroupSortTabs() { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; - } - - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { Children = new Drawable[] { new Box @@ -114,29 +110,42 @@ namespace osu.Game.Screens.Select Anchor = Anchor.TopLeft, Position = new Vector2(0, 23) }, - groupTabs = new FilterTabControl + groupTabs = new FilterTabControl(GroupMode.All, GroupMode.RecentlyPlayed) { - Width = 210 + Width = 230, + AutoSort = true }, - sortTabs = new FilterTabControl + new Container { - Width = 180, + AutoSizeAxes = Axes.Both, Anchor = Anchor.TopRight, - Origin = Anchor.TopRight + Origin = Anchor.TopRight, + Children = new Drawable[] + { + spriteText = new OsuSpriteText + { + Font = @"Exo2.0-Bold", + Text = "Sort results by", + TextSize = 14, + Margin = new MarginPadding + { + Top = 5, + Bottom = 5 + }, + }, + sortTabs = new FilterTabControl(87) + { + Width = 191, + AutoSort = true + } + } } }; - sortTabs.Prefix.Children = new Drawable[] - { - new OsuSpriteText - { - Font = @"Exo2.0-Bold", - Text = "Sort results by", - TextSize = 14, - Margin = new MarginPadding { Top = 5, Bottom = 5 }, - } - }; - groupTabs.Pin(GroupMode.All); - groupTabs.Pin(GroupMode.RecentlyPlayed); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) { + spriteText.Colour = colours.GreenLight; } } } diff --git a/osu.Game/Screens/Select/Tab/FilterTabControl.cs b/osu.Game/Screens/Select/Tab/FilterTabControl.cs index b076f66bde..f36c088cf3 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabControl.cs +++ b/osu.Game/Screens/Select/Tab/FilterTabControl.cs @@ -10,5 +10,13 @@ namespace osu.Game.Screens.Select.Tab protected override TabDropDownMenu CreateDropDownMenu() => new FilterTabDropDownMenu(); protected override TabItem CreateTabItem(T value) => new FilterTabItem { Value = value }; + + public FilterTabControl(float offset, params T[] pinned) : base(offset, pinned) + { + } + + public FilterTabControl(params T[] pinned) : base(pinned) + { + } } } diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs b/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs index 7d90dea594..df4766c3e7 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs +++ b/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE -using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface; @@ -30,11 +29,5 @@ namespace osu.Game.Screens.Select.Tab } }; } - - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - ellipses.Colour = colours.Blue; - } } } diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs index 7555a59d25..20f211aaa2 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs +++ b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs @@ -7,10 +7,12 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Extensions; using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Transforms; using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface.Tab; using osu.Game.Graphics; +using osu.Game.Screens.Select.Filter; using OpenTK; using OpenTK.Graphics; @@ -18,6 +20,9 @@ namespace osu.Game.Screens.Select.Tab { public class FilterTabDropDownMenu : TabDropDownMenu { + public override float HeaderWidth => 14; + public override float HeaderHeight => 24; + protected override BasicDropDownHeader CreateHeader() => new FilterTabDropDownHeader(); protected override IEnumerable> GetDropDownItems(IEnumerable> values) @@ -25,9 +30,11 @@ namespace osu.Game.Screens.Select.Tab public FilterTabDropDownMenu() { - ContentContainer.CornerRadius = 4; MaxDropDownHeight = int.MaxValue; - ContentBackground.Colour = Color4.Black.Opacity(0.5f); + ContentContainer.CornerRadius = 4; + ContentBackground.Colour = Color4.Black.Opacity(0.9f); + ScrollContainer.ScrollDraggerVisible = false; + DropDownItemsContainer.Padding = new MarginPadding { Left = 5, Bottom = 7, Right = 5, Top = 7 }; if (!typeof(T).IsEnum) throw new InvalidOperationException("TabControl only supports enums as the generic type argument"); @@ -62,9 +69,12 @@ namespace osu.Game.Screens.Select.Tab } [BackgroundDependencyLoader] - private void load(OsuColour colours) { - //Colour = colours.White; - //SelectedItem.Colour = colours.Blue; + private void load(OsuColour colours) + { + if (typeof(T) == typeof(SortMode)) + Header.Colour = colours.GreenLight; + else + Header.Colour = colours.Blue; } } } diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs index 42ab12e1e4..6747fd3eee 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs +++ b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs @@ -9,6 +9,7 @@ using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics; using OpenTK.Graphics; using osu.Game.Graphics.Sprites; +using osu.Game.Screens.Select.Filter; namespace osu.Game.Screens.Select.Tab { @@ -16,9 +17,11 @@ namespace osu.Game.Screens.Select.Tab { public FilterTabDropDownMenuItem(string text, T value) : base(text, value) { - Foreground.Padding = new MarginPadding(5); - Background.Colour = Color4.Red; + Foreground.Padding = new MarginPadding { Top = 4, Bottom = 4 }; Foreground.Margin = new MarginPadding { Left = 7 }; + + Masking = true; + CornerRadius = 6; Foreground.Add(new OsuSpriteText { Text = text, @@ -30,10 +33,20 @@ namespace osu.Game.Screens.Select.Tab [BackgroundDependencyLoader] private void load(OsuColour colours) { - BackgroundColour = Color4.Black.Opacity(0.8f); - BackgroundColourHover = new Color4(124, 200, 253, 255); - BackgroundColourSelected = new Color4(124, 200, 253, 255); - //BackgroundColourSelected = new Color4(163, 196, 36, 255); // Green + BackgroundColour = Color4.Black.Opacity(0f); + ForegroundColourHover = Color4.Black; + ForegroundColourSelected = Color4.Black; + + if (typeof(T) == typeof(SortMode)) + { + BackgroundColourHover = new Color4(163, 196, 36, 255); + BackgroundColourSelected = new Color4(163, 196, 36, 255); + } + else + { + BackgroundColourHover = new Color4(124, 200, 253, 255); + BackgroundColourSelected = new Color4(124, 200, 253, 255); + } } } } diff --git a/osu.Game/Screens/Select/Tab/FilterTabItem.cs b/osu.Game/Screens/Select/Tab/FilterTabItem.cs index c24dbd7e15..3847c84c92 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabItem.cs +++ b/osu.Game/Screens/Select/Tab/FilterTabItem.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Extensions; using osu.Framework.Graphics; @@ -11,7 +12,7 @@ using osu.Framework.Graphics.UserInterface.Tab; using osu.Framework.Input; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -using OpenTK.Graphics; +using osu.Game.Screens.Select.Filter; namespace osu.Game.Screens.Select.Tab { @@ -90,16 +91,21 @@ namespace osu.Game.Screens.Select.Tab }; } - // TODO: Remove this (for debugging) - public override string ToString() { - return Value.ToString(); - } - [BackgroundDependencyLoader] private void load(OsuColour colours) { - fadeColour = colours.Blue; - text.Colour = colours.Blue; + if (typeof(T) == typeof(SortMode)) + { + fadeColour = colours.GreenLight; + if (!Active) + text.Colour = colours.GreenLight; + } + else + { + fadeColour = colours.Blue; + if (!Active) + text.Colour = colours.Blue; + } } } } From ee3d3b682f0dfbf2546acad2771afd11b5850856 Mon Sep 17 00:00:00 2001 From: Kelvin <2yangk23@gmail.com> Date: Thu, 9 Mar 2017 02:50:00 -0800 Subject: [PATCH 03/74] Updated usage for DropDownHeader of FilterTabControl --- osu.Game/Graphics/UserInterface/OsuDropDownMenu.cs | 2 +- .../Screens/Select/Tab/FilterTabDropDownHeader.cs | 11 +++++++---- osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuDropDownMenu.cs b/osu.Game/Graphics/UserInterface/OsuDropDownMenu.cs index 6ca44034c6..786636ce1a 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropDownMenu.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropDownMenu.cs @@ -11,7 +11,7 @@ namespace osu.Game.Graphics.UserInterface { public class OsuDropDownMenu : DropDownMenu { - protected override BasicDropDownHeader CreateHeader() => new OsuDropDownHeader(); + protected override DropDownHeader CreateHeader() => new OsuDropDownHeader(); public OsuDropDownMenu() { diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs b/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs index df4766c3e7..3c77b12010 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs +++ b/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs @@ -8,16 +8,19 @@ using osu.Game.Graphics; namespace osu.Game.Screens.Select.Tab { - public class FilterTabDropDownHeader : BasicDropDownHeader + public class FilterTabDropDownHeader : DropDownHeader { protected override string Label { get; set; } private TextAwesome ellipses; - public FilterTabDropDownHeader() - { + public FilterTabDropDownHeader() { + Background.Hide(); // don't need a background + RelativeSizeAxes = Axes.None; AutoSizeAxes = Axes.Both; - Children = new Drawable[] + Foreground.RelativeSizeAxes = Axes.None; + Foreground.AutoSizeAxes = Axes.Both; + Foreground.Children = new Drawable[] { ellipses = new TextAwesome { diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs index 20f211aaa2..0ac2ff07d3 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs +++ b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs @@ -23,7 +23,7 @@ namespace osu.Game.Screens.Select.Tab public override float HeaderWidth => 14; public override float HeaderHeight => 24; - protected override BasicDropDownHeader CreateHeader() => new FilterTabDropDownHeader(); + protected override DropDownHeader CreateHeader() => new FilterTabDropDownHeader(); protected override IEnumerable> GetDropDownItems(IEnumerable> values) => values.Select(v => new FilterTabDropDownMenuItem(v.Key, v.Value)); From 755fb260dbb93ed31211e2336fb92376e7d118d1 Mon Sep 17 00:00:00 2001 From: Kelvin <2yangk23@gmail.com> Date: Tue, 14 Mar 2017 19:46:13 -0700 Subject: [PATCH 04/74] Updated TabControl Usage --- .../Tests/TestCaseTabControl.cs | 15 +++++---------- .../Graphics/UserInterface/OsuDropDownMenu.cs | 4 ++-- osu.Game/Screens/Select/FilterControl.cs | 4 +++- osu.Game/Screens/Select/SongSelect.cs | 4 ++-- osu.Game/Screens/Select/Tab/FilterTabControl.cs | 6 +----- .../Screens/Select/Tab/FilterTabDropDownHeader.cs | 9 ++------- .../Screens/Select/Tab/FilterTabDropDownMenu.cs | 3 +-- 7 files changed, 16 insertions(+), 29 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs b/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs index d534acbdc8..6ea957b5d0 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs @@ -1,19 +1,11 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; -using osu.Framework.Graphics.UserInterface.Tab; using osu.Framework.Screens.Testing; -using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Screens.Select.Filter; using osu.Game.Screens.Select.Tab; @@ -37,7 +29,7 @@ namespace osu.Desktop.VisualTests.Tests AutoSizeAxes = Axes.Both, Children = new Drawable[] { - filter = new FilterTabControl(GroupMode.All, GroupMode.RecentlyPlayed) + filter = new FilterTabControl { Width = 229, AutoSort = true @@ -49,7 +41,10 @@ namespace osu.Desktop.VisualTests.Tests } } }); - + + filter.PinTab(GroupMode.All); + filter.PinTab(GroupMode.RecentlyPlayed); + filter.ValueChanged += (sender, mode) => { Debug.WriteLine($"Selected {mode}"); diff --git a/osu.Game/Graphics/UserInterface/OsuDropDownMenu.cs b/osu.Game/Graphics/UserInterface/OsuDropDownMenu.cs index 786636ce1a..14615417f7 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropDownMenu.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropDownMenu.cs @@ -1,11 +1,11 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Graphics.Transforms; -using osu.Framework.Graphics.UserInterface; using OpenTK; using OpenTK.Graphics; using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics.Transforms; +using osu.Framework.Graphics.UserInterface; namespace osu.Game.Graphics.UserInterface { diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index 06e909924a..3ab65f3d42 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -110,7 +110,7 @@ namespace osu.Game.Screens.Select Anchor = Anchor.TopLeft, Position = new Vector2(0, 23) }, - groupTabs = new FilterTabControl(GroupMode.All, GroupMode.RecentlyPlayed) + groupTabs = new FilterTabControl { Width = 230, AutoSort = true @@ -141,6 +141,8 @@ namespace osu.Game.Screens.Select } } }; + groupTabs.PinTab(GroupMode.All); + groupTabs.PinTab(GroupMode.RecentlyPlayed); } [BackgroundDependencyLoader] diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index ca8b353c57..132f737d22 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -109,10 +109,10 @@ namespace osu.Game.Screens.Select Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, }); - Add(filter = new FilterControl + Add(filter = new FilterControl(filter_height) { RelativeSizeAxes = Axes.X, - Height = filter_height, + AutoSizeAxes = Axes.Y, FilterChanged = () => filterChanged(), Exit = Exit, }); diff --git a/osu.Game/Screens/Select/Tab/FilterTabControl.cs b/osu.Game/Screens/Select/Tab/FilterTabControl.cs index f36c088cf3..5dd0c24ba1 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabControl.cs +++ b/osu.Game/Screens/Select/Tab/FilterTabControl.cs @@ -11,11 +11,7 @@ namespace osu.Game.Screens.Select.Tab protected override TabItem CreateTabItem(T value) => new FilterTabItem { Value = value }; - public FilterTabControl(float offset, params T[] pinned) : base(offset, pinned) - { - } - - public FilterTabControl(params T[] pinned) : base(pinned) + public FilterTabControl(float offset = 0) : base(offset) { } } diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs b/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs index 3c77b12010..8ba4d9c402 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs +++ b/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs @@ -3,23 +3,18 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Primitives; -using osu.Framework.Graphics.UserInterface; +using osu.Framework.Graphics.UserInterface.Tab; using osu.Game.Graphics; namespace osu.Game.Screens.Select.Tab { - public class FilterTabDropDownHeader : DropDownHeader + public class FilterTabDropDownHeader : TabDropDownHeader { protected override string Label { get; set; } private TextAwesome ellipses; public FilterTabDropDownHeader() { - Background.Hide(); // don't need a background - RelativeSizeAxes = Axes.None; - AutoSizeAxes = Axes.Both; - Foreground.RelativeSizeAxes = Axes.None; - Foreground.AutoSizeAxes = Axes.Both; Foreground.Children = new Drawable[] { ellipses = new TextAwesome diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs index 0ac2ff07d3..df96711e0c 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs +++ b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs @@ -25,8 +25,7 @@ namespace osu.Game.Screens.Select.Tab protected override DropDownHeader CreateHeader() => new FilterTabDropDownHeader(); - protected override IEnumerable> GetDropDownItems(IEnumerable> values) - => values.Select(v => new FilterTabDropDownMenuItem(v.Key, v.Value)); + protected override DropDownMenuItem CreateDropDownItem(string key, T value) => new FilterTabDropDownMenuItem(key, value); public FilterTabDropDownMenu() { From 20e2e7a8c80d6b68cbba03f6be9b0365e422832e Mon Sep 17 00:00:00 2001 From: Kelvin <2yangk23@gmail.com> Date: Tue, 14 Mar 2017 20:19:41 -0700 Subject: [PATCH 05/74] Sort on SortTabs ValueChanged --- osu.Game/Screens/Select/Filter/GroupMode.cs | 1 - osu.Game/Screens/Select/Filter/SortMode.cs | 1 - osu.Game/Screens/Select/FilterControl.cs | 134 ++++++++++-------- .../Screens/Select/Tab/FilterTabControl.cs | 6 + .../Select/Tab/FilterTabDropDownMenu.cs | 13 -- 5 files changed, 79 insertions(+), 76 deletions(-) diff --git a/osu.Game/Screens/Select/Filter/GroupMode.cs b/osu.Game/Screens/Select/Filter/GroupMode.cs index a0e343b164..5b7a1c332e 100644 --- a/osu.Game/Screens/Select/Filter/GroupMode.cs +++ b/osu.Game/Screens/Select/Filter/GroupMode.cs @@ -7,7 +7,6 @@ namespace osu.Game.Screens.Select.Filter { public enum GroupMode { - None = 0, [Description("All")] All, [Description("Artist")] diff --git a/osu.Game/Screens/Select/Filter/SortMode.cs b/osu.Game/Screens/Select/Filter/SortMode.cs index d0b7f3e614..2a7d62a623 100644 --- a/osu.Game/Screens/Select/Filter/SortMode.cs +++ b/osu.Game/Screens/Select/Filter/SortMode.cs @@ -7,7 +7,6 @@ namespace osu.Game.Screens.Select.Filter { public enum SortMode { - None = 0, [Description("Artist")] Artist, [Description("Author")] diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index 3ab65f3d42..c8e85e4992 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -2,9 +2,9 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using osu.Framework.Allocation; using OpenTK; using OpenTK.Graphics; +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; @@ -36,6 +36,23 @@ namespace osu.Game.Screens.Select } } + private GroupMode group = GroupMode.All; + public GroupMode Group { + get { return group; } + set + { + if (group != value) + { + group = value; + FilterChanged?.Invoke(); + } + } + } + + private TabControl groupTabs; + private TabControl sortTabs; + private OsuSpriteText spriteText; + public Action Exit; private SearchTextBox searchTextBox; @@ -72,10 +89,61 @@ namespace osu.Game.Screens.Select }, Exit = () => Exit?.Invoke(), }, - new GroupSortTabs() + new Container + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.X, + Height = 1, + Colour = OsuColour.Gray(80), + Origin = Anchor.TopLeft, + Anchor = Anchor.TopLeft, + Position = new Vector2(0, 23) + }, + groupTabs = new FilterTabControl + { + Width = 230, + AutoSort = true + }, + new Container + { + AutoSizeAxes = Axes.Both, + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + Children = new Drawable[] + { + spriteText = new OsuSpriteText + { + Font = @"Exo2.0-Bold", + Text = "Sort results by", + TextSize = 14, + Margin = new MarginPadding + { + Top = 5, + Bottom = 5 + }, + }, + sortTabs = new FilterTabControl(87) + { + Width = 191, + AutoSort = true + } + } + } + } + } } } }; + + groupTabs.PinTab(GroupMode.All); + groupTabs.PinTab(GroupMode.RecentlyPlayed); + groupTabs.ValueChanged += (sender, value) => Group = value; + sortTabs.ValueChanged += (sender, value) => Sort = value; } public void Deactivate() @@ -89,66 +157,10 @@ namespace osu.Game.Screens.Select searchTextBox.HoldFocus = true; } - private class GroupSortTabs : Container + [BackgroundDependencyLoader] + private void load(OsuColour colours) { - private TabControl groupTabs; - private TabControl sortTabs; - private OsuSpriteText spriteText; - - public GroupSortTabs() - { - RelativeSizeAxes = Axes.X; - AutoSizeAxes = Axes.Y; - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.X, - Height = 1, - Colour = OsuColour.Gray(80), - Origin = Anchor.TopLeft, - Anchor = Anchor.TopLeft, - Position = new Vector2(0, 23) - }, - groupTabs = new FilterTabControl - { - Width = 230, - AutoSort = true - }, - new Container - { - AutoSizeAxes = Axes.Both, - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight, - Children = new Drawable[] - { - spriteText = new OsuSpriteText - { - Font = @"Exo2.0-Bold", - Text = "Sort results by", - TextSize = 14, - Margin = new MarginPadding - { - Top = 5, - Bottom = 5 - }, - }, - sortTabs = new FilterTabControl(87) - { - Width = 191, - AutoSort = true - } - } - } - }; - groupTabs.PinTab(GroupMode.All); - groupTabs.PinTab(GroupMode.RecentlyPlayed); - } - - [BackgroundDependencyLoader] - private void load(OsuColour colours) { - spriteText.Colour = colours.GreenLight; - } + spriteText.Colour = colours.GreenLight; } } } \ No newline at end of file diff --git a/osu.Game/Screens/Select/Tab/FilterTabControl.cs b/osu.Game/Screens/Select/Tab/FilterTabControl.cs index 5dd0c24ba1..3f2e0d9a8e 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabControl.cs +++ b/osu.Game/Screens/Select/Tab/FilterTabControl.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Framework.Graphics.UserInterface.Tab; namespace osu.Game.Screens.Select.Tab @@ -13,6 +14,11 @@ namespace osu.Game.Screens.Select.Tab public FilterTabControl(float offset = 0) : base(offset) { + if (!typeof(T).IsEnum) + throw new InvalidOperationException("FilterTabControl only supports enums as the generic type argument"); + + foreach (var val in (T[])Enum.GetValues(typeof(T))) + AddTab(val); } } } diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs index df96711e0c..5f56a8aa8b 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs +++ b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs @@ -34,19 +34,6 @@ namespace osu.Game.Screens.Select.Tab ContentBackground.Colour = Color4.Black.Opacity(0.9f); ScrollContainer.ScrollDraggerVisible = false; DropDownItemsContainer.Padding = new MarginPadding { Left = 5, Bottom = 7, Right = 5, Top = 7 }; - - if (!typeof(T).IsEnum) - throw new InvalidOperationException("TabControl only supports enums as the generic type argument"); - - List> items = new List>(); - foreach (var val in (T[])Enum.GetValues(typeof(T))) - { - if (!val.Equals(default(T))) - items.Add(new KeyValuePair((val as Enum)?.GetDescription(), val)); - } - - Items = items; - // TODO: ValueChanged Handling } protected override void AnimateOpen() From 18afd8eabeccf4be2859628cbce374bd57fb8c9e Mon Sep 17 00:00:00 2001 From: Kelvin <2yangk23@gmail.com> Date: Tue, 14 Mar 2017 20:30:42 -0700 Subject: [PATCH 06/74] Fixed license headers --- osu-resources | 2 +- osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs | 2 +- osu.Game/Screens/Select/Filter/GroupMode.cs | 2 +- osu.Game/Screens/Select/Filter/SortMode.cs | 2 +- osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs | 2 +- osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs | 8 ++------ osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs | 2 +- 7 files changed, 8 insertions(+), 12 deletions(-) diff --git a/osu-resources b/osu-resources index 51f2b9b37f..4f9ed4e703 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 51f2b9b37f38cd349a3dd728a78f8fffcb3a54f5 +Subproject commit 4f9ed4e703777ede98737c7e2af31efa4694c395 diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs b/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs index 6ea957b5d0..7fda6a4bbf 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Diagnostics; using osu.Framework.Graphics; diff --git a/osu.Game/Screens/Select/Filter/GroupMode.cs b/osu.Game/Screens/Select/Filter/GroupMode.cs index 5b7a1c332e..b9e0938fcc 100644 --- a/osu.Game/Screens/Select/Filter/GroupMode.cs +++ b/osu.Game/Screens/Select/Filter/GroupMode.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game/Screens/Select/Filter/SortMode.cs b/osu.Game/Screens/Select/Filter/SortMode.cs index 2a7d62a623..4beecb730e 100644 --- a/osu.Game/Screens/Select/Filter/SortMode.cs +++ b/osu.Game/Screens/Select/Filter/SortMode.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs b/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs index 8ba4d9c402..13a3fd836b 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs +++ b/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; using osu.Framework.Graphics.Primitives; diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs index 5f56a8aa8b..4acf6d6b1d 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs +++ b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs @@ -1,11 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; -using System.Collections.Generic; -using System.Linq; +using OpenTK; +using OpenTK.Graphics; using osu.Framework.Allocation; -using osu.Framework.Extensions; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Transforms; @@ -13,8 +11,6 @@ using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface.Tab; using osu.Game.Graphics; using osu.Game.Screens.Select.Filter; -using OpenTK; -using OpenTK.Graphics; namespace osu.Game.Screens.Select.Tab { diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs index 6747fd3eee..9a6b575fbc 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs +++ b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; From 4353c9dc3d67f4c73a6339616832663a0cc9fc8a Mon Sep 17 00:00:00 2001 From: Kelvin <2yangk23@gmail.com> Date: Tue, 14 Mar 2017 20:42:02 -0700 Subject: [PATCH 07/74] Fixed Warnings --- osu.Game/Screens/Select/FilterControl.cs | 5 +++-- .../Screens/Select/Tab/FilterTabDropDownHeader.cs | 4 +--- .../Screens/Select/Tab/FilterTabDropDownMenu.cs | 13 +++---------- .../Screens/Select/Tab/FilterTabDropDownMenuItem.cs | 8 ++++---- 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index c8e85e4992..a70af1a2b5 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -49,8 +49,6 @@ namespace osu.Game.Screens.Select } } - private TabControl groupTabs; - private TabControl sortTabs; private OsuSpriteText spriteText; public Action Exit; @@ -59,6 +57,9 @@ namespace osu.Game.Screens.Select public FilterControl(float height) { + TabControl sortTabs; + TabControl groupTabs; + Children = new Drawable[] { new Box diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs b/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs index 13a3fd836b..6a0ed9044e 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs +++ b/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs @@ -12,12 +12,10 @@ namespace osu.Game.Screens.Select.Tab { protected override string Label { get; set; } - private TextAwesome ellipses; - public FilterTabDropDownHeader() { Foreground.Children = new Drawable[] { - ellipses = new TextAwesome + new TextAwesome { Icon = FontAwesome.fa_ellipsis_h, TextSize = 14, diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs index 4acf6d6b1d..b47976446c 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs +++ b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs @@ -44,19 +44,12 @@ namespace osu.Game.Screens.Select.Tab protected override void UpdateContentHeight() { - if (State == DropDownMenuState.Opened) - ContentContainer.ResizeTo(new Vector2(1, ContentHeight), 300, EasingTypes.OutQuint); - else - ContentContainer.ResizeTo(new Vector2(1, 0), 300, EasingTypes.OutQuint); + ContentContainer.ResizeTo(new Vector2(1, State == DropDownMenuState.Opened ? ContentHeight : 0), 300, EasingTypes.OutQuint); } [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - if (typeof(T) == typeof(SortMode)) - Header.Colour = colours.GreenLight; - else - Header.Colour = colours.Blue; + private void load(OsuColour colours) { + Header.Colour = typeof(T) == typeof(SortMode) ? colours.GreenLight : colours.Blue; } } } diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs index 9a6b575fbc..166ce33f05 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs +++ b/osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs @@ -39,13 +39,13 @@ namespace osu.Game.Screens.Select.Tab if (typeof(T) == typeof(SortMode)) { - BackgroundColourHover = new Color4(163, 196, 36, 255); - BackgroundColourSelected = new Color4(163, 196, 36, 255); + BackgroundColourHover = colours.GreenLight; + BackgroundColourSelected = colours.GreenLight; } else { - BackgroundColourHover = new Color4(124, 200, 253, 255); - BackgroundColourSelected = new Color4(124, 200, 253, 255); + BackgroundColourHover = colours.Blue; + BackgroundColourSelected = colours.Blue; } } } From 3aecbf57395d2b6933e2de0189bfd478dfee42a7 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 15 Mar 2017 20:11:50 -0400 Subject: [PATCH 08/74] Rearrange things somewhat --- .../Tests/TestCaseTabControl.cs | 6 +++--- .../UserInterface/OsuTabControl.cs} | 12 ++++++------ .../UserInterface/OsuTabDropDownHeader.cs} | 7 ++++--- .../UserInterface/OsuTabDropDownMenu.cs} | 13 +++++++------ .../UserInterface/OsuTabDropDownMenuItem.cs} | 6 +++--- .../UserInterface/OsuTabItem.cs} | 6 +++--- osu.Game/Screens/Select/FilterControl.cs | 15 +++++++++------ osu.Game/osu.Game.csproj | 10 +++++----- 8 files changed, 40 insertions(+), 35 deletions(-) rename osu.Game/{Screens/Select/Tab/FilterTabControl.cs => Graphics/UserInterface/OsuTabControl.cs} (57%) rename osu.Game/{Screens/Select/Tab/FilterTabDropDownHeader.cs => Graphics/UserInterface/OsuTabDropDownHeader.cs} (81%) rename osu.Game/{Screens/Select/Tab/FilterTabDropDownMenu.cs => Graphics/UserInterface/OsuTabDropDownMenu.cs} (83%) rename osu.Game/{Screens/Select/Tab/FilterTabDropDownMenuItem.cs => Graphics/UserInterface/OsuTabDropDownMenuItem.cs} (86%) rename osu.Game/{Screens/Select/Tab/FilterTabItem.cs => Graphics/UserInterface/OsuTabItem.cs} (92%) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs b/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs index 7fda6a4bbf..a072087956 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs @@ -8,7 +8,7 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Screens.Testing; using osu.Game.Graphics.Sprites; using osu.Game.Screens.Select.Filter; -using osu.Game.Screens.Select.Tab; +using osu.Game.Graphics.UserInterface; namespace osu.Desktop.VisualTests.Tests { @@ -21,7 +21,7 @@ namespace osu.Desktop.VisualTests.Tests base.Reset(); OsuSpriteText text; - FilterTabControl filter; + OsuTabControl filter; Add(new FillFlowContainer { @@ -29,7 +29,7 @@ namespace osu.Desktop.VisualTests.Tests AutoSizeAxes = Axes.Both, Children = new Drawable[] { - filter = new FilterTabControl + filter = new OsuTabControl { Width = 229, AutoSort = true diff --git a/osu.Game/Screens/Select/Tab/FilterTabControl.cs b/osu.Game/Graphics/UserInterface/OsuTabControl.cs similarity index 57% rename from osu.Game/Screens/Select/Tab/FilterTabControl.cs rename to osu.Game/Graphics/UserInterface/OsuTabControl.cs index 3f2e0d9a8e..51df8e7830 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabControl.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabControl.cs @@ -4,18 +4,18 @@ using System; using osu.Framework.Graphics.UserInterface.Tab; -namespace osu.Game.Screens.Select.Tab +namespace osu.Game.Graphics.UserInterface { - public class FilterTabControl : TabControl + public class OsuTabControl : TabControl { - protected override TabDropDownMenu CreateDropDownMenu() => new FilterTabDropDownMenu(); + protected override TabDropDownMenu CreateDropDownMenu() => new OsuTabDropDownMenu(); - protected override TabItem CreateTabItem(T value) => new FilterTabItem { Value = value }; + protected override TabItem CreateTabItem(T value) => new OsuTabItem { Value = value }; - public FilterTabControl(float offset = 0) : base(offset) + public OsuTabControl(float offset = 0) : base(offset) { if (!typeof(T).IsEnum) - throw new InvalidOperationException("FilterTabControl only supports enums as the generic type argument"); + throw new InvalidOperationException("OsuTabControl only supports enums as the generic type argument"); foreach (var val in (T[])Enum.GetValues(typeof(T))) AddTab(val); diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs b/osu.Game/Graphics/UserInterface/OsuTabDropDownHeader.cs similarity index 81% rename from osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs rename to osu.Game/Graphics/UserInterface/OsuTabDropDownHeader.cs index 6a0ed9044e..5506365aef 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabDropDownHeader.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabDropDownHeader.cs @@ -6,13 +6,14 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface.Tab; using osu.Game.Graphics; -namespace osu.Game.Screens.Select.Tab +namespace osu.Game.Graphics.UserInterface { - public class FilterTabDropDownHeader : TabDropDownHeader + public class OsuTabDropDownHeader : TabDropDownHeader { protected override string Label { get; set; } - public FilterTabDropDownHeader() { + public OsuTabDropDownHeader() + { Foreground.Children = new Drawable[] { new TextAwesome diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs b/osu.Game/Graphics/UserInterface/OsuTabDropDownMenu.cs similarity index 83% rename from osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs rename to osu.Game/Graphics/UserInterface/OsuTabDropDownMenu.cs index b47976446c..57f298513a 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenu.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabDropDownMenu.cs @@ -12,18 +12,18 @@ using osu.Framework.Graphics.UserInterface.Tab; using osu.Game.Graphics; using osu.Game.Screens.Select.Filter; -namespace osu.Game.Screens.Select.Tab +namespace osu.Game.Graphics.UserInterface { - public class FilterTabDropDownMenu : TabDropDownMenu + public class OsuTabDropDownMenu : TabDropDownMenu { public override float HeaderWidth => 14; public override float HeaderHeight => 24; - protected override DropDownHeader CreateHeader() => new FilterTabDropDownHeader(); + protected override DropDownHeader CreateHeader() => new OsuTabDropDownHeader(); - protected override DropDownMenuItem CreateDropDownItem(string key, T value) => new FilterTabDropDownMenuItem(key, value); + protected override DropDownMenuItem CreateDropDownItem(string key, T value) => new OsuTabDropDownMenuItem(key, value); - public FilterTabDropDownMenu() + public OsuTabDropDownMenu() { MaxDropDownHeight = int.MaxValue; ContentContainer.CornerRadius = 4; @@ -48,7 +48,8 @@ namespace osu.Game.Screens.Select.Tab } [BackgroundDependencyLoader] - private void load(OsuColour colours) { + private void load(OsuColour colours) + { Header.Colour = typeof(T) == typeof(SortMode) ? colours.GreenLight : colours.Blue; } } diff --git a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs b/osu.Game/Graphics/UserInterface/OsuTabDropDownMenuItem.cs similarity index 86% rename from osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs rename to osu.Game/Graphics/UserInterface/OsuTabDropDownMenuItem.cs index 166ce33f05..130e026ab4 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabDropDownMenuItem.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabDropDownMenuItem.cs @@ -11,11 +11,11 @@ using OpenTK.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Screens.Select.Filter; -namespace osu.Game.Screens.Select.Tab +namespace osu.Game.Graphics.UserInterface { - public class FilterTabDropDownMenuItem : DropDownMenuItem + public class OsuTabDropDownMenuItem : DropDownMenuItem { - public FilterTabDropDownMenuItem(string text, T value) : base(text, value) + public OsuTabDropDownMenuItem(string text, T value) : base(text, value) { Foreground.Padding = new MarginPadding { Top = 4, Bottom = 4 }; Foreground.Margin = new MarginPadding { Left = 7 }; diff --git a/osu.Game/Screens/Select/Tab/FilterTabItem.cs b/osu.Game/Graphics/UserInterface/OsuTabItem.cs similarity index 92% rename from osu.Game/Screens/Select/Tab/FilterTabItem.cs rename to osu.Game/Graphics/UserInterface/OsuTabItem.cs index 3847c84c92..8b62829df3 100644 --- a/osu.Game/Screens/Select/Tab/FilterTabItem.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabItem.cs @@ -14,9 +14,9 @@ using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Screens.Select.Filter; -namespace osu.Game.Screens.Select.Tab +namespace osu.Game.Graphics.UserInterface { - public class FilterTabItem : TabItem + public class OsuTabItem : TabItem { private SpriteText text; private Box box; @@ -68,7 +68,7 @@ namespace osu.Game.Screens.Select.Tab fadeInactive(); } - public FilterTabItem() + public OsuTabItem() { AutoSizeAxes = Axes.Both; Children = new Drawable[] diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index a70af1a2b5..7bf237d378 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -9,12 +9,12 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.UserInterface.Tab; using osu.Game.Graphics; +using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.Sprites; using osu.Game.Screens.Select.Filter; -using osu.Game.Screens.Select.Tab; using Container = osu.Framework.Graphics.Containers.Container; +using osu.Framework.Graphics.UserInterface.Tab; namespace osu.Game.Screens.Select { @@ -23,8 +23,10 @@ namespace osu.Game.Screens.Select public Action FilterChanged; public string Search => searchTextBox.Text; + private SortMode sort = SortMode.Title; - public SortMode Sort { + public SortMode Sort + { get { return sort; } set { @@ -37,7 +39,8 @@ namespace osu.Game.Screens.Select } private GroupMode group = GroupMode.All; - public GroupMode Group { + public GroupMode Group + { get { return group; } set { @@ -105,7 +108,7 @@ namespace osu.Game.Screens.Select Anchor = Anchor.TopLeft, Position = new Vector2(0, 23) }, - groupTabs = new FilterTabControl + groupTabs = new OsuTabControl { Width = 230, AutoSort = true @@ -128,7 +131,7 @@ namespace osu.Game.Screens.Select Bottom = 5 }, }, - sortTabs = new FilterTabControl(87) + sortTabs = new OsuTabControl(87) { Width = 191, AutoSort = true diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 5368b08260..1b6ea5d84b 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -85,11 +85,6 @@ - - - - - @@ -354,6 +349,11 @@ + + + + + From db5a1e241a23d80399634381f3a813339d47245d Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 15 Mar 2017 20:18:20 -0400 Subject: [PATCH 09/74] Don't crash on unimplemented sorts --- osu.Game/Screens/Select/CarouselContainer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/CarouselContainer.cs b/osu.Game/Screens/Select/CarouselContainer.cs index c0340acbd5..7de7779bd0 100644 --- a/osu.Game/Screens/Select/CarouselContainer.cs +++ b/osu.Game/Screens/Select/CarouselContainer.cs @@ -197,7 +197,8 @@ namespace osu.Game.Screens.Select }); break; default: - throw new NotImplementedException(); + Sort(SortMode.Artist); // Temporary + break; } scrollableContent.Clear(false); From 01cca1a4d217188ee05e0db4b405f683fb5ea827 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 15 Mar 2017 20:52:31 -0400 Subject: [PATCH 10/74] Refactor color handling colour* --- .../Graphics/UserInterface/OsuTabControl.cs | 22 +++++++++++ .../UserInterface/OsuTabDropDownMenu.cs | 26 ++++++++++--- .../UserInterface/OsuTabDropDownMenuItem.cs | 28 +++++++------- osu.Game/Graphics/UserInterface/OsuTabItem.cs | 37 ++++++++++--------- osu.Game/Screens/Select/FilterControl.cs | 7 ++-- 5 files changed, 81 insertions(+), 39 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuTabControl.cs b/osu.Game/Graphics/UserInterface/OsuTabControl.cs index 51df8e7830..d03fb474b8 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabControl.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabControl.cs @@ -2,6 +2,8 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using OpenTK.Graphics; +using osu.Framework.Allocation; using osu.Framework.Graphics.UserInterface.Tab; namespace osu.Game.Graphics.UserInterface @@ -20,5 +22,25 @@ namespace osu.Game.Graphics.UserInterface foreach (var val in (T[])Enum.GetValues(typeof(T))) AddTab(val); } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + if (accentColour == null) + AccentColour = colours.Blue; + } + + private Color4? accentColour; + public Color4 AccentColour + { + get { return accentColour.GetValueOrDefault(); } + set + { + accentColour = value; + (DropDown as OsuTabDropDownMenu).AccentColour = value; + foreach (OsuTabItem item in TabContainer.Children) + item.AccentColour = value; + } + } } } diff --git a/osu.Game/Graphics/UserInterface/OsuTabDropDownMenu.cs b/osu.Game/Graphics/UserInterface/OsuTabDropDownMenu.cs index 57f298513a..51e7009e45 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabDropDownMenu.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabDropDownMenu.cs @@ -9,8 +9,6 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Transforms; using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface.Tab; -using osu.Game.Graphics; -using osu.Game.Screens.Select.Filter; namespace osu.Game.Graphics.UserInterface { @@ -19,9 +17,26 @@ namespace osu.Game.Graphics.UserInterface public override float HeaderWidth => 14; public override float HeaderHeight => 24; - protected override DropDownHeader CreateHeader() => new OsuTabDropDownHeader(); + private Color4? accentColour; + public Color4 AccentColour + { + get { return accentColour.GetValueOrDefault(); } + set + { + accentColour = value; + Header.Colour = value; + foreach (OsuTabDropDownMenuItem item in ItemList) + item.AccentColour = value; + } + } - protected override DropDownMenuItem CreateDropDownItem(string key, T value) => new OsuTabDropDownMenuItem(key, value); + protected override DropDownHeader CreateHeader() => new OsuTabDropDownHeader + { + Colour = AccentColour + }; + + protected override DropDownMenuItem CreateDropDownItem(string key, T value) => + new OsuTabDropDownMenuItem(key, value) { AccentColour = AccentColour }; public OsuTabDropDownMenu() { @@ -50,7 +65,8 @@ namespace osu.Game.Graphics.UserInterface [BackgroundDependencyLoader] private void load(OsuColour colours) { - Header.Colour = typeof(T) == typeof(SortMode) ? colours.GreenLight : colours.Blue; + if (accentColour == null) + AccentColour = colours.Blue; } } } diff --git a/osu.Game/Graphics/UserInterface/OsuTabDropDownMenuItem.cs b/osu.Game/Graphics/UserInterface/OsuTabDropDownMenuItem.cs index 130e026ab4..1df57e3ac6 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabDropDownMenuItem.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabDropDownMenuItem.cs @@ -6,10 +6,8 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface; -using osu.Game.Graphics; using OpenTK.Graphics; using osu.Game.Graphics.Sprites; -using osu.Game.Screens.Select.Filter; namespace osu.Game.Graphics.UserInterface { @@ -30,23 +28,27 @@ namespace osu.Game.Graphics.UserInterface }); } + private Color4? accentColour; + public Color4 AccentColour + { + get { return accentColour.Value; } + set + { + accentColour = value; + BackgroundColourHover = BackgroundColourSelected = value; + FormatBackground(); + FormatForeground(); + } + } + [BackgroundDependencyLoader] private void load(OsuColour colours) { BackgroundColour = Color4.Black.Opacity(0f); ForegroundColourHover = Color4.Black; ForegroundColourSelected = Color4.Black; - - if (typeof(T) == typeof(SortMode)) - { - BackgroundColourHover = colours.GreenLight; - BackgroundColourSelected = colours.GreenLight; - } - else - { - BackgroundColourHover = colours.Blue; - BackgroundColourSelected = colours.Blue; - } + if (accentColour == null) + AccentColour = colours.Blue; } } } diff --git a/osu.Game/Graphics/UserInterface/OsuTabItem.cs b/osu.Game/Graphics/UserInterface/OsuTabItem.cs index 8b62829df3..ca4b70d5d8 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabItem.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabItem.cs @@ -10,9 +10,7 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface.Tab; using osu.Framework.Input; -using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -using osu.Game.Screens.Select.Filter; namespace osu.Game.Graphics.UserInterface { @@ -20,7 +18,18 @@ namespace osu.Game.Graphics.UserInterface { private SpriteText text; private Box box; - private Color4 fadeColour; + + private Color4? accentColour; + public Color4 AccentColour + { + get { return accentColour.GetValueOrDefault(); } + set + { + accentColour = value; + if (!Active) + text.Colour = value; + } + } public new T Value { @@ -54,16 +63,18 @@ namespace osu.Game.Graphics.UserInterface private void fadeInactive() { box.FadeOut(300); - text.FadeColour(fadeColour, 300); + text.FadeColour(AccentColour, 300); } - protected override bool OnHover(InputState state) { + protected override bool OnHover(InputState state) + { if (!Active) fadeActive(); return true; } - protected override void OnHoverLost(InputState state) { + protected override void OnHoverLost(InputState state) + { if (!Active) fadeInactive(); } @@ -94,18 +105,8 @@ namespace osu.Game.Graphics.UserInterface [BackgroundDependencyLoader] private void load(OsuColour colours) { - if (typeof(T) == typeof(SortMode)) - { - fadeColour = colours.GreenLight; - if (!Active) - text.Colour = colours.GreenLight; - } - else - { - fadeColour = colours.Blue; - if (!Active) - text.Colour = colours.Blue; - } + if (accentColour == null) + AccentColour = colours.Blue; } } } diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index 7bf237d378..a162579b96 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -23,6 +23,8 @@ namespace osu.Game.Screens.Select public Action FilterChanged; public string Search => searchTextBox.Text; + + private OsuTabControl sortTabs; private SortMode sort = SortMode.Title; public SortMode Sort @@ -60,7 +62,6 @@ namespace osu.Game.Screens.Select public FilterControl(float height) { - TabControl sortTabs; TabControl groupTabs; Children = new Drawable[] @@ -134,7 +135,7 @@ namespace osu.Game.Screens.Select sortTabs = new OsuTabControl(87) { Width = 191, - AutoSort = true + AutoSort = true, } } } @@ -164,7 +165,7 @@ namespace osu.Game.Screens.Select [BackgroundDependencyLoader] private void load(OsuColour colours) { - spriteText.Colour = colours.GreenLight; + sortTabs.AccentColour = spriteText.Colour = colours.GreenLight; } } } \ No newline at end of file From 0000cf1bee9ae5e289d1c96dcfd41fac9f18e8f6 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 15 Mar 2017 21:44:27 -0400 Subject: [PATCH 11/74] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 036b124eb2..67dd51e27c 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 036b124eb2387dde29af56e06391c42063ec85e2 +Subproject commit 67dd51e27c1a4cbbc17f29fee5dee3a125eed78e From 360340c61d1038ccffc229e25c6a6449df092ea6 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 15 Mar 2017 22:39:09 -0400 Subject: [PATCH 12/74] Fix linter issues --- osu.Game/Graphics/UserInterface/OsuTabControl.cs | 7 +++++-- osu.Game/Graphics/UserInterface/OsuTabDropDownHeader.cs | 1 - osu.Game/Graphics/UserInterface/OsuTabDropDownMenu.cs | 3 ++- osu.Game/Graphics/UserInterface/OsuTabDropDownMenuItem.cs | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuTabControl.cs b/osu.Game/Graphics/UserInterface/OsuTabControl.cs index d03fb474b8..5f467b48ca 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabControl.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabControl.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Linq; using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Graphics.UserInterface.Tab; @@ -37,8 +38,10 @@ namespace osu.Game.Graphics.UserInterface set { accentColour = value; - (DropDown as OsuTabDropDownMenu).AccentColour = value; - foreach (OsuTabItem item in TabContainer.Children) + var dropDown = DropDown as OsuTabDropDownMenu; + if (dropDown != null) + dropDown.AccentColour = value; + foreach (var item in TabContainer.Children.OfType>()) item.AccentColour = value; } } diff --git a/osu.Game/Graphics/UserInterface/OsuTabDropDownHeader.cs b/osu.Game/Graphics/UserInterface/OsuTabDropDownHeader.cs index 5506365aef..2b4d68b4b4 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabDropDownHeader.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabDropDownHeader.cs @@ -4,7 +4,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface.Tab; -using osu.Game.Graphics; namespace osu.Game.Graphics.UserInterface { diff --git a/osu.Game/Graphics/UserInterface/OsuTabDropDownMenu.cs b/osu.Game/Graphics/UserInterface/OsuTabDropDownMenu.cs index 51e7009e45..f84ab25354 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabDropDownMenu.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabDropDownMenu.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Linq; using OpenTK; using OpenTK.Graphics; using osu.Framework.Allocation; @@ -25,7 +26,7 @@ namespace osu.Game.Graphics.UserInterface { accentColour = value; Header.Colour = value; - foreach (OsuTabDropDownMenuItem item in ItemList) + foreach (var item in ItemList.OfType>()) item.AccentColour = value; } } diff --git a/osu.Game/Graphics/UserInterface/OsuTabDropDownMenuItem.cs b/osu.Game/Graphics/UserInterface/OsuTabDropDownMenuItem.cs index 1df57e3ac6..86d451f7bb 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabDropDownMenuItem.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabDropDownMenuItem.cs @@ -31,7 +31,7 @@ namespace osu.Game.Graphics.UserInterface private Color4? accentColour; public Color4 AccentColour { - get { return accentColour.Value; } + get { return accentColour.GetValueOrDefault(); } set { accentColour = value; From c82ae011fb125a8a41c2c7f74140306e51376285 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Thu, 16 Mar 2017 12:40:35 +0900 Subject: [PATCH 13/74] Make ScoreProcessors take generic judgements. --- osu.Game.Modes.Catch/CatchRuleset.cs | 2 - osu.Game.Modes.Catch/CatchScoreProcessor.cs | 21 ++++++++ osu.Game.Modes.Catch/UI/CatchHitRenderer.cs | 4 +- .../osu.Game.Modes.Catch.csproj | 1 + osu.Game.Modes.Catch/packages.config | 1 + osu.Game.Modes.Mania/ManiaRuleset.cs | 2 - osu.Game.Modes.Mania/ManiaScoreProcessor.cs | 21 ++++++++ osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs | 4 +- .../osu.Game.Modes.Mania.csproj | 1 + osu.Game.Modes.Mania/packages.config | 1 + osu.Game.Modes.Osu/OsuRuleset.cs | 2 - osu.Game.Modes.Osu/OsuScoreProcessor.cs | 13 ++--- osu.Game.Modes.Osu/UI/OsuHitRenderer.cs | 4 +- osu.Game.Modes.Osu/packages.config | 1 + osu.Game.Modes.Taiko/TaikoRuleset.cs | 2 - osu.Game.Modes.Taiko/TaikoScoreProcessor.cs | 21 ++++++++ osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs | 4 +- .../osu.Game.Modes.Taiko.csproj | 1 + osu.Game.Modes.Taiko/packages.config | 1 + osu.Game/Database/ScoreDatabase.cs | 3 +- osu.Game/Modes/Ruleset.cs | 2 - osu.Game/Modes/ScoreProcesssor.cs | 50 ++++++++++++------- osu.Game/Modes/UI/HitRenderer.cs | 23 ++++----- osu.Game/Screens/Play/Player.cs | 7 +-- osu.Game/packages.config | 1 + 25 files changed, 137 insertions(+), 56 deletions(-) create mode 100644 osu.Game.Modes.Catch/CatchScoreProcessor.cs create mode 100644 osu.Game.Modes.Mania/ManiaScoreProcessor.cs create mode 100644 osu.Game.Modes.Taiko/TaikoScoreProcessor.cs diff --git a/osu.Game.Modes.Catch/CatchRuleset.cs b/osu.Game.Modes.Catch/CatchRuleset.cs index cb695aaabe..0166948fcb 100644 --- a/osu.Game.Modes.Catch/CatchRuleset.cs +++ b/osu.Game.Modes.Catch/CatchRuleset.cs @@ -87,8 +87,6 @@ namespace osu.Game.Modes.Catch new KeyCounterMouse(MouseButton.Right) }; - public override ScoreProcessor CreateScoreProcessor(int hitObjectCount = 0) => null; - public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => new CatchDifficultyCalculator(beatmap); } } diff --git a/osu.Game.Modes.Catch/CatchScoreProcessor.cs b/osu.Game.Modes.Catch/CatchScoreProcessor.cs new file mode 100644 index 0000000000..e653297a15 --- /dev/null +++ b/osu.Game.Modes.Catch/CatchScoreProcessor.cs @@ -0,0 +1,21 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Modes.Catch.Judgements; +using osu.Game.Modes.Catch.Objects; +using osu.Game.Modes.UI; + +namespace osu.Game.Modes.Catch +{ + internal class CatchScoreProcessor : ScoreProcessor + { + public CatchScoreProcessor(HitRenderer hitRenderer) + : base(hitRenderer) + { + } + + protected override void UpdateCalculations(CatchJudgementInfo newJudgement) + { + } + } +} diff --git a/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs b/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs index e45ca7d293..c02b6b6c49 100644 --- a/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs +++ b/osu.Game.Modes.Catch/UI/CatchHitRenderer.cs @@ -17,11 +17,13 @@ namespace osu.Game.Modes.Catch.UI { } + public override ScoreProcessor CreateScoreProcessor() => new CatchScoreProcessor(this); + protected override IBeatmapConverter CreateBeatmapConverter() => new CatchBeatmapConverter(); protected override IBeatmapProcessor CreateBeatmapProcessor() => new CatchBeatmapProcessor(); - protected override Playfield CreatePlayfield() => new CatchPlayfield(); + protected override Playfield CreatePlayfield() => new CatchPlayfield(); protected override DrawableHitObject GetVisualRepresentation(CatchBaseHit h) => null; } diff --git a/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj b/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj index e6861b54ef..a32416173d 100644 --- a/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj +++ b/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj @@ -50,6 +50,7 @@ + diff --git a/osu.Game.Modes.Catch/packages.config b/osu.Game.Modes.Catch/packages.config index 4031dd62a8..08fca09c35 100644 --- a/osu.Game.Modes.Catch/packages.config +++ b/osu.Game.Modes.Catch/packages.config @@ -1,4 +1,5 @@  +