From eacf2045f0c1bf5ef817fcfd88f22dd44dc639dc Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 28 Apr 2017 04:56:34 +0300 Subject: [PATCH 01/74] Initial commit --- osu.Game/Screens/Play/SongProgress.cs | 16 ++++- osu.Game/Screens/Play/SongProgressInfo.cs | 87 +++++++++++++++++++++++ osu.Game/osu.Game.csproj | 1 + 3 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 osu.Game/Screens/Play/SongProgressInfo.cs diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index ed57dad644..db81d22844 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -28,6 +28,7 @@ namespace osu.Game.Screens.Play private readonly SongProgressBar bar; private readonly SongProgressGraph graph; + private readonly SongProgressInfo info; public Action OnSeek; @@ -62,6 +63,14 @@ namespace osu.Game.Screens.Play Children = new Drawable[] { + info = new SongProgressInfo + { + Origin = Anchor.BottomLeft, + Anchor = Anchor.BottomLeft, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Y = -(bottom_bar_height + graph_height), + }, graph = new SongProgressGraph { RelativeSizeAxes = Axes.X, @@ -130,10 +139,15 @@ namespace osu.Game.Screens.Play if (objects == null) return; - double progress = ((AudioClock?.CurrentTime ?? Time.Current) - firstHitTime) / lastHitTime; + double currentTime = (AudioClock?.CurrentTime ?? Time.Current); + double progress = (currentTime - firstHitTime) / lastHitTime; bar.UpdatePosition((float)progress); graph.Progress = (int)(graph.ColumnCount * progress); + + info.TimeCurrent = TimeSpan.FromMilliseconds(currentTime).ToString(@"m\:ss"); + info.TimeLeft = TimeSpan.FromMilliseconds(lastHitTime - currentTime).ToString(@"m\:ss"); + info.Progress = ((int)(currentTime / lastHitTime * 100)).ToString(); } } } diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs new file mode 100644 index 0000000000..7f32c18957 --- /dev/null +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -0,0 +1,87 @@ +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Primitives; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; + +namespace osu.Game.Screens.Play +{ + public class SongProgressInfo : Container + { + private InfoText timeCurrent; + private InfoText timeLeft; + private InfoText progress; + + private const int margin = 10; + + public string TimeCurrent + { + set + { + timeCurrent.Text = value; + } + } + + public string TimeLeft + { + set + { + timeLeft.Text = @"-" + value; + } + } + public string Progress + { + set + { + progress.Text = value + @"%"; + } + } + + public SongProgressInfo() + { + Children = new Drawable[] + { + timeCurrent = new InfoText + { + Origin = Anchor.BottomLeft, + Anchor = Anchor.BottomLeft, + Margin = new MarginPadding + { + Left = margin, + }, + }, + progress = new InfoText + { + Origin = Anchor.BottomCentre, + Anchor = Anchor.BottomCentre, + }, + timeLeft = new InfoText + { + Origin = Anchor.BottomRight, + Anchor = Anchor.BottomRight, + Margin = new MarginPadding + { + Right = margin, + } + } + }; + } + + private class InfoText : OsuSpriteText + { + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + Colour = colours.BlueLighter; + Font = @"Venera"; + EdgeEffect = new EdgeEffect + { + Colour = colours.BlueDarker, + Type = EdgeEffectType.Glow, + Radius = 5, + }; + } + } + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index cb491055c4..6d7a1c43cd 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -224,6 +224,7 @@ + From c27909d53c0bb6b5d611b89670bd93e33333204c Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 28 Apr 2017 05:02:25 +0300 Subject: [PATCH 02/74] CI fixes --- osu.Game/Screens/Play/SongProgress.cs | 2 +- osu.Game/Screens/Play/SongProgressInfo.cs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index db81d22844..4fdc4710ac 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -139,7 +139,7 @@ namespace osu.Game.Screens.Play if (objects == null) return; - double currentTime = (AudioClock?.CurrentTime ?? Time.Current); + double currentTime = AudioClock?.CurrentTime ?? Time.Current; double progress = (currentTime - firstHitTime) / lastHitTime; bar.UpdatePosition((float)progress); diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index 7f32c18957..127a87f3bf 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -1,4 +1,7 @@ -using osu.Framework.Allocation; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; From c4bd21914d3a4908933ece0f7458af2378a77e31 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 28 Apr 2017 15:37:22 +0300 Subject: [PATCH 03/74] warning fixes --- osu.Game/Screens/Play/SongProgressInfo.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index 127a87f3bf..fa179d05c1 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -12,9 +12,9 @@ namespace osu.Game.Screens.Play { public class SongProgressInfo : Container { - private InfoText timeCurrent; - private InfoText timeLeft; - private InfoText progress; + private readonly InfoText timeCurrent; + private readonly InfoText timeLeft; + private readonly InfoText progress; private const int margin = 10; From f8faea8da28644b5d10c27a06304acfc4b1ffc72 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 28 Apr 2017 16:02:00 +0300 Subject: [PATCH 04/74] Removed unnecessary nested class --- osu.Game/Screens/Play/SongProgressInfo.cs | 37 +++++++++-------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index fa179d05c1..1a36f1bd42 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -12,9 +12,9 @@ namespace osu.Game.Screens.Play { public class SongProgressInfo : Container { - private readonly InfoText timeCurrent; - private readonly InfoText timeLeft; - private readonly InfoText progress; + private OsuSpriteText timeCurrent; + private OsuSpriteText timeLeft; + private OsuSpriteText progress; private const int margin = 10; @@ -41,28 +41,35 @@ namespace osu.Game.Screens.Play } } - public SongProgressInfo() + [BackgroundDependencyLoader] + private void load(OsuColour colours) { Children = new Drawable[] { - timeCurrent = new InfoText + timeCurrent = new OsuSpriteText { Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, + Colour = colours.BlueLighter, + Font = @"Venera", Margin = new MarginPadding { Left = margin, }, }, - progress = new InfoText + progress = new OsuSpriteText { Origin = Anchor.BottomCentre, Anchor = Anchor.BottomCentre, + Colour = colours.BlueLighter, + Font = @"Venera", }, - timeLeft = new InfoText + timeLeft = new OsuSpriteText { Origin = Anchor.BottomRight, Anchor = Anchor.BottomRight, + Colour = colours.BlueLighter, + Font = @"Venera", Margin = new MarginPadding { Right = margin, @@ -70,21 +77,5 @@ namespace osu.Game.Screens.Play } }; } - - private class InfoText : OsuSpriteText - { - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - Colour = colours.BlueLighter; - Font = @"Venera"; - EdgeEffect = new EdgeEffect - { - Colour = colours.BlueDarker, - Type = EdgeEffectType.Glow, - Radius = 5, - }; - } - } } } From 698ae0832f86037150f1987272360464ce2203d9 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 1 May 2017 07:00:44 +0300 Subject: [PATCH 05/74] Move string formatting inside the class --- osu.Game/Screens/Play/SongProgress.cs | 6 +++--- osu.Game/Screens/Play/SongProgressInfo.cs | 26 ++++------------------- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 4fdc4710ac..35aeb33528 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -145,9 +145,9 @@ namespace osu.Game.Screens.Play bar.UpdatePosition((float)progress); graph.Progress = (int)(graph.ColumnCount * progress); - info.TimeCurrent = TimeSpan.FromMilliseconds(currentTime).ToString(@"m\:ss"); - info.TimeLeft = TimeSpan.FromMilliseconds(lastHitTime - currentTime).ToString(@"m\:ss"); - info.Progress = ((int)(currentTime / lastHitTime * 100)).ToString(); + info.TimeCurrent = currentTime; + info.TimeLeft = lastHitTime - currentTime; + info.Progress = (int)(currentTime / lastHitTime * 100); } } } diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index 1a36f1bd42..ffee4e4094 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using System; namespace osu.Game.Screens.Play { @@ -18,28 +19,9 @@ namespace osu.Game.Screens.Play private const int margin = 10; - public string TimeCurrent - { - set - { - timeCurrent.Text = value; - } - } - - public string TimeLeft - { - set - { - timeLeft.Text = @"-" + value; - } - } - public string Progress - { - set - { - progress.Text = value + @"%"; - } - } + public double TimeCurrent { set { timeCurrent.Text = TimeSpan.FromMilliseconds(value).ToString(@"m\:ss"); } } + public double TimeLeft { set { timeLeft.Text = @"- " + TimeSpan.FromMilliseconds(value).ToString(@"m\:ss"); } } + public int Progress { set { progress.Text = value.ToString() + @"%"; } } [BackgroundDependencyLoader] private void load(OsuColour colours) From 81d67cbe06381b596b48263f686c675eb7f6f1b3 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Fri, 5 May 2017 01:59:24 -0300 Subject: [PATCH 06/74] Play first visible set in playlist when commiting in the search field. --- osu.Game/Overlays/Music/FilterControl.cs | 1 + osu.Game/Overlays/Music/PlaylistItem.cs | 4 ++++ osu.Game/Overlays/Music/PlaylistList.cs | 2 ++ osu.Game/Overlays/Music/PlaylistOverlay.cs | 5 +++++ osu.Game/Screens/Select/SearchTextBox.cs | 7 ++++++- 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Music/FilterControl.cs b/osu.Game/Overlays/Music/FilterControl.cs index c6572c5ed2..5b528b7e89 100644 --- a/osu.Game/Overlays/Music/FilterControl.cs +++ b/osu.Game/Overlays/Music/FilterControl.cs @@ -62,6 +62,7 @@ namespace osu.Game.Overlays.Music protected override Color4 BackgroundUnfocused => backgroundColour; protected override Color4 BackgroundFocused => backgroundColour; + protected override bool AllowCommit => true; public FilterTextBox() { diff --git a/osu.Game/Overlays/Music/PlaylistItem.cs b/osu.Game/Overlays/Music/PlaylistItem.cs index da31e94e22..c2413956b4 100644 --- a/osu.Game/Overlays/Music/PlaylistItem.cs +++ b/osu.Game/Overlays/Music/PlaylistItem.cs @@ -132,6 +132,10 @@ namespace osu.Game.Overlays.Music FadeTo(matching ? 1 : 0, 200); } + get + { + return matching; + } } } } diff --git a/osu.Game/Overlays/Music/PlaylistList.cs b/osu.Game/Overlays/Music/PlaylistList.cs index c7909f1a63..ffe59a9d93 100644 --- a/osu.Game/Overlays/Music/PlaylistList.cs +++ b/osu.Game/Overlays/Music/PlaylistList.cs @@ -22,6 +22,8 @@ namespace osu.Game.Overlays.Music } } + public BeatmapSetInfo FirstVisibleSet => items.Children.FirstOrDefault(i => i.MatchingCurrentFilter)?.BeatmapSetInfo; + private void itemSelected(BeatmapSetInfo b) { OnSelect?.Invoke(b); diff --git a/osu.Game/Overlays/Music/PlaylistOverlay.cs b/osu.Game/Overlays/Music/PlaylistOverlay.cs index 92b8addd97..00d66053a7 100644 --- a/osu.Game/Overlays/Music/PlaylistOverlay.cs +++ b/osu.Game/Overlays/Music/PlaylistOverlay.cs @@ -84,6 +84,11 @@ namespace osu.Game.Overlays.Music list.BeatmapSets = BeatmapSets = beatmaps.GetAllWithChildren().ToList(); beatmapBacking.BindTo(game.Beatmap); + + filter.Search.OnCommit = delegate { + var beatmap = list.FirstVisibleSet?.Beatmaps?.ValueAtOrDefault(0); + if (beatmap != null) playSpecified(beatmap); + }; } protected override void LoadComplete() diff --git a/osu.Game/Screens/Select/SearchTextBox.cs b/osu.Game/Screens/Select/SearchTextBox.cs index 4f2ab221cb..743b1fc5c7 100644 --- a/osu.Game/Screens/Select/SearchTextBox.cs +++ b/osu.Game/Screens/Select/SearchTextBox.cs @@ -15,6 +15,8 @@ namespace osu.Game.Screens.Select /// public class SearchTextBox : FocusedTextBox { + protected virtual bool AllowCommit => false; + public SearchTextBox() { Height = 35; @@ -45,8 +47,11 @@ namespace osu.Game.Screens.Select case Key.Right: case Key.Up: case Key.Down: - case Key.Enter: return false; + + case Key.Enter: + if (!AllowCommit) return false; + break; } } From 3c4faae554d6f99bc1628fdec84d38ecd8f76f60 Mon Sep 17 00:00:00 2001 From: Jorolf Date: Sun, 7 May 2017 20:35:57 +0200 Subject: [PATCH 07/74] add search box and the ability to search --- osu.Game/Overlays/Options/OptionsSection.cs | 17 +++++++++++++++-- osu.Game/Overlays/Options/OptionsSubsection.cs | 14 +++++++++++++- osu.Game/Overlays/OptionsOverlay.cs | 14 +++++++++++++- 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/Options/OptionsSection.cs b/osu.Game/Overlays/Options/OptionsSection.cs index d5dafad9ba..4069503a51 100644 --- a/osu.Game/Overlays/Options/OptionsSection.cs +++ b/osu.Game/Overlays/Options/OptionsSection.cs @@ -1,4 +1,6 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +using System; +using System.Collections.Generic; +// Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; @@ -10,10 +12,11 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using System.Linq; namespace osu.Game.Overlays.Options { - public abstract class OptionsSection : Container + public abstract class OptionsSection : Container, IHasFilterableChildren { protected FillFlowContainer FlowContent; protected override Container Content => FlowContent; @@ -21,6 +24,16 @@ namespace osu.Game.Overlays.Options public abstract FontAwesome Icon { get; } public abstract string Header { get; } + public IEnumerable FilterableChildren => Children.OfType(); + public string[] FilterTerms => new[] { Header }; + public bool MatchingCurrentFilter + { + set + { + FadeTo(value ? 1 : 0); + } + } + private readonly SpriteText headerLabel; protected OptionsSection() diff --git a/osu.Game/Overlays/Options/OptionsSubsection.cs b/osu.Game/Overlays/Options/OptionsSubsection.cs index 9fd2e8fb1e..ff9e60c273 100644 --- a/osu.Game/Overlays/Options/OptionsSubsection.cs +++ b/osu.Game/Overlays/Options/OptionsSubsection.cs @@ -6,10 +6,12 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using osu.Game.Graphics.Sprites; +using System.Collections.Generic; +using System.Linq; namespace osu.Game.Overlays.Options { - public abstract class OptionsSubsection : FillFlowContainer + public abstract class OptionsSubsection : FillFlowContainer, IHasFilterableChildren { protected override Container Content => content; @@ -17,6 +19,16 @@ namespace osu.Game.Overlays.Options protected abstract string Header { get; } + public IEnumerable FilterableChildren => Children.OfType(); + public string[] FilterTerms => new[] { Header }; + public bool MatchingCurrentFilter + { + set + { + FadeTo(value ? 1 : 0); + } + } + protected OptionsSubsection() { RelativeSizeAxes = Axes.X; diff --git a/osu.Game/Overlays/OptionsOverlay.cs b/osu.Game/Overlays/OptionsOverlay.cs index dcbce80c69..afe998c208 100644 --- a/osu.Game/Overlays/OptionsOverlay.cs +++ b/osu.Game/Overlays/OptionsOverlay.cs @@ -13,6 +13,7 @@ using System; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Overlays.Options.Sections; +using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays { @@ -32,6 +33,7 @@ namespace osu.Game.Overlays private Sidebar sidebar; private SidebarButton[] sidebarButtons; private OptionsSection[] sections; + private SearchContainer searchContainer; private float lastKnownScroll; public OptionsOverlay() @@ -43,6 +45,8 @@ namespace osu.Game.Overlays [BackgroundDependencyLoader(permitNulls: true)] private void load(OsuGame game, OsuColour colours) { + OsuTextBox textBox; + sections = new OptionsSection[] { new GeneralSection(), @@ -92,7 +96,13 @@ namespace osu.Game.Overlays TextSize = 18, Margin = new MarginPadding { Left = CONTENT_MARGINS, Bottom = 30 }, }, - new FillFlowContainer + textBox = new OsuTextBox + { + PlaceholderText = "Type to search!", + Width = width - CONTENT_MARGINS * 2, + Margin = new MarginPadding { Left = CONTENT_MARGINS }, + }, + searchContainer = new SearchContainer { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, @@ -118,6 +128,8 @@ namespace osu.Game.Overlays } }; + textBox.Current.ValueChanged += newValue => searchContainer.SearchTerm = newValue; + scrollContainer.Padding = new MarginPadding { Top = game?.Toolbar.DrawHeight ?? 0 }; } From ea28a9f7ce2dfcba262710137478e46d543a6c8a Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 8 May 2017 00:16:58 +0300 Subject: [PATCH 08/74] Adjust values --- osu.Game/Screens/Play/SongProgress.cs | 11 +++--- osu.Game/Screens/Play/SongProgressInfo.cs | 48 +++++++++++++++++++---- 2 files changed, 47 insertions(+), 12 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 35aeb33528..b0a77afa51 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -139,15 +139,16 @@ namespace osu.Game.Screens.Play if (objects == null) return; - double currentTime = AudioClock?.CurrentTime ?? Time.Current; - double progress = (currentTime - firstHitTime) / lastHitTime; + double drawableCurrentTime = AudioClock?.CurrentTime ?? Time.Current; + double songCurrentTime = drawableCurrentTime - firstHitTime; + double progress = songCurrentTime / lastHitTime; bar.UpdatePosition((float)progress); graph.Progress = (int)(graph.ColumnCount * progress); - info.TimeCurrent = currentTime; - info.TimeLeft = lastHitTime - currentTime; - info.Progress = (int)(currentTime / lastHitTime * 100); + info.Progress = (int)(progress * 100); + info.TimeCurrent = songCurrentTime; + info.TimeLeft = lastHitTime - firstHitTime - songCurrentTime; } } } diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index ffee4e4094..17623ca9f7 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -13,22 +13,54 @@ namespace osu.Game.Screens.Play { public class SongProgressInfo : Container { - private OsuSpriteText timeCurrent; + private OsuSpriteText timeCurrentText; private OsuSpriteText timeLeft; - private OsuSpriteText progress; + private OsuSpriteText progressText; + + private int progress; + private double timeCurrent; private const int margin = 10; - public double TimeCurrent { set { timeCurrent.Text = TimeSpan.FromMilliseconds(value).ToString(@"m\:ss"); } } - public double TimeLeft { set { timeLeft.Text = @"- " + TimeSpan.FromMilliseconds(value).ToString(@"m\:ss"); } } - public int Progress { set { progress.Text = value.ToString() + @"%"; } } + public double TimeCurrent + { + set + { + timeCurrent = value; + + if (value > 0) + timeCurrentText.Text = TimeSpan.FromMilliseconds(value).ToString(@"m\:ss"); + } + } + public double TimeLeft + { + set + { + if(timeCurrent < 0) + timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(value + timeCurrent).ToString(@"m\:ss"); + else + timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(value).ToString(@"m\:ss"); + } + } + public int Progress + { + set + { + if (progress == value) + return; + + progress = value; + if (value > 0) + progressText.Text = value.ToString() + @"%"; + } + } [BackgroundDependencyLoader] private void load(OsuColour colours) { Children = new Drawable[] { - timeCurrent = new OsuSpriteText + timeCurrentText = new OsuSpriteText { Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, @@ -38,13 +70,15 @@ namespace osu.Game.Screens.Play { Left = margin, }, + Text = @"0:00", }, - progress = new OsuSpriteText + progressText = new OsuSpriteText { Origin = Anchor.BottomCentre, Anchor = Anchor.BottomCentre, Colour = colours.BlueLighter, Font = @"Venera", + Text = @"0%", }, timeLeft = new OsuSpriteText { From 531f2c410a3a9145ba7b08cd2d4b11b0d3098458 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 8 May 2017 00:26:34 +0300 Subject: [PATCH 09/74] removed useless variable --- osu.Game/Screens/Play/SongProgress.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index b0a77afa51..6489391d6a 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -139,16 +139,15 @@ namespace osu.Game.Screens.Play if (objects == null) return; - double drawableCurrentTime = AudioClock?.CurrentTime ?? Time.Current; - double songCurrentTime = drawableCurrentTime - firstHitTime; - double progress = songCurrentTime / lastHitTime; + double currentTime = (AudioClock?.CurrentTime ?? Time.Current) - firstHitTime; + double progress = currentTime / lastHitTime; bar.UpdatePosition((float)progress); graph.Progress = (int)(graph.ColumnCount * progress); info.Progress = (int)(progress * 100); - info.TimeCurrent = songCurrentTime; - info.TimeLeft = lastHitTime - firstHitTime - songCurrentTime; + info.TimeCurrent = currentTime; + info.TimeLeft = lastHitTime - firstHitTime - currentTime; } } } From c3a42ded361f647055774a3ac3284555cdf0f32d Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 8 May 2017 01:23:51 +0300 Subject: [PATCH 10/74] Fixed Graph/seeking offset --- osu.Game/Screens/Play/SongProgress.cs | 2 +- osu.Game/Screens/Play/SongProgressGraph.cs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 6489391d6a..737c65397c 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -140,7 +140,7 @@ namespace osu.Game.Screens.Play return; double currentTime = (AudioClock?.CurrentTime ?? Time.Current) - firstHitTime; - double progress = currentTime / lastHitTime; + double progress = currentTime / (lastHitTime-firstHitTime); bar.UpdatePosition((float)progress); graph.Progress = (int)(graph.ColumnCount * progress); diff --git a/osu.Game/Screens/Play/SongProgressGraph.cs b/osu.Game/Screens/Play/SongProgressGraph.cs index 20548970e5..4e56f60c31 100644 --- a/osu.Game/Screens/Play/SongProgressGraph.cs +++ b/osu.Game/Screens/Play/SongProgressGraph.cs @@ -20,12 +20,13 @@ namespace osu.Game.Screens.Play const int granularity = 200; + var firstHit = objects.First().StartTime; var lastHit = (objects.Last() as IHasEndTime)?.EndTime ?? 0; if (lastHit == 0) lastHit = objects.Last().StartTime; - var interval = (lastHit + 1) / granularity; + var interval = (lastHit - firstHit + 1) / granularity; var values = new int[granularity]; @@ -33,8 +34,8 @@ namespace osu.Game.Screens.Play { IHasEndTime end = h as IHasEndTime; - int startRange = (int)(h.StartTime / interval); - int endRange = (int)((end?.EndTime > 0 ? end.EndTime : h.StartTime) / interval); + int startRange = (int)((h.StartTime - firstHit)/ interval); + int endRange = (int)(((end?.EndTime > 0 ? end.EndTime : h.StartTime) - firstHit) / interval); for (int i = startRange; i <= endRange; i++) values[i]++; } From dda25219bc07efba77c22e02856536d471ff976e Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 8 May 2017 01:54:31 +0300 Subject: [PATCH 11/74] code fixes --- osu.Game/Screens/Play/SongProgress.cs | 2 +- osu.Game/Screens/Play/SongProgressInfo.cs | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 737c65397c..020a26f703 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -140,7 +140,7 @@ namespace osu.Game.Screens.Play return; double currentTime = (AudioClock?.CurrentTime ?? Time.Current) - firstHitTime; - double progress = currentTime / (lastHitTime-firstHitTime); + double progress = currentTime / (lastHitTime - firstHitTime); bar.UpdatePosition((float)progress); graph.Progress = (int)(graph.ColumnCount * progress); diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index 17623ca9f7..d2b236035d 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -32,16 +32,7 @@ namespace osu.Game.Screens.Play timeCurrentText.Text = TimeSpan.FromMilliseconds(value).ToString(@"m\:ss"); } } - public double TimeLeft - { - set - { - if(timeCurrent < 0) - timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(value + timeCurrent).ToString(@"m\:ss"); - else - timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(value).ToString(@"m\:ss"); - } - } + public double TimeLeft { set { timeLeft.Text = @"-" + TimeSpan.FromMilliseconds((timeCurrent < 0) ? (value + timeCurrent) : value).ToString(@"m\:ss"); } } public int Progress { set From 926ed907c26cdc3d18de40efa38c1c71beab37ff Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 8 May 2017 02:00:21 +0300 Subject: [PATCH 12/74] CI fixes --- osu.Game/Screens/Play/SongProgressInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index d2b236035d..12752e09c3 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -32,7 +32,7 @@ namespace osu.Game.Screens.Play timeCurrentText.Text = TimeSpan.FromMilliseconds(value).ToString(@"m\:ss"); } } - public double TimeLeft { set { timeLeft.Text = @"-" + TimeSpan.FromMilliseconds((timeCurrent < 0) ? (value + timeCurrent) : value).ToString(@"m\:ss"); } } + public double TimeLeft { set { timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(timeCurrent < 0 ? value + timeCurrent : value).ToString(@"m\:ss"); } } public int Progress { set From f0145c7f4f6ab6cb533b39e009e80d6942cc9515 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 8 May 2017 02:16:56 +0300 Subject: [PATCH 13/74] Trying to woke up AppVeyor --- osu.Game/Screens/Play/SongProgressInfo.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index 12752e09c3..5b33e6d8af 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -27,7 +27,6 @@ namespace osu.Game.Screens.Play set { timeCurrent = value; - if (value > 0) timeCurrentText.Text = TimeSpan.FromMilliseconds(value).ToString(@"m\:ss"); } From de8428c95bf09b7323e9e12af99bca15ed7afb65 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Sun, 7 May 2017 22:23:33 -0300 Subject: [PATCH 14/74] Make requested changes --- osu.Game/Overlays/Music/PlaylistOverlay.cs | 2 +- osu.Game/Screens/Select/SearchTextBox.cs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Music/PlaylistOverlay.cs b/osu.Game/Overlays/Music/PlaylistOverlay.cs index 00d66053a7..0cae9db2e6 100644 --- a/osu.Game/Overlays/Music/PlaylistOverlay.cs +++ b/osu.Game/Overlays/Music/PlaylistOverlay.cs @@ -85,7 +85,7 @@ namespace osu.Game.Overlays.Music beatmapBacking.BindTo(game.Beatmap); - filter.Search.OnCommit = delegate { + filter.Search.OnCommit = (sender, newText) => { var beatmap = list.FirstVisibleSet?.Beatmaps?.ValueAtOrDefault(0); if (beatmap != null) playSpecified(beatmap); }; diff --git a/osu.Game/Screens/Select/SearchTextBox.cs b/osu.Game/Screens/Select/SearchTextBox.cs index 743b1fc5c7..d451f63a96 100644 --- a/osu.Game/Screens/Select/SearchTextBox.cs +++ b/osu.Game/Screens/Select/SearchTextBox.cs @@ -48,7 +48,6 @@ namespace osu.Game.Screens.Select case Key.Up: case Key.Down: return false; - case Key.Enter: if (!AllowCommit) return false; break; From 4b5e24cc36086467809060ebb316cbfc46252cea Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 8 May 2017 19:14:19 +0300 Subject: [PATCH 15/74] Changed logic a bit --- osu.Game/Screens/Play/SongProgress.cs | 4 ++-- osu.Game/Screens/Play/SongProgressInfo.cs | 28 +++++++++++++++-------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 020a26f703..6a0bc64de9 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -45,6 +45,7 @@ namespace osu.Game.Screens.Play set { graph.Objects = objects = value; + info.SongLenght = lastHitTime - firstHitTime; } } @@ -146,8 +147,7 @@ namespace osu.Game.Screens.Play graph.Progress = (int)(graph.ColumnCount * progress); info.Progress = (int)(progress * 100); - info.TimeCurrent = currentTime; - info.TimeLeft = lastHitTime - firstHitTime - currentTime; + info.CurrentTime = currentTime; } } } diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index 5b33e6d8af..cf73a0d10a 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -13,25 +13,26 @@ namespace osu.Game.Screens.Play { public class SongProgressInfo : Container { - private OsuSpriteText timeCurrentText; + private OsuSpriteText timeCurrent; private OsuSpriteText timeLeft; private OsuSpriteText progressText; + private double currentTime; + private double songLenght; private int progress; - private double timeCurrent; private const int margin = 10; - public double TimeCurrent + public double SongLenght { set { songLenght = value; } } + public double CurrentTime { set { - timeCurrent = value; + currentTime = value; if (value > 0) - timeCurrentText.Text = TimeSpan.FromMilliseconds(value).ToString(@"m\:ss"); + timeCurrent.Text = TimeSpan.FromMilliseconds(value).ToString(@"m\:ss"); } } - public double TimeLeft { set { timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(timeCurrent < 0 ? value + timeCurrent : value).ToString(@"m\:ss"); } } public int Progress { set @@ -40,7 +41,7 @@ namespace osu.Game.Screens.Play return; progress = value; - if (value > 0) + if (currentTime > 0) progressText.Text = value.ToString() + @"%"; } } @@ -50,7 +51,7 @@ namespace osu.Game.Screens.Play { Children = new Drawable[] { - timeCurrentText = new OsuSpriteText + timeCurrent = new OsuSpriteText { Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, @@ -79,9 +80,18 @@ namespace osu.Game.Screens.Play Margin = new MarginPadding { Right = margin, - } + }, + Text = @"-" + TimeSpan.FromMilliseconds(songLenght).ToString(@"m\:ss"), } }; } + + protected override void Update() + { + base.Update(); + + if(currentTime > 0) + timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(songLenght - currentTime).ToString(@"m\:ss"); + } } } From 86f0173c6b476a203034e4b2dfc5483b4f0d72c1 Mon Sep 17 00:00:00 2001 From: Jorolf Date: Mon, 8 May 2017 18:30:00 +0200 Subject: [PATCH 16/74] fix license header --- osu.Game/Overlays/Options/OptionsSection.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Options/OptionsSection.cs b/osu.Game/Overlays/Options/OptionsSection.cs index 4069503a51..5e36f79467 100644 --- a/osu.Game/Overlays/Options/OptionsSection.cs +++ b/osu.Game/Overlays/Options/OptionsSection.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; @@ -12,6 +10,7 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using System.Collections.Generic; using System.Linq; namespace osu.Game.Overlays.Options From 17d1ecb8f592d5c630c17c49892720561bdf130c Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 8 May 2017 19:42:36 +0300 Subject: [PATCH 17/74] Use float type for progress value --- osu.Game/Screens/Play/SongProgress.cs | 6 +++--- osu.Game/Screens/Play/SongProgressInfo.cs | 13 ++++--------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 6a0bc64de9..e3f96bd395 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -141,12 +141,12 @@ namespace osu.Game.Screens.Play return; double currentTime = (AudioClock?.CurrentTime ?? Time.Current) - firstHitTime; - double progress = currentTime / (lastHitTime - firstHitTime); + float progress = (float)(currentTime / (lastHitTime - firstHitTime)); - bar.UpdatePosition((float)progress); + bar.UpdatePosition(progress); graph.Progress = (int)(graph.ColumnCount * progress); - info.Progress = (int)(progress * 100); + info.Progress = progress; info.CurrentTime = currentTime; } } diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index cf73a0d10a..6719ddfb6b 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -15,11 +15,10 @@ namespace osu.Game.Screens.Play { private OsuSpriteText timeCurrent; private OsuSpriteText timeLeft; - private OsuSpriteText progressText; + private OsuSpriteText progress; private double currentTime; private double songLenght; - private int progress; private const int margin = 10; @@ -33,16 +32,12 @@ namespace osu.Game.Screens.Play timeCurrent.Text = TimeSpan.FromMilliseconds(value).ToString(@"m\:ss"); } } - public int Progress + public float Progress { set { - if (progress == value) - return; - - progress = value; if (currentTime > 0) - progressText.Text = value.ToString() + @"%"; + progress.Text = value.ToString("P0"); } } @@ -63,7 +58,7 @@ namespace osu.Game.Screens.Play }, Text = @"0:00", }, - progressText = new OsuSpriteText + progress = new OsuSpriteText { Origin = Anchor.BottomCentre, Anchor = Anchor.BottomCentre, From de2486b8e61481f518db0b7d1075b54f4209c261 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 8 May 2017 20:36:02 +0300 Subject: [PATCH 18/74] Moved timeLeft recalculation to property --- osu.Game/Screens/Play/SongProgressInfo.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index 6719ddfb6b..d805dc2cbd 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -29,7 +29,10 @@ namespace osu.Game.Screens.Play { currentTime = value; if (value > 0) + { timeCurrent.Text = TimeSpan.FromMilliseconds(value).ToString(@"m\:ss"); + timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(songLenght - value).ToString(@"m\:ss"); + } } } public float Progress @@ -80,13 +83,5 @@ namespace osu.Game.Screens.Play } }; } - - protected override void Update() - { - base.Update(); - - if(currentTime > 0) - timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(songLenght - currentTime).ToString(@"m\:ss"); - } } } From 2826c663fd665f6f32b8da7c00504defef631a59 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 9 May 2017 06:05:37 +0300 Subject: [PATCH 19/74] Apply suggested changes --- osu.Game/Screens/Play/SongProgress.cs | 22 ++++--- osu.Game/Screens/Play/SongProgressInfo.cs | 79 +++++++++++++++-------- 2 files changed, 66 insertions(+), 35 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index e3f96bd395..3d192b990c 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -32,7 +32,15 @@ namespace osu.Game.Screens.Play public Action OnSeek; - public IClock AudioClock; + private IClock audioClock; + public IClock AudioClock + { + set + { + audioClock = value; + info.AudioClock = value; + } + } private double lastHitTime => ((objects.Last() as IHasEndTime)?.EndTime ?? objects.Last().StartTime) + 1; @@ -45,7 +53,9 @@ namespace osu.Game.Screens.Play set { graph.Objects = objects = value; - info.SongLenght = lastHitTime - firstHitTime; + + info.StartTime = firstHitTime; + info.EndTime = lastHitTime; } } @@ -70,7 +80,7 @@ namespace osu.Game.Screens.Play Anchor = Anchor.BottomLeft, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, - Y = -(bottom_bar_height + graph_height), + Margin = new MarginPadding { Bottom = bottom_bar_height + graph_height }, }, graph = new SongProgressGraph { @@ -140,14 +150,10 @@ namespace osu.Game.Screens.Play if (objects == null) return; - double currentTime = (AudioClock?.CurrentTime ?? Time.Current) - firstHitTime; - float progress = (float)(currentTime / (lastHitTime - firstHitTime)); + float progress = (float)(((audioClock?.CurrentTime ?? Time.Current) - firstHitTime) / (lastHitTime - firstHitTime)); bar.UpdatePosition(progress); graph.Progress = (int)(graph.ColumnCount * progress); - - info.Progress = progress; - info.CurrentTime = currentTime; } } } diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index d805dc2cbd..069c977bf2 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -5,6 +5,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; +using osu.Framework.Timing; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using System; @@ -17,32 +18,19 @@ namespace osu.Game.Screens.Play private OsuSpriteText timeLeft; private OsuSpriteText progress; - private double currentTime; - private double songLenght; + private double startTime; + private double endTime; - private const int margin = 10; + private int previousPercent; + private int previousSecond; + private bool defaultsSetted; - public double SongLenght { set { songLenght = value; } } - public double CurrentTime - { - set - { - currentTime = value; - if (value > 0) - { - timeCurrent.Text = TimeSpan.FromMilliseconds(value).ToString(@"m\:ss"); - timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(songLenght - value).ToString(@"m\:ss"); - } - } - } - public float Progress - { - set - { - if (currentTime > 0) - progress.Text = value.ToString("P0"); - } - } + private const int margin = 10; + + public IClock AudioClock; + + public double StartTime { set { startTime = value; } } + public double EndTime { set { endTime = value; } } [BackgroundDependencyLoader] private void load(OsuColour colours) @@ -59,7 +47,6 @@ namespace osu.Game.Screens.Play { Left = margin, }, - Text = @"0:00", }, progress = new OsuSpriteText { @@ -67,7 +54,6 @@ namespace osu.Game.Screens.Play Anchor = Anchor.BottomCentre, Colour = colours.BlueLighter, Font = @"Venera", - Text = @"0%", }, timeLeft = new OsuSpriteText { @@ -79,9 +65,48 @@ namespace osu.Game.Screens.Play { Right = margin, }, - Text = @"-" + TimeSpan.FromMilliseconds(songLenght).ToString(@"m\:ss"), } }; } + + protected override void Update() + { + base.Update(); + + double songCurrentTime = AudioClock.CurrentTime - startTime; + + if (!defaultsSetted) + { + timeCurrent.Text = @"0:00"; + timeLeft.Text = TimeSpan.FromMilliseconds(endTime - startTime).ToString(@"m\:ss"); + progress.Text = @"0%"; + + defaultsSetted = true; + } + else + { + if(songCurrentTime >= 0) + { + int currentSecond = TimeSpan.FromMilliseconds(songCurrentTime).Seconds; + + if (currentSecond != previousSecond) + { + previousSecond = currentSecond; + + timeCurrent.Text = TimeSpan.FromMilliseconds(songCurrentTime).ToString(@"m\:ss"); + timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(endTime - AudioClock.CurrentTime).ToString(@"m\:ss"); + } + + int currentPercent = (int)((songCurrentTime / (endTime - startTime)) * 100); + + if (currentPercent != previousPercent) + { + previousPercent = currentPercent; + + progress.Text = currentPercent.ToString() + @"%"; + } + } + } + } } } From 315f1f1256e2295ed2675921d43b32a43c4ffaf2 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 9 May 2017 06:23:03 +0300 Subject: [PATCH 20/74] CI fixes --- osu.Game/Screens/Play/SongProgressInfo.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index 069c977bf2..6483a0b017 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -25,7 +25,7 @@ namespace osu.Game.Screens.Play private int previousSecond; private bool defaultsSetted; - private const int margin = 10; + private const int margin = 10; public IClock AudioClock; @@ -97,7 +97,7 @@ namespace osu.Game.Screens.Play timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(endTime - AudioClock.CurrentTime).ToString(@"m\:ss"); } - int currentPercent = (int)((songCurrentTime / (endTime - startTime)) * 100); + int currentPercent = (int)(songCurrentTime / (endTime - startTime) * 100); if (currentPercent != previousPercent) { From 7b17e331c46d98bcbf2a563317d98d98f74529d6 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Wed, 10 May 2017 03:45:31 +0300 Subject: [PATCH 21/74] cleanups --- osu.Game/Screens/Play/SongProgress.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 3d192b990c..548befdb36 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -33,14 +33,7 @@ namespace osu.Game.Screens.Play public Action OnSeek; private IClock audioClock; - public IClock AudioClock - { - set - { - audioClock = value; - info.AudioClock = value; - } - } + public IClock AudioClock { set { audioClock = info.AudioClock = value; } } private double lastHitTime => ((objects.Last() as IHasEndTime)?.EndTime ?? objects.Last().StartTime) + 1; @@ -150,9 +143,9 @@ namespace osu.Game.Screens.Play if (objects == null) return; - float progress = (float)(((audioClock?.CurrentTime ?? Time.Current) - firstHitTime) / (lastHitTime - firstHitTime)); + double progress = ((audioClock?.CurrentTime ?? Time.Current) - firstHitTime) / (lastHitTime - firstHitTime); - bar.UpdatePosition(progress); + bar.UpdatePosition((float)progress); graph.Progress = (int)(graph.ColumnCount * progress); } } From d8f9e71b846e9f822f3d9841525f89bd6a64d431 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Wed, 10 May 2017 10:14:44 +0300 Subject: [PATCH 22/74] Applied suggested changes --- osu.Game/Screens/Play/SongProgressInfo.cs | 43 ++++++++--------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index 6483a0b017..54a645aa99 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -23,7 +23,7 @@ namespace osu.Game.Screens.Play private int previousPercent; private int previousSecond; - private bool defaultsSetted; + private double previousTimespan; private const int margin = 10; @@ -75,37 +75,24 @@ namespace osu.Game.Screens.Play double songCurrentTime = AudioClock.CurrentTime - startTime; - if (!defaultsSetted) - { - timeCurrent.Text = @"0:00"; - timeLeft.Text = TimeSpan.FromMilliseconds(endTime - startTime).ToString(@"m\:ss"); - progress.Text = @"0%"; + int currentSecond = TimeSpan.FromMilliseconds(songCurrentTime).Seconds; - defaultsSetted = true; + if (currentSecond != previousSecond || (previousTimespan < 0 && songCurrentTime > 0)) + { + previousTimespan = songCurrentTime; + previousSecond = currentSecond; + + timeCurrent.Text = ((songCurrentTime < 0) ? @"-" : @"") + TimeSpan.FromMilliseconds(songCurrentTime).ToString(@"m\:ss"); + timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(endTime - AudioClock.CurrentTime).ToString(@"m\:ss"); } - else + + int currentPercent = (int)(songCurrentTime / (endTime - startTime) * 100); + + if (currentPercent != previousPercent) { - if(songCurrentTime >= 0) - { - int currentSecond = TimeSpan.FromMilliseconds(songCurrentTime).Seconds; + previousPercent = currentPercent; - if (currentSecond != previousSecond) - { - previousSecond = currentSecond; - - timeCurrent.Text = TimeSpan.FromMilliseconds(songCurrentTime).ToString(@"m\:ss"); - timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(endTime - AudioClock.CurrentTime).ToString(@"m\:ss"); - } - - int currentPercent = (int)(songCurrentTime / (endTime - startTime) * 100); - - if (currentPercent != previousPercent) - { - previousPercent = currentPercent; - - progress.Text = currentPercent.ToString() + @"%"; - } - } + progress.Text = ((currentPercent <= 0) ? @"0" : currentPercent.ToString()) + @"%"; } } } From 5b469eff6990f8f7126f424c010e8bae5e90b71a Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Wed, 10 May 2017 10:33:02 +0300 Subject: [PATCH 23/74] Fixes --- osu.Game/Screens/Play/SongProgressInfo.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index 54a645aa99..88ef358fbc 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -77,12 +77,16 @@ namespace osu.Game.Screens.Play int currentSecond = TimeSpan.FromMilliseconds(songCurrentTime).Seconds; - if (currentSecond != previousSecond || (previousTimespan < 0 && songCurrentTime > 0)) + if (currentSecond != previousSecond || previousTimespan < 0 && songCurrentTime > 0) { previousTimespan = songCurrentTime; previousSecond = currentSecond; - timeCurrent.Text = ((songCurrentTime < 0) ? @"-" : @"") + TimeSpan.FromMilliseconds(songCurrentTime).ToString(@"m\:ss"); + if(songCurrentTime < 0) + timeCurrent.Text = @"-" + TimeSpan.FromMilliseconds(songCurrentTime - 1000).ToString(@"m\:ss"); + else + timeCurrent.Text = TimeSpan.FromMilliseconds(songCurrentTime).ToString(@"m\:ss"); + timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(endTime - AudioClock.CurrentTime).ToString(@"m\:ss"); } @@ -92,7 +96,7 @@ namespace osu.Game.Screens.Play { previousPercent = currentPercent; - progress.Text = ((currentPercent <= 0) ? @"0" : currentPercent.ToString()) + @"%"; + progress.Text = (currentPercent <= 0 ? @"0" : currentPercent.ToString()) + @"%"; } } } From d55c97a08ad2cf93127022523d853c24700d1eaa Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Thu, 11 May 2017 01:48:46 +0300 Subject: [PATCH 24/74] Stop progress as soon as we at 100% --- osu.Game/Screens/Play/SongProgress.cs | 7 +++-- osu.Game/Screens/Play/SongProgressInfo.cs | 35 ++++++++++++----------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 548befdb36..c10248e97d 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -145,8 +145,11 @@ namespace osu.Game.Screens.Play double progress = ((audioClock?.CurrentTime ?? Time.Current) - firstHitTime) / (lastHitTime - firstHitTime); - bar.UpdatePosition((float)progress); - graph.Progress = (int)(graph.ColumnCount * progress); + if((int)progress * 100 < 100) + { + bar.UpdatePosition((float)progress); + graph.Progress = (int)(graph.ColumnCount * progress); + } } } } diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index 88ef358fbc..2767e4ec63 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -75,28 +75,31 @@ namespace osu.Game.Screens.Play double songCurrentTime = AudioClock.CurrentTime - startTime; - int currentSecond = TimeSpan.FromMilliseconds(songCurrentTime).Seconds; - - if (currentSecond != previousSecond || previousTimespan < 0 && songCurrentTime > 0) + if(songCurrentTime < endTime - startTime) { - previousTimespan = songCurrentTime; - previousSecond = currentSecond; + int currentSecond = TimeSpan.FromMilliseconds(songCurrentTime).Seconds; - if(songCurrentTime < 0) - timeCurrent.Text = @"-" + TimeSpan.FromMilliseconds(songCurrentTime - 1000).ToString(@"m\:ss"); - else - timeCurrent.Text = TimeSpan.FromMilliseconds(songCurrentTime).ToString(@"m\:ss"); + if (currentSecond != previousSecond || previousTimespan < 0 && songCurrentTime > 0) + { + previousTimespan = songCurrentTime; + previousSecond = currentSecond; - timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(endTime - AudioClock.CurrentTime).ToString(@"m\:ss"); - } + if (songCurrentTime < 0) + timeCurrent.Text = @"-" + TimeSpan.FromMilliseconds(songCurrentTime - 1000).ToString(@"m\:ss"); + else + timeCurrent.Text = TimeSpan.FromMilliseconds(songCurrentTime).ToString(@"m\:ss"); - int currentPercent = (int)(songCurrentTime / (endTime - startTime) * 100); + timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(endTime - AudioClock.CurrentTime).ToString(@"m\:ss"); + } - if (currentPercent != previousPercent) - { - previousPercent = currentPercent; + int currentPercent = (int)(songCurrentTime / (endTime - startTime) * 100) + 1; - progress.Text = (currentPercent <= 0 ? @"0" : currentPercent.ToString()) + @"%"; + if (currentPercent != previousPercent) + { + previousPercent = currentPercent; + + progress.Text = (currentPercent <= 0 ? @"0" : currentPercent.ToString()) + @"%"; + } } } } From c0acc1799b5841d129444647b2ba687e233ccb40 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Thu, 11 May 2017 01:49:57 +0300 Subject: [PATCH 25/74] Now progress testcase has it's own clock --- osu.Desktop.VisualTests/Tests/TestCaseSongProgress.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseSongProgress.cs b/osu.Desktop.VisualTests/Tests/TestCaseSongProgress.cs index 6d8aac1d09..e3c343f5f8 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseSongProgress.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseSongProgress.cs @@ -18,10 +18,14 @@ namespace osu.Desktop.VisualTests.Tests private SongProgress progress; private SongProgressGraph graph; + private StopwatchClock clock; + public override void Reset() { base.Reset(); + clock = new StopwatchClock(true); + Add(progress = new SongProgress { RelativeSizeAxes = Axes.X, @@ -55,6 +59,9 @@ namespace osu.Desktop.VisualTests.Tests progress.Objects = objects; graph.Objects = objects; + + progress.AudioClock = clock; + progress.OnSeek = pos => clock.Seek(pos); } } } From ea0add2354cc73cf2ed8ac5650ba4e396d40e303 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Thu, 11 May 2017 02:34:57 +0300 Subject: [PATCH 26/74] Fixed update condition --- osu.Game/Screens/Play/SongProgress.cs | 2 +- osu.Game/Screens/Play/SongProgressInfo.cs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index c10248e97d..8cead0684e 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -145,7 +145,7 @@ namespace osu.Game.Screens.Play double progress = ((audioClock?.CurrentTime ?? Time.Current) - firstHitTime) / (lastHitTime - firstHitTime); - if((int)progress * 100 < 100) + if(progress < 1) { bar.UpdatePosition((float)progress); graph.Progress = (int)(graph.ColumnCount * progress); diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index 2767e4ec63..ae6436bc6c 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -74,8 +74,9 @@ namespace osu.Game.Screens.Play base.Update(); double songCurrentTime = AudioClock.CurrentTime - startTime; + int currentPercent = (int)(songCurrentTime / (endTime - startTime) * 100); - if(songCurrentTime < endTime - startTime) + if (currentPercent <= 100) { int currentSecond = TimeSpan.FromMilliseconds(songCurrentTime).Seconds; @@ -92,8 +93,6 @@ namespace osu.Game.Screens.Play timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(endTime - AudioClock.CurrentTime).ToString(@"m\:ss"); } - int currentPercent = (int)(songCurrentTime / (endTime - startTime) * 100) + 1; - if (currentPercent != previousPercent) { previousPercent = currentPercent; From 7d8af5f1da4fd320c20b32ee5f76acf2d16e9bf6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 11 May 2017 13:19:31 +0900 Subject: [PATCH 27/74] Use SearchTextBox Correctly handle focus. --- osu.Game/Overlays/OptionsOverlay.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/osu.Game/Overlays/OptionsOverlay.cs b/osu.Game/Overlays/OptionsOverlay.cs index afe998c208..677c3f7c40 100644 --- a/osu.Game/Overlays/OptionsOverlay.cs +++ b/osu.Game/Overlays/OptionsOverlay.cs @@ -13,7 +13,7 @@ using System; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Overlays.Options.Sections; -using osu.Game.Graphics.UserInterface; +using osu.Game.Screens.Select; namespace osu.Game.Overlays { @@ -33,7 +33,10 @@ namespace osu.Game.Overlays private Sidebar sidebar; private SidebarButton[] sidebarButtons; private OptionsSection[] sections; + private SearchContainer searchContainer; + private SearchTextBox searchTextBox; + private float lastKnownScroll; public OptionsOverlay() @@ -45,8 +48,6 @@ namespace osu.Game.Overlays [BackgroundDependencyLoader(permitNulls: true)] private void load(OsuGame game, OsuColour colours) { - OsuTextBox textBox; - sections = new OptionsSection[] { new GeneralSection(), @@ -96,11 +97,11 @@ namespace osu.Game.Overlays TextSize = 18, Margin = new MarginPadding { Left = CONTENT_MARGINS, Bottom = 30 }, }, - textBox = new OsuTextBox + searchTextBox = new SearchTextBox { - PlaceholderText = "Type to search!", Width = width - CONTENT_MARGINS * 2, Margin = new MarginPadding { Left = CONTENT_MARGINS }, + Exit = () => Hide(), }, searchContainer = new SearchContainer { @@ -128,7 +129,7 @@ namespace osu.Game.Overlays } }; - textBox.Current.ValueChanged += newValue => searchContainer.SearchTerm = newValue; + searchTextBox.Current.ValueChanged += newValue => searchContainer.SearchTerm = newValue; scrollContainer.Padding = new MarginPadding { Top = game?.Toolbar.DrawHeight ?? 0 }; } @@ -169,6 +170,8 @@ namespace osu.Game.Overlays scrollContainer.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint); sidebar.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint); FadeTo(1, TRANSITION_LENGTH / 2); + + searchTextBox.HoldFocus = true; } protected override void PopOut() @@ -178,6 +181,9 @@ namespace osu.Game.Overlays scrollContainer.MoveToX(-width, TRANSITION_LENGTH, EasingTypes.OutQuint); sidebar.MoveToX(-SIDEBAR_WIDTH, TRANSITION_LENGTH, EasingTypes.OutQuint); FadeTo(0, TRANSITION_LENGTH / 2); + + searchTextBox.HoldFocus = false; + searchTextBox.TriggerFocusLost(); } } } From df4820440376e89f619752581d555814b3888767 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 11 May 2017 13:56:21 +0900 Subject: [PATCH 28/74] Fix OptionsOverlay stealing focus itself. --- osu.Game/Overlays/OptionsOverlay.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/osu.Game/Overlays/OptionsOverlay.cs b/osu.Game/Overlays/OptionsOverlay.cs index 677c3f7c40..1176e91a36 100644 --- a/osu.Game/Overlays/OptionsOverlay.cs +++ b/osu.Game/Overlays/OptionsOverlay.cs @@ -14,6 +14,7 @@ using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Overlays.Options.Sections; using osu.Game.Screens.Select; +using osu.Framework.Input; namespace osu.Game.Overlays { @@ -185,5 +186,11 @@ namespace osu.Game.Overlays searchTextBox.HoldFocus = false; searchTextBox.TriggerFocusLost(); } + + protected override bool OnFocus(InputState state) + { + searchTextBox.TriggerFocus(state); + return false; + } } } From ec67b617aea07053a8cecd7fd0e3140dfe065a7f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 11 May 2017 14:55:25 +0900 Subject: [PATCH 29/74] Add OptionsHeader class Makes search textbox anchor correctly. Also improves visual styling. --- osu.Game/Overlays/Options/OptionsHeader.cs | 108 +++++++++++++++++++++ osu.Game/Overlays/OptionsOverlay.cs | 72 ++++++-------- osu.Game/osu.Game.csproj | 1 + 3 files changed, 137 insertions(+), 44 deletions(-) create mode 100644 osu.Game/Overlays/Options/OptionsHeader.cs diff --git a/osu.Game/Overlays/Options/OptionsHeader.cs b/osu.Game/Overlays/Options/OptionsHeader.cs new file mode 100644 index 0000000000..1add9dc409 --- /dev/null +++ b/osu.Game/Overlays/Options/OptionsHeader.cs @@ -0,0 +1,108 @@ +// 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.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Primitives; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Screens.Select; +using OpenTK.Graphics; + +namespace osu.Game.Overlays.Options +{ + public class OptionsHeader : Container + { + public SearchTextBox SearchTextBox; + + private Box background; + + private readonly Func currentScrollOffset; + + public Action Exit; + + /// A reference to the current scroll position of the ScrollContainer we are contained within. + public OptionsHeader(Func currentScrollOffset) + { + this.currentScrollOffset = currentScrollOffset; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; + + Children = new Drawable[] + { + background = new Box + { + Colour = Color4.Black, + RelativeSizeAxes = Axes.Both, + }, + new FillFlowContainer + { + AutoSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.X, + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + new OsuSpriteText + { + Text = "settings", + TextSize = 40, + Margin = new MarginPadding { + Left = OptionsOverlay.CONTENT_MARGINS, + Top = Toolbar.Toolbar.TOOLTIP_HEIGHT + }, + }, + new OsuSpriteText + { + Colour = colours.Pink, + Text = "Change the way osu! behaves", + TextSize = 18, + Margin = new MarginPadding { + Left = OptionsOverlay.CONTENT_MARGINS, + Bottom = 30 + }, + }, + SearchTextBox = new SearchTextBox + { + RelativeSizeAxes = Axes.X, + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + Width = 0.95f, + Margin = new MarginPadding { + Top = 20, + Bottom = 20 + }, + Exit = () => Exit(), + }, + } + } + }; + } + + protected override void UpdateAfterChildren() + { + base.UpdateAfterChildren(); + + // the point at which we will start anchoring to the top. + float anchorOffset = SearchTextBox.Y; + + float scrollPosition = currentScrollOffset(); + + // we want to anchor the search field to the top of the screen when scrolling. + Margin = new MarginPadding { Top = Math.Max(0, scrollPosition - anchorOffset) }; + + // we don't want the header to scroll when scrolling beyond the upper extent. + Y = Math.Min(0, scrollPosition); + + // we get darker as scroll progresses + background.Alpha = Math.Min(1, scrollPosition / anchorOffset) * 0.5f; + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/OptionsOverlay.cs b/osu.Game/Overlays/OptionsOverlay.cs index 1176e91a36..6d1a3a64fc 100644 --- a/osu.Game/Overlays/OptionsOverlay.cs +++ b/osu.Game/Overlays/OptionsOverlay.cs @@ -10,10 +10,7 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Game.Overlays.Options; using System; -using osu.Game.Graphics; -using osu.Game.Graphics.Sprites; using osu.Game.Overlays.Options.Sections; -using osu.Game.Screens.Select; using osu.Framework.Input; namespace osu.Game.Overlays @@ -35,8 +32,11 @@ namespace osu.Game.Overlays private SidebarButton[] sidebarButtons; private OptionsSection[] sections; + private OptionsHeader header; + + private OptionsFooter footer; + private SearchContainer searchContainer; - private SearchTextBox searchTextBox; private float lastKnownScroll; @@ -47,7 +47,7 @@ namespace osu.Game.Overlays } [BackgroundDependencyLoader(permitNulls: true)] - private void load(OsuGame game, OsuColour colours) + private void load(OsuGame game) { sections = new OptionsSection[] { @@ -75,45 +75,20 @@ namespace osu.Game.Overlays RelativeSizeAxes = Axes.Y, Width = width, Margin = new MarginPadding { Left = SIDEBAR_WIDTH }, - Children = new[] + Children = new Drawable[] { - new FillFlowContainer + searchContainer = new SearchContainer { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, Direction = FillDirection.Vertical, - - Children = new Drawable[] - { - new OsuSpriteText - { - Text = "settings", - TextSize = 40, - Margin = new MarginPadding { Left = CONTENT_MARGINS, Top = Toolbar.Toolbar.TOOLTIP_HEIGHT }, - }, - new OsuSpriteText - { - Colour = colours.Pink, - Text = "Change the way osu! behaves", - TextSize = 18, - Margin = new MarginPadding { Left = CONTENT_MARGINS, Bottom = 30 }, - }, - searchTextBox = new SearchTextBox - { - Width = width - CONTENT_MARGINS * 2, - Margin = new MarginPadding { Left = CONTENT_MARGINS }, - Exit = () => Hide(), - }, - searchContainer = new SearchContainer - { - AutoSizeAxes = Axes.Y, - RelativeSizeAxes = Axes.X, - Direction = FillDirection.Vertical, - Children = sections, - }, - new OptionsFooter() - } - } + Children = sections, + }, + footer = new OptionsFooter(), + header = new OptionsHeader(() => scrollContainer.Current) + { + Exit = Hide, + }, } }, sidebar = new Sidebar @@ -130,11 +105,20 @@ namespace osu.Game.Overlays } }; - searchTextBox.Current.ValueChanged += newValue => searchContainer.SearchTerm = newValue; + header.SearchTextBox.Current.ValueChanged += newValue => searchContainer.SearchTerm = newValue; scrollContainer.Padding = new MarginPadding { Top = game?.Toolbar.DrawHeight ?? 0 }; } + protected override void UpdateAfterChildren() + { + base.UpdateAfterChildren(); + + //we need to update these manually because we can't put the OptionsHeader inside the SearchContainer (due to its anchoring). + searchContainer.Y = header.DrawHeight; + footer.Y = searchContainer.Y + searchContainer.DrawHeight; + } + protected override void Update() { base.Update(); @@ -172,7 +156,7 @@ namespace osu.Game.Overlays sidebar.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint); FadeTo(1, TRANSITION_LENGTH / 2); - searchTextBox.HoldFocus = true; + header.SearchTextBox.HoldFocus = true; } protected override void PopOut() @@ -183,13 +167,13 @@ namespace osu.Game.Overlays sidebar.MoveToX(-SIDEBAR_WIDTH, TRANSITION_LENGTH, EasingTypes.OutQuint); FadeTo(0, TRANSITION_LENGTH / 2); - searchTextBox.HoldFocus = false; - searchTextBox.TriggerFocusLost(); + header.SearchTextBox.HoldFocus = false; + header.SearchTextBox.TriggerFocusLost(); } protected override bool OnFocus(InputState state) { - searchTextBox.TriggerFocus(state); + header.SearchTextBox.TriggerFocus(state); return false; } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index bd9f087cf7..904cf7f437 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -78,6 +78,7 @@ + From f044b95ce81d9822ae6e08e70939794b21c8e20d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 11 May 2017 23:10:19 +0900 Subject: [PATCH 30/74] Allow OsuTabControl to handle non-enum types. --- osu.Game/Graphics/UserInterface/OsuTabControl.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuTabControl.cs b/osu.Game/Graphics/UserInterface/OsuTabControl.cs index 242a9a8f6a..8b72eedbfd 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabControl.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabControl.cs @@ -25,15 +25,15 @@ namespace osu.Game.Graphics.UserInterface protected override bool InternalContains(Vector2 screenSpacePos) => base.InternalContains(screenSpacePos) || Dropdown.Contains(screenSpacePos); + private bool isEnumType => typeof(T).IsEnum; + public OsuTabControl() { TabContainer.Spacing = new Vector2(10f, 0f); - if (!typeof(T).IsEnum) - throw new InvalidOperationException("OsuTabControl only supports enums as the generic type argument"); - - foreach (var val in (T[])Enum.GetValues(typeof(T))) - AddItem(val); + if (isEnumType) + foreach (var val in (T[])Enum.GetValues(typeof(T))) + AddItem(val); } [BackgroundDependencyLoader] @@ -136,7 +136,7 @@ namespace osu.Game.Graphics.UserInterface Margin = new MarginPadding { Top = 5, Bottom = 5 }, Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, - Text = (value as Enum)?.GetDescription(), + Text = (value as Enum)?.GetDescription() ?? value.ToString(), TextSize = 14, Font = @"Exo2.0-Bold", // Font should only turn bold when active? }, From a77049213dc51b98c793af5765a5a14da21d7b2f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 11 May 2017 23:10:48 +0900 Subject: [PATCH 31/74] Add basic hard-coded inefficient multi-channel support. --- osu.Game/Online/Chat/Channel.cs | 2 + .../Online/Chat/Drawables/DrawableChannel.cs | 10 +-- osu.Game/Overlays/ChatOverlay.cs | 63 +++++++++++++++---- 3 files changed, 54 insertions(+), 21 deletions(-) diff --git a/osu.Game/Online/Chat/Channel.cs b/osu.Game/Online/Chat/Channel.cs index d3bd57a1c9..6b43010776 100644 --- a/osu.Game/Online/Chat/Channel.cs +++ b/osu.Game/Online/Chat/Channel.cs @@ -53,5 +53,7 @@ namespace osu.Game.Online.Chat if (messageCount > MAX_HISTORY) Messages.RemoveRange(0, messageCount - MAX_HISTORY); } + + public override string ToString() => Name; } } diff --git a/osu.Game/Online/Chat/Drawables/DrawableChannel.cs b/osu.Game/Online/Chat/Drawables/DrawableChannel.cs index e3101e8fd7..8268ab41c5 100644 --- a/osu.Game/Online/Chat/Drawables/DrawableChannel.cs +++ b/osu.Game/Online/Chat/Drawables/DrawableChannel.cs @@ -25,14 +25,6 @@ namespace osu.Game.Online.Chat.Drawables Children = new Drawable[] { - new OsuSpriteText - { - Text = channel.Name, - TextSize = 50, - Alpha = 0.3f, - Anchor = Anchor.Centre, - Origin = Anchor.Centre - }, scroll = new ScrollContainer { RelativeSizeAxes = Axes.Both, @@ -93,4 +85,4 @@ namespace osu.Game.Online.Chat.Drawables private void scrollToEnd() => Scheduler.AddDelayed(() => scroll.ScrollToEnd(), 50); } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index dc586bd363..77c9f36af5 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -30,9 +30,7 @@ namespace osu.Game.Overlays private ScheduledDelegate messageRequest; - private readonly Container content; - - protected override Container Content => content; + private readonly Container currentChannelContainer; private readonly FocusedTextBox inputTextBox; @@ -42,6 +40,8 @@ namespace osu.Game.Overlays private GetMessagesRequest fetchReq; + private readonly OsuTabControl channelTabs; + public ChatOverlay() { RelativeSizeAxes = Axes.X; @@ -49,8 +49,13 @@ namespace osu.Game.Overlays Anchor = Anchor.BottomLeft; Origin = Anchor.BottomLeft; - AddInternal(new Drawable[] + Children = new Drawable[] { + channelTabs = new OsuTabControl() + { + RelativeSizeAxes = Axes.X, + Height = 20, + }, new Box { Depth = float.MaxValue, @@ -58,10 +63,10 @@ namespace osu.Game.Overlays Colour = Color4.Black, Alpha = 0.9f, }, - content = new Container + currentChannelContainer = new Container { RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Top = 5, Bottom = textbox_height + 5 }, + Padding = new MarginPadding { Top = 25, Bottom = textbox_height + 5 }, }, new Container { @@ -83,7 +88,9 @@ namespace osu.Game.Overlays } } } - }); + }; + + channelTabs.Current.ValueChanged += newChannel => CurrentChannel = newChannel; } public void APIStateChanged(APIAccess api, APIState state) @@ -137,7 +144,7 @@ namespace osu.Game.Overlays private void initializeChannels() { - Clear(); + currentChannelContainer.Clear(); careChannels = new List(); @@ -161,24 +168,56 @@ namespace osu.Game.Overlays { loading.FadeOut(100); addChannel(channels.Find(c => c.Name == @"#lazer")); + addChannel(channels.Find(c => c.Name == @"#osu")); + addChannel(channels.Find(c => c.Name == @"#lobby")); }); - messageRequest = Scheduler.AddDelayed(fetchNewMessages, 1000, true); + messageRequest = Scheduler.AddDelayed(() => fetchNewMessages(), 1000, true); }; + api.Queue(req); } + private Channel currentChannel; + + protected Channel CurrentChannel + { + get + { + return currentChannel; + } + + set + { + if (currentChannel == value) return; + + if (currentChannel != null) + currentChannelContainer.Clear(); + + currentChannel = value; + currentChannelContainer.Add(new DrawableChannel(currentChannel)); + + channelTabs.Current.Value = value; + } + } + private void addChannel(Channel channel) { - Add(new DrawableChannel(channel)); careChannels.Add(channel); + channelTabs.AddItem(channel); + + // we need to get a good number of messages initially for each channel we care about. + fetchNewMessages(channel); + + if (CurrentChannel == null) + CurrentChannel = channel; } - private void fetchNewMessages() + private void fetchNewMessages(Channel specificChannel = null) { if (fetchReq != null) return; - fetchReq = new GetMessagesRequest(careChannels, lastMessageId); + fetchReq = new GetMessagesRequest(specificChannel != null ? new List { specificChannel } : careChannels, lastMessageId); fetchReq.Success += delegate (List messages) { var ids = messages.Where(m => m.TargetType == TargetType.Channel).Select(m => m.TargetId).Distinct(); From ffa59c6cb3a0cd7fa9036e008cfbb78ee24fb3ee Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 11 May 2017 23:51:26 +0900 Subject: [PATCH 32/74] Support read-only channels, post to correct channel. Also cache drawable channels better. --- osu.Game/Online/Chat/Channel.cs | 2 ++ .../Online/Chat/Drawables/DrawableChannel.cs | 8 ++++---- osu.Game/Overlays/ChatOverlay.cs | 20 +++++++++++++++---- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/osu.Game/Online/Chat/Channel.cs b/osu.Game/Online/Chat/Channel.cs index 6b43010776..d159f482a9 100644 --- a/osu.Game/Online/Chat/Channel.cs +++ b/osu.Game/Online/Chat/Channel.cs @@ -27,6 +27,8 @@ namespace osu.Game.Online.Chat //internal bool Joined; + public bool ReadOnly => Name != "#lazer"; + public const int MAX_HISTORY = 300; [JsonConstructor] diff --git a/osu.Game/Online/Chat/Drawables/DrawableChannel.cs b/osu.Game/Online/Chat/Drawables/DrawableChannel.cs index 8268ab41c5..870f67a01e 100644 --- a/osu.Game/Online/Chat/Drawables/DrawableChannel.cs +++ b/osu.Game/Online/Chat/Drawables/DrawableChannel.cs @@ -13,13 +13,13 @@ namespace osu.Game.Online.Chat.Drawables { public class DrawableChannel : Container { - private readonly Channel channel; + public readonly Channel Channel; private readonly FillFlowContainer flow; private readonly ScrollContainer scroll; public DrawableChannel(Channel channel) { - this.channel = channel; + Channel = channel; RelativeSizeAxes = Axes.Both; @@ -48,14 +48,14 @@ namespace osu.Game.Online.Chat.Drawables { base.LoadComplete(); - newMessagesArrived(channel.Messages); + newMessagesArrived(Channel.Messages); scrollToEnd(); } protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); - channel.NewMessagesArrived -= newMessagesArrived; + Channel.NewMessagesArrived -= newMessagesArrived; } private void newMessagesArrived(IEnumerable newMessages) diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 77c9f36af5..05239082ef 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -142,10 +142,14 @@ namespace osu.Game.Overlays private List careChannels; + private List loadedChannels = new List(); + private void initializeChannels() { currentChannelContainer.Clear(); + loadedChannels.Clear(); + careChannels = new List(); SpriteText loading; @@ -167,6 +171,7 @@ namespace osu.Game.Overlays Scheduler.Add(delegate { loading.FadeOut(100); + addChannel(channels.Find(c => c.Name == @"#lazer")); addChannel(channels.Find(c => c.Name == @"#osu")); addChannel(channels.Find(c => c.Name == @"#lobby")); @@ -192,10 +197,17 @@ namespace osu.Game.Overlays if (currentChannel == value) return; if (currentChannel != null) - currentChannelContainer.Clear(); + currentChannelContainer.Clear(false); currentChannel = value; - currentChannelContainer.Add(new DrawableChannel(currentChannel)); + + var loaded = loadedChannels.Find(d => d.Channel == value); + if (loaded == null) + loadedChannels.Add(loaded = new DrawableChannel(currentChannel)); + + inputTextBox.Current.Disabled = currentChannel.ReadOnly; + + currentChannelContainer.Add(loaded); channelTabs.Current.Value = value; } @@ -203,6 +215,8 @@ namespace osu.Game.Overlays private void addChannel(Channel channel) { + if (channel == null) return; + careChannels.Add(channel); channelTabs.AddItem(channel); @@ -246,8 +260,6 @@ namespace osu.Game.Overlays if (!string.IsNullOrEmpty(postText) && api.LocalUser.Value != null) { - var currentChannel = careChannels.FirstOrDefault(); - if (currentChannel == null) return; var message = new Message From 79ed92a0d7d3fa9d15a4a02e8e577b28654e3c4a Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 12 May 2017 01:48:28 +0300 Subject: [PATCH 33/74] Simplified logic --- osu.Game/Screens/Play/SongProgressInfo.cs | 49 ++++++++++++----------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index ae6436bc6c..0303d024b4 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -25,6 +25,11 @@ namespace osu.Game.Screens.Play private int previousSecond; private double previousTimespan; + private double songLenght => endTime - startTime; + + private bool percentHasChanged = true; + private bool secondHasChanged = true; + private const int margin = 10; public IClock AudioClock; @@ -74,32 +79,30 @@ namespace osu.Game.Screens.Play base.Update(); double songCurrentTime = AudioClock.CurrentTime - startTime; - int currentPercent = (int)(songCurrentTime / (endTime - startTime) * 100); + int currentPercent = songCurrentTime < 0 ? 0 : songCurrentTime > songLenght ? 100 : (int)(songCurrentTime / songLenght * 100); + int currentSecond = TimeSpan.FromMilliseconds(songCurrentTime).Seconds; - if (currentPercent <= 100) + if (percentHasChanged) { - int currentSecond = TimeSpan.FromMilliseconds(songCurrentTime).Seconds; - - if (currentSecond != previousSecond || previousTimespan < 0 && songCurrentTime > 0) - { - previousTimespan = songCurrentTime; - previousSecond = currentSecond; - - if (songCurrentTime < 0) - timeCurrent.Text = @"-" + TimeSpan.FromMilliseconds(songCurrentTime - 1000).ToString(@"m\:ss"); - else - timeCurrent.Text = TimeSpan.FromMilliseconds(songCurrentTime).ToString(@"m\:ss"); - - timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(endTime - AudioClock.CurrentTime).ToString(@"m\:ss"); - } - - if (currentPercent != previousPercent) - { - previousPercent = currentPercent; - - progress.Text = (currentPercent <= 0 ? @"0" : currentPercent.ToString()) + @"%"; - } + progress.Text = currentPercent.ToString() + @"%"; + previousPercent = currentPercent; } + + if (secondHasChanged && songCurrentTime < songLenght || previousTimespan < 0 && songCurrentTime > 0) + { + if (songCurrentTime < 0) + timeCurrent.Text = @"-" + TimeSpan.FromMilliseconds(songCurrentTime - 1000).ToString(@"m\:ss"); + else + timeCurrent.Text = TimeSpan.FromMilliseconds(songCurrentTime).ToString(@"m\:ss"); + + timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(endTime - AudioClock.CurrentTime).ToString(@"m\:ss"); + + previousSecond = currentSecond; + previousTimespan = songCurrentTime; + } + + percentHasChanged = currentPercent != previousPercent; + secondHasChanged = currentSecond != previousSecond; } } } From f248efb01f5cdc8b6a1747bd1a179fb981fbe7d9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 May 2017 13:25:50 +0900 Subject: [PATCH 34/74] CI Fixes --- osu.Game/Online/Chat/Drawables/DrawableChannel.cs | 1 - osu.Game/Overlays/ChatOverlay.cs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game/Online/Chat/Drawables/DrawableChannel.cs b/osu.Game/Online/Chat/Drawables/DrawableChannel.cs index 870f67a01e..d179f851b2 100644 --- a/osu.Game/Online/Chat/Drawables/DrawableChannel.cs +++ b/osu.Game/Online/Chat/Drawables/DrawableChannel.cs @@ -7,7 +7,6 @@ using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; -using osu.Game.Graphics.Sprites; namespace osu.Game.Online.Chat.Drawables { diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 05239082ef..75ddcd89b6 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -51,7 +51,7 @@ namespace osu.Game.Overlays Children = new Drawable[] { - channelTabs = new OsuTabControl() + channelTabs = new OsuTabControl { RelativeSizeAxes = Axes.X, Height = 20, @@ -142,7 +142,7 @@ namespace osu.Game.Overlays private List careChannels; - private List loadedChannels = new List(); + private readonly List loadedChannels = new List(); private void initializeChannels() { From 34b4efc4e9ce0676258882fa4e65a06228804aa2 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 12 May 2017 08:12:34 +0300 Subject: [PATCH 35/74] Applied suggested changes --- osu.Game/Screens/Play/SongProgressInfo.cs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index 0303d024b4..36bb344dab 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -23,9 +23,8 @@ namespace osu.Game.Screens.Play private int previousPercent; private int previousSecond; - private double previousTimespan; - private double songLenght => endTime - startTime; + private double songLength => endTime - startTime; private bool percentHasChanged = true; private bool secondHasChanged = true; @@ -79,8 +78,8 @@ namespace osu.Game.Screens.Play base.Update(); double songCurrentTime = AudioClock.CurrentTime - startTime; - int currentPercent = songCurrentTime < 0 ? 0 : songCurrentTime > songLenght ? 100 : (int)(songCurrentTime / songLenght * 100); - int currentSecond = TimeSpan.FromMilliseconds(songCurrentTime).Seconds; + int currentPercent = Math.Max(0, Math.Min(100, (int)(songCurrentTime / songLength * 100))); + int currentSecond = (int)Math.Floor(songCurrentTime / 1000.0); if (percentHasChanged) { @@ -88,17 +87,12 @@ namespace osu.Game.Screens.Play previousPercent = currentPercent; } - if (secondHasChanged && songCurrentTime < songLenght || previousTimespan < 0 && songCurrentTime > 0) + if (secondHasChanged && songCurrentTime < songLength) { - if (songCurrentTime < 0) - timeCurrent.Text = @"-" + TimeSpan.FromMilliseconds(songCurrentTime - 1000).ToString(@"m\:ss"); - else - timeCurrent.Text = TimeSpan.FromMilliseconds(songCurrentTime).ToString(@"m\:ss"); - - timeLeft.Text = @"-" + TimeSpan.FromMilliseconds(endTime - AudioClock.CurrentTime).ToString(@"m\:ss"); + timeCurrent.Text = TimeSpan.FromSeconds(currentSecond).ToString(songCurrentTime < 0 ? @"\-m\:ss" : @"m\:ss"); + timeLeft.Text = TimeSpan.FromMilliseconds(endTime - AudioClock.CurrentTime).ToString(@"\-m\:ss"); previousSecond = currentSecond; - previousTimespan = songCurrentTime; } percentHasChanged = currentPercent != previousPercent; From 1420aa406c8d12ba8d4b8ee0c3fa4adb3fb1f181 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 May 2017 14:24:32 +0900 Subject: [PATCH 36/74] Add framework fix. --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 682f078b2e..fcf36739bc 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 682f078b2efc82fa19342f499f14c4a8458843d5 +Subproject commit fcf36739bc8a97b43a08ce0b29bd7c67ce1a3547 From 9cf4998701e4e11038e273304817efb1f02647bd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 May 2017 13:54:02 +0900 Subject: [PATCH 37/74] Make chat resizable via drag, save user set size --- osu.Game/Configuration/OsuConfigManager.cs | 6 +++- osu.Game/Overlays/ChatOverlay.cs | 33 +++++++++++++++++++--- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 3907496ca2..ba19d8592a 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -3,6 +3,7 @@ using osu.Framework.Configuration; using osu.Framework.Platform; +using osu.Game.Overlays; using osu.Game.Screens.Select; namespace osu.Game.Configuration @@ -19,6 +20,8 @@ namespace osu.Game.Configuration Set(OsuConfig.DisplayStarsMinimum, 0.0, 0, 10); Set(OsuConfig.DisplayStarsMaximum, 10.0, 0, 10); + Set(OsuConfig.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1); + // Online settings Set(OsuConfig.Username, string.Empty); @@ -102,6 +105,7 @@ namespace osu.Game.Configuration DisplayStarsMaximum, SnakingInSliders, SnakingOutSliders, - ShowFpsDisplay + ShowFpsDisplay, + ChatDisplayHeight } } diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 75ddcd89b6..3630ad0518 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -7,6 +7,7 @@ using System.Diagnostics; using System.Linq; using OpenTK; using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; @@ -21,6 +22,7 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface; using OpenTK.Graphics; using osu.Framework.Input; +using osu.Game.Configuration; namespace osu.Game.Overlays { @@ -38,14 +40,19 @@ namespace osu.Game.Overlays private const int transition_length = 500; + public const float DEFAULT_HEIGHT = 0.4f; + private GetMessagesRequest fetchReq; private readonly OsuTabControl channelTabs; + private Bindable chatHeight; + public ChatOverlay() { - RelativeSizeAxes = Axes.X; - Size = new Vector2(1, 300); + RelativeSizeAxes = Axes.Both; + RelativePositionAxes = Axes.Both; + Size = new Vector2(1, DEFAULT_HEIGHT); Anchor = Anchor.BottomLeft; Origin = Anchor.BottomLeft; @@ -93,6 +100,20 @@ namespace osu.Game.Overlays channelTabs.Current.ValueChanged += newChannel => CurrentChannel = newChannel; } + protected override bool OnDragStart(InputState state) + { + if (channelTabs.Hovering) + return true; + + return base.OnDragStart(state); + } + + protected override bool OnDrag(InputState state) + { + chatHeight.Value = Height - state.Mouse.Delta.Y / Parent.DrawSize.Y; + return base.OnDrag(state); + } + public void APIStateChanged(APIAccess api, APIState state) { switch (state) @@ -124,7 +145,7 @@ namespace osu.Game.Overlays protected override void PopOut() { - MoveToY(DrawSize.Y, transition_length, EasingTypes.InSine); + MoveToY(Height, transition_length, EasingTypes.InSine); FadeOut(transition_length, EasingTypes.InSine); inputTextBox.HoldFocus = false; @@ -132,10 +153,14 @@ namespace osu.Game.Overlays } [BackgroundDependencyLoader] - private void load(APIAccess api) + private void load(APIAccess api, OsuConfigManager config) { this.api = api; api.Register(this); + + chatHeight = config.GetBindable(OsuConfig.ChatDisplayHeight); + chatHeight.ValueChanged += h => Height = (float)h; + chatHeight.TriggerChange(); } private long? lastMessageId; From c4a93cbc8540870d68405194318e0ad1c5eb01a7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 May 2017 14:21:57 +0900 Subject: [PATCH 38/74] Move drawable chat related classes to better namespace --- .../Chat/Drawables => Overlays/Chat}/ChatLine.cs | 14 +++++++++----- .../Drawables => Overlays/Chat}/DrawableChannel.cs | 3 ++- osu.Game/Overlays/ChatOverlay.cs | 3 ++- osu.Game/osu.Game.csproj | 4 ++-- 4 files changed, 15 insertions(+), 9 deletions(-) rename osu.Game/{Online/Chat/Drawables => Overlays/Chat}/ChatLine.cs (87%) rename osu.Game/{Online/Chat/Drawables => Overlays/Chat}/DrawableChannel.cs (94%) diff --git a/osu.Game/Online/Chat/Drawables/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs similarity index 87% rename from osu.Game/Online/Chat/Drawables/ChatLine.cs rename to osu.Game/Overlays/Chat/ChatLine.cs index 6bfa25755f..d4063efbb5 100644 --- a/osu.Game/Online/Chat/Drawables/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -6,10 +6,11 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using osu.Game.Online.Chat; using OpenTK; using OpenTK.Graphics; -namespace osu.Game.Online.Chat.Drawables +namespace osu.Game.Overlays.Chat { public class ChatLine : Container { @@ -62,7 +63,10 @@ namespace osu.Game.Online.Chat.Drawables return username_colours[message.UserId % username_colours.Length]; } - private const float padding = 200; + public const float LEFT_PADDING = message_padding + padding * 2; + + private const float padding = 15; + private const float message_padding = 200; private const float text_size = 20; public ChatLine(Message message) @@ -72,13 +76,13 @@ namespace osu.Game.Online.Chat.Drawables RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; - Padding = new MarginPadding { Left = 15, Right = 15 }; + Padding = new MarginPadding { Left = padding, Right = padding }; Children = new Drawable[] { new Container { - Size = new Vector2(padding, text_size), + Size = new Vector2(message_padding, text_size), Children = new Drawable[] { new OsuSpriteText @@ -106,7 +110,7 @@ namespace osu.Game.Online.Chat.Drawables { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, - Padding = new MarginPadding { Left = padding + 15 }, + Padding = new MarginPadding { Left = message_padding + padding }, Children = new Drawable[] { new OsuSpriteText diff --git a/osu.Game/Online/Chat/Drawables/DrawableChannel.cs b/osu.Game/Overlays/Chat/DrawableChannel.cs similarity index 94% rename from osu.Game/Online/Chat/Drawables/DrawableChannel.cs rename to osu.Game/Overlays/Chat/DrawableChannel.cs index d179f851b2..39dc1914ab 100644 --- a/osu.Game/Online/Chat/Drawables/DrawableChannel.cs +++ b/osu.Game/Overlays/Chat/DrawableChannel.cs @@ -7,8 +7,9 @@ using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; +using osu.Game.Online.Chat; -namespace osu.Game.Online.Chat.Drawables +namespace osu.Game.Overlays.Chat { public class DrawableChannel : Container { diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 3630ad0518..a9dc915c6b 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -16,13 +16,14 @@ using osu.Game.Graphics.Sprites; using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Online.Chat; -using osu.Game.Online.Chat.Drawables; using osu.Game.Graphics.UserInterface; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface; using OpenTK.Graphics; using osu.Framework.Input; using osu.Game.Configuration; +using osu.Game.Graphics; +using osu.Game.Overlays.Chat; namespace osu.Game.Overlays { diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index fd15115fe2..313d003605 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -304,8 +304,8 @@ - - + + From 6ea65009c402f5517d7b8db5bc2def862631e727 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 May 2017 14:22:11 +0900 Subject: [PATCH 39/74] Initial design update pass --- osu.Game/Overlays/ChatOverlay.cs | 89 ++++++++++++++++++++++---------- 1 file changed, 62 insertions(+), 27 deletions(-) diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index a9dc915c6b..7f74750873 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -29,7 +29,7 @@ namespace osu.Game.Overlays { public class ChatOverlay : FocusedOverlayContainer, IOnlineComponent { - private const float textbox_height = 40; + private const float textbox_height = 60; private ScheduledDelegate messageRequest; @@ -43,6 +43,8 @@ namespace osu.Game.Overlays public const float DEFAULT_HEIGHT = 0.4f; + private const float tab_area_height = 50; + private GetMessagesRequest fetchReq; private readonly OsuTabControl channelTabs; @@ -57,45 +59,78 @@ namespace osu.Game.Overlays Anchor = Anchor.BottomLeft; Origin = Anchor.BottomLeft; + const float padding = 5; + Children = new Drawable[] { - channelTabs = new OsuTabControl + new Container { + Name = @"tabs area", RelativeSizeAxes = Axes.X, - Height = 20, - }, - new Box - { - Depth = float.MaxValue, - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, - Alpha = 0.9f, - }, - currentChannelContainer = new Container - { - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Top = 25, Bottom = textbox_height + 5 }, + Height = tab_area_height, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + Alpha = 0.8f, + }, + channelTabs = new OsuTabControl + { + RelativeSizeAxes = Axes.Both, + }, + } }, new Container { - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft, - RelativeSizeAxes = Axes.X, - Height = textbox_height, - Padding = new MarginPadding(5), + Name = @"chat area", + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Top = tab_area_height }, Children = new Drawable[] { - inputTextBox = new FocusedTextBox + new Box { RelativeSizeAxes = Axes.Both, - Height = 1, - PlaceholderText = "type your message", - Exit = () => State = Visibility.Hidden, - OnCommit = postMessage, - HoldFocus = true, + Colour = OsuColour.FromHex(@"17292e"), + }, + currentChannelContainer = new Container + { + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding + { + Top = padding, + Bottom = textbox_height + padding + }, + }, + new Container + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + RelativeSizeAxes = Axes.X, + Height = textbox_height, + Padding = new MarginPadding + { + Top = padding * 2, + Bottom = padding * 2, + Left = ChatLine.LEFT_PADDING + padding * 2, + Right = padding * 2, + }, + Children = new Drawable[] + { + inputTextBox = new FocusedTextBox + { + RelativeSizeAxes = Axes.Both, + Height = 1, + PlaceholderText = "type your message", + Exit = () => State = Visibility.Hidden, + OnCommit = postMessage, + HoldFocus = true, + } + } } } - } + }, }; channelTabs.Current.ValueChanged += newChannel => CurrentChannel = newChannel; From dbf60d24bf8aff079f418fed073806f9382716cc Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 May 2017 15:32:52 +0900 Subject: [PATCH 40/74] Second design update pass. --- osu.Game/Graphics/OsuColour.cs | 2 + osu.Game/Overlays/Chat/ChatTabControl.cs | 182 +++++++++++++++++++++++ osu.Game/Overlays/ChatOverlay.cs | 53 +++---- osu.Game/osu.Game.csproj | 1 + 4 files changed, 213 insertions(+), 25 deletions(-) create mode 100644 osu.Game/Overlays/Chat/ChatTabControl.cs diff --git a/osu.Game/Graphics/OsuColour.cs b/osu.Game/Graphics/OsuColour.cs index b666442f19..3d83668d07 100644 --- a/osu.Game/Graphics/OsuColour.cs +++ b/osu.Game/Graphics/OsuColour.cs @@ -85,5 +85,7 @@ namespace osu.Game.Graphics public readonly Color4 Red = FromHex(@"ed1121"); public readonly Color4 RedDark = FromHex(@"ba0011"); public readonly Color4 RedDarker = FromHex(@"870000"); + + public readonly Color4 ChatBlue = FromHex(@"17292e"); } } diff --git a/osu.Game/Overlays/Chat/ChatTabControl.cs b/osu.Game/Overlays/Chat/ChatTabControl.cs new file mode 100644 index 0000000000..c7e1382255 --- /dev/null +++ b/osu.Game/Overlays/Chat/ChatTabControl.cs @@ -0,0 +1,182 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Primitives; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface; +using osu.Framework.Input; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; +using osu.Game.Online.Chat; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Overlays.Chat +{ + public class ChatTabControl : OsuTabControl + { + protected override TabItem CreateTabItem(Channel value) => new ChannelTabItem(value); + + private const float shear_width = 10; + + public ChatTabControl() + { + TabContainer.Margin = new MarginPadding { Left = 50 }; + TabContainer.Spacing = new Vector2(-shear_width, 0); + TabContainer.Masking = false; + + AddInternal(new TextAwesome + { + Icon = FontAwesome.fa_comments, + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + TextSize = 20, + Padding = new MarginPadding(10), + }); + } + + private class ChannelTabItem : TabItem + { + private Color4 backgroundInactive; + private Color4 backgroundHover; + private Color4 backgroundActive; + + private readonly SpriteText text; + private readonly Box box; + private readonly Box highlightBox; + + public override bool Active + { + get { return base.Active; } + set + { + if (Active == value) return; + + base.Active = value; + updateState(); + } + } + + private void updateState() + { + if (Active) + fadeActive(); + else + fadeInactive(); + } + + private const float transition_length = 400; + + private void fadeActive() + { + ResizeTo(new Vector2(Width, 1.1f), transition_length, EasingTypes.OutQuint); + + box.FadeColour(backgroundActive, transition_length, EasingTypes.OutQuint); + highlightBox.FadeIn(transition_length, EasingTypes.OutQuint); + text.Font = @"Exo2.0-Bold"; + } + + private void fadeInactive() + { + ResizeTo(new Vector2(Width, 1), transition_length, EasingTypes.OutQuint); + + box.FadeColour(backgroundInactive, transition_length, EasingTypes.OutQuint); + highlightBox.FadeOut(transition_length, EasingTypes.OutQuint); + text.Font = @"Exo2.0-Regular"; + } + + protected override bool OnHover(InputState state) + { + if (!Active) + box.FadeColour(backgroundHover, transition_length, EasingTypes.OutQuint); + return true; + } + + protected override void OnHoverLost(InputState state) + { + updateState(); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + backgroundActive = colours.ChatBlue; + backgroundInactive = colours.Gray4; + backgroundHover = colours.Gray7; + + highlightBox.Colour = colours.Yellow; + + updateState(); + } + + public ChannelTabItem(Channel value) : base(value) + { + Width = 150; + + RelativeSizeAxes = Axes.Y; + + Anchor = Anchor.BottomLeft; + Origin = Anchor.BottomLeft; + + Shear = new Vector2(shear_width / ChatOverlay.TAB_AREA_HEIGHT, 0); + + Masking = true; + EdgeEffect = new EdgeEffect + { + Type = EdgeEffectType.Shadow, + Radius = 10, + Colour = Color4.Black.Opacity(0.2f), + }; + + Children = new Drawable[] + { + box = new Box + { + EdgeSmoothness = new Vector2(1, 0), + RelativeSizeAxes = Axes.Both, + }, + highlightBox = new Box + { + Width = 5, + Alpha = 0, + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomRight, + EdgeSmoothness = new Vector2(1, 0), + RelativeSizeAxes = Axes.Y, + }, + new Container + { + Shear = new Vector2(-shear_width / ChatOverlay.TAB_AREA_HEIGHT, 0), + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + new TextAwesome + { + Icon = FontAwesome.fa_hashtag, + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Colour = Color4.Black, + X = -10, + Alpha = 0.2f, + TextSize = ChatOverlay.TAB_AREA_HEIGHT, + }, + text = new OsuSpriteText + { + Margin = new MarginPadding(5), + Origin = Anchor.CentreLeft, + Anchor = Anchor.CentreLeft, + Text = value.ToString(), + TextSize = 18, + }, + } + } + }; + } + } + } +} diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 7f74750873..812ab236e7 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -43,11 +43,13 @@ namespace osu.Game.Overlays public const float DEFAULT_HEIGHT = 0.4f; - private const float tab_area_height = 50; + public const float TAB_AREA_HEIGHT = 50; private GetMessagesRequest fetchReq; - private readonly OsuTabControl channelTabs; + private readonly ChatTabControl channelTabs; + + private readonly Box chatBackground; private Bindable chatHeight; @@ -63,36 +65,16 @@ namespace osu.Game.Overlays Children = new Drawable[] { - new Container - { - Name = @"tabs area", - RelativeSizeAxes = Axes.X, - Height = tab_area_height, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, - Alpha = 0.8f, - }, - channelTabs = new OsuTabControl - { - RelativeSizeAxes = Axes.Both, - }, - } - }, new Container { Name = @"chat area", RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Top = tab_area_height }, + Padding = new MarginPadding { Top = TAB_AREA_HEIGHT }, Children = new Drawable[] { - new Box + chatBackground = new Box { RelativeSizeAxes = Axes.Both, - Colour = OsuColour.FromHex(@"17292e"), }, currentChannelContainer = new Container { @@ -131,6 +113,25 @@ namespace osu.Game.Overlays } } }, + new Container + { + Name = @"tabs area", + RelativeSizeAxes = Axes.X, + Height = TAB_AREA_HEIGHT, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + Alpha = 0.8f, + }, + channelTabs = new ChatTabControl + { + RelativeSizeAxes = Axes.Both, + }, + } + }, }; channelTabs.Current.ValueChanged += newChannel => CurrentChannel = newChannel; @@ -189,7 +190,7 @@ namespace osu.Game.Overlays } [BackgroundDependencyLoader] - private void load(APIAccess api, OsuConfigManager config) + private void load(APIAccess api, OsuConfigManager config, OsuColour colours) { this.api = api; api.Register(this); @@ -197,6 +198,8 @@ namespace osu.Game.Overlays chatHeight = config.GetBindable(OsuConfig.ChatDisplayHeight); chatHeight.ValueChanged += h => Height = (float)h; chatHeight.TriggerChange(); + + chatBackground.Colour = colours.ChatBlue; } private long? lastMessageId; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 313d003605..a738e7180b 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -75,6 +75,7 @@ + From 9a040691238ab2d377128efe00a72200e178a279 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 12 May 2017 10:16:31 +0300 Subject: [PATCH 41/74] removed useless booleans, using nullables instead --- osu.Game/Screens/Play/SongProgressInfo.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index 36bb344dab..4c53b61313 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -21,14 +21,11 @@ namespace osu.Game.Screens.Play private double startTime; private double endTime; - private int previousPercent; - private int previousSecond; + private int? previousPercent; + private int? previousSecond; private double songLength => endTime - startTime; - private bool percentHasChanged = true; - private bool secondHasChanged = true; - private const int margin = 10; public IClock AudioClock; @@ -81,22 +78,19 @@ namespace osu.Game.Screens.Play int currentPercent = Math.Max(0, Math.Min(100, (int)(songCurrentTime / songLength * 100))); int currentSecond = (int)Math.Floor(songCurrentTime / 1000.0); - if (percentHasChanged) + if (currentPercent != previousPercent) { progress.Text = currentPercent.ToString() + @"%"; previousPercent = currentPercent; } - if (secondHasChanged && songCurrentTime < songLength) + if (currentSecond != previousSecond && songCurrentTime < songLength) { timeCurrent.Text = TimeSpan.FromSeconds(currentSecond).ToString(songCurrentTime < 0 ? @"\-m\:ss" : @"m\:ss"); timeLeft.Text = TimeSpan.FromMilliseconds(endTime - AudioClock.CurrentTime).ToString(@"\-m\:ss"); previousSecond = currentSecond; } - - percentHasChanged = currentPercent != previousPercent; - secondHasChanged = currentSecond != previousSecond; } } } From cf239f4d9cbffa7d57f3b6b014fbfe822ca350ef Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 May 2017 19:03:21 +0900 Subject: [PATCH 42/74] Move chat into main content Also changes the way parallax is applied to OsuScreens game-wide. --- osu.Game/OsuGame.cs | 5 ++--- osu.Game/Screens/OsuScreen.cs | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index ccead95ede..a84333df8c 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -160,7 +160,7 @@ namespace osu.Game }); //overlay elements - LoadComponentAsync(chat = new ChatOverlay { Depth = 0 }, overlayContent.Add); + LoadComponentAsync(chat = new ChatOverlay { Depth = -1 }, mainContent.Add); LoadComponentAsync(options = new OptionsOverlay { Depth = -1 }, overlayContent.Add); LoadComponentAsync(musicController = new MusicController { @@ -320,8 +320,7 @@ namespace osu.Game { base.UpdateAfterChildren(); - if (intro?.ChildScreen != null) - intro.ChildScreen.Padding = new MarginPadding { Top = Toolbar.Position.Y + Toolbar.DrawHeight }; + mainContent.Padding = new MarginPadding { Top = Toolbar.Position.Y + Toolbar.DrawHeight }; Cursor.State = currentScreen?.HasLocalCursorDisplayed == false ? Visibility.Visible : Visibility.Hidden; } diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 0b3ecb4f5a..16bdd6132f 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -7,6 +7,7 @@ using osu.Framework.Screens; using osu.Game.Beatmaps; using osu.Game.Database; using osu.Game.Graphics.Containers; +using OpenTK; namespace osu.Game.Screens { @@ -96,6 +97,9 @@ namespace osu.Game.Screens } else if (bg != null) { + // this makes up for the fact our padding changes when the global toolbar is visible. + bg.Scale = new Vector2(1.06f); + AddInternal(new ParallaxContainer { Depth = float.MaxValue, From bc5bcfa66a5c737d62128e793a373bf04f8d741c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 May 2017 19:15:04 +0900 Subject: [PATCH 43/74] Make tab background opaque when chat is fullscreen --- osu.Game/Overlays/ChatOverlay.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 812ab236e7..15f8586125 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -50,6 +50,7 @@ namespace osu.Game.Overlays private readonly ChatTabControl channelTabs; private readonly Box chatBackground; + private readonly Box tabBackground; private Bindable chatHeight; @@ -120,11 +121,10 @@ namespace osu.Game.Overlays Height = TAB_AREA_HEIGHT, Children = new Drawable[] { - new Box + tabBackground = new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black, - Alpha = 0.8f, }, channelTabs = new ChatTabControl { @@ -196,7 +196,11 @@ namespace osu.Game.Overlays api.Register(this); chatHeight = config.GetBindable(OsuConfig.ChatDisplayHeight); - chatHeight.ValueChanged += h => Height = (float)h; + chatHeight.ValueChanged += h => + { + Height = (float)h; + tabBackground.FadeTo(Height == 1 ? 1 : 0.8f, 200); + }; chatHeight.TriggerChange(); chatBackground.Colour = colours.ChatBlue; From d2e066ca35f199d6e12f9da330b0f14ba83e6855 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 May 2017 19:57:06 +0900 Subject: [PATCH 44/74] Move SearchTextBox to better namespace Is being used in multiple places now. --- .../Select => Graphics/UserInterface}/SearchTextBox.cs | 6 ++---- osu.Game/Overlays/Options/OptionsHeader.cs | 1 + osu.Game/osu.Game.csproj | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) rename osu.Game/{Screens/Select => Graphics/UserInterface}/SearchTextBox.cs (91%) diff --git a/osu.Game/Screens/Select/SearchTextBox.cs b/osu.Game/Graphics/UserInterface/SearchTextBox.cs similarity index 91% rename from osu.Game/Screens/Select/SearchTextBox.cs rename to osu.Game/Graphics/UserInterface/SearchTextBox.cs index 4f2ab221cb..18148e9d31 100644 --- a/osu.Game/Screens/Select/SearchTextBox.cs +++ b/osu.Game/Graphics/UserInterface/SearchTextBox.cs @@ -1,14 +1,12 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK.Input; using osu.Framework.Graphics; using osu.Framework.Graphics.Primitives; using osu.Framework.Input; -using osu.Game.Graphics; -using osu.Game.Graphics.UserInterface; +using OpenTK.Input; -namespace osu.Game.Screens.Select +namespace osu.Game.Graphics.UserInterface { /// /// A textbox which holds focus eagerly. diff --git a/osu.Game/Overlays/Options/OptionsHeader.cs b/osu.Game/Overlays/Options/OptionsHeader.cs index 1add9dc409..c173b8844d 100644 --- a/osu.Game/Overlays/Options/OptionsHeader.cs +++ b/osu.Game/Overlays/Options/OptionsHeader.cs @@ -9,6 +9,7 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Select; using OpenTK.Graphics; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 904cf7f437..a8f5c11a80 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -384,7 +384,7 @@ - + From fec91d4de12f74398d6b3635d33c68d85e45aed8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 May 2017 19:58:31 +0900 Subject: [PATCH 45/74] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index fcf36739bc..e1ac6316aa 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit fcf36739bc8a97b43a08ce0b29bd7c67ce1a3547 +Subproject commit e1ac6316aa3862efb8e79e585a7b4c901a4e1b3c From a9b3f74218ec4d4c26f55636912c389c500a7492 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 May 2017 20:05:44 +0900 Subject: [PATCH 46/74] Fix ruleset not always getting populated in a WorkingBeatmap --- osu.Game/Database/BeatmapDatabase.cs | 2 +- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Database/BeatmapDatabase.cs b/osu.Game/Database/BeatmapDatabase.cs index de570d3e7e..bd25ebe8a9 100644 --- a/osu.Game/Database/BeatmapDatabase.cs +++ b/osu.Game/Database/BeatmapDatabase.cs @@ -267,7 +267,7 @@ namespace osu.Game.Database public WorkingBeatmap GetWorkingBeatmap(BeatmapInfo beatmapInfo, WorkingBeatmap previous = null, bool withStoryboard = false) { - if (beatmapInfo.BeatmapSet == null) + if (beatmapInfo.BeatmapSet == null || beatmapInfo.Ruleset == null) beatmapInfo = GetChildren(beatmapInfo, true); if (beatmapInfo.BeatmapSet == null) diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 44f2aeb0da..6a2f7a26fc 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -124,7 +124,7 @@ namespace osu.Game.Screens.Select Content = getBPMRange(beatmap.Beatmap), })); - //get statistics fromt he current ruleset. + //get statistics from the current ruleset. labels.AddRange(beatmapInfo.Ruleset.CreateInstance().GetBeatmapStatistics(beatmap).Select(s => new InfoLabel(s))); } From 6c117f15afa03da81f62d9600331e107a22399d8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 May 2017 20:06:38 +0900 Subject: [PATCH 47/74] Remove unnecessary usings --- osu.Game/Overlays/Music/FilterControl.cs | 1 - osu.Game/Overlays/Options/OptionsHeader.cs | 1 - 2 files changed, 2 deletions(-) diff --git a/osu.Game/Overlays/Music/FilterControl.cs b/osu.Game/Overlays/Music/FilterControl.cs index c6572c5ed2..0b4e067fff 100644 --- a/osu.Game/Overlays/Music/FilterControl.cs +++ b/osu.Game/Overlays/Music/FilterControl.cs @@ -10,7 +10,6 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; -using osu.Game.Screens.Select; using OpenTK; using OpenTK.Graphics; using System; diff --git a/osu.Game/Overlays/Options/OptionsHeader.cs b/osu.Game/Overlays/Options/OptionsHeader.cs index c173b8844d..8b97a607a2 100644 --- a/osu.Game/Overlays/Options/OptionsHeader.cs +++ b/osu.Game/Overlays/Options/OptionsHeader.cs @@ -10,7 +10,6 @@ using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; -using osu.Game.Screens.Select; using OpenTK.Graphics; namespace osu.Game.Overlays.Options From fd9218b6d541795038c9311415523fbdac88837e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 May 2017 20:48:25 +0900 Subject: [PATCH 48/74] Use FirstOrDefault --- osu.Game/Overlays/Music/PlaylistOverlay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Music/PlaylistOverlay.cs b/osu.Game/Overlays/Music/PlaylistOverlay.cs index 0cae9db2e6..eb5dff57b3 100644 --- a/osu.Game/Overlays/Music/PlaylistOverlay.cs +++ b/osu.Game/Overlays/Music/PlaylistOverlay.cs @@ -86,7 +86,7 @@ namespace osu.Game.Overlays.Music beatmapBacking.BindTo(game.Beatmap); filter.Search.OnCommit = (sender, newText) => { - var beatmap = list.FirstVisibleSet?.Beatmaps?.ValueAtOrDefault(0); + var beatmap = list.FirstVisibleSet?.Beatmaps?.FirstOrDefault(); if (beatmap != null) playSpecified(beatmap); }; } From 19728b3d98f16bede4fe52613c3cb90069d1fa5b Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 12 May 2017 15:13:02 +0300 Subject: [PATCH 49/74] Fixed IncompatibleMods for OsuModAutoplay --- osu.Game.Rulesets.Osu/Mods/OsuMod.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs index ff277dea1f..cc06946d38 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs @@ -92,7 +92,7 @@ namespace osu.Game.Rulesets.Osu.Mods public class OsuModAutoplay : ModAutoplay { - public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray(); + public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot), typeof(OsuModSpunOut) }).ToArray(); protected override Score CreateReplayScore(Beatmap beatmap) => new Score { From 86ebd9d663a2de0b8f0f133402ea22804a40814a Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 13 May 2017 02:51:58 +0300 Subject: [PATCH 50/74] spinner's progress depends on current map OD now --- .../Objects/Drawables/DrawableSpinner.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index 90a6d432c4..0e0784c8ba 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -10,6 +10,8 @@ using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; using OpenTK; using OpenTK.Graphics; using osu.Game.Rulesets.Osu.UI; +using osu.Game.Beatmaps; +using osu.Framework.Allocation; namespace osu.Game.Rulesets.Osu.Objects.Drawables { @@ -22,6 +24,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private readonly Container circleContainer; private readonly DrawableHitCircle circle; + private WorkingBeatmap currentBeatmap; + public DrawableSpinner(Spinner s) : base(s) { AlwaysReceiveInput = true; @@ -71,6 +75,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables disc.Scale = scaleToCircle; } + [BackgroundDependencyLoader(permitNulls: true)] + private void load(OsuGame game) + { + currentBeatmap = game?.Beatmap?.Value; + } + protected override void CheckJudgement(bool userTriggered) { if (Time.Current < HitObject.StartTime) return; @@ -108,9 +118,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private Vector2 scaleToCircle => circle.Scale * circle.DrawWidth / DrawWidth * 0.95f; - private const float spins_per_minute_needed = 100 + 5 * 15; //TODO: read per-map OD and place it on the 5 + private float spinsPerMinuteNeeded => 100 + (currentBeatmap?.Beatmap.BeatmapInfo.Difficulty.OverallDifficulty ?? 5) * 15; - private float rotationsNeeded => (float)(spins_per_minute_needed * (spinner.EndTime - spinner.StartTime) / 60000f); + private float rotationsNeeded => (float)(spinsPerMinuteNeeded * (spinner.EndTime - spinner.StartTime) / 60000f); public float Progress => MathHelper.Clamp(disc.RotationAbsolute / 360 / rotationsNeeded, 0, 1); From 5532d3ec496b9cb9171efd19fbc18dcb2ecfdc53 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 13 May 2017 03:04:40 +0300 Subject: [PATCH 51/74] storing OD value only --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index 0e0784c8ba..2586f246e5 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private readonly Container circleContainer; private readonly DrawableHitCircle circle; - private WorkingBeatmap currentBeatmap; + private float beatmapOD; public DrawableSpinner(Spinner s) : base(s) { @@ -78,7 +78,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables [BackgroundDependencyLoader(permitNulls: true)] private void load(OsuGame game) { - currentBeatmap = game?.Beatmap?.Value; + beatmapOD = game?.Beatmap?.Value.Beatmap.BeatmapInfo.Difficulty.OverallDifficulty ?? 5; } protected override void CheckJudgement(bool userTriggered) @@ -118,7 +118,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private Vector2 scaleToCircle => circle.Scale * circle.DrawWidth / DrawWidth * 0.95f; - private float spinsPerMinuteNeeded => 100 + (currentBeatmap?.Beatmap.BeatmapInfo.Difficulty.OverallDifficulty ?? 5) * 15; + private float spinsPerMinuteNeeded => 100 + beatmapOD * 15; private float rotationsNeeded => (float)(spinsPerMinuteNeeded * (spinner.EndTime - spinner.StartTime) / 60000f); From 6d9e11a74f8ff7be393e340d3ae80744b0b6eae2 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 13 May 2017 03:10:13 +0300 Subject: [PATCH 52/74] CI fixes --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index 2586f246e5..59a381149c 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -10,7 +10,6 @@ using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; using OpenTK; using OpenTK.Graphics; using osu.Game.Rulesets.Osu.UI; -using osu.Game.Beatmaps; using osu.Framework.Allocation; namespace osu.Game.Rulesets.Osu.Objects.Drawables @@ -24,7 +23,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private readonly Container circleContainer; private readonly DrawableHitCircle circle; - private float beatmapOD; + private float beatmapOd; public DrawableSpinner(Spinner s) : base(s) { @@ -78,7 +77,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables [BackgroundDependencyLoader(permitNulls: true)] private void load(OsuGame game) { - beatmapOD = game?.Beatmap?.Value.Beatmap.BeatmapInfo.Difficulty.OverallDifficulty ?? 5; + beatmapOd = game?.Beatmap?.Value.Beatmap.BeatmapInfo.Difficulty.OverallDifficulty ?? 5; } protected override void CheckJudgement(bool userTriggered) @@ -118,7 +117,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private Vector2 scaleToCircle => circle.Scale * circle.DrawWidth / DrawWidth * 0.95f; - private float spinsPerMinuteNeeded => 100 + beatmapOD * 15; + private float spinsPerMinuteNeeded => 100 + beatmapOd * 15; private float rotationsNeeded => (float)(spinsPerMinuteNeeded * (spinner.EndTime - spinner.StartTime) / 60000f); From ca6df533bd128837b49291c3fc917e8e09fc3f88 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 13 May 2017 03:46:37 +0300 Subject: [PATCH 53/74] Automatic gameplay cursor size --- osu.Game/Configuration/OsuConfigManager.cs | 2 ++ osu.Game/Graphics/Cursor/GameplayCursor.cs | 17 +++++++++++++++-- .../Overlays/Options/Sections/SkinSection.cs | 5 +++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index ba19d8592a..8df054712b 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -50,6 +50,7 @@ namespace osu.Game.Configuration Set(OsuConfig.MenuCursorSize, 1.0, 0.5f, 2); Set(OsuConfig.GameplayCursorSize, 1.0, 0.5f, 2); + Set(OsuConfig.AutoCursorSize, false); Set(OsuConfig.MouseDisableButtons, false); Set(OsuConfig.MouseDisableWheel, false); @@ -86,6 +87,7 @@ namespace osu.Game.Configuration Token, MenuCursorSize, GameplayCursorSize, + AutoCursorSize, DimLevel, KeyOverlay, ShowInterface, diff --git a/osu.Game/Graphics/Cursor/GameplayCursor.cs b/osu.Game/Graphics/Cursor/GameplayCursor.cs index 3f699219a4..1ef2ad5910 100644 --- a/osu.Game/Graphics/Cursor/GameplayCursor.cs +++ b/osu.Game/Graphics/Cursor/GameplayCursor.cs @@ -42,6 +42,9 @@ namespace osu.Game.Graphics.Cursor { private Container cursorContainer; private Bindable cursorScale; + private Bindable autoCursorScale; + + private const int scaling_factor = 5; public OsuCursor() { @@ -49,8 +52,8 @@ namespace osu.Game.Graphics.Cursor Size = new Vector2(42); } - [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + [BackgroundDependencyLoader(permitNulls:true)] + private void load(OsuConfigManager config, OsuGame game) { Children = new Drawable[] { @@ -117,6 +120,16 @@ namespace osu.Game.Graphics.Cursor cursorScale = config.GetBindable(OsuConfig.GameplayCursorSize); cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)cursorScale); cursorScale.TriggerChange(); + + autoCursorScale = config.GetBindable(OsuConfig.AutoCursorSize); + autoCursorScale.ValueChanged += newScale => + { + if (newScale) + cursorContainer.Scale *= scaling_factor / (game?.Beatmap?.Value.Beatmap.BeatmapInfo.Difficulty.CircleSize ?? scaling_factor); + else + cursorScale.TriggerChange(); + }; + autoCursorScale.TriggerChange(); } } } diff --git a/osu.Game/Overlays/Options/Sections/SkinSection.cs b/osu.Game/Overlays/Options/Sections/SkinSection.cs index b3c225d00c..a3645d03de 100644 --- a/osu.Game/Overlays/Options/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Options/Sections/SkinSection.cs @@ -31,6 +31,11 @@ namespace osu.Game.Overlays.Options.Sections LabelText = "Gameplay cursor size", Bindable = config.GetBindable(OsuConfig.GameplayCursorSize) }, + new OptionCheckbox + { + LabelText = "Automatic gameplay cursor size", + Bindable = config.GetBindable(OsuConfig.AutoCursorSize) + }, }; } From ef234057334eb899030e824d837cf6d53b80ebc1 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sun, 14 May 2017 06:45:35 +0300 Subject: [PATCH 54/74] Applied suggested changes --- .../Objects/Drawables/DrawableSpinner.cs | 15 +-------------- osu.Game.Rulesets.Osu/Objects/Spinner.cs | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index 59a381149c..e06e72a8bf 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -10,7 +10,6 @@ using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; using OpenTK; using OpenTK.Graphics; using osu.Game.Rulesets.Osu.UI; -using osu.Framework.Allocation; namespace osu.Game.Rulesets.Osu.Objects.Drawables { @@ -23,8 +22,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private readonly Container circleContainer; private readonly DrawableHitCircle circle; - private float beatmapOd; - public DrawableSpinner(Spinner s) : base(s) { AlwaysReceiveInput = true; @@ -74,12 +71,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables disc.Scale = scaleToCircle; } - [BackgroundDependencyLoader(permitNulls: true)] - private void load(OsuGame game) - { - beatmapOd = game?.Beatmap?.Value.Beatmap.BeatmapInfo.Difficulty.OverallDifficulty ?? 5; - } - protected override void CheckJudgement(bool userTriggered) { if (Time.Current < HitObject.StartTime) return; @@ -117,11 +108,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private Vector2 scaleToCircle => circle.Scale * circle.DrawWidth / DrawWidth * 0.95f; - private float spinsPerMinuteNeeded => 100 + beatmapOd * 15; - - private float rotationsNeeded => (float)(spinsPerMinuteNeeded * (spinner.EndTime - spinner.StartTime) / 60000f); - - public float Progress => MathHelper.Clamp(disc.RotationAbsolute / 360 / rotationsNeeded, 0, 1); + public float Progress => MathHelper.Clamp(disc.RotationAbsolute / 360 / (float)spinner.SpinsRequired, 0, 1); protected override void UpdatePreemptState() { diff --git a/osu.Game.Rulesets.Osu/Objects/Spinner.cs b/osu.Game.Rulesets.Osu/Objects/Spinner.cs index 0a2c05833a..ab5d03dadc 100644 --- a/osu.Game.Rulesets.Osu/Objects/Spinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Spinner.cs @@ -2,6 +2,8 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Types; +using osu.Game.Beatmaps.Timing; +using osu.Game.Database; namespace osu.Game.Rulesets.Osu.Objects { @@ -10,6 +12,18 @@ namespace osu.Game.Rulesets.Osu.Objects public double EndTime { get; set; } public double Duration => EndTime - StartTime; + /// + /// Number of spins required to finish the spinner without miss. + /// + public double SpinsRequired { get; protected set; } + public override bool NewCombo => true; + + public override void ApplyDefaults(TimingInfo timing, BeatmapDifficulty difficulty) + { + base.ApplyDefaults(timing, difficulty); + + SpinsRequired = Duration / 1000 * BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 3, 5, 7.5); + } } } From 12dab6f75c93d586e9b715e98ac34836d7a16f92 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sun, 14 May 2017 07:28:12 +0300 Subject: [PATCH 55/74] iplemented stable-like algorithm --- osu.Game/Graphics/Cursor/GameplayCursor.cs | 29 +++++++++++++--------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/osu.Game/Graphics/Cursor/GameplayCursor.cs b/osu.Game/Graphics/Cursor/GameplayCursor.cs index 1ef2ad5910..ab2f36e45a 100644 --- a/osu.Game/Graphics/Cursor/GameplayCursor.cs +++ b/osu.Game/Graphics/Cursor/GameplayCursor.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 OpenTK; using OpenTK.Graphics; using osu.Framework.Allocation; @@ -44,7 +45,11 @@ namespace osu.Game.Graphics.Cursor private Bindable cursorScale; private Bindable autoCursorScale; - private const int scaling_factor = 5; + private float beatmapCircleSize; + private const float default_beatmap_cs = 5f; + + private float autoScaleMultiplier => autoCursorScale ? (float)(1 - (0.7 * (beatmapCircleSize - 4) / 5)) : 1f; + public OsuCursor() { @@ -117,19 +122,19 @@ namespace osu.Game.Graphics.Cursor }, }; - cursorScale = config.GetBindable(OsuConfig.GameplayCursorSize); - cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)cursorScale); - cursorScale.TriggerChange(); + beatmapCircleSize = game?.Beatmap?.Value.Beatmap.BeatmapInfo.Difficulty.CircleSize ?? default_beatmap_cs; + cursorScale = config.GetBindable(OsuConfig.GameplayCursorSize); autoCursorScale = config.GetBindable(OsuConfig.AutoCursorSize); - autoCursorScale.ValueChanged += newScale => - { - if (newScale) - cursorContainer.Scale *= scaling_factor / (game?.Beatmap?.Value.Beatmap.BeatmapInfo.Difficulty.CircleSize ?? scaling_factor); - else - cursorScale.TriggerChange(); - }; - autoCursorScale.TriggerChange(); + + cursorScale.ValueChanged += newValue => calculateScale(); + autoCursorScale.ValueChanged += newValue => calculateScale(); + cursorScale.TriggerChange(); + } + + private void calculateScale() + { + cursorContainer.Scale = new Vector2(autoScaleMultiplier * (float)cursorScale); } } } From 49f5364e9e4434d72fa417af8d9b4665747cd9f0 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sun, 14 May 2017 07:35:23 +0300 Subject: [PATCH 56/74] CI fixes --- osu.Game/Graphics/Cursor/GameplayCursor.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Graphics/Cursor/GameplayCursor.cs b/osu.Game/Graphics/Cursor/GameplayCursor.cs index ab2f36e45a..5aa3ae8326 100644 --- a/osu.Game/Graphics/Cursor/GameplayCursor.cs +++ b/osu.Game/Graphics/Cursor/GameplayCursor.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using OpenTK; using OpenTK.Graphics; using osu.Framework.Allocation; @@ -48,7 +47,7 @@ namespace osu.Game.Graphics.Cursor private float beatmapCircleSize; private const float default_beatmap_cs = 5f; - private float autoScaleMultiplier => autoCursorScale ? (float)(1 - (0.7 * (beatmapCircleSize - 4) / 5)) : 1f; + private float autoScaleMultiplier => autoCursorScale ? (float)(1 - 0.7 * (beatmapCircleSize - 4) / 5) : 1f; public OsuCursor() From a4d5660e418cf3c4a3b0af93512b3e8012c04b0d Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sun, 14 May 2017 09:22:49 +0300 Subject: [PATCH 57/74] Cast SpinsRequired value to int --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs | 2 +- osu.Game.Rulesets.Osu/Objects/Spinner.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index e06e72a8bf..a8ff231cc7 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -108,7 +108,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private Vector2 scaleToCircle => circle.Scale * circle.DrawWidth / DrawWidth * 0.95f; - public float Progress => MathHelper.Clamp(disc.RotationAbsolute / 360 / (float)spinner.SpinsRequired, 0, 1); + public float Progress => MathHelper.Clamp(disc.RotationAbsolute / 360 / spinner.SpinsRequired, 0, 1); protected override void UpdatePreemptState() { diff --git a/osu.Game.Rulesets.Osu/Objects/Spinner.cs b/osu.Game.Rulesets.Osu/Objects/Spinner.cs index ab5d03dadc..04ed7798af 100644 --- a/osu.Game.Rulesets.Osu/Objects/Spinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Spinner.cs @@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Osu.Objects /// /// Number of spins required to finish the spinner without miss. /// - public double SpinsRequired { get; protected set; } + public int SpinsRequired { get; protected set; } public override bool NewCombo => true; @@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Osu.Objects { base.ApplyDefaults(timing, difficulty); - SpinsRequired = Duration / 1000 * BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 3, 5, 7.5); + SpinsRequired = (int)(Duration / 1000 * BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 3, 5, 7.5)); } } } From 7055c99df07b05fb43689f4d357ede4b1ce75d56 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sun, 14 May 2017 09:36:09 +0300 Subject: [PATCH 58/74] Added default value --- osu.Game.Rulesets.Osu/Objects/Spinner.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Spinner.cs b/osu.Game.Rulesets.Osu/Objects/Spinner.cs index 04ed7798af..3761b62b65 100644 --- a/osu.Game.Rulesets.Osu/Objects/Spinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Spinner.cs @@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Osu.Objects /// /// Number of spins required to finish the spinner without miss. /// - public int SpinsRequired { get; protected set; } + public int SpinsRequired { get; protected set; } = 1; public override bool NewCombo => true; From b6460d89c97c7220639230d00ac9151fe9c56f26 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sun, 14 May 2017 10:26:52 +0300 Subject: [PATCH 59/74] Cleanup --- osu.Game/Graphics/Cursor/GameplayCursor.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game/Graphics/Cursor/GameplayCursor.cs b/osu.Game/Graphics/Cursor/GameplayCursor.cs index 5aa3ae8326..24e6f055b8 100644 --- a/osu.Game/Graphics/Cursor/GameplayCursor.cs +++ b/osu.Game/Graphics/Cursor/GameplayCursor.cs @@ -44,9 +44,9 @@ namespace osu.Game.Graphics.Cursor private Bindable cursorScale; private Bindable autoCursorScale; - private float beatmapCircleSize; - private const float default_beatmap_cs = 5f; + private float beatmapCircleSize; + private const int default_circle_size = 5; private float autoScaleMultiplier => autoCursorScale ? (float)(1 - 0.7 * (beatmapCircleSize - 4) / 5) : 1f; @@ -56,8 +56,8 @@ namespace osu.Game.Graphics.Cursor Size = new Vector2(42); } - [BackgroundDependencyLoader(permitNulls:true)] - private void load(OsuConfigManager config, OsuGame game) + [BackgroundDependencyLoader] + private void load(OsuConfigManager config, OsuGameBase game) { Children = new Drawable[] { @@ -121,7 +121,7 @@ namespace osu.Game.Graphics.Cursor }, }; - beatmapCircleSize = game?.Beatmap?.Value.Beatmap.BeatmapInfo.Difficulty.CircleSize ?? default_beatmap_cs; + beatmapCircleSize = game.Beatmap.Value?.Beatmap.BeatmapInfo.Difficulty.CircleSize ?? default_circle_size; cursorScale = config.GetBindable(OsuConfig.GameplayCursorSize); autoCursorScale = config.GetBindable(OsuConfig.AutoCursorSize); @@ -133,7 +133,7 @@ namespace osu.Game.Graphics.Cursor private void calculateScale() { - cursorContainer.Scale = new Vector2(autoScaleMultiplier * (float)cursorScale); + cursorContainer.Scale = new Vector2((float)(autoScaleMultiplier * cursorScale)); } } } From eaaba11586f2c3cadf8f541746eb90b331c136a5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 15 May 2017 10:55:29 +0900 Subject: [PATCH 60/74] Change all instances of options to settings where applicable --- osu-framework | 2 +- ...TestCaseOptions.cs => TestCaseSettings.cs} | 10 +-- .../osu.Desktop.VisualTests.csproj | 2 +- osu.Game/OsuGame.cs | 20 ++--- osu.Game/Overlays/LoginOverlay.cs | 12 +-- .../Sections/Audio/AudioDevicesSettings.cs} | 8 +- .../Sections/Audio/MainMenuSettings.cs} | 8 +- .../Sections/Audio/OffsetSettings.cs} | 6 +- .../Sections/Audio/VolumeSettings.cs} | 10 +-- .../Sections/AudioSection.cs | 14 ++-- .../Sections/Debug/GCSettings.cs} | 6 +- .../Sections/Debug/GeneralSettings.cs} | 6 +- .../Sections/DebugSection.cs | 10 +-- .../Sections/Gameplay/GeneralSettings.cs} | 10 +-- .../Sections/Gameplay/SongSelectSettings.cs} | 8 +- .../Sections/GameplaySection.cs | 10 +-- .../Sections/General/LanguageSettings.cs} | 8 +- .../Sections/General/LoginSettings.cs} | 8 +- .../Sections/General/UpdateSettings.cs} | 6 +- .../Sections/GeneralSection.cs | 10 +-- .../Sections/Graphics/DetailSettings.cs} | 8 +- .../Sections/Graphics/LayoutSettings.cs} | 24 +++--- .../Sections/Graphics/MainMenuSettings.cs} | 6 +- .../Sections/Graphics/RendererSettings.cs} | 10 +-- .../Sections/GraphicsSection.cs | 14 ++-- .../Sections/Input/KeyboardSettings.cs} | 6 +- .../Sections/Input/MouseSettings.cs} | 12 +-- .../Sections/InputSection.cs | 10 +-- .../Sections/MaintenanceSection.cs | 4 +- .../Sections/OnlineSection.cs | 4 +- .../Sections/SkinSection.cs | 8 +- .../SettingsCheckbox.cs} | 4 +- .../SettingsDropdown.cs} | 4 +- .../SettingsEnumDropdown.cs} | 8 +- .../SettingsFooter.cs} | 4 +- .../SettingsHeader.cs} | 10 +-- .../SettingsItem.cs} | 8 +- .../SettingsLabel.cs} | 4 +- .../SettingsSection.cs} | 10 +-- .../SettingsSlider.cs} | 6 +- .../SettingsSubsection.cs} | 6 +- .../SettingsTextBox.cs} | 4 +- .../Overlays/{Options => Settings}/Sidebar.cs | 2 +- .../{Options => Settings}/SidebarButton.cs | 6 +- .../{OptionsOverlay.cs => SettingsOverlay.cs} | 26 +++--- .../Overlays/Toolbar/ToolbarSettingsButton.cs | 4 +- osu.Game/Screens/Menu/ButtonSystem.cs | 2 +- osu.Game/Screens/Menu/MainMenu.cs | 2 +- .../Select/Options/BeatmapOptionsButton.cs | 6 +- .../Select/Options/BeatmapOptionsOverlay.cs | 6 +- osu.Game/osu.Game.csproj | 84 +++++++++---------- 51 files changed, 243 insertions(+), 243 deletions(-) rename osu.Desktop.VisualTests/Tests/{TestCaseOptions.cs => TestCaseSettings.cs} (54%) rename osu.Game/Overlays/{Options/Sections/Audio/AudioDevicesOptions.cs => Settings/Sections/Audio/AudioDevicesSettings.cs} (88%) rename osu.Game/Overlays/{Options/Sections/Audio/MainMenuOptions.cs => Settings/Sections/Audio/MainMenuSettings.cs} (78%) rename osu.Game/Overlays/{Options/Sections/Audio/OffsetOptions.cs => Settings/Sections/Audio/OffsetSettings.cs} (83%) rename osu.Game/Overlays/{Options/Sections/Audio/VolumeOptions.cs => Settings/Sections/Audio/VolumeSettings.cs} (53%) rename osu.Game/Overlays/{Options => Settings}/Sections/AudioSection.cs (58%) rename osu.Game/Overlays/{Options/Sections/Debug/GCOptions.cs => Settings/Sections/Debug/GCSettings.cs} (83%) rename osu.Game/Overlays/{Options/Sections/Debug/GeneralOptions.cs => Settings/Sections/Debug/GeneralSettings.cs} (80%) rename osu.Game/Overlays/{Options => Settings}/Sections/DebugSection.cs (65%) rename osu.Game/Overlays/{Options/Sections/Gameplay/GeneralOptions.cs => Settings/Sections/Gameplay/GeneralSettings.cs} (79%) rename osu.Game/Overlays/{Options/Sections/Gameplay/SongSelectOptions.cs => Settings/Sections/Gameplay/SongSelectSettings.cs} (80%) rename osu.Game/Overlays/{Options => Settings}/Sections/GameplaySection.cs (64%) rename osu.Game/Overlays/{Options/Sections/General/LanguageOptions.cs => Settings/Sections/General/LanguageSettings.cs} (77%) rename osu.Game/Overlays/{Options/Sections/General/LoginOptions.cs => Settings/Sections/General/LoginSettings.cs} (93%) rename osu.Game/Overlays/{Options/Sections/General/UpdateOptions.cs => Settings/Sections/General/UpdateSettings.cs} (83%) rename osu.Game/Overlays/{Options => Settings}/Sections/GeneralSection.cs (64%) rename osu.Game/Overlays/{Options/Sections/Graphics/DetailOptions.cs => Settings/Sections/Graphics/DetailSettings.cs} (79%) rename osu.Game/Overlays/{Options/Sections/Graphics/LayoutOptions.cs => Settings/Sections/Graphics/LayoutSettings.cs} (70%) rename osu.Game/Overlays/{Options/Sections/Graphics/MainMenuOptions.cs => Settings/Sections/Graphics/MainMenuSettings.cs} (78%) rename osu.Game/Overlays/{Options/Sections/Graphics/RendererOptions.cs => Settings/Sections/Graphics/RendererSettings.cs} (79%) rename osu.Game/Overlays/{Options => Settings}/Sections/GraphicsSection.cs (58%) rename osu.Game/Overlays/{Options/Sections/Input/KeyboardOptions.cs => Settings/Sections/Input/KeyboardSettings.cs} (76%) rename osu.Game/Overlays/{Options/Sections/Input/MouseOptions.cs => Settings/Sections/Input/MouseSettings.cs} (80%) rename osu.Game/Overlays/{Options => Settings}/Sections/InputSection.cs (65%) rename osu.Game/Overlays/{Options => Settings}/Sections/MaintenanceSection.cs (81%) rename osu.Game/Overlays/{Options => Settings}/Sections/OnlineSection.cs (80%) rename osu.Game/Overlays/{Options => Settings}/Sections/SkinSection.cs (83%) rename osu.Game/Overlays/{Options/OptionCheckbox.cs => Settings/SettingsCheckbox.cs} (82%) rename osu.Game/Overlays/{Options/OptionDropdown.cs => Settings/SettingsDropdown.cs} (88%) rename osu.Game/Overlays/{Options/OptionEnumDropdown.cs => Settings/SettingsEnumDropdown.cs} (75%) rename osu.Game/Overlays/{Options/OptionsFooter.cs => Settings/SettingsFooter.cs} (93%) rename osu.Game/Overlays/{Options/OptionsHeader.cs => Settings/SettingsHeader.cs} (90%) rename osu.Game/Overlays/{Options/OptionItem.cs => Settings/SettingsItem.cs} (89%) rename osu.Game/Overlays/{Options/OptionLabel.cs => Settings/SettingsLabel.cs} (80%) rename osu.Game/Overlays/{Options/OptionsSection.cs => Settings/SettingsSection.cs} (88%) rename osu.Game/Overlays/{Options/OptionSlider.cs => Settings/SettingsSlider.cs} (76%) rename osu.Game/Overlays/{Options/OptionsSubsection.cs => Settings/SettingsSubsection.cs} (87%) rename osu.Game/Overlays/{Options/OptionTextBox.cs => Settings/SettingsTextBox.cs} (74%) rename osu.Game/Overlays/{Options => Settings}/Sidebar.cs (95%) rename osu.Game/Overlays/{Options => Settings}/SidebarButton.cs (93%) rename osu.Game/Overlays/{OptionsOverlay.cs => SettingsOverlay.cs} (86%) diff --git a/osu-framework b/osu-framework index e1ac6316aa..f699dfe3c9 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit e1ac6316aa3862efb8e79e585a7b4c901a4e1b3c +Subproject commit f699dfe3c995c43b15cd66ec094d628bac1697c0 diff --git a/osu.Desktop.VisualTests/Tests/TestCaseOptions.cs b/osu.Desktop.VisualTests/Tests/TestCaseSettings.cs similarity index 54% rename from osu.Desktop.VisualTests/Tests/TestCaseOptions.cs rename to osu.Desktop.VisualTests/Tests/TestCaseSettings.cs index ff6bdc8a5a..660085e558 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseOptions.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseSettings.cs @@ -6,18 +6,18 @@ using osu.Game.Overlays; namespace osu.Desktop.VisualTests.Tests { - internal class TestCaseOptions : TestCase + internal class TestCaseSettings : TestCase { - public override string Description => @"Tests the options overlay"; + public override string Description => @"Tests the settings overlay"; - private OptionsOverlay options; + private SettingsOverlay settings; public override void Reset() { base.Reset(); - Children = new[] { options = new OptionsOverlay() }; - options.ToggleVisibility(); + Children = new[] { settings = new SettingsOverlay() }; + settings.ToggleVisibility(); } } } diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index 66cad48964..9b07ebf90b 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -211,7 +211,7 @@ - + diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index a84333df8c..8d9d5cd26c 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -62,14 +62,14 @@ namespace osu.Game private readonly string[] args; - private OptionsOverlay options; + private SettingsOverlay settings; public OsuGame(string[] args = null) { this.args = args; } - public void ToggleOptions() => options.ToggleVisibility(); + public void ToggleSettings() => settings.ToggleVisibility(); [BackgroundDependencyLoader] private void load() @@ -161,7 +161,7 @@ namespace osu.Game //overlay elements LoadComponentAsync(chat = new ChatOverlay { Depth = -1 }, mainContent.Add); - LoadComponentAsync(options = new OptionsOverlay { Depth = -1 }, overlayContent.Add); + LoadComponentAsync(settings = new SettingsOverlay { Depth = -1 }, overlayContent.Add); LoadComponentAsync(musicController = new MusicController { Depth = -2, @@ -192,7 +192,7 @@ namespace osu.Game }); }; - Dependencies.Cache(options); + Dependencies.Cache(settings); Dependencies.Cache(chat); Dependencies.Cache(musicController); Dependencies.Cache(notificationManager); @@ -204,15 +204,15 @@ namespace osu.Game OnHome = delegate { intro?.ChildScreen?.MakeCurrent(); }, }, overlayContent.Add); - options.StateChanged += delegate + settings.StateChanged += delegate { - switch (options.State) + switch (settings.State) { case Visibility.Hidden: - intro.MoveToX(0, OptionsOverlay.TRANSITION_LENGTH, EasingTypes.OutQuint); + intro.MoveToX(0, SettingsOverlay.TRANSITION_LENGTH, EasingTypes.OutQuint); break; case Visibility.Visible: - intro.MoveToX(OptionsOverlay.SIDEBAR_WIDTH / 2, OptionsOverlay.TRANSITION_LENGTH, EasingTypes.OutQuint); + intro.MoveToX(SettingsOverlay.SIDEBAR_WIDTH / 2, SettingsOverlay.TRANSITION_LENGTH, EasingTypes.OutQuint); break; } }; @@ -247,7 +247,7 @@ namespace osu.Game Toolbar.ToggleVisibility(); return true; case Key.O: - options.ToggleVisibility(); + settings.ToggleVisibility(); return true; } } @@ -276,7 +276,7 @@ namespace osu.Game //central game screen change logic. if (!currentScreen.ShowOverlays) { - options.State = Visibility.Hidden; + settings.State = Visibility.Hidden; Toolbar.State = Visibility.Hidden; musicController.State = Visibility.Hidden; chat.State = Visibility.Hidden; diff --git a/osu.Game/Overlays/LoginOverlay.cs b/osu.Game/Overlays/LoginOverlay.cs index 694eba2c41..8c4a3b85c0 100644 --- a/osu.Game/Overlays/LoginOverlay.cs +++ b/osu.Game/Overlays/LoginOverlay.cs @@ -7,14 +7,14 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; -using osu.Game.Overlays.Options.Sections.General; +using osu.Game.Overlays.Settings.Sections.General; using OpenTK.Graphics; namespace osu.Game.Overlays { internal class LoginOverlay : FocusedOverlayContainer { - private LoginOptions optionsSection; + private LoginSettings settingsSection; private const float transition_time = 400; @@ -42,7 +42,7 @@ namespace osu.Game.Overlays AutoSizeEasing = EasingTypes.OutQuint, Children = new Drawable[] { - optionsSection = new LoginOptions + settingsSection = new LoginSettings { Padding = new MarginPadding(10), }, @@ -64,17 +64,17 @@ namespace osu.Game.Overlays { base.PopIn(); - optionsSection.Bounding = true; + settingsSection.Bounding = true; FadeIn(transition_time, EasingTypes.OutQuint); - optionsSection.TriggerFocus(); + settingsSection.TriggerFocus(); } protected override void PopOut() { base.PopOut(); - optionsSection.Bounding = false; + settingsSection.Bounding = false; FadeOut(transition_time); } } diff --git a/osu.Game/Overlays/Options/Sections/Audio/AudioDevicesOptions.cs b/osu.Game/Overlays/Settings/Sections/Audio/AudioDevicesSettings.cs similarity index 88% rename from osu.Game/Overlays/Options/Sections/Audio/AudioDevicesOptions.cs rename to osu.Game/Overlays/Settings/Sections/Audio/AudioDevicesSettings.cs index e3033b876d..47f7abf571 100644 --- a/osu.Game/Overlays/Options/Sections/Audio/AudioDevicesOptions.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/AudioDevicesSettings.cs @@ -7,14 +7,14 @@ using osu.Framework.Graphics; using System.Collections.Generic; using System.Linq; -namespace osu.Game.Overlays.Options.Sections.Audio +namespace osu.Game.Overlays.Settings.Sections.Audio { - public class AudioDevicesOptions : OptionsSubsection + public class AudioDevicesSettings : SettingsSubsection { protected override string Header => "Devices"; private AudioManager audio; - private OptionDropdown dropdown; + private SettingsDropdown dropdown; [BackgroundDependencyLoader] private void load(AudioManager audio) @@ -56,7 +56,7 @@ namespace osu.Game.Overlays.Options.Sections.Audio Children = new Drawable[] { - dropdown = new OptionDropdown + dropdown = new SettingsDropdown { Bindable = audio.AudioDevice }, diff --git a/osu.Game/Overlays/Options/Sections/Audio/MainMenuOptions.cs b/osu.Game/Overlays/Settings/Sections/Audio/MainMenuSettings.cs similarity index 78% rename from osu.Game/Overlays/Options/Sections/Audio/MainMenuOptions.cs rename to osu.Game/Overlays/Settings/Sections/Audio/MainMenuSettings.cs index b2d1235b97..8101720d04 100644 --- a/osu.Game/Overlays/Options/Sections/Audio/MainMenuOptions.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/MainMenuSettings.cs @@ -4,9 +4,9 @@ using osu.Framework.Allocation; using osu.Game.Configuration; -namespace osu.Game.Overlays.Options.Sections.Audio +namespace osu.Game.Overlays.Settings.Sections.Audio { - public class MainMenuOptions : OptionsSubsection + public class MainMenuSettings : SettingsSubsection { protected override string Header => "Main Menu"; @@ -15,12 +15,12 @@ namespace osu.Game.Overlays.Options.Sections.Audio { Children = new[] { - new OptionCheckbox + new SettingsCheckbox { LabelText = "Interface voices", Bindable = config.GetBindable(OsuConfig.MenuVoice) }, - new OptionCheckbox + new SettingsCheckbox { LabelText = "osu! music theme", Bindable = config.GetBindable(OsuConfig.MenuMusic) diff --git a/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs b/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs similarity index 83% rename from osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs rename to osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs index 72c3dd071a..593002eb36 100644 --- a/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs @@ -6,9 +6,9 @@ using osu.Framework.Graphics; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.Sections.Audio +namespace osu.Game.Overlays.Settings.Sections.Audio { - public class OffsetOptions : OptionsSubsection + public class OffsetSettings : SettingsSubsection { protected override string Header => "Offset Adjustment"; @@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Options.Sections.Audio { Children = new Drawable[] { - new OptionSlider + new SettingsSlider { LabelText = "Audio Offset", Bindable = config.GetBindable(OsuConfig.AudioOffset) diff --git a/osu.Game/Overlays/Options/Sections/Audio/VolumeOptions.cs b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs similarity index 53% rename from osu.Game/Overlays/Options/Sections/Audio/VolumeOptions.cs rename to osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs index c3eb04da13..ea442cdfc2 100644 --- a/osu.Game/Overlays/Options/Sections/Audio/VolumeOptions.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs @@ -5,9 +5,9 @@ using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Graphics; -namespace osu.Game.Overlays.Options.Sections.Audio +namespace osu.Game.Overlays.Settings.Sections.Audio { - public class VolumeOptions : OptionsSubsection + public class VolumeSettings : SettingsSubsection { protected override string Header => "Volume"; @@ -16,9 +16,9 @@ namespace osu.Game.Overlays.Options.Sections.Audio { Children = new Drawable[] { - new OptionSlider { LabelText = "Master", Bindable = audio.Volume }, - new OptionSlider { LabelText = "Effect", Bindable = audio.VolumeSample }, - new OptionSlider { LabelText = "Music", Bindable = audio.VolumeTrack }, + new SettingsSlider { LabelText = "Master", Bindable = audio.Volume }, + new SettingsSlider { LabelText = "Effect", Bindable = audio.VolumeSample }, + new SettingsSlider { LabelText = "Music", Bindable = audio.VolumeTrack }, }; } } diff --git a/osu.Game/Overlays/Options/Sections/AudioSection.cs b/osu.Game/Overlays/Settings/Sections/AudioSection.cs similarity index 58% rename from osu.Game/Overlays/Options/Sections/AudioSection.cs rename to osu.Game/Overlays/Settings/Sections/AudioSection.cs index a9f8265a68..c994a6296c 100644 --- a/osu.Game/Overlays/Options/Sections/AudioSection.cs +++ b/osu.Game/Overlays/Settings/Sections/AudioSection.cs @@ -3,11 +3,11 @@ using osu.Framework.Graphics; using osu.Game.Graphics; -using osu.Game.Overlays.Options.Sections.Audio; +using osu.Game.Overlays.Settings.Sections.Audio; -namespace osu.Game.Overlays.Options.Sections +namespace osu.Game.Overlays.Settings.Sections { - public class AudioSection : OptionsSection + public class AudioSection : SettingsSection { public override string Header => "Audio"; public override FontAwesome Icon => FontAwesome.fa_headphones; @@ -16,10 +16,10 @@ namespace osu.Game.Overlays.Options.Sections { Children = new Drawable[] { - new AudioDevicesOptions(), - new VolumeOptions(), - new OffsetOptions(), - new MainMenuOptions(), + new AudioDevicesSettings(), + new VolumeSettings(), + new OffsetSettings(), + new MainMenuSettings(), }; } } diff --git a/osu.Game/Overlays/Options/Sections/Debug/GCOptions.cs b/osu.Game/Overlays/Settings/Sections/Debug/GCSettings.cs similarity index 83% rename from osu.Game/Overlays/Options/Sections/Debug/GCOptions.cs rename to osu.Game/Overlays/Settings/Sections/Debug/GCSettings.cs index 4350625d51..29b96a59c2 100644 --- a/osu.Game/Overlays/Options/Sections/Debug/GCOptions.cs +++ b/osu.Game/Overlays/Settings/Sections/Debug/GCSettings.cs @@ -8,9 +8,9 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.Sections.Debug +namespace osu.Game.Overlays.Settings.Sections.Debug { - public class GCOptions : OptionsSubsection + public class GCSettings : SettingsSubsection { protected override string Header => "Garbage Collector"; @@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Options.Sections.Debug { Children = new Drawable[] { - new OptionEnumDropdown + new SettingsEnumDropdown { LabelText = "Active mode", Bindable = config.GetBindable(FrameworkDebugConfig.ActiveGCMode) diff --git a/osu.Game/Overlays/Options/Sections/Debug/GeneralOptions.cs b/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs similarity index 80% rename from osu.Game/Overlays/Options/Sections/Debug/GeneralOptions.cs rename to osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs index 9258b8fbeb..9fbb4011b7 100644 --- a/osu.Game/Overlays/Options/Sections/Debug/GeneralOptions.cs +++ b/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs @@ -5,9 +5,9 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; -namespace osu.Game.Overlays.Options.Sections.Debug +namespace osu.Game.Overlays.Settings.Sections.Debug { - public class GeneralOptions : OptionsSubsection + public class GeneralSettings : SettingsSubsection { protected override string Header => "General"; @@ -16,7 +16,7 @@ namespace osu.Game.Overlays.Options.Sections.Debug { Children = new Drawable[] { - new OptionCheckbox + new SettingsCheckbox { LabelText = "Bypass caching", Bindable = config.GetBindable(FrameworkDebugConfig.BypassCaching) diff --git a/osu.Game/Overlays/Options/Sections/DebugSection.cs b/osu.Game/Overlays/Settings/Sections/DebugSection.cs similarity index 65% rename from osu.Game/Overlays/Options/Sections/DebugSection.cs rename to osu.Game/Overlays/Settings/Sections/DebugSection.cs index a90558a319..05b7171eed 100644 --- a/osu.Game/Overlays/Options/Sections/DebugSection.cs +++ b/osu.Game/Overlays/Settings/Sections/DebugSection.cs @@ -3,11 +3,11 @@ using osu.Framework.Graphics; using osu.Game.Graphics; -using osu.Game.Overlays.Options.Sections.Debug; +using osu.Game.Overlays.Settings.Sections.Debug; -namespace osu.Game.Overlays.Options.Sections +namespace osu.Game.Overlays.Settings.Sections { - public class DebugSection : OptionsSection + public class DebugSection : SettingsSection { public override string Header => "Debug"; public override FontAwesome Icon => FontAwesome.fa_bug; @@ -16,8 +16,8 @@ namespace osu.Game.Overlays.Options.Sections { Children = new Drawable[] { - new GeneralOptions(), - new GCOptions(), + new GeneralSettings(), + new GCSettings(), }; } } diff --git a/osu.Game/Overlays/Options/Sections/Gameplay/GeneralOptions.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs similarity index 79% rename from osu.Game/Overlays/Options/Sections/Gameplay/GeneralOptions.cs rename to osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs index 2598d95949..770ec3aaf3 100644 --- a/osu.Game/Overlays/Options/Sections/Gameplay/GeneralOptions.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs @@ -5,9 +5,9 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Configuration; -namespace osu.Game.Overlays.Options.Sections.Gameplay +namespace osu.Game.Overlays.Settings.Sections.Gameplay { - public class GeneralOptions : OptionsSubsection + public class GeneralSettings : SettingsSubsection { protected override string Header => "General"; @@ -16,17 +16,17 @@ namespace osu.Game.Overlays.Options.Sections.Gameplay { Children = new Drawable[] { - new OptionSlider + new SettingsSlider { LabelText = "Background dim", Bindable = config.GetBindable(OsuConfig.DimLevel) }, - new OptionCheckbox + new SettingsCheckbox { LabelText = "Show score overlay", Bindable = config.GetBindable(OsuConfig.ShowInterface) }, - new OptionCheckbox + new SettingsCheckbox { LabelText = "Always show key overlay", Bindable = config.GetBindable(OsuConfig.KeyOverlay) diff --git a/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs similarity index 80% rename from osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs rename to osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs index 910eae9a5a..14d6f36535 100644 --- a/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs @@ -6,9 +6,9 @@ using osu.Framework.Graphics; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.Sections.Gameplay +namespace osu.Game.Overlays.Settings.Sections.Gameplay { - public class SongSelectOptions : OptionsSubsection + public class SongSelectSettings : SettingsSubsection { protected override string Header => "Song Select"; @@ -17,12 +17,12 @@ namespace osu.Game.Overlays.Options.Sections.Gameplay { Children = new Drawable[] { - new OptionSlider + new SettingsSlider { LabelText = "Display beatmaps from", Bindable = config.GetBindable(OsuConfig.DisplayStarsMinimum) }, - new OptionSlider + new SettingsSlider { LabelText = "up to", Bindable = config.GetBindable(OsuConfig.DisplayStarsMaximum) diff --git a/osu.Game/Overlays/Options/Sections/GameplaySection.cs b/osu.Game/Overlays/Settings/Sections/GameplaySection.cs similarity index 64% rename from osu.Game/Overlays/Options/Sections/GameplaySection.cs rename to osu.Game/Overlays/Settings/Sections/GameplaySection.cs index 85a180ccbc..be957912c1 100644 --- a/osu.Game/Overlays/Options/Sections/GameplaySection.cs +++ b/osu.Game/Overlays/Settings/Sections/GameplaySection.cs @@ -3,11 +3,11 @@ using osu.Framework.Graphics; using osu.Game.Graphics; -using osu.Game.Overlays.Options.Sections.Gameplay; +using osu.Game.Overlays.Settings.Sections.Gameplay; -namespace osu.Game.Overlays.Options.Sections +namespace osu.Game.Overlays.Settings.Sections { - public class GameplaySection : OptionsSection + public class GameplaySection : SettingsSection { public override string Header => "Gameplay"; public override FontAwesome Icon => FontAwesome.fa_circle_o; @@ -16,8 +16,8 @@ namespace osu.Game.Overlays.Options.Sections { Children = new Drawable[] { - new GeneralOptions(), - new SongSelectOptions(), + new GeneralSettings(), + new SongSelectSettings(), }; } } diff --git a/osu.Game/Overlays/Options/Sections/General/LanguageOptions.cs b/osu.Game/Overlays/Settings/Sections/General/LanguageSettings.cs similarity index 77% rename from osu.Game/Overlays/Options/Sections/General/LanguageOptions.cs rename to osu.Game/Overlays/Settings/Sections/General/LanguageSettings.cs index 2778f2567d..552b8bea1b 100644 --- a/osu.Game/Overlays/Options/Sections/General/LanguageOptions.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LanguageSettings.cs @@ -5,9 +5,9 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; -namespace osu.Game.Overlays.Options.Sections.General +namespace osu.Game.Overlays.Settings.Sections.General { - public class LanguageOptions : OptionsSubsection + public class LanguageSettings : SettingsSubsection { protected override string Header => "Language"; @@ -16,10 +16,10 @@ namespace osu.Game.Overlays.Options.Sections.General { Children = new Drawable[] { - new OptionCheckbox + new SettingsCheckbox { LabelText = "Prefer metadata in original language", - Bindable = frameworkConfig.GetBindable(FrameworkConfig.ShowUnicode) + Bindable = frameworkConfig.GetBindable(FrameworkSetting.ShowUnicode) }, }; } diff --git a/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs similarity index 93% rename from osu.Game/Overlays/Options/Sections/General/LoginOptions.cs rename to osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index a3612a6396..3193c2eb5a 100644 --- a/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs @@ -13,9 +13,9 @@ using osu.Game.Online.API; using OpenTK; using osu.Framework.Input; -namespace osu.Game.Overlays.Options.Sections.General +namespace osu.Game.Overlays.Settings.Sections.General { - public class LoginOptions : OptionsSubsection, IOnlineComponent + public class LoginSettings : SettingsSubsection, IOnlineComponent { private bool bounding = true; private LoginForm form; @@ -132,12 +132,12 @@ namespace osu.Game.Overlays.Options.Sections.General TabbableContentContainer = this, OnCommit = (sender, newText) => performLogin() }, - new OptionCheckbox + new SettingsCheckbox { LabelText = "Remember username", Bindable = config.GetBindable(OsuConfig.SaveUsername), }, - new OptionCheckbox + new SettingsCheckbox { LabelText = "Stay logged in", Bindable = config.GetBindable(OsuConfig.SavePassword), diff --git a/osu.Game/Overlays/Options/Sections/General/UpdateOptions.cs b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs similarity index 83% rename from osu.Game/Overlays/Options/Sections/General/UpdateOptions.cs rename to osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs index 1d9a5a7d72..3f2f073bff 100644 --- a/osu.Game/Overlays/Options/Sections/General/UpdateOptions.cs +++ b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs @@ -7,9 +7,9 @@ using osu.Framework.Platform; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.Sections.General +namespace osu.Game.Overlays.Settings.Sections.General { - public class UpdateOptions : OptionsSubsection + public class UpdateSettings : SettingsSubsection { protected override string Header => "Updates"; @@ -18,7 +18,7 @@ namespace osu.Game.Overlays.Options.Sections.General { Children = new Drawable[] { - new OptionEnumDropdown + new SettingsEnumDropdown { LabelText = "Release stream", Bindable = config.GetBindable(OsuConfig.ReleaseStream), diff --git a/osu.Game/Overlays/Options/Sections/GeneralSection.cs b/osu.Game/Overlays/Settings/Sections/GeneralSection.cs similarity index 64% rename from osu.Game/Overlays/Options/Sections/GeneralSection.cs rename to osu.Game/Overlays/Settings/Sections/GeneralSection.cs index e0c447b08b..5511f827e2 100644 --- a/osu.Game/Overlays/Options/Sections/GeneralSection.cs +++ b/osu.Game/Overlays/Settings/Sections/GeneralSection.cs @@ -3,11 +3,11 @@ using osu.Framework.Graphics; using osu.Game.Graphics; -using osu.Game.Overlays.Options.Sections.General; +using osu.Game.Overlays.Settings.Sections.General; -namespace osu.Game.Overlays.Options.Sections +namespace osu.Game.Overlays.Settings.Sections { - public class GeneralSection : OptionsSection + public class GeneralSection : SettingsSection { public override string Header => "General"; public override FontAwesome Icon => FontAwesome.fa_gear; @@ -16,8 +16,8 @@ namespace osu.Game.Overlays.Options.Sections { Children = new Drawable[] { - new LanguageOptions(), - new UpdateOptions(), + new LanguageSettings(), + new UpdateSettings(), }; } } diff --git a/osu.Game/Overlays/Options/Sections/Graphics/DetailOptions.cs b/osu.Game/Overlays/Settings/Sections/Graphics/DetailSettings.cs similarity index 79% rename from osu.Game/Overlays/Options/Sections/Graphics/DetailOptions.cs rename to osu.Game/Overlays/Settings/Sections/Graphics/DetailSettings.cs index 6503a7ea90..5bfb8a4373 100644 --- a/osu.Game/Overlays/Options/Sections/Graphics/DetailOptions.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/DetailSettings.cs @@ -5,9 +5,9 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Configuration; -namespace osu.Game.Overlays.Options.Sections.Graphics +namespace osu.Game.Overlays.Settings.Sections.Graphics { - public class DetailOptions : OptionsSubsection + public class DetailSettings : SettingsSubsection { protected override string Header => "Detail Settings"; @@ -16,12 +16,12 @@ namespace osu.Game.Overlays.Options.Sections.Graphics { Children = new Drawable[] { - new OptionCheckbox + new SettingsCheckbox { LabelText = "Snaking in sliders", Bindable = config.GetBindable(OsuConfig.SnakingInSliders) }, - new OptionCheckbox + new SettingsCheckbox { LabelText = "Snaking out sliders", Bindable = config.GetBindable(OsuConfig.SnakingOutSliders) diff --git a/osu.Game/Overlays/Options/Sections/Graphics/LayoutOptions.cs b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs similarity index 70% rename from osu.Game/Overlays/Options/Sections/Graphics/LayoutOptions.cs rename to osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs index 1b4b0b3c7d..9a5fd769cd 100644 --- a/osu.Game/Overlays/Options/Sections/Graphics/LayoutOptions.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs @@ -5,43 +5,43 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; -namespace osu.Game.Overlays.Options.Sections.Graphics +namespace osu.Game.Overlays.Settings.Sections.Graphics { - public class LayoutOptions : OptionsSubsection + public class LayoutSettings : SettingsSubsection { protected override string Header => "Layout"; - private OptionSlider letterboxPositionX; - private OptionSlider letterboxPositionY; + private SettingsSlider letterboxPositionX; + private SettingsSlider letterboxPositionY; private Bindable letterboxing; [BackgroundDependencyLoader] private void load(FrameworkConfigManager config) { - letterboxing = config.GetBindable(FrameworkConfig.Letterboxing); + letterboxing = config.GetBindable(FrameworkSetting.Letterboxing); Children = new Drawable[] { - new OptionEnumDropdown + new SettingsEnumDropdown { LabelText = "Screen mode", - Bindable = config.GetBindable(FrameworkConfig.WindowMode), + Bindable = config.GetBindable(FrameworkSetting.WindowMode), }, - new OptionCheckbox + new SettingsCheckbox { LabelText = "Letterboxing", Bindable = letterboxing, }, - letterboxPositionX = new OptionSlider + letterboxPositionX = new SettingsSlider { LabelText = "Horizontal position", - Bindable = config.GetBindable(FrameworkConfig.LetterboxPositionX) + Bindable = config.GetBindable(FrameworkSetting.LetterboxPositionX) }, - letterboxPositionY = new OptionSlider + letterboxPositionY = new SettingsSlider { LabelText = "Vertical position", - Bindable = config.GetBindable(FrameworkConfig.LetterboxPositionY) + Bindable = config.GetBindable(FrameworkSetting.LetterboxPositionY) }, }; diff --git a/osu.Game/Overlays/Options/Sections/Graphics/MainMenuOptions.cs b/osu.Game/Overlays/Settings/Sections/Graphics/MainMenuSettings.cs similarity index 78% rename from osu.Game/Overlays/Options/Sections/Graphics/MainMenuOptions.cs rename to osu.Game/Overlays/Settings/Sections/Graphics/MainMenuSettings.cs index 6ebb8f263d..fd135e336f 100644 --- a/osu.Game/Overlays/Options/Sections/Graphics/MainMenuOptions.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/MainMenuSettings.cs @@ -4,9 +4,9 @@ using osu.Framework.Allocation; using osu.Game.Configuration; -namespace osu.Game.Overlays.Options.Sections.Graphics +namespace osu.Game.Overlays.Settings.Sections.Graphics { - public class MainMenuOptions : OptionsSubsection + public class MainMenuSettings : SettingsSubsection { protected override string Header => "User Interface"; @@ -15,7 +15,7 @@ namespace osu.Game.Overlays.Options.Sections.Graphics { Children = new[] { - new OptionCheckbox + new SettingsCheckbox { LabelText = "Parallax", Bindable = config.GetBindable(OsuConfig.MenuParallax) diff --git a/osu.Game/Overlays/Options/Sections/Graphics/RendererOptions.cs b/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs similarity index 79% rename from osu.Game/Overlays/Options/Sections/Graphics/RendererOptions.cs rename to osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs index f11c18d3b4..0c79c8cd42 100644 --- a/osu.Game/Overlays/Options/Sections/Graphics/RendererOptions.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs @@ -6,9 +6,9 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Game.Configuration; -namespace osu.Game.Overlays.Options.Sections.Graphics +namespace osu.Game.Overlays.Settings.Sections.Graphics { - public class RendererOptions : OptionsSubsection + public class RendererSettings : SettingsSubsection { protected override string Header => "Renderer"; @@ -19,12 +19,12 @@ namespace osu.Game.Overlays.Options.Sections.Graphics Children = new Drawable[] { // TODO: this needs to be a custom dropdown at some point - new OptionEnumDropdown + new SettingsEnumDropdown { LabelText = "Frame limiter", - Bindable = config.GetBindable(FrameworkConfig.FrameSync) + Bindable = config.GetBindable(FrameworkSetting.FrameSync) }, - new OptionCheckbox + new SettingsCheckbox { LabelText = "Show FPS", Bindable = osuConfig.GetBindable(OsuConfig.ShowFpsDisplay) diff --git a/osu.Game/Overlays/Options/Sections/GraphicsSection.cs b/osu.Game/Overlays/Settings/Sections/GraphicsSection.cs similarity index 58% rename from osu.Game/Overlays/Options/Sections/GraphicsSection.cs rename to osu.Game/Overlays/Settings/Sections/GraphicsSection.cs index dbbcbde2b9..f188f2476c 100644 --- a/osu.Game/Overlays/Options/Sections/GraphicsSection.cs +++ b/osu.Game/Overlays/Settings/Sections/GraphicsSection.cs @@ -3,11 +3,11 @@ using osu.Framework.Graphics; using osu.Game.Graphics; -using osu.Game.Overlays.Options.Sections.Graphics; +using osu.Game.Overlays.Settings.Sections.Graphics; -namespace osu.Game.Overlays.Options.Sections +namespace osu.Game.Overlays.Settings.Sections { - public class GraphicsSection : OptionsSection + public class GraphicsSection : SettingsSection { public override string Header => "Graphics"; public override FontAwesome Icon => FontAwesome.fa_laptop; @@ -16,10 +16,10 @@ namespace osu.Game.Overlays.Options.Sections { Children = new Drawable[] { - new RendererOptions(), - new LayoutOptions(), - new DetailOptions(), - new MainMenuOptions(), + new RendererSettings(), + new LayoutSettings(), + new DetailSettings(), + new MainMenuSettings(), }; } } diff --git a/osu.Game/Overlays/Options/Sections/Input/KeyboardOptions.cs b/osu.Game/Overlays/Settings/Sections/Input/KeyboardSettings.cs similarity index 76% rename from osu.Game/Overlays/Options/Sections/Input/KeyboardOptions.cs rename to osu.Game/Overlays/Settings/Sections/Input/KeyboardSettings.cs index b7e8598cff..9ead4ca7a4 100644 --- a/osu.Game/Overlays/Options/Sections/Input/KeyboardOptions.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/KeyboardSettings.cs @@ -4,13 +4,13 @@ using osu.Framework.Graphics; using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.Sections.Input +namespace osu.Game.Overlays.Settings.Sections.Input { - public class KeyboardOptions : OptionsSubsection + public class KeyboardSettings : SettingsSubsection { protected override string Header => "Keyboard"; - public KeyboardOptions() + public KeyboardSettings() { Children = new Drawable[] { diff --git a/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs similarity index 80% rename from osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs rename to osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs index b4ce11e2bc..7bf42fd7e7 100644 --- a/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs @@ -8,9 +8,9 @@ using osu.Framework.Input; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options.Sections.Input +namespace osu.Game.Overlays.Settings.Sections.Input { - public class MouseOptions : OptionsSubsection + public class MouseSettings : SettingsSubsection { protected override string Header => "Mouse"; @@ -19,17 +19,17 @@ namespace osu.Game.Overlays.Options.Sections.Input { Children = new Drawable[] { - new OptionEnumDropdown + new SettingsEnumDropdown { LabelText = "Confine mouse cursor", - Bindable = config.GetBindable(FrameworkConfig.ConfineMouseMode), + Bindable = config.GetBindable(FrameworkSetting.ConfineMouseMode), }, - new OptionCheckbox + new SettingsCheckbox { LabelText = "Disable mouse wheel during gameplay", Bindable = osuConfig.GetBindable(OsuConfig.MouseDisableWheel) }, - new OptionCheckbox + new SettingsCheckbox { LabelText = "Disable mouse buttons during gameplay", Bindable = osuConfig.GetBindable(OsuConfig.MouseDisableButtons) diff --git a/osu.Game/Overlays/Options/Sections/InputSection.cs b/osu.Game/Overlays/Settings/Sections/InputSection.cs similarity index 65% rename from osu.Game/Overlays/Options/Sections/InputSection.cs rename to osu.Game/Overlays/Settings/Sections/InputSection.cs index d39d0a0e20..cfa3bc78f0 100644 --- a/osu.Game/Overlays/Options/Sections/InputSection.cs +++ b/osu.Game/Overlays/Settings/Sections/InputSection.cs @@ -3,11 +3,11 @@ using osu.Framework.Graphics; using osu.Game.Graphics; -using osu.Game.Overlays.Options.Sections.Input; +using osu.Game.Overlays.Settings.Sections.Input; -namespace osu.Game.Overlays.Options.Sections +namespace osu.Game.Overlays.Settings.Sections { - public class InputSection : OptionsSection + public class InputSection : SettingsSection { public override string Header => "Input"; public override FontAwesome Icon => FontAwesome.fa_keyboard_o; @@ -16,8 +16,8 @@ namespace osu.Game.Overlays.Options.Sections { Children = new Drawable[] { - new MouseOptions(), - new KeyboardOptions(), + new MouseSettings(), + new KeyboardSettings(), }; } } diff --git a/osu.Game/Overlays/Options/Sections/MaintenanceSection.cs b/osu.Game/Overlays/Settings/Sections/MaintenanceSection.cs similarity index 81% rename from osu.Game/Overlays/Options/Sections/MaintenanceSection.cs rename to osu.Game/Overlays/Settings/Sections/MaintenanceSection.cs index e8a4f91074..529cec79c1 100644 --- a/osu.Game/Overlays/Options/Sections/MaintenanceSection.cs +++ b/osu.Game/Overlays/Settings/Sections/MaintenanceSection.cs @@ -5,9 +5,9 @@ using osu.Framework.Graphics; using osu.Game.Graphics; using OpenTK; -namespace osu.Game.Overlays.Options.Sections +namespace osu.Game.Overlays.Settings.Sections { - public class MaintenanceSection : OptionsSection + public class MaintenanceSection : SettingsSection { public override string Header => "Maintenance"; public override FontAwesome Icon => FontAwesome.fa_wrench; diff --git a/osu.Game/Overlays/Options/Sections/OnlineSection.cs b/osu.Game/Overlays/Settings/Sections/OnlineSection.cs similarity index 80% rename from osu.Game/Overlays/Options/Sections/OnlineSection.cs rename to osu.Game/Overlays/Settings/Sections/OnlineSection.cs index 1a65a23121..4494da1bf4 100644 --- a/osu.Game/Overlays/Options/Sections/OnlineSection.cs +++ b/osu.Game/Overlays/Settings/Sections/OnlineSection.cs @@ -4,9 +4,9 @@ using osu.Framework.Graphics; using osu.Game.Graphics; -namespace osu.Game.Overlays.Options.Sections +namespace osu.Game.Overlays.Settings.Sections { - public class OnlineSection : OptionsSection + public class OnlineSection : SettingsSection { public override string Header => "Online"; public override FontAwesome Icon => FontAwesome.fa_globe; diff --git a/osu.Game/Overlays/Options/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs similarity index 83% rename from osu.Game/Overlays/Options/Sections/SkinSection.cs rename to osu.Game/Overlays/Settings/Sections/SkinSection.cs index b3c225d00c..cc416f45ca 100644 --- a/osu.Game/Overlays/Options/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Settings/Sections/SkinSection.cs @@ -8,9 +8,9 @@ using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using OpenTK; -namespace osu.Game.Overlays.Options.Sections +namespace osu.Game.Overlays.Settings.Sections { - public class SkinSection : OptionsSection + public class SkinSection : SettingsSection { public override string Header => "Skin"; public override FontAwesome Icon => FontAwesome.fa_paint_brush; @@ -21,12 +21,12 @@ namespace osu.Game.Overlays.Options.Sections FlowContent.Spacing = new Vector2(0, 5); Children = new Drawable[] { - new OptionSlider + new SettingsSlider { LabelText = "Menu cursor size", Bindable = config.GetBindable(OsuConfig.MenuCursorSize) }, - new OptionSlider + new SettingsSlider { LabelText = "Gameplay cursor size", Bindable = config.GetBindable(OsuConfig.GameplayCursorSize) diff --git a/osu.Game/Overlays/Options/OptionCheckbox.cs b/osu.Game/Overlays/Settings/SettingsCheckbox.cs similarity index 82% rename from osu.Game/Overlays/Options/OptionCheckbox.cs rename to osu.Game/Overlays/Settings/SettingsCheckbox.cs index de7b138c3c..659754ce79 100644 --- a/osu.Game/Overlays/Options/OptionCheckbox.cs +++ b/osu.Game/Overlays/Settings/SettingsCheckbox.cs @@ -4,9 +4,9 @@ using osu.Framework.Graphics; using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Settings { - public class OptionCheckbox : OptionItem + public class SettingsCheckbox : SettingsItem { private OsuCheckbox checkbox; diff --git a/osu.Game/Overlays/Options/OptionDropdown.cs b/osu.Game/Overlays/Settings/SettingsDropdown.cs similarity index 88% rename from osu.Game/Overlays/Options/OptionDropdown.cs rename to osu.Game/Overlays/Settings/SettingsDropdown.cs index 1427eafe39..8ce755b90e 100644 --- a/osu.Game/Overlays/Options/OptionDropdown.cs +++ b/osu.Game/Overlays/Settings/SettingsDropdown.cs @@ -7,9 +7,9 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Settings { - public class OptionDropdown : OptionItem + public class SettingsDropdown : SettingsItem { private Dropdown dropdown; diff --git a/osu.Game/Overlays/Options/OptionEnumDropdown.cs b/osu.Game/Overlays/Settings/SettingsEnumDropdown.cs similarity index 75% rename from osu.Game/Overlays/Options/OptionEnumDropdown.cs rename to osu.Game/Overlays/Settings/SettingsEnumDropdown.cs index 1a4f4635e2..a9f0848403 100644 --- a/osu.Game/Overlays/Options/OptionEnumDropdown.cs +++ b/osu.Game/Overlays/Settings/SettingsEnumDropdown.cs @@ -6,14 +6,14 @@ using System.Reflection; using System.ComponentModel; using System.Collections.Generic; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Settings { - public class OptionEnumDropdown : OptionDropdown + public class SettingsEnumDropdown : SettingsDropdown { - public OptionEnumDropdown() + public SettingsEnumDropdown() { if (!typeof(T).IsEnum) - throw new InvalidOperationException("OptionsDropdown only supports enums as the generic type argument"); + throw new InvalidOperationException("SettingsDropdown only supports enums as the generic type argument"); List> items = new List>(); foreach(var val in (T[])Enum.GetValues(typeof(T))) diff --git a/osu.Game/Overlays/Options/OptionsFooter.cs b/osu.Game/Overlays/Settings/SettingsFooter.cs similarity index 93% rename from osu.Game/Overlays/Options/OptionsFooter.cs rename to osu.Game/Overlays/Settings/SettingsFooter.cs index c785f2d0c0..a9293ac2af 100644 --- a/osu.Game/Overlays/Options/OptionsFooter.cs +++ b/osu.Game/Overlays/Settings/SettingsFooter.cs @@ -12,9 +12,9 @@ using osu.Game.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Settings { - public class OptionsFooter : FillFlowContainer + public class SettingsFooter : FillFlowContainer { [BackgroundDependencyLoader] private void load(OsuGameBase game, OsuColour colours, RulesetDatabase rulesets) diff --git a/osu.Game/Overlays/Options/OptionsHeader.cs b/osu.Game/Overlays/Settings/SettingsHeader.cs similarity index 90% rename from osu.Game/Overlays/Options/OptionsHeader.cs rename to osu.Game/Overlays/Settings/SettingsHeader.cs index 8b97a607a2..8a118120de 100644 --- a/osu.Game/Overlays/Options/OptionsHeader.cs +++ b/osu.Game/Overlays/Settings/SettingsHeader.cs @@ -12,9 +12,9 @@ using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using OpenTK.Graphics; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Settings { - public class OptionsHeader : Container + public class SettingsHeader : Container { public SearchTextBox SearchTextBox; @@ -25,7 +25,7 @@ namespace osu.Game.Overlays.Options public Action Exit; /// A reference to the current scroll position of the ScrollContainer we are contained within. - public OptionsHeader(Func currentScrollOffset) + public SettingsHeader(Func currentScrollOffset) { this.currentScrollOffset = currentScrollOffset; } @@ -55,7 +55,7 @@ namespace osu.Game.Overlays.Options Text = "settings", TextSize = 40, Margin = new MarginPadding { - Left = OptionsOverlay.CONTENT_MARGINS, + Left = SettingsOverlay.CONTENT_MARGINS, Top = Toolbar.Toolbar.TOOLTIP_HEIGHT }, }, @@ -65,7 +65,7 @@ namespace osu.Game.Overlays.Options Text = "Change the way osu! behaves", TextSize = 18, Margin = new MarginPadding { - Left = OptionsOverlay.CONTENT_MARGINS, + Left = SettingsOverlay.CONTENT_MARGINS, Bottom = 30 }, }, diff --git a/osu.Game/Overlays/Options/OptionItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs similarity index 89% rename from osu.Game/Overlays/Options/OptionItem.cs rename to osu.Game/Overlays/Settings/SettingsItem.cs index 2124796089..a40f895e0a 100644 --- a/osu.Game/Overlays/Options/OptionItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -10,9 +10,9 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.Sprites; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Settings { - public abstract class OptionItem : FillFlowContainer, IFilterable + public abstract class SettingsItem : FillFlowContainer, IFilterable { protected abstract Drawable CreateControl(); @@ -37,7 +37,7 @@ namespace osu.Game.Overlays.Options } } - // hold a reference to the provided bindable so we don't have to in every options section. + // hold a reference to the provided bindable so we don't have to in every settings section. private Bindable bindable; public Bindable Bindable @@ -65,7 +65,7 @@ namespace osu.Game.Overlays.Options } } - protected OptionItem() + protected SettingsItem() { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; diff --git a/osu.Game/Overlays/Options/OptionLabel.cs b/osu.Game/Overlays/Settings/SettingsLabel.cs similarity index 80% rename from osu.Game/Overlays/Options/OptionLabel.cs rename to osu.Game/Overlays/Settings/SettingsLabel.cs index 3f3c569f3a..7d1364ef41 100644 --- a/osu.Game/Overlays/Options/OptionLabel.cs +++ b/osu.Game/Overlays/Settings/SettingsLabel.cs @@ -5,9 +5,9 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Graphics; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Settings { - internal class OptionLabel : OptionItem + internal class SettingsLabel : SettingsItem { protected override Drawable CreateControl() => null; diff --git a/osu.Game/Overlays/Options/OptionsSection.cs b/osu.Game/Overlays/Settings/SettingsSection.cs similarity index 88% rename from osu.Game/Overlays/Options/OptionsSection.cs rename to osu.Game/Overlays/Settings/SettingsSection.cs index 5e36f79467..66b860402a 100644 --- a/osu.Game/Overlays/Options/OptionsSection.cs +++ b/osu.Game/Overlays/Settings/SettingsSection.cs @@ -13,9 +13,9 @@ using osu.Game.Graphics.Sprites; using System.Collections.Generic; using System.Linq; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Settings { - public abstract class OptionsSection : Container, IHasFilterableChildren + public abstract class SettingsSection : Container, IHasFilterableChildren { protected FillFlowContainer FlowContent; protected override Container Content => FlowContent; @@ -35,7 +35,7 @@ namespace osu.Game.Overlays.Options private readonly SpriteText headerLabel; - protected OptionsSection() + protected SettingsSection() { Margin = new MarginPadding { Top = 20 }; AutoSizeAxes = Axes.Y; @@ -57,8 +57,8 @@ namespace osu.Game.Overlays.Options Padding = new MarginPadding { Top = 20 + border_size, - Left = OptionsOverlay.CONTENT_MARGINS, - Right = OptionsOverlay.CONTENT_MARGINS, + Left = SettingsOverlay.CONTENT_MARGINS, + Right = SettingsOverlay.CONTENT_MARGINS, Bottom = 10, }, RelativeSizeAxes = Axes.X, diff --git a/osu.Game/Overlays/Options/OptionSlider.cs b/osu.Game/Overlays/Settings/SettingsSlider.cs similarity index 76% rename from osu.Game/Overlays/Options/OptionSlider.cs rename to osu.Game/Overlays/Settings/SettingsSlider.cs index 2cceb085a7..9ce4efdd52 100644 --- a/osu.Game/Overlays/Options/OptionSlider.cs +++ b/osu.Game/Overlays/Settings/SettingsSlider.cs @@ -6,14 +6,14 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Settings { - public class OptionSlider : OptionSlider> + public class SettingsSlider : SettingsSlider> where T : struct { } - public class OptionSlider : OptionItem + public class SettingsSlider : SettingsItem where T : struct where U : SliderBar, new() { diff --git a/osu.Game/Overlays/Options/OptionsSubsection.cs b/osu.Game/Overlays/Settings/SettingsSubsection.cs similarity index 87% rename from osu.Game/Overlays/Options/OptionsSubsection.cs rename to osu.Game/Overlays/Settings/SettingsSubsection.cs index ff9e60c273..b4ce54cb75 100644 --- a/osu.Game/Overlays/Options/OptionsSubsection.cs +++ b/osu.Game/Overlays/Settings/SettingsSubsection.cs @@ -9,9 +9,9 @@ using osu.Game.Graphics.Sprites; using System.Collections.Generic; using System.Linq; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Settings { - public abstract class OptionsSubsection : FillFlowContainer, IHasFilterableChildren + public abstract class SettingsSubsection : FillFlowContainer, IHasFilterableChildren { protected override Container Content => content; @@ -29,7 +29,7 @@ namespace osu.Game.Overlays.Options } } - protected OptionsSubsection() + protected SettingsSubsection() { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; diff --git a/osu.Game/Overlays/Options/OptionTextBox.cs b/osu.Game/Overlays/Settings/SettingsTextBox.cs similarity index 74% rename from osu.Game/Overlays/Options/OptionTextBox.cs rename to osu.Game/Overlays/Settings/SettingsTextBox.cs index 498f27796a..710330ad41 100644 --- a/osu.Game/Overlays/Options/OptionTextBox.cs +++ b/osu.Game/Overlays/Settings/SettingsTextBox.cs @@ -4,9 +4,9 @@ using osu.Framework.Graphics; using osu.Game.Graphics.UserInterface; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Settings { - public class OptionTextBox : OptionItem + public class SettingsTextBox : SettingsItem { protected override Drawable CreateControl() => new OsuTextBox(); } diff --git a/osu.Game/Overlays/Options/Sidebar.cs b/osu.Game/Overlays/Settings/Sidebar.cs similarity index 95% rename from osu.Game/Overlays/Options/Sidebar.cs rename to osu.Game/Overlays/Settings/Sidebar.cs index eb489810ad..be93fdbac5 100644 --- a/osu.Game/Overlays/Options/Sidebar.cs +++ b/osu.Game/Overlays/Settings/Sidebar.cs @@ -10,7 +10,7 @@ using osu.Framework.Input; using osu.Framework.Threading; using osu.Game.Overlays.Toolbar; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Settings { public class Sidebar : Container { diff --git a/osu.Game/Overlays/Options/SidebarButton.cs b/osu.Game/Overlays/Settings/SidebarButton.cs similarity index 93% rename from osu.Game/Overlays/Options/SidebarButton.cs rename to osu.Game/Overlays/Settings/SidebarButton.cs index 7c0049e8c7..766c6cf7e2 100644 --- a/osu.Game/Overlays/Options/SidebarButton.cs +++ b/osu.Game/Overlays/Settings/SidebarButton.cs @@ -12,7 +12,7 @@ using osu.Framework.Input; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -namespace osu.Game.Overlays.Options +namespace osu.Game.Overlays.Settings { public class SidebarButton : Container { @@ -23,8 +23,8 @@ namespace osu.Game.Overlays.Options private readonly Container text; public Action Action; - private OptionsSection section; - public OptionsSection Section + private SettingsSection section; + public SettingsSection Section { get { diff --git a/osu.Game/Overlays/OptionsOverlay.cs b/osu.Game/Overlays/SettingsOverlay.cs similarity index 86% rename from osu.Game/Overlays/OptionsOverlay.cs rename to osu.Game/Overlays/SettingsOverlay.cs index 6d1a3a64fc..e3fbf12df3 100644 --- a/osu.Game/Overlays/OptionsOverlay.cs +++ b/osu.Game/Overlays/SettingsOverlay.cs @@ -8,14 +8,14 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; -using osu.Game.Overlays.Options; +using osu.Game.Overlays.Settings; using System; -using osu.Game.Overlays.Options.Sections; +using osu.Game.Overlays.Settings.Sections; using osu.Framework.Input; namespace osu.Game.Overlays { - public class OptionsOverlay : FocusedOverlayContainer + public class SettingsOverlay : FocusedOverlayContainer { internal const float CONTENT_MARGINS = 10; @@ -30,17 +30,17 @@ namespace osu.Game.Overlays private ScrollContainer scrollContainer; private Sidebar sidebar; private SidebarButton[] sidebarButtons; - private OptionsSection[] sections; + private SettingsSection[] sections; - private OptionsHeader header; + private SettingsHeader header; - private OptionsFooter footer; + private SettingsFooter footer; private SearchContainer searchContainer; private float lastKnownScroll; - public OptionsOverlay() + public SettingsOverlay() { RelativeSizeAxes = Axes.Y; AutoSizeAxes = Axes.X; @@ -49,7 +49,7 @@ namespace osu.Game.Overlays [BackgroundDependencyLoader(permitNulls: true)] private void load(OsuGame game) { - sections = new OptionsSection[] + sections = new SettingsSection[] { new GeneralSection(), new GraphicsSection(), @@ -84,8 +84,8 @@ namespace osu.Game.Overlays Direction = FillDirection.Vertical, Children = sections, }, - footer = new OptionsFooter(), - header = new OptionsHeader(() => scrollContainer.Current) + footer = new SettingsFooter(), + header = new SettingsHeader(() => scrollContainer.Current) { Exit = Hide, }, @@ -114,7 +114,7 @@ namespace osu.Game.Overlays { base.UpdateAfterChildren(); - //we need to update these manually because we can't put the OptionsHeader inside the SearchContainer (due to its anchoring). + //we need to update these manually because we can't put the SettingsHeader inside the SearchContainer (due to its anchoring). searchContainer.Y = header.DrawHeight; footer.Y = searchContainer.Y + searchContainer.DrawHeight; } @@ -128,10 +128,10 @@ namespace osu.Game.Overlays { lastKnownScroll = currentScroll; - OptionsSection bestCandidate = null; + SettingsSection bestCandidate = null; float bestDistance = float.MaxValue; - foreach (OptionsSection section in sections) + foreach (SettingsSection section in sections) { float distance = Math.Abs(scrollContainer.GetChildPosInContent(section) - currentScroll); if (distance < bestDistance) diff --git a/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs b/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs index ae54b98aca..2eb8c15dcf 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs @@ -16,9 +16,9 @@ namespace osu.Game.Overlays.Toolbar } [BackgroundDependencyLoader] - private void load(OptionsOverlay options) + private void load(SettingsOverlay settings) { - StateContainer = options; + StateContainer = settings; } } } \ No newline at end of file diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index b0d12cb5a1..2f418d2f88 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -82,7 +82,7 @@ namespace osu.Game.Screens.Menu AutoSizeAxes = Axes.Both, Children = new[] { - settingsButton = new Button(@"settings", @"options", FontAwesome.fa_gear, new Color4(85, 85, 85, 255), () => OnSettings?.Invoke(), -WEDGE_WIDTH, Key.O), + settingsButton = new Button(@"settings", @"settings", FontAwesome.fa_gear, new Color4(85, 85, 85, 255), () => OnSettings?.Invoke(), -WEDGE_WIDTH, Key.O), backButton = new Button(@"back", @"back", FontAwesome.fa_osu_left_o, new Color4(51, 58, 94, 255), onBack, -WEDGE_WIDTH), iconFacade = new Container //need a container to make the osu! icon flow properly. { diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index c8a00e0671..3e03a9aac8 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -84,7 +84,7 @@ namespace osu.Game.Screens.Menu } } - buttons.OnSettings = game.ToggleOptions; + buttons.OnSettings = game.ToggleSettings; preloadSongSelect(); } diff --git a/osu.Game/Screens/Select/Options/BeatmapOptionsButton.cs b/osu.Game/Screens/Select/Options/BeatmapOptionsButton.cs index 965ea12fe2..0935bb3686 100644 --- a/osu.Game/Screens/Select/Options/BeatmapOptionsButton.cs +++ b/osu.Game/Screens/Select/Options/BeatmapOptionsButton.cs @@ -1,9 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; -using OpenTK.Graphics; -using OpenTK.Input; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -12,6 +9,9 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Input; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using OpenTK; +using OpenTK.Graphics; +using OpenTK.Input; namespace osu.Game.Screens.Select.Options { diff --git a/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs b/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs index 77001950f6..c064a0272e 100644 --- a/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs +++ b/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs @@ -4,14 +4,14 @@ using System; using System.Collections.Generic; using System.Linq; -using OpenTK; -using OpenTK.Graphics; -using OpenTK.Input; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; +using OpenTK; +using OpenTK.Graphics; +using OpenTK.Input; namespace osu.Game.Screens.Select.Options { diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index ee6153dc55..1f866f0e17 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -79,8 +79,8 @@ - - + + @@ -207,13 +207,13 @@ - - + + - - - - + + + + @@ -278,6 +278,8 @@ + + @@ -313,7 +315,7 @@ - + @@ -346,39 +348,39 @@ - - - + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + @@ -410,8 +412,6 @@ - - From 622b155fda4535bd45facffe36b0d390535bebf0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 15 May 2017 10:56:27 +0900 Subject: [PATCH 61/74] OsuConfig -> OsuSetting --- .../Objects/Drawables/Pieces/SliderBody.cs | 4 +- osu.Game/Configuration/OsuConfigManager.cs | 58 +++++++++---------- .../Graphics/Containers/ParallaxContainer.cs | 2 +- osu.Game/Graphics/Cursor/GameplayCursor.cs | 2 +- osu.Game/Graphics/Cursor/MenuCursor.cs | 2 +- osu.Game/OsuGame.cs | 2 +- osu.Game/OsuGameBase.cs | 10 ++-- osu.Game/Overlays/ChatOverlay.cs | 2 +- .../Sections/Audio/MainMenuSettings.cs | 4 +- .../Settings/Sections/Audio/OffsetSettings.cs | 2 +- .../Sections/Gameplay/GeneralSettings.cs | 6 +- .../Sections/Gameplay/SongSelectSettings.cs | 4 +- .../Sections/General/LoginSettings.cs | 4 +- .../Sections/General/UpdateSettings.cs | 2 +- .../Sections/Graphics/DetailSettings.cs | 4 +- .../Sections/Graphics/MainMenuSettings.cs | 2 +- .../Sections/Graphics/RendererSettings.cs | 2 +- .../Settings/Sections/Input/MouseSettings.cs | 4 +- .../Overlays/Settings/Sections/SkinSection.cs | 4 +- osu.Game/Screens/Menu/Intro.cs | 4 +- osu.Game/Screens/Menu/MainMenu.cs | 2 +- osu.Game/Screens/Play/HUDOverlay.cs | 4 +- osu.Game/Screens/Play/Player.cs | 6 +- osu.Game/Screens/Play/PlayerInputManager.cs | 2 +- .../Select/BeatmapDetailAreaTabControl.cs | 2 +- 25 files changed, 70 insertions(+), 70 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs index b23fdde4e8..8b9441ea65 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs @@ -97,8 +97,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces [BackgroundDependencyLoader] private void load(OsuConfigManager config) { - snakingIn = config.GetBindable(OsuConfig.SnakingInSliders); - snakingOut = config.GetBindable(OsuConfig.SnakingOutSliders); + snakingIn = config.GetBindable(OsuSetting.SnakingInSliders); + snakingOut = config.GetBindable(OsuSetting.SnakingOutSliders); reloadTexture(); } diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index ba19d8592a..14f83ed11f 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -8,71 +8,71 @@ using osu.Game.Screens.Select; namespace osu.Game.Configuration { - public class OsuConfigManager : ConfigManager + public class OsuConfigManager : ConfigManager { protected override void InitialiseDefaults() { // UI/selection defaults - Set(OsuConfig.Ruleset, 0, 0, int.MaxValue); - Set(OsuConfig.BeatmapDetailTab, BeatmapDetailTab.Details); + Set(OsuSetting.Ruleset, 0, 0, int.MaxValue); + Set(OsuSetting.BeatmapDetailTab, BeatmapDetailTab.Details); - Set(OsuConfig.DisplayStarsMinimum, 0.0, 0, 10); - Set(OsuConfig.DisplayStarsMaximum, 10.0, 0, 10); + Set(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10); + Set(OsuSetting.DisplayStarsMaximum, 10.0, 0, 10); - Set(OsuConfig.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1); + Set(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1); // Online settings - Set(OsuConfig.Username, string.Empty); - Set(OsuConfig.Token, string.Empty); + Set(OsuSetting.Username, string.Empty); + Set(OsuSetting.Token, string.Empty); - Set(OsuConfig.SavePassword, false).ValueChanged += val => + Set(OsuSetting.SavePassword, false).ValueChanged += val => { - if (val) Set(OsuConfig.SaveUsername, true); + if (val) Set(OsuSetting.SaveUsername, true); }; - Set(OsuConfig.SaveUsername, true).ValueChanged += val => + Set(OsuSetting.SaveUsername, true).ValueChanged += val => { - if (!val) Set(OsuConfig.SavePassword, false); + if (!val) Set(OsuSetting.SavePassword, false); }; // Audio - Set(OsuConfig.AudioDevice, string.Empty); + Set(OsuSetting.AudioDevice, string.Empty); - Set(OsuConfig.MenuVoice, true); - Set(OsuConfig.MenuMusic, true); + Set(OsuSetting.MenuVoice, true); + Set(OsuSetting.MenuMusic, true); - Set(OsuConfig.AudioOffset, 0, -500.0, 500.0); + Set(OsuSetting.AudioOffset, 0, -500.0, 500.0); // Input - Set(OsuConfig.MenuCursorSize, 1.0, 0.5f, 2); - Set(OsuConfig.GameplayCursorSize, 1.0, 0.5f, 2); + Set(OsuSetting.MenuCursorSize, 1.0, 0.5f, 2); + Set(OsuSetting.GameplayCursorSize, 1.0, 0.5f, 2); - Set(OsuConfig.MouseDisableButtons, false); - Set(OsuConfig.MouseDisableWheel, false); + Set(OsuSetting.MouseDisableButtons, false); + Set(OsuSetting.MouseDisableWheel, false); // Graphics - Set(OsuConfig.ShowFpsDisplay, false); + Set(OsuSetting.ShowFpsDisplay, false); - Set(OsuConfig.MenuParallax, true); + Set(OsuSetting.MenuParallax, true); - Set(OsuConfig.SnakingInSliders, true); - Set(OsuConfig.SnakingOutSliders, true); + Set(OsuSetting.SnakingInSliders, true); + Set(OsuSetting.SnakingOutSliders, true); // Gameplay - Set(OsuConfig.DimLevel, 0.3, 0, 1); + Set(OsuSetting.DimLevel, 0.3, 0, 1); - Set(OsuConfig.ShowInterface, true); - Set(OsuConfig.KeyOverlay, false); + Set(OsuSetting.ShowInterface, true); + Set(OsuSetting.KeyOverlay, false); // Update - Set(OsuConfig.ReleaseStream, ReleaseStream.Lazer); + Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer); } public OsuConfigManager(Storage storage) : base(storage) @@ -80,7 +80,7 @@ namespace osu.Game.Configuration } } - public enum OsuConfig + public enum OsuSetting { Ruleset, Token, diff --git a/osu.Game/Graphics/Containers/ParallaxContainer.cs b/osu.Game/Graphics/Containers/ParallaxContainer.cs index 8352656f8e..2d5952a3ce 100644 --- a/osu.Game/Graphics/Containers/ParallaxContainer.cs +++ b/osu.Game/Graphics/Containers/ParallaxContainer.cs @@ -39,7 +39,7 @@ namespace osu.Game.Graphics.Containers private void load(UserInputManager input, OsuConfigManager config) { this.input = input; - parallaxEnabled = config.GetBindable(OsuConfig.MenuParallax); + parallaxEnabled = config.GetBindable(OsuSetting.MenuParallax); parallaxEnabled.ValueChanged += delegate { if (!parallaxEnabled) diff --git a/osu.Game/Graphics/Cursor/GameplayCursor.cs b/osu.Game/Graphics/Cursor/GameplayCursor.cs index 3f699219a4..dcdbe675b4 100644 --- a/osu.Game/Graphics/Cursor/GameplayCursor.cs +++ b/osu.Game/Graphics/Cursor/GameplayCursor.cs @@ -114,7 +114,7 @@ namespace osu.Game.Graphics.Cursor }, }; - cursorScale = config.GetBindable(OsuConfig.GameplayCursorSize); + cursorScale = config.GetBindable(OsuSetting.GameplayCursorSize); cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)cursorScale); cursorScale.TriggerChange(); } diff --git a/osu.Game/Graphics/Cursor/MenuCursor.cs b/osu.Game/Graphics/Cursor/MenuCursor.cs index 8d5f95aad5..b48ab879a6 100644 --- a/osu.Game/Graphics/Cursor/MenuCursor.cs +++ b/osu.Game/Graphics/Cursor/MenuCursor.cs @@ -128,7 +128,7 @@ namespace osu.Game.Graphics.Cursor } }; - cursorScale = config.GetBindable(OsuConfig.MenuCursorSize); + cursorScale = config.GetBindable(OsuSetting.MenuCursorSize); cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)newScale); cursorScale.TriggerChange(); } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 8d9d5cd26c..9ce725661b 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -88,7 +88,7 @@ namespace osu.Game Dependencies.Cache(this); - configRuleset = LocalConfig.GetBindable(OsuConfig.Ruleset); + configRuleset = LocalConfig.GetBindable(OsuSetting.Ruleset); Ruleset.Value = RulesetDatabase.GetRuleset(configRuleset.Value); Ruleset.ValueChanged += r => configRuleset.Value = r.ID ?? 0; } diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index a814b5f125..7e16030ec3 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -125,8 +125,8 @@ namespace osu.Game Dependencies.Cache(API = new APIAccess { - Username = LocalConfig.Get(OsuConfig.Username), - Token = LocalConfig.Get(OsuConfig.Token) + Username = LocalConfig.Get(OsuSetting.Username), + Token = LocalConfig.Get(OsuSetting.Token) }); API.Register(this); @@ -137,7 +137,7 @@ namespace osu.Game switch (state) { case APIState.Online: - LocalConfig.Set(OsuConfig.Username, LocalConfig.Get(OsuConfig.SaveUsername) ? API.Username : string.Empty); + LocalConfig.Set(OsuSetting.Username, LocalConfig.Get(OsuSetting.SaveUsername) ? API.Username : string.Empty); break; } } @@ -166,7 +166,7 @@ namespace osu.Game // TODO: This is temporary until we reimplement the local FPS display. // It's just to allow end-users to access the framework FPS display without knowing the shortcut key. - fpsDisplayVisible = LocalConfig.GetBindable(OsuConfig.ShowFpsDisplay); + fpsDisplayVisible = LocalConfig.GetBindable(OsuSetting.ShowFpsDisplay); fpsDisplayVisible.ValueChanged += val => { FrameStatisticsMode = val ? FrameStatisticsMode.Minimal : FrameStatisticsMode.None; @@ -192,7 +192,7 @@ namespace osu.Game //refresh token may have changed. if (LocalConfig != null && API != null) { - LocalConfig.Set(OsuConfig.Token, LocalConfig.Get(OsuConfig.SavePassword) ? API.Token : string.Empty); + LocalConfig.Set(OsuSetting.Token, LocalConfig.Get(OsuSetting.SavePassword) ? API.Token : string.Empty); LocalConfig.Save(); } diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 15f8586125..7c5651b5ff 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -195,7 +195,7 @@ namespace osu.Game.Overlays this.api = api; api.Register(this); - chatHeight = config.GetBindable(OsuConfig.ChatDisplayHeight); + chatHeight = config.GetBindable(OsuSetting.ChatDisplayHeight); chatHeight.ValueChanged += h => { Height = (float)h; diff --git a/osu.Game/Overlays/Settings/Sections/Audio/MainMenuSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/MainMenuSettings.cs index 8101720d04..41a1bad364 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/MainMenuSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/MainMenuSettings.cs @@ -18,12 +18,12 @@ namespace osu.Game.Overlays.Settings.Sections.Audio new SettingsCheckbox { LabelText = "Interface voices", - Bindable = config.GetBindable(OsuConfig.MenuVoice) + Bindable = config.GetBindable(OsuSetting.MenuVoice) }, new SettingsCheckbox { LabelText = "osu! music theme", - Bindable = config.GetBindable(OsuConfig.MenuMusic) + Bindable = config.GetBindable(OsuSetting.MenuMusic) }, }; } diff --git a/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs index 593002eb36..bc09a2145a 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs @@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio new SettingsSlider { LabelText = "Audio Offset", - Bindable = config.GetBindable(OsuConfig.AudioOffset) + Bindable = config.GetBindable(OsuSetting.AudioOffset) }, new OsuButton { diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs index 770ec3aaf3..a8ec04514a 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs @@ -19,17 +19,17 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay new SettingsSlider { LabelText = "Background dim", - Bindable = config.GetBindable(OsuConfig.DimLevel) + Bindable = config.GetBindable(OsuSetting.DimLevel) }, new SettingsCheckbox { LabelText = "Show score overlay", - Bindable = config.GetBindable(OsuConfig.ShowInterface) + Bindable = config.GetBindable(OsuSetting.ShowInterface) }, new SettingsCheckbox { LabelText = "Always show key overlay", - Bindable = config.GetBindable(OsuConfig.KeyOverlay) + Bindable = config.GetBindable(OsuSetting.KeyOverlay) }, }; } diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs index 14d6f36535..7626911627 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs @@ -20,12 +20,12 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay new SettingsSlider { LabelText = "Display beatmaps from", - Bindable = config.GetBindable(OsuConfig.DisplayStarsMinimum) + Bindable = config.GetBindable(OsuSetting.DisplayStarsMinimum) }, new SettingsSlider { LabelText = "up to", - Bindable = config.GetBindable(OsuConfig.DisplayStarsMaximum) + Bindable = config.GetBindable(OsuSetting.DisplayStarsMaximum) }, }; } diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index 3193c2eb5a..86a47d8a95 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs @@ -135,12 +135,12 @@ namespace osu.Game.Overlays.Settings.Sections.General new SettingsCheckbox { LabelText = "Remember username", - Bindable = config.GetBindable(OsuConfig.SaveUsername), + Bindable = config.GetBindable(OsuSetting.SaveUsername), }, new SettingsCheckbox { LabelText = "Stay logged in", - Bindable = config.GetBindable(OsuConfig.SavePassword), + Bindable = config.GetBindable(OsuSetting.SavePassword), }, new OsuButton { diff --git a/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs index 3f2f073bff..3ceb8d2ff4 100644 --- a/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs @@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Settings.Sections.General new SettingsEnumDropdown { LabelText = "Release stream", - Bindable = config.GetBindable(OsuConfig.ReleaseStream), + Bindable = config.GetBindable(OsuSetting.ReleaseStream), }, new OsuButton { diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/DetailSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/DetailSettings.cs index 5bfb8a4373..78eab6ebd8 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/DetailSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/DetailSettings.cs @@ -19,12 +19,12 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics new SettingsCheckbox { LabelText = "Snaking in sliders", - Bindable = config.GetBindable(OsuConfig.SnakingInSliders) + Bindable = config.GetBindable(OsuSetting.SnakingInSliders) }, new SettingsCheckbox { LabelText = "Snaking out sliders", - Bindable = config.GetBindable(OsuConfig.SnakingOutSliders) + Bindable = config.GetBindable(OsuSetting.SnakingOutSliders) }, }; } diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/MainMenuSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/MainMenuSettings.cs index fd135e336f..7fe5be2fa1 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/MainMenuSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/MainMenuSettings.cs @@ -18,7 +18,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics new SettingsCheckbox { LabelText = "Parallax", - Bindable = config.GetBindable(OsuConfig.MenuParallax) + Bindable = config.GetBindable(OsuSetting.MenuParallax) }, }; } diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs index 0c79c8cd42..8e84a25bb9 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs @@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics new SettingsCheckbox { LabelText = "Show FPS", - Bindable = osuConfig.GetBindable(OsuConfig.ShowFpsDisplay) + Bindable = osuConfig.GetBindable(OsuSetting.ShowFpsDisplay) }, }; } diff --git a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs index 7bf42fd7e7..9cf5c42319 100644 --- a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs @@ -27,12 +27,12 @@ namespace osu.Game.Overlays.Settings.Sections.Input new SettingsCheckbox { LabelText = "Disable mouse wheel during gameplay", - Bindable = osuConfig.GetBindable(OsuConfig.MouseDisableWheel) + Bindable = osuConfig.GetBindable(OsuSetting.MouseDisableWheel) }, new SettingsCheckbox { LabelText = "Disable mouse buttons during gameplay", - Bindable = osuConfig.GetBindable(OsuConfig.MouseDisableButtons) + Bindable = osuConfig.GetBindable(OsuSetting.MouseDisableButtons) }, }; } diff --git a/osu.Game/Overlays/Settings/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs index cc416f45ca..46bc899499 100644 --- a/osu.Game/Overlays/Settings/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Settings/Sections/SkinSection.cs @@ -24,12 +24,12 @@ namespace osu.Game.Overlays.Settings.Sections new SettingsSlider { LabelText = "Menu cursor size", - Bindable = config.GetBindable(OsuConfig.MenuCursorSize) + Bindable = config.GetBindable(OsuSetting.MenuCursorSize) }, new SettingsSlider { LabelText = "Gameplay cursor size", - Bindable = config.GetBindable(OsuConfig.GameplayCursorSize) + Bindable = config.GetBindable(OsuSetting.GameplayCursorSize) }, }; } diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 92032e5120..01659edd72 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -64,8 +64,8 @@ namespace osu.Game.Screens.Menu [BackgroundDependencyLoader] private void load(AudioManager audio, OsuConfigManager config) { - menuVoice = config.GetBindable(OsuConfig.MenuVoice); - menuMusic = config.GetBindable(OsuConfig.MenuMusic); + menuVoice = config.GetBindable(OsuSetting.MenuVoice); + menuMusic = config.GetBindable(OsuSetting.MenuMusic); bgm = audio.Track.Get(@"circles"); bgm.Looping = true; diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 3e03a9aac8..71d020b0f2 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -66,7 +66,7 @@ namespace osu.Game.Screens.Menu [BackgroundDependencyLoader] private void load(OsuGame game, OsuConfigManager config, BeatmapDatabase beatmaps) { - menuMusic = config.GetBindable(OsuConfig.MenuMusic); + menuMusic = config.GetBindable(OsuSetting.MenuMusic); LoadComponentAsync(background); if (!menuMusic) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 12e2cb197e..1e57c2ba2a 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -67,7 +67,7 @@ namespace osu.Game.Screens.Play [BackgroundDependencyLoader(true)] private void load(OsuConfigManager config, NotificationManager notificationManager) { - showKeyCounter = config.GetBindable(OsuConfig.KeyOverlay); + showKeyCounter = config.GetBindable(OsuSetting.KeyOverlay); showKeyCounter.ValueChanged += keyCounterVisibility => { if (keyCounterVisibility) @@ -77,7 +77,7 @@ namespace osu.Game.Screens.Play }; showKeyCounter.TriggerChange(); - showHud = config.GetBindable(OsuConfig.ShowInterface); + showHud = config.GetBindable(OsuSetting.ShowInterface); showHud.ValueChanged += hudVisibility => { if (hudVisibility) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 7b910c11e5..de390b63b3 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -79,8 +79,8 @@ namespace osu.Game.Screens.Play [BackgroundDependencyLoader(permitNulls: true)] private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config, OsuGame osu) { - dimLevel = config.GetBindable(OsuConfig.DimLevel); - mouseWheelDisabled = config.GetBindable(OsuConfig.MouseDisableWheel); + dimLevel = config.GetBindable(OsuSetting.DimLevel); + mouseWheelDisabled = config.GetBindable(OsuSetting.MouseDisableWheel); Ruleset rulesetInstance; @@ -138,7 +138,7 @@ namespace osu.Game.Screens.Play offsetClock = new FramedOffsetClock(decoupledClock); - userAudioOffset = config.GetBindable(OsuConfig.AudioOffset); + userAudioOffset = config.GetBindable(OsuSetting.AudioOffset); userAudioOffset.ValueChanged += v => offsetClock.Offset = v; userAudioOffset.TriggerChange(); diff --git a/osu.Game/Screens/Play/PlayerInputManager.cs b/osu.Game/Screens/Play/PlayerInputManager.cs index 9707ccbc35..f5e57f9e9d 100644 --- a/osu.Game/Screens/Play/PlayerInputManager.cs +++ b/osu.Game/Screens/Play/PlayerInputManager.cs @@ -40,7 +40,7 @@ namespace osu.Game.Screens.Play [BackgroundDependencyLoader] private void load(OsuConfigManager config) { - mouseDisabled = config.GetBindable(OsuConfig.MouseDisableButtons); + mouseDisabled = config.GetBindable(OsuSetting.MouseDisableButtons); } protected override void LoadComplete() diff --git a/osu.Game/Screens/Select/BeatmapDetailAreaTabControl.cs b/osu.Game/Screens/Select/BeatmapDetailAreaTabControl.cs index 51ec6f7707..e3c95d42a1 100644 --- a/osu.Game/Screens/Select/BeatmapDetailAreaTabControl.cs +++ b/osu.Game/Screens/Select/BeatmapDetailAreaTabControl.cs @@ -35,7 +35,7 @@ namespace osu.Game.Screens.Select { modsCheckbox.AccentColour = tabs.AccentColour = colour.YellowLight; - selectedTab = config.GetBindable(OsuConfig.BeatmapDetailTab); + selectedTab = config.GetBindable(OsuSetting.BeatmapDetailTab); tabs.Current.BindTo(selectedTab); tabs.Current.TriggerChange(); From d969507f65a8d3fde2a18acb4c191dfcef7cbcda Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 15 May 2017 11:14:19 +0900 Subject: [PATCH 62/74] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index f699dfe3c9..fa44e5a47e 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit f699dfe3c995c43b15cd66ec094d628bac1697c0 +Subproject commit fa44e5a47e20956b12e598e85159a1a25b500b3c From f73076918607487569b5aaf66283fbc0fbc27ed8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 15 May 2017 12:54:56 +0900 Subject: [PATCH 63/74] Rewrite to make better --- osu.Game/Database/BeatmapDifficulty.cs | 13 ++++++--- osu.Game/Graphics/Cursor/GameplayCursor.cs | 32 ++++++++++++++-------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/osu.Game/Database/BeatmapDifficulty.cs b/osu.Game/Database/BeatmapDifficulty.cs index 7c9f47e7b6..cf1305f705 100644 --- a/osu.Game/Database/BeatmapDifficulty.cs +++ b/osu.Game/Database/BeatmapDifficulty.cs @@ -7,12 +7,17 @@ namespace osu.Game.Database { public class BeatmapDifficulty { + /// + /// The default value used for all difficulty settings except and . + /// + public const float DEFAULT_DIFFICULTY = 5; + [PrimaryKey, AutoIncrement] public int ID { get; set; } - public float DrainRate { get; set; } = 5; - public float CircleSize { get; set; } = 5; - public float OverallDifficulty { get; set; } = 5; - public float ApproachRate { get; set; } = 5; + public float DrainRate { get; set; } = DEFAULT_DIFFICULTY; + public float CircleSize { get; set; } = DEFAULT_DIFFICULTY; + public float OverallDifficulty { get; set; } = DEFAULT_DIFFICULTY; + public float ApproachRate { get; set; } = DEFAULT_DIFFICULTY; public float SliderMultiplier { get; set; } = 1; public float SliderTickRate { get; set; } = 1; diff --git a/osu.Game/Graphics/Cursor/GameplayCursor.cs b/osu.Game/Graphics/Cursor/GameplayCursor.cs index 766371c07d..801fe1d011 100644 --- a/osu.Game/Graphics/Cursor/GameplayCursor.cs +++ b/osu.Game/Graphics/Cursor/GameplayCursor.cs @@ -11,7 +11,9 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Sprites; using osu.Framework.Input; +using osu.Game.Beatmaps; using osu.Game.Configuration; +using osu.Game.Database; namespace osu.Game.Graphics.Cursor { @@ -41,14 +43,10 @@ namespace osu.Game.Graphics.Cursor public class OsuCursor : Container { private Container cursorContainer; + private Bindable cursorScale; private Bindable autoCursorScale; - - - private float beatmapCircleSize; - private const int default_circle_size = 5; - private float autoScaleMultiplier => autoCursorScale ? (float)(1 - 0.7 * (beatmapCircleSize - 4) / 5) : 1f; - + private Bindable beatmap; public OsuCursor() { @@ -121,19 +119,29 @@ namespace osu.Game.Graphics.Cursor }, }; - beatmapCircleSize = game.Beatmap.Value?.Beatmap.BeatmapInfo.Difficulty.CircleSize ?? default_circle_size; + beatmap = game.Beatmap.GetBoundCopy(); + beatmap.ValueChanged += v => calculateScale(); cursorScale = config.GetBindable(OsuSetting.GameplayCursorSize); - autoCursorScale = config.GetBindable(OsuSetting.AutoCursorSize); + cursorScale.ValueChanged += v => calculateScale(); - cursorScale.ValueChanged += newValue => calculateScale(); - autoCursorScale.ValueChanged += newValue => calculateScale(); - cursorScale.TriggerChange(); + autoCursorScale = config.GetBindable(OsuSetting.AutoCursorSize); + autoCursorScale.ValueChanged += v => calculateScale(); + + calculateScale(); } private void calculateScale() { - cursorContainer.Scale = new Vector2((float)(autoScaleMultiplier * cursorScale)); + float scale = (float)cursorScale.Value; + + if (autoCursorScale && beatmap.Value != null) + { + // if we have a beatmap available, let's get its circle size to figure out an automatic cursor scale modifier. + scale *= (float)(1 - 0.7 * (1 + beatmap.Value.BeatmapInfo.Difficulty.CircleSize - BeatmapDifficulty.DEFAULT_DIFFICULTY) / BeatmapDifficulty.DEFAULT_DIFFICULTY); + } + + cursorContainer.Scale = new Vector2(scale); } } } From 1f3039926fb7e1de6d1d56e783531fb92e8839cd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 15 May 2017 12:57:55 +0900 Subject: [PATCH 64/74] Reword settings text slightly --- osu.Game/Overlays/Settings/Sections/SkinSection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs index ddf13e9bbe..4b4426aca8 100644 --- a/osu.Game/Overlays/Settings/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Settings/Sections/SkinSection.cs @@ -33,7 +33,7 @@ namespace osu.Game.Overlays.Settings.Sections }, new SettingsCheckbox { - LabelText = "Automatic gameplay cursor size", + LabelText = "Adjust gameplay cursor size based on current beatmap", Bindable = config.GetBindable(OsuSetting.AutoCursorSize) }, }; From dcd4b4450d4fa41d165e4714f22f6078ce80b4e2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 15 May 2017 13:26:35 +0900 Subject: [PATCH 65/74] Add error message in chat when attempting to use commands --- osu.Game/Online/Chat/Channel.cs | 4 +- osu.Game/Online/Chat/ErrorMessage.cs | 25 ++++++++++ osu.Game/Online/Chat/Message.cs | 5 ++ osu.Game/Overlays/ChatOverlay.cs | 69 +++++++++++++++------------- osu.Game/osu.Game.csproj | 1 + 5 files changed, 71 insertions(+), 33 deletions(-) create mode 100644 osu.Game/Online/Chat/ErrorMessage.cs diff --git a/osu.Game/Online/Chat/Channel.cs b/osu.Game/Online/Chat/Channel.cs index d159f482a9..2925c3ccb4 100644 --- a/osu.Game/Online/Chat/Channel.cs +++ b/osu.Game/Online/Chat/Channel.cs @@ -38,9 +38,9 @@ namespace osu.Game.Online.Chat public event Action> NewMessagesArrived; - public void AddNewMessages(IEnumerable messages) + public void AddNewMessages(params Message[] messages) { - messages = messages.Except(Messages).ToList(); + messages = messages.Except(Messages).ToArray(); Messages.AddRange(messages); diff --git a/osu.Game/Online/Chat/ErrorMessage.cs b/osu.Game/Online/Chat/ErrorMessage.cs new file mode 100644 index 0000000000..a410e9044a --- /dev/null +++ b/osu.Game/Online/Chat/ErrorMessage.cs @@ -0,0 +1,25 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using osu.Game.Users; + +namespace osu.Game.Online.Chat +{ + public class ErrorMessage : Message + { + private static int errorId = -1; + + public ErrorMessage(string message) : base(errorId--) + { + Timestamp = DateTime.Now; + Content = message; + + Sender = new User + { + Username = @"system", + Colour = @"ff0000", + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Online/Chat/Message.cs b/osu.Game/Online/Chat/Message.cs index 372e43be38..bf53a68910 100644 --- a/osu.Game/Online/Chat/Message.cs +++ b/osu.Game/Online/Chat/Message.cs @@ -37,6 +37,11 @@ namespace osu.Game.Online.Chat { } + public Message(long id) + { + Id = id; + } + public override bool Equals(object obj) { var objMessage = obj as Message; diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 7c5651b5ff..d43d0b22aa 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -306,7 +306,7 @@ namespace osu.Game.Overlays //batch messages per channel. foreach (var id in ids) - careChannels.Find(c => c.Id == id)?.AddNewMessages(messages.Where(m => m.TargetId == id)); + careChannels.Find(c => c.Id == id)?.AddNewMessages(messages.Where(m => m.TargetId == id).ToArray()); lastMessageId = messages.LastOrDefault()?.Id ?? lastMessageId; @@ -326,38 +326,45 @@ namespace osu.Game.Overlays { var postText = textbox.Text; - if (!string.IsNullOrEmpty(postText) && api.LocalUser.Value != null) + if (string.IsNullOrEmpty(postText) || api.LocalUser.Value == null) return; + + if (currentChannel == null) return; + + if (postText[0] == '/') { - if (currentChannel == null) return; - - var message = new Message - { - Sender = api.LocalUser.Value, - Timestamp = DateTimeOffset.Now, - TargetType = TargetType.Channel, //TODO: read this from currentChannel - TargetId = currentChannel.Id, - Content = postText - }; - - textbox.ReadOnly = true; - var req = new PostMessageRequest(message); - - req.Failure += e => - { - textbox.FlashColour(Color4.Red, 1000); - textbox.ReadOnly = false; - }; - - req.Success += m => - { - currentChannel.AddNewMessages(new[] { m }); - - textbox.ReadOnly = false; - textbox.Text = string.Empty; - }; - - api.Queue(req); + // TODO: handle commands + currentChannel.AddNewMessages(new ErrorMessage("Chat commands are not supported yet!")); + textbox.Text = string.Empty; + return; } + + var message = new Message + { + Sender = api.LocalUser.Value, + Timestamp = DateTimeOffset.Now, + TargetType = TargetType.Channel, //TODO: read this from currentChannel + TargetId = currentChannel.Id, + Content = postText + }; + + textbox.ReadOnly = true; + var req = new PostMessageRequest(message); + + req.Failure += e => + { + textbox.FlashColour(Color4.Red, 1000); + textbox.ReadOnly = false; + }; + + req.Success += m => + { + currentChannel.AddNewMessages(m); + + textbox.ReadOnly = false; + textbox.Text = string.Empty; + }; + + api.Queue(req); } } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 1f866f0e17..919b2bb732 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -75,6 +75,7 @@ + From 3b1d5ce7df2881d981d507fb602f12ebefc600f9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 15 May 2017 13:31:51 +0900 Subject: [PATCH 66/74] CI fix --- osu.Game/Overlays/ChatOverlay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index d43d0b22aa..111d3e5eb4 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -337,7 +337,7 @@ namespace osu.Game.Overlays textbox.Text = string.Empty; return; } - + var message = new Message { Sender = api.LocalUser.Value, From fa889c4340a9295d7862530041b2d0c08aaf315a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 15 May 2017 16:20:02 +0900 Subject: [PATCH 67/74] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index fa44e5a47e..7146c07159 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit fa44e5a47e20956b12e598e85159a1a25b500b3c +Subproject commit 7146c07159d2cf3d07a8d371fa50ef8b200ba038 From 23760d6805251e7f499e196421ba91d47b760008 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 15 May 2017 19:36:03 +0900 Subject: [PATCH 68/74] Adjust osu! logo metrics and add shockwave impact animation --- osu-resources | 2 +- osu.Game/Screens/Menu/ButtonSystem.cs | 6 ++++ osu.Game/Screens/Menu/OsuLogo.cs | 42 ++++++++++++++++++++++++--- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/osu-resources b/osu-resources index b90c4ed490..ffccbeb98d 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit b90c4ed490f76f2995662b3a8af3a32b8756a012 +Subproject commit ffccbeb98dc9e8f0965520270b5885e63f244c83 diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 2f418d2f88..72db445052 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -245,8 +245,14 @@ namespace osu.Game.Screens.Menu buttonArea.FadeIn(300); if (lastState == MenuState.Initial) + { buttonArea.Delay(150, true); + if (osuLogo.Scale.X > 0.5f) + using (osuLogo.BeginDelayedSequence(200, true)) + osuLogo.Impact(); + } + Scheduler.AddDelayed(() => toolbar?.Show(), 150); foreach (Button b in buttonsTopLevel) diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index f3fffedd43..e28adeacff 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -35,7 +35,7 @@ namespace osu.Game.Screens.Menu public Action Action; - public float SizeForFlow => logo == null ? 0 : logo.DrawSize.X * logo.Scale.X * logoBounceContainer.Scale.X * logoHoverContainer.Scale.X * 0.78f; + public float SizeForFlow => logo == null ? 0 : logo.DrawSize.X * logo.Scale.X * logoBounceContainer.Scale.X * logoHoverContainer.Scale.X * 0.74f; private readonly Sprite ripple; @@ -63,8 +63,14 @@ namespace osu.Game.Screens.Menu public bool Interactive = true; private readonly Box flashLayer; + private readonly Container impactContainer; + + private const float default_size = 480; + public OsuLogo() { + Size = new Vector2(default_size); + Anchor = Anchor.Centre; Origin = Anchor.Centre; @@ -92,7 +98,7 @@ namespace osu.Game.Screens.Menu Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, - Scale = new Vector2(0.8f), + Scale = new Vector2(0.88f), Masking = true, Children = new Drawable[] { @@ -137,6 +143,7 @@ namespace osu.Game.Screens.Menu { Anchor = Anchor.Centre, Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, Children = new Drawable[] { ripple = new Sprite @@ -148,11 +155,30 @@ namespace osu.Game.Screens.Menu } } }, + impactContainer = new CircularContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Alpha = 0, + BorderColour = Color4.White, + RelativeSizeAxes = Axes.Both, + BorderThickness = 10, + Masking = true, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + AlwaysPresent = true, + Alpha = 0, + } + } + }, new MenuVisualisation { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Size = logo.Size, + RelativeSizeAxes = Axes.Both, BlendingMode = BlendingMode.Additive, Alpha = 0.2f, } @@ -211,7 +237,8 @@ namespace osu.Game.Screens.Menu protected override bool OnHover(InputState state) { if (!Interactive) return false; - logoHoverContainer.ScaleTo(1.2f, 500, EasingTypes.OutElastic); + + logoHoverContainer.ScaleTo(1.1f, 500, EasingTypes.OutElastic); return true; } @@ -219,5 +246,12 @@ namespace osu.Game.Screens.Menu { logoHoverContainer.ScaleTo(1, 500, EasingTypes.OutElastic); } + + public void Impact() + { + impactContainer.FadeOutFromOne(250, EasingTypes.In); + impactContainer.ScaleTo(0.96f); + impactContainer.ScaleTo(1.12f, 250); + } } } \ No newline at end of file From efab186384aefe32c8353416da2287a5dc59b356 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 16 May 2017 12:50:30 +0900 Subject: [PATCH 69/74] Update namespaces in line with framework --- osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetails.cs | 1 - osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs | 1 - osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs | 2 +- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 1 - .../Objects/Drawables/Pieces/ElongatedCirclePiece.cs | 2 +- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs | 1 - osu.Game/Beatmaps/Drawables/BeatmapPanel.cs | 1 - osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs | 1 - osu.Game/Graphics/Cursor/TooltipContainer.cs | 1 - osu.Game/Graphics/UserInterface/OsuCheckbox.cs | 1 - osu.Game/Graphics/UserInterface/OsuDropdown.cs | 1 - osu.Game/Graphics/UserInterface/OsuMenu.cs | 1 - osu.Game/Graphics/UserInterface/OsuTabControl.cs | 1 - osu.Game/Graphics/UserInterface/OsuTabControlCheckbox.cs | 1 - osu.Game/Graphics/UserInterface/OsuTextBox.cs | 1 - osu.Game/Graphics/UserInterface/SearchTextBox.cs | 1 - osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs | 1 - osu.Game/OsuGame.cs | 1 - osu.Game/Overlays/Chat/ChatLine.cs | 1 - osu.Game/Overlays/Chat/ChatTabControl.cs | 1 - osu.Game/Overlays/Chat/DrawableChannel.cs | 1 - osu.Game/Overlays/ChatOverlay.cs | 1 - osu.Game/Overlays/Dialog/PopupDialog.cs | 1 - osu.Game/Overlays/LoginOverlay.cs | 1 - osu.Game/Overlays/Mods/ModSection.cs | 1 - osu.Game/Overlays/Mods/ModSelectOverlay.cs | 1 - osu.Game/Overlays/Music/FilterControl.cs | 1 - osu.Game/Overlays/Music/PlaylistItem.cs | 1 - osu.Game/Overlays/Music/PlaylistOverlay.cs | 1 - osu.Game/Overlays/MusicController.cs | 1 - osu.Game/Overlays/NotificationManager.cs | 1 - osu.Game/Overlays/Notifications/Notification.cs | 1 - osu.Game/Overlays/Notifications/NotificationSection.cs | 1 - osu.Game/Overlays/Settings/SettingsDropdown.cs | 1 - osu.Game/Overlays/Settings/SettingsFooter.cs | 1 - osu.Game/Overlays/Settings/SettingsHeader.cs | 1 - osu.Game/Overlays/Settings/SettingsItem.cs | 1 - osu.Game/Overlays/Settings/SettingsSection.cs | 1 - osu.Game/Overlays/Settings/SettingsSlider.cs | 1 - osu.Game/Overlays/Settings/SettingsSubsection.cs | 1 - osu.Game/Overlays/SettingsOverlay.cs | 1 - osu.Game/Overlays/Toolbar/ToolbarButton.cs | 1 - osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs | 1 - osu.Game/Screens/Menu/Disclaimer.cs | 1 - osu.Game/Screens/Play/HUD/ComboCounter.cs | 1 - osu.Game/Screens/Play/HUD/ModDisplay.cs | 1 - osu.Game/Screens/Play/Pause/PauseProgressBar.cs | 1 - osu.Game/Screens/Play/PlayerLoader.cs | 1 - osu.Game/Screens/Play/SongProgress.cs | 1 - osu.Game/Screens/Play/SongProgressInfo.cs | 1 - osu.Game/Screens/Play/StandardHUDOverlay.cs | 1 - osu.Game/Screens/Ranking/ResultModeTabControl.cs | 1 - osu.Game/Screens/Ranking/Results.cs | 1 - osu.Game/Screens/Ranking/ResultsPageScore.cs | 1 - osu.Game/Screens/Select/BeatmapDetailArea.cs | 1 - osu.Game/Screens/Select/BeatmapDetails.cs | 1 - osu.Game/Screens/Select/BeatmapInfoWedge.cs | 1 - osu.Game/Screens/Select/FilterControl.cs | 1 - osu.Game/Screens/Select/Leaderboards/Leaderboard.cs | 1 - osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs | 1 - osu.Game/Screens/Select/Options/BeatmapOptionsButton.cs | 1 - osu.Game/Screens/Select/PlaySongSelect.cs | 1 - osu.Game/Screens/Select/SongSelect.cs | 1 - osu.Game/Screens/Tournament/Drawings.cs | 1 - osu.Game/Screens/Tournament/Group.cs | 1 - 65 files changed, 2 insertions(+), 65 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetails.cs b/osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetails.cs index 4a59ad9534..58cbad936a 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetails.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetails.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; -using osu.Framework.Graphics.Primitives; using osu.Framework.Testing; using osu.Game.Database; using osu.Game.Screens.Select; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs b/osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs index cfa66f12ed..f86fa4dab5 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs @@ -3,7 +3,6 @@ using OpenTK; using osu.Framework.Graphics; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.MathUtils; using osu.Framework.Testing; diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs b/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs index b72abd1992..96933a15e7 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTabControl.cs @@ -1,8 +1,8 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Graphics; using OpenTK; -using osu.Framework.Graphics.Primitives; using osu.Framework.Testing; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 438c1f4b5f..487304d7f3 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -10,7 +10,6 @@ using OpenTK.Graphics; using osu.Game.Rulesets.Mania.Judgements; using osu.Framework.Graphics.Containers; using System; -using osu.Framework.Graphics.Primitives; using osu.Game.Graphics; using osu.Framework.Allocation; using OpenTK.Input; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs index bed54d358e..f607e2040f 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using osu.Framework.Graphics.Primitives; +using osu.Framework.Graphics; namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces { diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index 23c7606a15..2278158506 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -13,7 +13,6 @@ using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Extensions.Color4Extensions; -using osu.Framework.Graphics.Primitives; using System.Linq; using osu.Game.Rulesets.Taiko.Objects.Drawables; using System; diff --git a/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs b/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs index 34e4ebf8ac..cb929dcca5 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs @@ -5,7 +5,6 @@ using System; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Game.Database; using osu.Game.Graphics; diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs index 8431e5f812..2ab5487082 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -9,7 +9,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Graphics/Cursor/TooltipContainer.cs b/osu.Game/Graphics/Cursor/TooltipContainer.cs index 5f0743746a..c5b8382816 100644 --- a/osu.Game/Graphics/Cursor/TooltipContainer.cs +++ b/osu.Game/Graphics/Cursor/TooltipContainer.cs @@ -8,7 +8,6 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Input; using osu.Framework.Threading; diff --git a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs index e81db4954e..85231ffab9 100644 --- a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs +++ b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs @@ -6,7 +6,6 @@ using osu.Framework.Audio; using osu.Framework.Audio.Sample; using osu.Framework.Configuration; using osu.Framework.Graphics; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input; diff --git a/osu.Game/Graphics/UserInterface/OsuDropdown.cs b/osu.Game/Graphics/UserInterface/OsuDropdown.cs index 59bee8baad..4f286ba7b5 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropdown.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropdown.cs @@ -7,7 +7,6 @@ using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Graphics/UserInterface/OsuMenu.cs b/osu.Game/Graphics/UserInterface/OsuMenu.cs index c51c5d210e..84b88da96e 100644 --- a/osu.Game/Graphics/UserInterface/OsuMenu.cs +++ b/osu.Game/Graphics/UserInterface/OsuMenu.cs @@ -5,7 +5,6 @@ using OpenTK; using OpenTK.Graphics; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface; namespace osu.Game.Graphics.UserInterface diff --git a/osu.Game/Graphics/UserInterface/OsuTabControl.cs b/osu.Game/Graphics/UserInterface/OsuTabControl.cs index 8b72eedbfd..a9fad0c739 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabControl.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabControl.cs @@ -9,7 +9,6 @@ using osu.Framework.Allocation; using osu.Framework.Extensions; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input; diff --git a/osu.Game/Graphics/UserInterface/OsuTabControlCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuTabControlCheckbox.cs index f732916889..6fc3875f61 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabControlCheckbox.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabControlCheckbox.cs @@ -6,7 +6,6 @@ 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.Graphics.UserInterface; using osu.Framework.Input; diff --git a/osu.Game/Graphics/UserInterface/OsuTextBox.cs b/osu.Game/Graphics/UserInterface/OsuTextBox.cs index 62b10b96ef..97c38f6b85 100644 --- a/osu.Game/Graphics/UserInterface/OsuTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuTextBox.cs @@ -3,7 +3,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input; diff --git a/osu.Game/Graphics/UserInterface/SearchTextBox.cs b/osu.Game/Graphics/UserInterface/SearchTextBox.cs index 6a8236529b..0a37024d0f 100644 --- a/osu.Game/Graphics/UserInterface/SearchTextBox.cs +++ b/osu.Game/Graphics/UserInterface/SearchTextBox.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; -using osu.Framework.Graphics.Primitives; using osu.Framework.Input; using OpenTK.Input; diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index 4933c170e8..f2ae47354e 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -6,7 +6,6 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Input; using osu.Framework.Threading; using OpenTK; -using osu.Framework.Graphics.Primitives; using osu.Framework.Audio; using osu.Framework.Allocation; diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 9ce725661b..5a3b47eb23 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -19,7 +19,6 @@ using osu.Game.Screens; using osu.Game.Screens.Menu; using OpenTK; using System.Linq; -using osu.Framework.Graphics.Primitives; using System.Threading.Tasks; using osu.Framework.Threading; using osu.Game.Database; diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index d4063efbb5..3aaca7593c 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -3,7 +3,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Online.Chat; diff --git a/osu.Game/Overlays/Chat/ChatTabControl.cs b/osu.Game/Overlays/Chat/ChatTabControl.cs index c7e1382255..5778999a0c 100644 --- a/osu.Game/Overlays/Chat/ChatTabControl.cs +++ b/osu.Game/Overlays/Chat/ChatTabControl.cs @@ -5,7 +5,6 @@ using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input; diff --git a/osu.Game/Overlays/Chat/DrawableChannel.cs b/osu.Game/Overlays/Chat/DrawableChannel.cs index 39dc1914ab..355aeed134 100644 --- a/osu.Game/Overlays/Chat/DrawableChannel.cs +++ b/osu.Game/Overlays/Chat/DrawableChannel.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Game.Online.Chat; namespace osu.Game.Overlays.Chat diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 7c5651b5ff..ed6ecdffcf 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -17,7 +17,6 @@ using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Online.Chat; using osu.Game.Graphics.UserInterface; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface; using OpenTK.Graphics; using osu.Framework.Input; diff --git a/osu.Game/Overlays/Dialog/PopupDialog.cs b/osu.Game/Overlays/Dialog/PopupDialog.cs index b4127c8af4..47674de817 100644 --- a/osu.Game/Overlays/Dialog/PopupDialog.cs +++ b/osu.Game/Overlays/Dialog/PopupDialog.cs @@ -6,7 +6,6 @@ using System.Linq; using osu.Framework.Extensions.Color4Extensions; 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.Graphics; diff --git a/osu.Game/Overlays/LoginOverlay.cs b/osu.Game/Overlays/LoginOverlay.cs index 8c4a3b85c0..e555600028 100644 --- a/osu.Game/Overlays/LoginOverlay.cs +++ b/osu.Game/Overlays/LoginOverlay.cs @@ -4,7 +4,6 @@ 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.Game.Graphics; using osu.Game.Overlays.Settings.Sections.General; diff --git a/osu.Game/Overlays/Mods/ModSection.cs b/osu.Game/Overlays/Mods/ModSection.cs index 40bd1e8b07..aac8a72dd7 100644 --- a/osu.Game/Overlays/Mods/ModSection.cs +++ b/osu.Game/Overlays/Mods/ModSection.cs @@ -6,7 +6,6 @@ using OpenTK.Graphics; using OpenTK.Input; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Input; using osu.Game.Graphics.Sprites; using osu.Game.Rulesets.Mods; diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 2840ffd1e4..c001d613e4 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -8,7 +8,6 @@ using osu.Framework.Configuration; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; using osu.Game.Graphics.Backgrounds; diff --git a/osu.Game/Overlays/Music/FilterControl.cs b/osu.Game/Overlays/Music/FilterControl.cs index f6188d941c..6d8790a9e8 100644 --- a/osu.Game/Overlays/Music/FilterControl.cs +++ b/osu.Game/Overlays/Music/FilterControl.cs @@ -6,7 +6,6 @@ using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; diff --git a/osu.Game/Overlays/Music/PlaylistItem.cs b/osu.Game/Overlays/Music/PlaylistItem.cs index c2413956b4..16978903a7 100644 --- a/osu.Game/Overlays/Music/PlaylistItem.cs +++ b/osu.Game/Overlays/Music/PlaylistItem.cs @@ -5,7 +5,6 @@ using System; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Game.Database; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Overlays/Music/PlaylistOverlay.cs b/osu.Game/Overlays/Music/PlaylistOverlay.cs index eb5dff57b3..5e433aa414 100644 --- a/osu.Game/Overlays/Music/PlaylistOverlay.cs +++ b/osu.Game/Overlays/Music/PlaylistOverlay.cs @@ -10,7 +10,6 @@ using osu.Framework.Configuration; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Game.Beatmaps; using osu.Game.Database; diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index e3edaa0ca7..4faa339bed 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -12,7 +12,6 @@ using osu.Framework.Configuration; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Framework.Input; diff --git a/osu.Game/Overlays/NotificationManager.cs b/osu.Game/Overlays/NotificationManager.cs index 264543367c..b344d533ee 100644 --- a/osu.Game/Overlays/NotificationManager.cs +++ b/osu.Game/Overlays/NotificationManager.cs @@ -6,7 +6,6 @@ using osu.Framework.Allocation; using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Game.Overlays.Notifications; using OpenTK.Graphics; diff --git a/osu.Game/Overlays/Notifications/Notification.cs b/osu.Game/Overlays/Notifications/Notification.cs index 961e83e958..cb3efaf269 100644 --- a/osu.Game/Overlays/Notifications/Notification.cs +++ b/osu.Game/Overlays/Notifications/Notification.cs @@ -7,7 +7,6 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transforms; using osu.Framework.Input; diff --git a/osu.Game/Overlays/Notifications/NotificationSection.cs b/osu.Game/Overlays/Notifications/NotificationSection.cs index 663c5cf90c..b53f8e6b14 100644 --- a/osu.Game/Overlays/Notifications/NotificationSection.cs +++ b/osu.Game/Overlays/Notifications/NotificationSection.cs @@ -8,7 +8,6 @@ using osu.Framework.Allocation; using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using OpenTK; diff --git a/osu.Game/Overlays/Settings/SettingsDropdown.cs b/osu.Game/Overlays/Settings/SettingsDropdown.cs index 8ce755b90e..bf2cd10b9d 100644 --- a/osu.Game/Overlays/Settings/SettingsDropdown.cs +++ b/osu.Game/Overlays/Settings/SettingsDropdown.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using osu.Framework.Graphics; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.UserInterface; diff --git a/osu.Game/Overlays/Settings/SettingsFooter.cs b/osu.Game/Overlays/Settings/SettingsFooter.cs index a9293ac2af..be08e61c1a 100644 --- a/osu.Game/Overlays/Settings/SettingsFooter.cs +++ b/osu.Game/Overlays/Settings/SettingsFooter.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Game.Database; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Overlays/Settings/SettingsHeader.cs b/osu.Game/Overlays/Settings/SettingsHeader.cs index 8a118120de..56018dc7d9 100644 --- a/osu.Game/Overlays/Settings/SettingsHeader.cs +++ b/osu.Game/Overlays/Settings/SettingsHeader.cs @@ -5,7 +5,6 @@ using System; 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.Game.Graphics; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index a40f895e0a..e592ca9e37 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -5,7 +5,6 @@ using OpenTK.Graphics; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Overlays/Settings/SettingsSection.cs b/osu.Game/Overlays/Settings/SettingsSection.cs index 66b860402a..8b95c72412 100644 --- a/osu.Game/Overlays/Settings/SettingsSection.cs +++ b/osu.Game/Overlays/Settings/SettingsSection.cs @@ -6,7 +6,6 @@ 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.Game.Graphics; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Overlays/Settings/SettingsSlider.cs b/osu.Game/Overlays/Settings/SettingsSlider.cs index 9ce4efdd52..beb2bdf645 100644 --- a/osu.Game/Overlays/Settings/SettingsSlider.cs +++ b/osu.Game/Overlays/Settings/SettingsSlider.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.UserInterface; diff --git a/osu.Game/Overlays/Settings/SettingsSubsection.cs b/osu.Game/Overlays/Settings/SettingsSubsection.cs index b4ce54cb75..30abbc3805 100644 --- a/osu.Game/Overlays/Settings/SettingsSubsection.cs +++ b/osu.Game/Overlays/Settings/SettingsSubsection.cs @@ -4,7 +4,6 @@ using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Game.Graphics.Sprites; using System.Collections.Generic; using System.Linq; diff --git a/osu.Game/Overlays/SettingsOverlay.cs b/osu.Game/Overlays/SettingsOverlay.cs index e3fbf12df3..71ad18e081 100644 --- a/osu.Game/Overlays/SettingsOverlay.cs +++ b/osu.Game/Overlays/SettingsOverlay.cs @@ -6,7 +6,6 @@ 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.Game.Overlays.Settings; using System; diff --git a/osu.Game/Overlays/Toolbar/ToolbarButton.cs b/osu.Game/Overlays/Toolbar/ToolbarButton.cs index 6be63b1fe8..5ae88d9049 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarButton.cs @@ -8,7 +8,6 @@ using osu.Framework.Audio.Sample; using osu.Framework.Extensions.Color4Extensions; 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.Graphics; diff --git a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs index 209b64e709..8e610545f5 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs @@ -6,7 +6,6 @@ using osu.Framework.Allocation; using osu.Framework.Caching; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Game.Database; using OpenTK; diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index 4640067017..beaaa373b6 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -4,7 +4,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Screens; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Screens/Play/HUD/ComboCounter.cs b/osu.Game/Screens/Play/HUD/ComboCounter.cs index a130bc2eab..46c7084cec 100644 --- a/osu.Game/Screens/Play/HUD/ComboCounter.cs +++ b/osu.Game/Screens/Play/HUD/ComboCounter.cs @@ -4,7 +4,6 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transforms; using osu.Framework.MathUtils; diff --git a/osu.Game/Screens/Play/HUD/ModDisplay.cs b/osu.Game/Screens/Play/HUD/ModDisplay.cs index 1b67d8dc66..92c40f6351 100644 --- a/osu.Game/Screens/Play/HUD/ModDisplay.cs +++ b/osu.Game/Screens/Play/HUD/ModDisplay.cs @@ -6,7 +6,6 @@ using System.Linq; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.Sprites; using osu.Game.Rulesets.Mods; diff --git a/osu.Game/Screens/Play/Pause/PauseProgressBar.cs b/osu.Game/Screens/Play/Pause/PauseProgressBar.cs index fa380540a3..bfde7dd6d7 100644 --- a/osu.Game/Screens/Play/Pause/PauseProgressBar.cs +++ b/osu.Game/Screens/Play/Pause/PauseProgressBar.cs @@ -4,7 +4,6 @@ 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.Game.Beatmaps; using OpenTK.Graphics; diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index 9afa1018c6..726397a3b1 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -4,7 +4,6 @@ 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.Screens; using osu.Game.Beatmaps; diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 8cead0684e..887442b8c0 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -12,7 +12,6 @@ using System.Linq; using osu.Framework.Timing; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; -using osu.Framework.Graphics.Primitives; namespace osu.Game.Screens.Play { diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index 4c53b61313..06d7176cc5 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -4,7 +4,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Timing; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Screens/Play/StandardHUDOverlay.cs b/osu.Game/Screens/Play/StandardHUDOverlay.cs index 41f9ee1394..87fbea6810 100644 --- a/osu.Game/Screens/Play/StandardHUDOverlay.cs +++ b/osu.Game/Screens/Play/StandardHUDOverlay.cs @@ -3,7 +3,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.Primitives; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Rulesets.Scoring; diff --git a/osu.Game/Screens/Ranking/ResultModeTabControl.cs b/osu.Game/Screens/Ranking/ResultModeTabControl.cs index 346bff5720..06a6d31e37 100644 --- a/osu.Game/Screens/Ranking/ResultModeTabControl.cs +++ b/osu.Game/Screens/Ranking/ResultModeTabControl.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface; using OpenTK; diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index 5bcaba7813..f3dae710b2 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -7,7 +7,6 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Game.Rulesets.Scoring; using osu.Framework.Graphics.Sprites; using osu.Framework.Screens; diff --git a/osu.Game/Screens/Ranking/ResultsPageScore.cs b/osu.Game/Screens/Ranking/ResultsPageScore.cs index 4bfd998c54..fad914e9d4 100644 --- a/osu.Game/Screens/Ranking/ResultsPageScore.cs +++ b/osu.Game/Screens/Ranking/ResultsPageScore.cs @@ -11,7 +11,6 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Framework.Localisation; diff --git a/osu.Game/Screens/Select/BeatmapDetailArea.cs b/osu.Game/Screens/Select/BeatmapDetailArea.cs index cc22cca8bf..d116e5b159 100644 --- a/osu.Game/Screens/Select/BeatmapDetailArea.cs +++ b/osu.Game/Screens/Select/BeatmapDetailArea.cs @@ -3,7 +3,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Game.Beatmaps; using osu.Game.Screens.Select.Leaderboards; diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index 63fdfe3717..aaa267a299 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -6,7 +6,6 @@ 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.Game.Database; using osu.Game.Graphics; diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 6a2f7a26fc..2f5b35f92a 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -11,7 +11,6 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.MathUtils; using osu.Game.Beatmaps; diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index e0b197e9ca..7c7863acd1 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -8,7 +8,6 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics; diff --git a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs index 02a412685c..a136e298b5 100644 --- a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs @@ -8,7 +8,6 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using System; using osu.Framework.Allocation; using osu.Framework.Threading; diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 8df95f6913..c5fa0a5011 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -5,7 +5,6 @@ using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Screens/Select/Options/BeatmapOptionsButton.cs b/osu.Game/Screens/Select/Options/BeatmapOptionsButton.cs index 0935bb3686..182f778dd4 100644 --- a/osu.Game/Screens/Select/Options/BeatmapOptionsButton.cs +++ b/osu.Game/Screens/Select/Options/BeatmapOptionsButton.cs @@ -4,7 +4,6 @@ using osu.Framework.Extensions.Color4Extensions; 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.Graphics; diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 315992c113..8f91f1ed0f 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -5,7 +5,6 @@ using OpenTK.Input; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Screens; using osu.Game.Beatmaps; using osu.Game.Graphics; diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 51b67bdbef..4438b656b0 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -11,7 +11,6 @@ using osu.Framework.Audio.Track; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; using osu.Framework.Input; using osu.Framework.Screens; using osu.Framework.Threading; diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game/Screens/Tournament/Drawings.cs index eada42a53e..05bf3a250f 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game/Screens/Tournament/Drawings.cs @@ -9,7 +9,6 @@ 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.Sprites; using osu.Framework.Graphics.Textures; using osu.Framework.Logging; diff --git a/osu.Game/Screens/Tournament/Group.cs b/osu.Game/Screens/Tournament/Group.cs index f5695ae1cb..90ee90901f 100644 --- a/osu.Game/Screens/Tournament/Group.cs +++ b/osu.Game/Screens/Tournament/Group.cs @@ -7,7 +7,6 @@ using System.Text; 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.Graphics.Textures; using osu.Game.Graphics.Sprites; From 696c53646d6969e85304b113c6c81be23280b2f7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 16 May 2017 12:51:07 +0900 Subject: [PATCH 70/74] Change severity of unaccessed private collections to hint --- osu.sln.DotSettings | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index 03d9e34805..70bfacd6ef 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -20,6 +20,8 @@ HINT WARNING HINT + SUGGESTION + HINT HINT WARNING WARNING From e09f1c7c918cbe3ccb1770170178294cd585fc37 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 16 May 2017 12:51:43 +0900 Subject: [PATCH 71/74] Remove AudioDevice from game-level setting Should be (and is already) in FrameworkConfig. --- osu.Game/Configuration/OsuConfigManager.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 43b0456973..8f177d6b56 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -39,8 +39,6 @@ namespace osu.Game.Configuration // Audio - Set(OsuSetting.AudioDevice, string.Empty); - Set(OsuSetting.MenuVoice, true); Set(OsuSetting.MenuMusic, true); @@ -99,7 +97,6 @@ namespace osu.Game.Configuration MenuParallax, BeatmapDetailTab, Username, - AudioDevice, ReleaseStream, SavePassword, SaveUsername, From f0ea445e4696082bf6a906f7762eeb7e5e1ee825 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 16 May 2017 15:56:53 +0900 Subject: [PATCH 72/74] Fix initial requests of channel mesages not being performed fetchReq was being set even for initial lookups, which caused only one to run, and subsequent requests to be excessive to try and catch up. --- osu.Game/Overlays/ChatOverlay.cs | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 111d3e5eb4..5bbf20e196 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -245,7 +245,7 @@ namespace osu.Game.Overlays addChannel(channels.Find(c => c.Name == @"#lobby")); }); - messageRequest = Scheduler.AddDelayed(() => fetchNewMessages(), 1000, true); + messageRequest = Scheduler.AddDelayed(fetchNewMessages, 1000, true); }; api.Queue(req); @@ -289,17 +289,34 @@ namespace osu.Game.Overlays channelTabs.AddItem(channel); // we need to get a good number of messages initially for each channel we care about. - fetchNewMessages(channel); + fetchInitialMessages(channel); if (CurrentChannel == null) CurrentChannel = channel; } - private void fetchNewMessages(Channel specificChannel = null) + private void fetchInitialMessages(Channel channel) + { + var req = new GetMessagesRequest(new List { channel }, null); + + req.Success += delegate (List messages) + { + channel.AddNewMessages(messages.ToArray()); + Debug.Write("success!"); + }; + req.Failure += delegate + { + Debug.Write("failure!"); + }; + + api.Queue(req); + } + + private void fetchNewMessages() { if (fetchReq != null) return; - fetchReq = new GetMessagesRequest(specificChannel != null ? new List { specificChannel } : careChannels, lastMessageId); + fetchReq = new GetMessagesRequest(careChannels, lastMessageId); fetchReq.Success += delegate (List messages) { var ids = messages.Where(m => m.TargetType == TargetType.Channel).Select(m => m.TargetId).Distinct(); From ed92a1ee4e594194207c6d70f06be490fd328822 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 16 May 2017 16:37:05 +0900 Subject: [PATCH 73/74] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 7146c07159..3111d1aa4f 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 7146c07159d2cf3d07a8d371fa50ef8b200ba038 +Subproject commit 3111d1aa4f0d3aa1c0df03f8003b6c5c726b10d2 From 3673e4af1fa926a62f5dc3f4b6f386c27e2c3631 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 16 May 2017 17:37:54 +0900 Subject: [PATCH 74/74] Fade bold state of chat tabs better --- osu.Game/Overlays/Chat/ChatTabControl.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Chat/ChatTabControl.cs b/osu.Game/Overlays/Chat/ChatTabControl.cs index 5778999a0c..57447f1913 100644 --- a/osu.Game/Overlays/Chat/ChatTabControl.cs +++ b/osu.Game/Overlays/Chat/ChatTabControl.cs @@ -46,6 +46,7 @@ namespace osu.Game.Overlays.Chat private Color4 backgroundActive; private readonly SpriteText text; + private readonly SpriteText textBold; private readonly Box box; private readonly Box highlightBox; @@ -77,7 +78,9 @@ namespace osu.Game.Overlays.Chat box.FadeColour(backgroundActive, transition_length, EasingTypes.OutQuint); highlightBox.FadeIn(transition_length, EasingTypes.OutQuint); - text.Font = @"Exo2.0-Bold"; + + text.FadeOut(transition_length, EasingTypes.OutQuint); + textBold.FadeIn(transition_length, EasingTypes.OutQuint); } private void fadeInactive() @@ -86,7 +89,9 @@ namespace osu.Game.Overlays.Chat box.FadeColour(backgroundInactive, transition_length, EasingTypes.OutQuint); highlightBox.FadeOut(transition_length, EasingTypes.OutQuint); - text.Font = @"Exo2.0-Regular"; + + text.FadeIn(transition_length, EasingTypes.OutQuint); + textBold.FadeOut(transition_length, EasingTypes.OutQuint); } protected override bool OnHover(InputState state) @@ -172,6 +177,16 @@ namespace osu.Game.Overlays.Chat Text = value.ToString(), TextSize = 18, }, + textBold = new OsuSpriteText + { + Alpha = 0, + Margin = new MarginPadding(5), + Origin = Anchor.CentreLeft, + Anchor = Anchor.CentreLeft, + Text = value.ToString(), + Font = @"Exo2.0-Bold", + TextSize = 18, + }, } } };