From 6d97da8b19151fdf9cee4cd46b1ae6733caa9c02 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 2 Oct 2017 04:42:38 +0300 Subject: [PATCH 001/166] Add replay speed adjustment --- osu.Game/Screens/Play/HUDOverlay.cs | 18 +++++++++------- osu.Game/Screens/Play/Player.cs | 2 ++ .../Play/ReplaySettings/PlaybackSettings.cs | 21 ++++++++++++------- .../Screens/Play/ReplaySettingsOverlay.cs | 8 ++++--- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index ddcf031bd4..c632b7d893 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -32,6 +32,7 @@ namespace osu.Game.Screens.Play public readonly HealthDisplay HealthDisplay; public readonly SongProgress Progress; public readonly ModDisplay ModDisplay; + public readonly ReplaySettingsOverlay ReplaySettingsOverlay; private Bindable showHud; private bool replayLoaded; @@ -55,7 +56,7 @@ namespace osu.Game.Screens.Play HealthDisplay = CreateHealthDisplay(), Progress = CreateProgress(), ModDisplay = CreateModsContainer(), - //ReplaySettingsOverlay = CreateReplaySettingsOverlay(), + ReplaySettingsOverlay = CreateReplaySettingsOverlay(), } }); } @@ -98,7 +99,10 @@ namespace osu.Game.Screens.Play // in the case a replay isn't loaded, we want some elements to only appear briefly. if (!replayLoaded) + { + ReplaySettingsOverlay.Hide(); ModDisplay.Delay(2000).FadeOut(200); + } } protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) @@ -176,12 +180,12 @@ namespace osu.Game.Screens.Play Margin = new MarginPadding { Top = 20, Right = 10 }, }; - //protected virtual ReplaySettingsOverlay CreateReplaySettingsOverlay() => new ReplaySettingsOverlay - //{ - // Anchor = Anchor.TopRight, - // Origin = Anchor.TopRight, - // Margin = new MarginPadding { Top = 100, Right = 10 }, - //}; + protected virtual ReplaySettingsOverlay CreateReplaySettingsOverlay() => new ReplaySettingsOverlay + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + Margin = new MarginPadding { Top = 100, Right = 10 }, + }; public virtual void BindProcessor(ScoreProcessor processor) { diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index e120c7f193..9d983fd0a9 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -222,6 +222,8 @@ namespace osu.Game.Screens.Play hudOverlay.ModDisplay.Current.BindTo(working.Mods); + hudOverlay.ReplaySettingsOverlay.PlaybackSettings.BindClock(adjustableSourceClock); + // Bind ScoreProcessor to ourselves scoreProcessor.AllJudged += onCompletion; scoreProcessor.Failed += onFail; diff --git a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs index ea958d05f9..49b5ce4474 100644 --- a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs @@ -3,7 +3,7 @@ using osu.Framework.Allocation; using osu.Game.Configuration; -using osu.Framework.Graphics; +using osu.Framework.Timing; namespace osu.Game.Screens.Play.ReplaySettings { @@ -11,17 +11,24 @@ namespace osu.Game.Screens.Play.ReplaySettings { protected override string Title => @"playback"; + private ReplaySliderBar sliderbar; + [BackgroundDependencyLoader] private void load(OsuConfigManager config) { - Children = new Drawable[] + Child = sliderbar = new ReplaySliderBar { - new ReplaySliderBar - { - LabelText = "Playback speed", - Bindable = config.GetBindable(OsuSetting.PlaybackSpeed) - } + LabelText = "Playback speed", + Bindable = config.GetBindable(OsuSetting.PlaybackSpeed), }; } + + public void BindClock(IAdjustableClock clock) + { + var clockRate = clock.Rate; + sliderbar.Bindable.ValueChanged += (rateMultiplier) => clock.Rate = clockRate * rateMultiplier; + + sliderbar.Bindable.Value = 1; + } } } diff --git a/osu.Game/Screens/Play/ReplaySettingsOverlay.cs b/osu.Game/Screens/Play/ReplaySettingsOverlay.cs index 415f70005d..0edf4634ba 100644 --- a/osu.Game/Screens/Play/ReplaySettingsOverlay.cs +++ b/osu.Game/Screens/Play/ReplaySettingsOverlay.cs @@ -10,15 +10,17 @@ namespace osu.Game.Screens.Play { public class ReplaySettingsOverlay : FillFlowContainer { + public readonly PlaybackSettings PlaybackSettings; + public ReplaySettingsOverlay() { Direction = FillDirection.Vertical; AutoSizeAxes = Axes.Both; Spacing = new Vector2(0, 20); - Add(new CollectionSettings()); - Add(new DiscussionSettings()); - Add(new PlaybackSettings()); + //Add(new CollectionSettings()); + //Add(new DiscussionSettings()); + Add(PlaybackSettings = new PlaybackSettings()); } } } From c34cc07fdadcc00bd4328a532a88e4a6dd53efb7 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 2 Oct 2017 18:09:00 +0300 Subject: [PATCH 002/166] Remove default bindable from the config manager --- osu.Game/Configuration/OsuConfigManager.cs | 2 -- .../Play/ReplaySettings/PlaybackSettings.cs | 18 ++++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index b000f08369..b341c4413b 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -69,7 +69,6 @@ namespace osu.Game.Configuration Set(OsuSetting.KeyOverlay, false); Set(OsuSetting.FloatingComments, false); - Set(OsuSetting.PlaybackSpeed, 1.0, 0.5f, 2); // Update Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer); @@ -93,7 +92,6 @@ namespace osu.Game.Configuration ShowStoryboard, KeyOverlay, FloatingComments, - PlaybackSpeed, ShowInterface, MouseDisableButtons, MouseDisableWheel, diff --git a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs index 49b5ce4474..e8f20e3087 100644 --- a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs @@ -1,9 +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.Allocation; -using osu.Game.Configuration; using osu.Framework.Timing; +using osu.Framework.Configuration; namespace osu.Game.Screens.Play.ReplaySettings { @@ -11,15 +10,20 @@ namespace osu.Game.Screens.Play.ReplaySettings { protected override string Title => @"playback"; - private ReplaySliderBar sliderbar; + private readonly ReplaySliderBar sliderbar; - [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private readonly BindableNumber current; + + public PlaybackSettings() { + current = new BindableDouble(1) as BindableNumber; + current.MinValue = 0.5; + current.MaxValue = 2; + Child = sliderbar = new ReplaySliderBar { LabelText = "Playback speed", - Bindable = config.GetBindable(OsuSetting.PlaybackSpeed), + Bindable = current, }; } @@ -27,8 +31,6 @@ namespace osu.Game.Screens.Play.ReplaySettings { var clockRate = clock.Rate; sliderbar.Bindable.ValueChanged += (rateMultiplier) => clock.Rate = clockRate * rateMultiplier; - - sliderbar.Bindable.Value = 1; } } } From 4a298098c506fb3e61a680d5872a83ad321239a4 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 2 Oct 2017 18:19:55 +0300 Subject: [PATCH 003/166] CI fixes --- .../Play/ReplaySettings/PlaybackSettings.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs index e8f20e3087..9129dcab94 100644 --- a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs @@ -12,25 +12,23 @@ namespace osu.Game.Screens.Play.ReplaySettings private readonly ReplaySliderBar sliderbar; - private readonly BindableNumber current; - public PlaybackSettings() { - current = new BindableDouble(1) as BindableNumber; - current.MinValue = 0.5; - current.MaxValue = 2; - Child = sliderbar = new ReplaySliderBar { LabelText = "Playback speed", - Bindable = current, + Bindable = new BindableDouble(1) + { + MinValue = 0.5, + MaxValue = 2 + }, }; } public void BindClock(IAdjustableClock clock) { var clockRate = clock.Rate; - sliderbar.Bindable.ValueChanged += (rateMultiplier) => clock.Rate = clockRate * rateMultiplier; + sliderbar.Bindable.ValueChanged += rateMultiplier => clock.Rate = clockRate * rateMultiplier; } } } From b94c78e99306c4728fcd79f6cb7c9c9b1557aacb Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 2 Oct 2017 19:33:58 +0300 Subject: [PATCH 004/166] Hide/Show Replay settings on pressing Ctrl+H --- .../Screens/Play/HUD/ReplaySettingsOverlay.cs | 66 +++++++++++++++++++ osu.Game/Screens/Play/HUDOverlay.cs | 7 +- .../Screens/Play/ReplaySettingsOverlay.cs | 26 -------- .../Visual/TestCaseReplaySettingsOverlay.cs | 2 +- osu.Game/osu.Game.csproj | 2 +- 5 files changed, 69 insertions(+), 34 deletions(-) create mode 100644 osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs delete mode 100644 osu.Game/Screens/Play/ReplaySettingsOverlay.cs diff --git a/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs b/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs new file mode 100644 index 0000000000..9f55ce8ce5 --- /dev/null +++ b/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs @@ -0,0 +1,66 @@ +// 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 osu.Framework.Graphics.Containers; +using osu.Game.Screens.Play.ReplaySettings; +using OpenTK; +using osu.Framework.Input; +using OpenTK.Input; + +namespace osu.Game.Screens.Play.HUD +{ + public class ReplaySettingsOverlay : VisibilityContainer + { + private const int fade_duration = 200; + + public override bool HandleInput => true; + + public readonly PlaybackSettings PlaybackSettings; + //public readonly CollectionSettings CollectionSettings; + //public readonly DiscussionSettings DiscussionSettings; + + public ReplaySettingsOverlay() + { + AlwaysPresent = true; + RelativeSizeAxes = Axes.Both; + + Child = new FillFlowContainer + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 20), + Margin = new MarginPadding { Top = 100, Right = 10 }, + Children = new [] + { + //CollectionSettings = new CollectionSettings(), + //DiscussionSettings = new DiscussionSettings(), + PlaybackSettings = new PlaybackSettings(), + } + }; + + State = Visibility.Visible; + } + + protected override void PopIn() => this.FadeIn(fade_duration); + protected override void PopOut() => this.FadeOut(fade_duration); + + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + { + if (args.Repeat) return false; + + if (state.Keyboard.ControlPressed) + { + if (args.Key == Key.H) + { + ToggleVisibility(); + return true; + } + } + + return base.OnKeyDown(state, args); + } + } +} diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index c632b7d893..1d7e0727ba 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -180,12 +180,7 @@ namespace osu.Game.Screens.Play Margin = new MarginPadding { Top = 20, Right = 10 }, }; - protected virtual ReplaySettingsOverlay CreateReplaySettingsOverlay() => new ReplaySettingsOverlay - { - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight, - Margin = new MarginPadding { Top = 100, Right = 10 }, - }; + protected virtual ReplaySettingsOverlay CreateReplaySettingsOverlay() => new ReplaySettingsOverlay(); public virtual void BindProcessor(ScoreProcessor processor) { diff --git a/osu.Game/Screens/Play/ReplaySettingsOverlay.cs b/osu.Game/Screens/Play/ReplaySettingsOverlay.cs deleted file mode 100644 index 0edf4634ba..0000000000 --- a/osu.Game/Screens/Play/ReplaySettingsOverlay.cs +++ /dev/null @@ -1,26 +0,0 @@ -// 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 osu.Framework.Graphics.Containers; -using osu.Game.Screens.Play.ReplaySettings; -using OpenTK; - -namespace osu.Game.Screens.Play -{ - public class ReplaySettingsOverlay : FillFlowContainer - { - public readonly PlaybackSettings PlaybackSettings; - - public ReplaySettingsOverlay() - { - Direction = FillDirection.Vertical; - AutoSizeAxes = Axes.Both; - Spacing = new Vector2(0, 20); - - //Add(new CollectionSettings()); - //Add(new DiscussionSettings()); - Add(PlaybackSettings = new PlaybackSettings()); - } - } -} diff --git a/osu.Game/Tests/Visual/TestCaseReplaySettingsOverlay.cs b/osu.Game/Tests/Visual/TestCaseReplaySettingsOverlay.cs index 256c3d25c9..3105a7d588 100644 --- a/osu.Game/Tests/Visual/TestCaseReplaySettingsOverlay.cs +++ b/osu.Game/Tests/Visual/TestCaseReplaySettingsOverlay.cs @@ -3,7 +3,7 @@ using osu.Framework.Graphics; using osu.Game.Graphics.UserInterface; -using osu.Game.Screens.Play; +using osu.Game.Screens.Play.HUD; using osu.Game.Screens.Play.ReplaySettings; namespace osu.Game.Tests.Visual diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index c8e42a3ad3..f04aa4708c 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -656,7 +656,7 @@ - + From feb0b1852fe8e5e8107be177352fd81297058fb5 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 3 Oct 2017 20:05:50 +0300 Subject: [PATCH 005/166] Remove the dangerous function --- osu.Game/Screens/Play/Player.cs | 2 +- .../Play/ReplaySettings/PlaybackSettings.cs | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 9d983fd0a9..7e5ab58adb 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -222,7 +222,7 @@ namespace osu.Game.Screens.Play hudOverlay.ModDisplay.Current.BindTo(working.Mods); - hudOverlay.ReplaySettingsOverlay.PlaybackSettings.BindClock(adjustableSourceClock); + hudOverlay.ReplaySettingsOverlay.PlaybackSettings.AdjustableClock = adjustableSourceClock; // Bind ScoreProcessor to ourselves scoreProcessor.AllJudged += onCompletion; diff --git a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs index 9129dcab94..24f128ef49 100644 --- a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs @@ -10,6 +10,13 @@ namespace osu.Game.Screens.Play.ReplaySettings { protected override string Title => @"playback"; + private IAdjustableClock adjustableClock; + public IAdjustableClock AdjustableClock + { + set { adjustableClock = value; } + get { return adjustableClock; } + } + private readonly ReplaySliderBar sliderbar; public PlaybackSettings() @@ -25,10 +32,15 @@ namespace osu.Game.Screens.Play.ReplaySettings }; } - public void BindClock(IAdjustableClock clock) + protected override void LoadComplete() { - var clockRate = clock.Rate; - sliderbar.Bindable.ValueChanged += rateMultiplier => clock.Rate = clockRate * rateMultiplier; + base.LoadComplete(); + + if (adjustableClock != null) + { + var clockRate = adjustableClock.Rate; + sliderbar.Bindable.ValueChanged += rateMultiplier => adjustableClock.Rate = clockRate * rateMultiplier; + } } } } From 1c132938dfdd57d338eed74751107e11e266b27e Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 3 Oct 2017 20:26:53 +0300 Subject: [PATCH 006/166] Allow visibility can be toggled only if replay is loaded --- osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs | 4 +++- osu.Game/Screens/Play/HUDOverlay.cs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs b/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs index 9f55ce8ce5..e44a738d55 100644 --- a/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs +++ b/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs @@ -14,6 +14,8 @@ namespace osu.Game.Screens.Play.HUD { private const int fade_duration = 200; + public bool ReplayLoaded; + public override bool HandleInput => true; public readonly PlaybackSettings PlaybackSettings; @@ -53,7 +55,7 @@ namespace osu.Game.Screens.Play.HUD if (state.Keyboard.ControlPressed) { - if (args.Key == Key.H) + if (args.Key == Key.H && ReplayLoaded) { ToggleVisibility(); return true; diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 1d7e0727ba..f4b5efe1e5 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -97,6 +97,8 @@ namespace osu.Game.Screens.Play replayLoaded = rulesetContainer.HasReplayLoaded; + ReplaySettingsOverlay.ReplayLoaded = replayLoaded; + // in the case a replay isn't loaded, we want some elements to only appear briefly. if (!replayLoaded) { From 6fa45aafc6e5099ea46790e9b5c0bb362116717e Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Wed, 4 Oct 2017 23:06:31 +0300 Subject: [PATCH 007/166] Basic logic --- osu.Game/Screens/Menu/Intro.cs | 24 +++---------- osu.Game/Screens/Menu/IntroSequence.cs | 48 ++++++++++++++++++++++++++ osu.Game/Tests/Visual/TestCaseIntro.cs | 43 +++++++++++++++++++++++ osu.Game/osu.Game.csproj | 2 ++ 4 files changed, 97 insertions(+), 20 deletions(-) create mode 100644 osu.Game/Screens/Menu/IntroSequence.cs create mode 100644 osu.Game/Tests/Visual/TestCaseIntro.cs diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 3aeef4bbc9..8be330bd32 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -14,13 +14,12 @@ using osu.Game.Beatmaps.IO; using osu.Game.Configuration; using osu.Game.Graphics.Containers; using osu.Game.Screens.Backgrounds; -using OpenTK.Graphics; namespace osu.Game.Screens.Menu { public class Intro : OsuScreen { - private readonly OsuLogo logo; + private readonly IntroSequence introSequence; private const string menu_music_beatmap_hash = "715a09144f885d746644c1983e285044"; @@ -46,18 +45,7 @@ namespace osu.Game.Screens.Menu new ParallaxContainer { ParallaxAmount = 0.01f, - Children = new Drawable[] - { - logo = new OsuLogo - { - Alpha = 0, - Triangles = false, - Blending = BlendingMode.Additive, - Interactive = false, - Colour = Color4.DarkGray, - Ripple = false - } - } + Child = introSequence = new IntroSequence(), } }; } @@ -122,14 +110,10 @@ namespace osu.Game.Screens.Menu { DidLoadMenu = true; Push(mainMenu); - }, 2300); + }, 3200); }, 600); - logo.ScaleTo(0.4f); - logo.FadeOut(); - - logo.ScaleTo(1, 4400, Easing.OutQuint); - logo.FadeIn(20000, Easing.OutQuint); + introSequence.Start(); } protected override void OnSuspending(Screen next) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs new file mode 100644 index 0000000000..c8a0d6f811 --- /dev/null +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -0,0 +1,48 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Graphics.Sprites; + +namespace osu.Game.Screens.Menu +{ + public class IntroSequence : Container + { + private OsuSpriteText welcomeText; + + public IntroSequence() + { + RelativeSizeAxes = Axes.Both; + Children = new Drawable[] + { + welcomeText = new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Text = "welcome", + Font = @"Exo2.0-Light", + TextSize = 50, + Alpha = 0, + } + }; + } + + public void Start() + { + welcomeText.FadeIn(1000); + welcomeText.TransformSpacingTo(new Vector2(20, 0), 3000, Easing.OutQuint); + } + + public void Restart() + { + FinishTransforms(true); + + welcomeText.Alpha = 0; + welcomeText.Spacing = Vector2.Zero; + + Start(); + } + } +} diff --git a/osu.Game/Tests/Visual/TestCaseIntro.cs b/osu.Game/Tests/Visual/TestCaseIntro.cs new file mode 100644 index 0000000000..3900afb1e7 --- /dev/null +++ b/osu.Game/Tests/Visual/TestCaseIntro.cs @@ -0,0 +1,43 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK.Graphics; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Timing; +using osu.Game.Screens.Menu; + +namespace osu.Game.Tests.Visual +{ + internal class TestCaseIntro : OsuTestCase + { + private readonly IntroSequence intro; + + public TestCaseIntro() + { + var rateAdjustClock = new StopwatchClock(true); + var framedClock = new FramedClock(rateAdjustClock); + + framedClock.ProcessFrame(); + + Add(new Container + { + RelativeSizeAxes = Axes.Both, + Clock = framedClock, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + }, + intro = new IntroSequence(), + } + }); + + AddStep(@"Restart", intro.Restart); + AddSliderStep("Playback speed", 0.0, 2.0, 1, v => rateAdjustClock.Rate = v); + } + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index c8e42a3ad3..f9c17a8cca 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -624,6 +624,7 @@ + @@ -746,6 +747,7 @@ + From cafacf20ffb86e4c7ab2ccca184de43c1b4d9590 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Thu, 5 Oct 2017 02:50:13 +0300 Subject: [PATCH 008/166] Add all the needed objects --- osu.Game/Screens/Menu/IntroSequence.cs | 267 ++++++++++++++++++++++++- 1 file changed, 258 insertions(+), 9 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index c8a0d6f811..8555e726e5 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -2,8 +2,12 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; +using OpenTK.Graphics; +using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics; using osu.Game.Graphics.Sprites; namespace osu.Game.Screens.Menu @@ -12,37 +16,282 @@ namespace osu.Game.Screens.Menu { private OsuSpriteText welcomeText; + private readonly Container barTopLeft; + private readonly Container barBottomLeft; + private readonly Container barTopRight; + private readonly Container barBottomRight; + + private readonly Ring smallRing; + private readonly Ring mediumRing; + private readonly Ring bigRing; + + private readonly Container backgroundFill; + private readonly Container foregroundFill; + + private readonly CircularContainer pinkCircle; + private readonly CircularContainer blueCircle; + private readonly CircularContainer yellowCircle; + private readonly CircularContainer purpleCircle; + public IntroSequence() { RelativeSizeAxes = Axes.Both; Children = new Drawable[] { - welcomeText = new OsuSpriteText + new CircularContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Text = "welcome", - Font = @"Exo2.0-Light", - TextSize = 50, - Alpha = 0, + Size = new Vector2(480), + Masking = true, + Children = new Drawable[] + { + mediumRing = new Ring(Color4.White.Opacity(80)), + barTopLeft = new Container + { + Origin = Anchor.CentreLeft, + Anchor = Anchor.Centre, + Size = new Vector2(100, 1.5f), + Position = new Vector2(-120, -120), + Rotation = 45, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White.Opacity(180), + } + }, + barTopRight = new Container + { + Origin = Anchor.CentreRight, + Anchor = Anchor.Centre, + Size = new Vector2(100, 1.5f), + Position = new Vector2(120, -120), + Rotation = -45, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White.Opacity(80), + } + }, + barBottomLeft = new Container + { + Origin = Anchor.CentreLeft, + Anchor = Anchor.Centre, + Size = new Vector2(100, 1.5f), + Position = new Vector2(-120, 120), + Rotation = -45, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White.Opacity(230), + } + }, + barBottomRight = new Container + { + Origin = Anchor.CentreRight, + Anchor = Anchor.Centre, + Size = new Vector2(100, 1.5f), + Position = new Vector2(120, 120), + Rotation = 45, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White.Opacity(130), + } + }, + smallRing = new Ring(Color4.White), + bigRing = new Ring(OsuColour.FromHex(@"B6C5E9")), + backgroundFill = new Container + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = OsuColour.FromHex(@"C6D8FF").Opacity(160), + } + }, + welcomeText = new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Text = "welcome", + Font = @"Exo2.0-Light", + TextSize = 42, + }, + foregroundFill = new Container + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White, + } + }, + } + }, + purpleCircle = new CircularContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.TopCentre, + Masking = true, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Purple, + } + }, + yellowCircle = new CircularContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.BottomCentre, + Masking = true, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Yellow, + } + }, + blueCircle = new CircularContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.CentreRight, + Masking = true, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Blue, + } + }, + pinkCircle = new CircularContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.CentreLeft, + Masking = true, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Pink, + } } }; + + setDefaults(); } public void Start() { welcomeText.FadeIn(1000); welcomeText.TransformSpacingTo(new Vector2(20, 0), 3000, Easing.OutQuint); + + smallRing.Background.ResizeTo(50, 1000, Easing.OutQuint); + smallRing.Foreground.Delay(100).ResizeTo(52, 1000, Easing.OutQuint); + + mediumRing.Background.ResizeTo(100, 1000, Easing.OutQuint); + mediumRing.Foreground.Delay(100).ResizeTo(102, 1000, Easing.OutQuint); + + bigRing.Background.Delay(1500).ResizeTo(400, 1000, Easing.OutQuint); + bigRing.Foreground.Delay(1600).ResizeTo(402, 1000, Easing.OutQuint); + + backgroundFill.Delay(2500).ResizeHeightTo(250, 500, Easing.OutQuint); + backgroundFill.Delay(2500).RotateTo(-45, 500, Easing.OutQuint); + + foregroundFill.Delay(2500).ResizeWidthTo(500, 1000, Easing.OutQuint); + foregroundFill.Delay(2500).RotateTo(-90, 1000, Easing.OutQuint); + + yellowCircle.Delay(3500).MoveToY(-220, 1000); + yellowCircle.Delay(3500).RotateTo(-180, 1000); + yellowCircle.Delay(3500).ResizeTo(438, 1000); + + purpleCircle.Delay(3500).MoveToY(220, 1000); + purpleCircle.Delay(3500).RotateTo(-180, 1000); + purpleCircle.Delay(3500).ResizeTo(438, 1000); + + blueCircle.Delay(3500).MoveToX(-220, 1000); + blueCircle.Delay(3500).RotateTo(-180, 1000); + blueCircle.Delay(3500).ResizeTo(438, 1000); + + pinkCircle.Delay(3500).MoveToX(220, 1000); + pinkCircle.Delay(3500).RotateTo(-180, 1000); + pinkCircle.Delay(3500).ResizeTo(440, 1000); + } + + private void setDefaults() + { + welcomeText.Alpha = 0; + welcomeText.Spacing = Vector2.Zero; + + smallRing.Background.Size = smallRing.Foreground.Size = Vector2.Zero; + mediumRing.Background.Size = mediumRing.Foreground.Size = Vector2.Zero; + bigRing.Background.Size = bigRing.Foreground.Size = Vector2.Zero; + + backgroundFill.Rotation = 0; + backgroundFill.Size = new Vector2(500, 0); + + foregroundFill.Rotation = 0; + foregroundFill.Size = new Vector2(0, 500); + + yellowCircle.Position = new Vector2(0, -300); + yellowCircle.Size = Vector2.Zero; + yellowCircle.Rotation = 0; + + purpleCircle.Position = new Vector2(0, 300); + purpleCircle.Size = Vector2.Zero; + purpleCircle.Rotation = 0; + + blueCircle.Position = new Vector2(-300, 0); + blueCircle.Size = Vector2.Zero; + blueCircle.Rotation = 0; + + pinkCircle.Position = new Vector2(300, 0); + pinkCircle.Size = Vector2.Zero; + pinkCircle.Rotation = 0; } public void Restart() { FinishTransforms(true); - - welcomeText.Alpha = 0; - welcomeText.Spacing = Vector2.Zero; - + setDefaults(); Start(); } + + private class Ring : Container + { + public CircularContainer Background; + public CircularContainer Foreground; + + public Ring(Color4 ringColour) + { + Anchor = Anchor.Centre; + Origin = Anchor.Centre; + AutoSizeAxes = Axes.Both; + Children = new[] + { + Background = new CircularContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Masking = true, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = ringColour, + } + }, + Foreground = new CircularContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Masking = true, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + } + } + }; + } + } } } From f8830e1b7c0418b34d325edecccf10abccec4b65 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Thu, 5 Oct 2017 21:37:37 +0300 Subject: [PATCH 009/166] Animation adjustments --- osu.Game/Screens/Menu/Intro.cs | 7 +- osu.Game/Screens/Menu/IntroSequence.cs | 130 +++++++++++++++---------- 2 files changed, 82 insertions(+), 55 deletions(-) diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 8be330bd32..013b9a450d 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -45,7 +45,10 @@ namespace osu.Game.Screens.Menu new ParallaxContainer { ParallaxAmount = 0.01f, - Child = introSequence = new IntroSequence(), + Child = introSequence = new IntroSequence + { + Blending = BlendingMode.Additive, + }, } }; } @@ -110,7 +113,7 @@ namespace osu.Game.Screens.Menu { DidLoadMenu = true; Push(mainMenu); - }, 3200); + }, 3500); }, 600); introSequence.Start(); diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 8555e726e5..454ca6c839 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -16,6 +16,8 @@ namespace osu.Game.Screens.Menu { private OsuSpriteText welcomeText; + private readonly OsuLogo logo; + private readonly Container barTopLeft; private readonly Container barBottomLeft; private readonly Container barTopRight; @@ -42,7 +44,7 @@ namespace osu.Game.Screens.Menu { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Size = new Vector2(480), + Size = new Vector2(460), Masking = true, Children = new Drawable[] { @@ -51,8 +53,6 @@ namespace osu.Game.Screens.Menu { Origin = Anchor.CentreLeft, Anchor = Anchor.Centre, - Size = new Vector2(100, 1.5f), - Position = new Vector2(-120, -120), Rotation = 45, Child = new Box { @@ -64,8 +64,6 @@ namespace osu.Game.Screens.Menu { Origin = Anchor.CentreRight, Anchor = Anchor.Centre, - Size = new Vector2(100, 1.5f), - Position = new Vector2(120, -120), Rotation = -45, Child = new Box { @@ -77,8 +75,6 @@ namespace osu.Game.Screens.Menu { Origin = Anchor.CentreLeft, Anchor = Anchor.Centre, - Size = new Vector2(100, 1.5f), - Position = new Vector2(-120, 120), Rotation = -45, Child = new Box { @@ -90,8 +86,6 @@ namespace osu.Game.Screens.Menu { Origin = Anchor.CentreRight, Anchor = Anchor.Centre, - Size = new Vector2(100, 1.5f), - Position = new Vector2(120, 120), Rotation = 45, Child = new Box { @@ -139,7 +133,7 @@ namespace osu.Game.Screens.Menu Child = new Box { RelativeSizeAxes = Axes.Both, - Colour = Color4.Purple, + Colour = OsuColour.FromHex(@"AA92FF"), } }, yellowCircle = new CircularContainer @@ -150,7 +144,7 @@ namespace osu.Game.Screens.Menu Child = new Box { RelativeSizeAxes = Axes.Both, - Colour = Color4.Yellow, + Colour = OsuColour.FromHex(@"FFD64C"), } }, blueCircle = new CircularContainer @@ -161,7 +155,7 @@ namespace osu.Game.Screens.Menu Child = new Box { RelativeSizeAxes = Axes.Both, - Colour = Color4.Blue, + Colour = OsuColour.FromHex(@"8FE5FE"), } }, pinkCircle = new CircularContainer @@ -172,9 +166,17 @@ namespace osu.Game.Screens.Menu Child = new Box { RelativeSizeAxes = Axes.Both, - Colour = Color4.Pink, + Colour = OsuColour.FromHex(@"e967a1"), } - } + }, + logo = new OsuLogo + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Ripple = false, + Interactive = false, + Blending = BlendingMode.Additive, + }, }; setDefaults(); @@ -182,71 +184,93 @@ namespace osu.Game.Screens.Menu public void Start() { - welcomeText.FadeIn(1000); - welcomeText.TransformSpacingTo(new Vector2(20, 0), 3000, Easing.OutQuint); + welcomeText.Delay(350).ScaleTo(1, 250, Easing.Out); + welcomeText.Delay(350).FadeIn(1000, Easing.Out); + welcomeText.Delay(350).TransformSpacingTo(new Vector2(20, 0), 1450, Easing.Out); - smallRing.Background.ResizeTo(50, 1000, Easing.OutQuint); - smallRing.Foreground.Delay(100).ResizeTo(52, 1000, Easing.OutQuint); + mediumRing.Background.ResizeTo(120, 500, Easing.InExpo); + mediumRing.Foreground.ResizeTo(80, 500, Easing.InQuint).Then().ResizeTo(124, 1000, Easing.OutQuint); - mediumRing.Background.ResizeTo(100, 1000, Easing.OutQuint); - mediumRing.Foreground.Delay(100).ResizeTo(102, 1000, Easing.OutQuint); + smallRing.Background.Delay(100).ResizeTo(45, 500, Easing.InExpo); + smallRing.Foreground.Delay(100).ResizeTo(35, 500, Easing.InQuint).Then().ResizeTo(49, 2000, Easing.OutQuint); - bigRing.Background.Delay(1500).ResizeTo(400, 1000, Easing.OutQuint); - bigRing.Foreground.Delay(1600).ResizeTo(402, 1000, Easing.OutQuint); + barTopLeft.Delay(500).FadeIn(); + barTopLeft.Delay(500).MoveTo(new Vector2(-120, -120), 900, Easing.OutQuint); + barTopLeft.Delay(600).ResizeWidthTo(0, 900, Easing.OutExpo); - backgroundFill.Delay(2500).ResizeHeightTo(250, 500, Easing.OutQuint); - backgroundFill.Delay(2500).RotateTo(-45, 500, Easing.OutQuint); + barTopRight.Delay(500).FadeIn(); + barTopRight.Delay(500).MoveTo(new Vector2(120, -120), 900, Easing.OutQuint); + barTopRight.Delay(600).ResizeWidthTo(0, 900, Easing.OutExpo); - foregroundFill.Delay(2500).ResizeWidthTo(500, 1000, Easing.OutQuint); - foregroundFill.Delay(2500).RotateTo(-90, 1000, Easing.OutQuint); + barBottomLeft.Delay(500).FadeIn(); + barBottomLeft.Delay(500).MoveTo(new Vector2(-120, 120), 900, Easing.OutQuint); + barBottomLeft.Delay(600).ResizeWidthTo(0, 900, Easing.OutExpo); - yellowCircle.Delay(3500).MoveToY(-220, 1000); - yellowCircle.Delay(3500).RotateTo(-180, 1000); - yellowCircle.Delay(3500).ResizeTo(438, 1000); + barBottomRight.Delay(500).FadeIn(); + barBottomRight.Delay(500).MoveTo(new Vector2(120, 120), 900, Easing.OutQuint); + barBottomRight.Delay(600).ResizeWidthTo(0, 900, Easing.OutExpo); - purpleCircle.Delay(3500).MoveToY(220, 1000); - purpleCircle.Delay(3500).RotateTo(-180, 1000); - purpleCircle.Delay(3500).ResizeTo(438, 1000); + bigRing.Background.Delay(1950).ResizeTo(400, 550, Easing.InOutQuint); + bigRing.Foreground.Delay(1950).ResizeTo(350, 450, Easing.InExpo).Then().ResizeTo(404, 500, Easing.OutExpo); - blueCircle.Delay(3500).MoveToX(-220, 1000); - blueCircle.Delay(3500).RotateTo(-180, 1000); - blueCircle.Delay(3500).ResizeTo(438, 1000); + backgroundFill.Delay(2317).ResizeHeightTo(450, 650, Easing.InOutQuint); + backgroundFill.Delay(2317).RotateTo(-90, 650, Easing.InOutQuint); - pinkCircle.Delay(3500).MoveToX(220, 1000); - pinkCircle.Delay(3500).RotateTo(-180, 1000); - pinkCircle.Delay(3500).ResizeTo(440, 1000); + foregroundFill.Delay(2350).ResizeWidthTo(500, 650, Easing.InOutQuint); + foregroundFill.Delay(2350).RotateTo(-90, 650, Easing.InOutQuint); + + yellowCircle.Delay(2383).MoveToY(-207, 617, Easing.InOutQuad); + yellowCircle.Delay(2383).RotateTo(-180, 617, Easing.InOutQuad); + yellowCircle.Delay(2383).ResizeTo(414, 617, Easing.InOutExpo); + + purpleCircle.Delay(2317).MoveToY(207, 683, Easing.InOutQuad); + purpleCircle.Delay(2317).RotateTo(-180, 683, Easing.InOutQuad); + purpleCircle.Delay(2317).ResizeTo(414, 683, Easing.InOutExpo); + + blueCircle.Delay(2449).MoveToX(-207, 551, Easing.InOutQuad); + blueCircle.Delay(2449).RotateTo(-180, 551, Easing.InOutQuad); + blueCircle.Delay(2449).ResizeTo(414, 551, Easing.InOutExpo); + + pinkCircle.Delay(2515).MoveToX(208, 485, Easing.InOutQuad); + pinkCircle.Delay(2515).RotateTo(-180, 485, Easing.InOutQuad); + pinkCircle.Delay(2515).ResizeTo(416, 485, Easing.InOutExpo); + + logo.Delay(3200).FadeIn(300); + + backgroundFill.Delay(3200).FadeOut(); + foregroundFill.Delay(3500).FadeOut(); } private void setDefaults() { - welcomeText.Alpha = 0; + logo.Alpha = 0; + + welcomeText.Scale = new Vector2(0.9f); welcomeText.Spacing = Vector2.Zero; + welcomeText.Alpha = 0; smallRing.Background.Size = smallRing.Foreground.Size = Vector2.Zero; mediumRing.Background.Size = mediumRing.Foreground.Size = Vector2.Zero; bigRing.Background.Size = bigRing.Foreground.Size = Vector2.Zero; - backgroundFill.Rotation = 0; - backgroundFill.Size = new Vector2(500, 0); + barTopLeft.Size = barTopRight.Size = barBottomLeft.Size = barBottomRight.Size = new Vector2(115, 1.5f); + barTopLeft.Alpha = barTopRight.Alpha = barBottomLeft.Alpha = barBottomRight.Alpha = 0; + barTopLeft.Position = new Vector2(-90, -90); + barTopRight.Position = new Vector2(90, -90); + barBottomLeft.Position = new Vector2(-90, 90); + barBottomRight.Position = new Vector2(90, 90); - foregroundFill.Rotation = 0; + backgroundFill.Rotation = foregroundFill.Rotation = 0; + backgroundFill.Alpha = foregroundFill.Alpha = 1; + backgroundFill.Size = new Vector2(500, 0); foregroundFill.Size = new Vector2(0, 500); + yellowCircle.Size = purpleCircle.Size = blueCircle.Size = pinkCircle.Size = Vector2.Zero; + yellowCircle.Rotation = purpleCircle.Rotation = blueCircle.Rotation = pinkCircle.Rotation = 0; yellowCircle.Position = new Vector2(0, -300); - yellowCircle.Size = Vector2.Zero; - yellowCircle.Rotation = 0; - purpleCircle.Position = new Vector2(0, 300); - purpleCircle.Size = Vector2.Zero; - purpleCircle.Rotation = 0; - blueCircle.Position = new Vector2(-300, 0); - blueCircle.Size = Vector2.Zero; - blueCircle.Rotation = 0; - pinkCircle.Position = new Vector2(300, 0); - pinkCircle.Size = Vector2.Zero; - pinkCircle.Rotation = 0; } public void Restart() From 59a0343c01398846bbacecdad8c950cd4e84baf8 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 10 Oct 2017 01:36:40 +0300 Subject: [PATCH 010/166] CI fixes --- osu.Game/Screens/Menu/IntroSequence.cs | 6 +++--- osu.Game/Tests/Visual/TestCaseIntro.cs | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 454ca6c839..3824cb7c13 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -14,7 +14,7 @@ namespace osu.Game.Screens.Menu { public class IntroSequence : Container { - private OsuSpriteText welcomeText; + private readonly OsuSpriteText welcomeText; private readonly OsuLogo logo; @@ -282,8 +282,8 @@ namespace osu.Game.Screens.Menu private class Ring : Container { - public CircularContainer Background; - public CircularContainer Foreground; + public readonly CircularContainer Background; + public readonly CircularContainer Foreground; public Ring(Color4 ringColour) { diff --git a/osu.Game/Tests/Visual/TestCaseIntro.cs b/osu.Game/Tests/Visual/TestCaseIntro.cs index 3900afb1e7..d803caf2b0 100644 --- a/osu.Game/Tests/Visual/TestCaseIntro.cs +++ b/osu.Game/Tests/Visual/TestCaseIntro.cs @@ -12,13 +12,12 @@ namespace osu.Game.Tests.Visual { internal class TestCaseIntro : OsuTestCase { - private readonly IntroSequence intro; - public TestCaseIntro() { + IntroSequence intro; + var rateAdjustClock = new StopwatchClock(true); var framedClock = new FramedClock(rateAdjustClock); - framedClock.ProcessFrame(); Add(new Container From e2d6659d48d3aafc79babc90bd03c3ee90de4836 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 10 Oct 2017 03:57:15 +0300 Subject: [PATCH 011/166] Change Ring type, use RelativeSizeAxes for Background/Foreground --- osu.Game/Screens/Menu/IntroSequence.cs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 3824cb7c13..e60f109cc3 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -99,6 +99,7 @@ namespace osu.Game.Screens.Menu { Anchor = Anchor.Centre, Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, Child = new Box { RelativeSizeAxes = Axes.Both, @@ -117,6 +118,7 @@ namespace osu.Game.Screens.Menu { Anchor = Anchor.Centre, Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, Child = new Box { RelativeSizeAxes = Axes.Both, @@ -189,10 +191,10 @@ namespace osu.Game.Screens.Menu welcomeText.Delay(350).TransformSpacingTo(new Vector2(20, 0), 1450, Easing.Out); mediumRing.Background.ResizeTo(120, 500, Easing.InExpo); - mediumRing.Foreground.ResizeTo(80, 500, Easing.InQuint).Then().ResizeTo(124, 1000, Easing.OutQuint); + mediumRing.Foreground.ResizeTo(0.8f, 500, Easing.InQuint).Then().ResizeTo(1, 1000, Easing.OutQuint); smallRing.Background.Delay(100).ResizeTo(45, 500, Easing.InExpo); - smallRing.Foreground.Delay(100).ResizeTo(35, 500, Easing.InQuint).Then().ResizeTo(49, 2000, Easing.OutQuint); + smallRing.Foreground.Delay(100).ResizeTo(0.8f, 500, Easing.InQuint).Then().ResizeTo(1, 2000, Easing.OutQuint); barTopLeft.Delay(500).FadeIn(); barTopLeft.Delay(500).MoveTo(new Vector2(-120, -120), 900, Easing.OutQuint); @@ -211,12 +213,12 @@ namespace osu.Game.Screens.Menu barBottomRight.Delay(600).ResizeWidthTo(0, 900, Easing.OutExpo); bigRing.Background.Delay(1950).ResizeTo(400, 550, Easing.InOutQuint); - bigRing.Foreground.Delay(1950).ResizeTo(350, 450, Easing.InExpo).Then().ResizeTo(404, 500, Easing.OutExpo); + bigRing.Foreground.Delay(1950).ResizeTo(0.8f, 450, Easing.InExpo).Then().ResizeTo(1, 500, Easing.OutExpo); - backgroundFill.Delay(2317).ResizeHeightTo(450, 650, Easing.InOutQuint); + backgroundFill.Delay(2317).ResizeHeightTo(1, 650, Easing.InOutQuint); backgroundFill.Delay(2317).RotateTo(-90, 650, Easing.InOutQuint); - foregroundFill.Delay(2350).ResizeWidthTo(500, 650, Easing.InOutQuint); + foregroundFill.Delay(2350).ResizeWidthTo(1, 650, Easing.InOutQuint); foregroundFill.Delay(2350).RotateTo(-90, 650, Easing.InOutQuint); yellowCircle.Delay(2383).MoveToY(-207, 617, Easing.InOutQuad); @@ -262,8 +264,7 @@ namespace osu.Game.Screens.Menu backgroundFill.Rotation = foregroundFill.Rotation = 0; backgroundFill.Alpha = foregroundFill.Alpha = 1; - backgroundFill.Size = new Vector2(500, 0); - foregroundFill.Size = new Vector2(0, 500); + backgroundFill.Height = foregroundFill.Width = 0; yellowCircle.Size = purpleCircle.Size = blueCircle.Size = pinkCircle.Size = Vector2.Zero; yellowCircle.Rotation = purpleCircle.Rotation = blueCircle.Rotation = pinkCircle.Rotation = 0; @@ -280,9 +281,9 @@ namespace osu.Game.Screens.Menu Start(); } - private class Ring : Container + private class Ring : CircularContainer { - public readonly CircularContainer Background; + public readonly Container Background; public readonly CircularContainer Foreground; public Ring(Color4 ringColour) @@ -290,13 +291,13 @@ namespace osu.Game.Screens.Menu Anchor = Anchor.Centre; Origin = Anchor.Centre; AutoSizeAxes = Axes.Both; + Masking = true; Children = new[] { - Background = new CircularContainer + Background = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Masking = true, Child = new Box { RelativeSizeAxes = Axes.Both, @@ -307,6 +308,7 @@ namespace osu.Game.Screens.Menu { Anchor = Anchor.Centre, Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, Masking = true, Child = new Box { From 19723b82f781839b27b6d8f8ecf5250c6c244fd1 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 10 Oct 2017 04:12:01 +0300 Subject: [PATCH 012/166] Remove ring's background field and adjust some timings --- osu.Game/Screens/Menu/IntroSequence.cs | 56 ++++++++++++-------------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index e60f109cc3..a2a75f6a52 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -190,29 +190,29 @@ namespace osu.Game.Screens.Menu welcomeText.Delay(350).FadeIn(1000, Easing.Out); welcomeText.Delay(350).TransformSpacingTo(new Vector2(20, 0), 1450, Easing.Out); - mediumRing.Background.ResizeTo(120, 500, Easing.InExpo); - mediumRing.Foreground.ResizeTo(0.8f, 500, Easing.InQuint).Then().ResizeTo(1, 1000, Easing.OutQuint); + mediumRing.ResizeTo(120, 500, Easing.InExpo); + mediumRing.Foreground.Delay(620).ResizeTo(1, 1000, Easing.OutQuint); - smallRing.Background.Delay(100).ResizeTo(45, 500, Easing.InExpo); - smallRing.Foreground.Delay(100).ResizeTo(0.8f, 500, Easing.InQuint).Then().ResizeTo(1, 2000, Easing.OutQuint); + smallRing.Delay(200).ResizeTo(45, 500, Easing.InExpo); + smallRing.Foreground.Delay(700).ResizeTo(1, 2000, Easing.OutQuint); - barTopLeft.Delay(500).FadeIn(); - barTopLeft.Delay(500).MoveTo(new Vector2(-120, -120), 900, Easing.OutQuint); - barTopLeft.Delay(600).ResizeWidthTo(0, 900, Easing.OutExpo); + barTopLeft.Delay(700).FadeIn(); + barTopLeft.Delay(700).MoveTo(new Vector2(-120, -120), 900, Easing.OutQuint); + barTopLeft.Delay(800).ResizeWidthTo(0, 900, Easing.OutExpo); - barTopRight.Delay(500).FadeIn(); - barTopRight.Delay(500).MoveTo(new Vector2(120, -120), 900, Easing.OutQuint); - barTopRight.Delay(600).ResizeWidthTo(0, 900, Easing.OutExpo); + barTopRight.Delay(700).FadeIn(); + barTopRight.Delay(700).MoveTo(new Vector2(120, -120), 900, Easing.OutQuint); + barTopRight.Delay(800).ResizeWidthTo(0, 900, Easing.OutExpo); - barBottomLeft.Delay(500).FadeIn(); - barBottomLeft.Delay(500).MoveTo(new Vector2(-120, 120), 900, Easing.OutQuint); - barBottomLeft.Delay(600).ResizeWidthTo(0, 900, Easing.OutExpo); + barBottomLeft.Delay(700).FadeIn(); + barBottomLeft.Delay(700).MoveTo(new Vector2(-120, 120), 900, Easing.OutQuint); + barBottomLeft.Delay(800).ResizeWidthTo(0, 900, Easing.OutExpo); - barBottomRight.Delay(500).FadeIn(); - barBottomRight.Delay(500).MoveTo(new Vector2(120, 120), 900, Easing.OutQuint); - barBottomRight.Delay(600).ResizeWidthTo(0, 900, Easing.OutExpo); + barBottomRight.Delay(700).FadeIn(); + barBottomRight.Delay(700).MoveTo(new Vector2(120, 120), 900, Easing.OutQuint); + barBottomRight.Delay(800).ResizeWidthTo(0, 900, Easing.OutExpo); - bigRing.Background.Delay(1950).ResizeTo(400, 550, Easing.InOutQuint); + bigRing.Delay(1950).ResizeTo(400, 550, Easing.InOutQuint); bigRing.Foreground.Delay(1950).ResizeTo(0.8f, 450, Easing.InExpo).Then().ResizeTo(1, 500, Easing.OutExpo); backgroundFill.Delay(2317).ResizeHeightTo(1, 650, Easing.InOutQuint); @@ -251,9 +251,10 @@ namespace osu.Game.Screens.Menu welcomeText.Spacing = Vector2.Zero; welcomeText.Alpha = 0; - smallRing.Background.Size = smallRing.Foreground.Size = Vector2.Zero; - mediumRing.Background.Size = mediumRing.Foreground.Size = Vector2.Zero; - bigRing.Background.Size = bigRing.Foreground.Size = Vector2.Zero; + smallRing.Size = mediumRing.Size = bigRing.Size = Vector2.Zero; + mediumRing.Foreground.Size = new Vector2(0.8f); + smallRing.Foreground.Size = new Vector2(0.7f); + bigRing.Foreground.Size = Vector2.Zero; barTopLeft.Size = barTopRight.Size = barBottomLeft.Size = barBottomRight.Size = new Vector2(115, 1.5f); barTopLeft.Alpha = barTopRight.Alpha = barBottomLeft.Alpha = barBottomRight.Alpha = 0; @@ -283,26 +284,19 @@ namespace osu.Game.Screens.Menu private class Ring : CircularContainer { - public readonly Container Background; public readonly CircularContainer Foreground; public Ring(Color4 ringColour) { Anchor = Anchor.Centre; Origin = Anchor.Centre; - AutoSizeAxes = Axes.Both; Masking = true; - Children = new[] + Children = new Drawable[] { - Background = new Container + new Box { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = ringColour, - } + RelativeSizeAxes = Axes.Both, + Colour = ringColour, }, Foreground = new CircularContainer { From 6fb8755a95df6c6af6f3f2790243aa5d3297c52e Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 10 Oct 2017 06:06:09 +0300 Subject: [PATCH 013/166] Use less masking for the ring --- osu.Game/Screens/Menu/IntroSequence.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index a2a75f6a52..8bff3b8aea 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -282,7 +282,7 @@ namespace osu.Game.Screens.Menu Start(); } - private class Ring : CircularContainer + private class Ring : Container { public readonly CircularContainer Foreground; @@ -290,13 +290,19 @@ namespace osu.Game.Screens.Menu { Anchor = Anchor.Centre; Origin = Anchor.Centre; - Masking = true; - Children = new Drawable[] + Children = new[] { - new Box + new CircularContainer { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, - Colour = ringColour, + Masking = true, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = ringColour, + } }, Foreground = new CircularContainer { From 9cad0ce2e9bc0c72ef4491eceb8557c6d56d6a18 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 10 Oct 2017 07:07:09 +0300 Subject: [PATCH 014/166] Group transforms using delayed sequence And some timing adjustments --- osu.Game/Screens/Menu/IntroSequence.cs | 199 ++++++++++++++----------- 1 file changed, 116 insertions(+), 83 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 8bff3b8aea..1aac7c7728 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -18,6 +18,8 @@ namespace osu.Game.Screens.Menu private readonly OsuLogo logo; + private readonly Container barsContainer; + private readonly Container barTopLeft; private readonly Container barBottomLeft; private readonly Container barTopRight; @@ -49,48 +51,57 @@ namespace osu.Game.Screens.Menu Children = new Drawable[] { mediumRing = new Ring(Color4.White.Opacity(80)), - barTopLeft = new Container + barsContainer = new Container { - Origin = Anchor.CentreLeft, Anchor = Anchor.Centre, - Rotation = 45, - Child = new Box + Origin = Anchor.Centre, + AutoSizeAxes = Axes.Both, + Children = new Drawable[] { - RelativeSizeAxes = Axes.Both, - Colour = Color4.White.Opacity(180), - } - }, - barTopRight = new Container - { - Origin = Anchor.CentreRight, - Anchor = Anchor.Centre, - Rotation = -45, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.White.Opacity(80), - } - }, - barBottomLeft = new Container - { - Origin = Anchor.CentreLeft, - Anchor = Anchor.Centre, - Rotation = -45, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.White.Opacity(230), - } - }, - barBottomRight = new Container - { - Origin = Anchor.CentreRight, - Anchor = Anchor.Centre, - Rotation = 45, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.White.Opacity(130), + barTopLeft = new Container + { + Origin = Anchor.CentreLeft, + Anchor = Anchor.Centre, + Rotation = 45, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White.Opacity(180), + } + }, + barTopRight = new Container + { + Origin = Anchor.CentreRight, + Anchor = Anchor.Centre, + Rotation = -45, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White.Opacity(80), + } + }, + barBottomLeft = new Container + { + Origin = Anchor.CentreLeft, + Anchor = Anchor.Centre, + Rotation = -45, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White.Opacity(230), + } + }, + barBottomRight = new Container + { + Origin = Anchor.CentreRight, + Anchor = Anchor.Centre, + Rotation = 45, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White.Opacity(130), + } + }, } }, smallRing = new Ring(Color4.White), @@ -186,56 +197,78 @@ namespace osu.Game.Screens.Menu public void Start() { - welcomeText.Delay(350).ScaleTo(1, 250, Easing.Out); - welcomeText.Delay(350).FadeIn(1000, Easing.Out); - welcomeText.Delay(350).TransformSpacingTo(new Vector2(20, 0), 1450, Easing.Out); + mediumRing.ResizeTo(130, 500, Easing.InExpo); + mediumRing.Foreground.Delay(500).ResizeTo(1, 1000, Easing.OutQuint); - mediumRing.ResizeTo(120, 500, Easing.InExpo); - mediumRing.Foreground.Delay(620).ResizeTo(1, 1000, Easing.OutQuint); + using (welcomeText.BeginDelayedSequence(350)) + { + welcomeText.ScaleTo(1, 250, Easing.Out); + welcomeText.FadeIn(1000, Easing.Out); + welcomeText.TransformSpacingTo(new Vector2(20, 0), 1450, Easing.Out); + } - smallRing.Delay(200).ResizeTo(45, 500, Easing.InExpo); - smallRing.Foreground.Delay(700).ResizeTo(1, 2000, Easing.OutQuint); + using (smallRing.BeginDelayedSequence(200)) + { + smallRing.ResizeTo(40, 400, Easing.InExpo); + smallRing.Foreground.Delay(400).ResizeTo(1, 1500, Easing.OutQuint); + } - barTopLeft.Delay(700).FadeIn(); - barTopLeft.Delay(700).MoveTo(new Vector2(-120, -120), 900, Easing.OutQuint); - barTopLeft.Delay(800).ResizeWidthTo(0, 900, Easing.OutExpo); + using (barsContainer.BeginDelayedSequence(500, true)) + { + foreach (var bar in barsContainer) + { + bar.FadeIn(); + bar.Delay(100).ResizeWidthTo(0, 900, Easing.OutExpo); + } - barTopRight.Delay(700).FadeIn(); - barTopRight.Delay(700).MoveTo(new Vector2(120, -120), 900, Easing.OutQuint); - barTopRight.Delay(800).ResizeWidthTo(0, 900, Easing.OutExpo); - - barBottomLeft.Delay(700).FadeIn(); - barBottomLeft.Delay(700).MoveTo(new Vector2(-120, 120), 900, Easing.OutQuint); - barBottomLeft.Delay(800).ResizeWidthTo(0, 900, Easing.OutExpo); - - barBottomRight.Delay(700).FadeIn(); - barBottomRight.Delay(700).MoveTo(new Vector2(120, 120), 900, Easing.OutQuint); - barBottomRight.Delay(800).ResizeWidthTo(0, 900, Easing.OutExpo); + barTopLeft.MoveTo(new Vector2(-120, -120), 900, Easing.OutQuint); + barTopRight.MoveTo(new Vector2(120, -120), 900, Easing.OutQuint); + barBottomLeft.MoveTo(new Vector2(-120, 120), 900, Easing.OutQuint); + barBottomRight.MoveTo(new Vector2(120, 120), 900, Easing.OutQuint); + } bigRing.Delay(1950).ResizeTo(400, 550, Easing.InOutQuint); bigRing.Foreground.Delay(1950).ResizeTo(0.8f, 450, Easing.InExpo).Then().ResizeTo(1, 500, Easing.OutExpo); - backgroundFill.Delay(2317).ResizeHeightTo(1, 650, Easing.InOutQuint); - backgroundFill.Delay(2317).RotateTo(-90, 650, Easing.InOutQuint); + using (backgroundFill.BeginDelayedSequence(2317)) + { + backgroundFill.ResizeHeightTo(1, 650, Easing.InOutQuint); + backgroundFill.RotateTo(-90, 650, Easing.InOutQuint); + } - foregroundFill.Delay(2350).ResizeWidthTo(1, 650, Easing.InOutQuint); - foregroundFill.Delay(2350).RotateTo(-90, 650, Easing.InOutQuint); + using (foregroundFill.BeginDelayedSequence(2350)) + { + foregroundFill.ResizeWidthTo(1, 650, Easing.InOutQuint); + foregroundFill.RotateTo(-90, 650, Easing.InOutQuint); + } - yellowCircle.Delay(2383).MoveToY(-207, 617, Easing.InOutQuad); - yellowCircle.Delay(2383).RotateTo(-180, 617, Easing.InOutQuad); - yellowCircle.Delay(2383).ResizeTo(414, 617, Easing.InOutExpo); + using (yellowCircle.BeginDelayedSequence(2383)) + { + yellowCircle.MoveToY(-207, 617, Easing.InOutQuad); + yellowCircle.RotateTo(-180, 617, Easing.InOutQuad); + yellowCircle.ResizeTo(414, 617, Easing.InOutSine); + } - purpleCircle.Delay(2317).MoveToY(207, 683, Easing.InOutQuad); - purpleCircle.Delay(2317).RotateTo(-180, 683, Easing.InOutQuad); - purpleCircle.Delay(2317).ResizeTo(414, 683, Easing.InOutExpo); + using (purpleCircle.BeginDelayedSequence(2317)) + { + purpleCircle.MoveToY(207, 683, Easing.InOutQuad); + purpleCircle.RotateTo(-180, 683, Easing.InOutQuad); + purpleCircle.ResizeTo(414, 683, Easing.InOutSine); + } - blueCircle.Delay(2449).MoveToX(-207, 551, Easing.InOutQuad); - blueCircle.Delay(2449).RotateTo(-180, 551, Easing.InOutQuad); - blueCircle.Delay(2449).ResizeTo(414, 551, Easing.InOutExpo); + using (blueCircle.BeginDelayedSequence(2449)) + { + blueCircle.MoveToX(-207, 551, Easing.InOutQuad); + blueCircle.RotateTo(-180, 551, Easing.InOutQuad); + blueCircle.ResizeTo(414, 551, Easing.InOutSine); + } - pinkCircle.Delay(2515).MoveToX(208, 485, Easing.InOutQuad); - pinkCircle.Delay(2515).RotateTo(-180, 485, Easing.InOutQuad); - pinkCircle.Delay(2515).ResizeTo(416, 485, Easing.InOutExpo); + using (pinkCircle.BeginDelayedSequence(2515)) + { + pinkCircle.MoveToX(208, 485, Easing.InOutQuad); + pinkCircle.RotateTo(-180, 485, Easing.InOutQuad); + pinkCircle.ResizeTo(416, 485, Easing.InOutSine); + } logo.Delay(3200).FadeIn(300); @@ -252,11 +285,11 @@ namespace osu.Game.Screens.Menu welcomeText.Alpha = 0; smallRing.Size = mediumRing.Size = bigRing.Size = Vector2.Zero; - mediumRing.Foreground.Size = new Vector2(0.8f); - smallRing.Foreground.Size = new Vector2(0.7f); + mediumRing.Foreground.Size = new Vector2(0.75f); + smallRing.Foreground.Size = new Vector2(0.5f); bigRing.Foreground.Size = Vector2.Zero; - barTopLeft.Size = barTopRight.Size = barBottomLeft.Size = barBottomRight.Size = new Vector2(115, 1.5f); + barTopLeft.Size = barTopRight.Size = barBottomLeft.Size = barBottomRight.Size = new Vector2(110, 1.5f); barTopLeft.Alpha = barTopRight.Alpha = barBottomLeft.Alpha = barBottomRight.Alpha = 0; barTopLeft.Position = new Vector2(-90, -90); barTopRight.Position = new Vector2(90, -90); @@ -269,10 +302,10 @@ namespace osu.Game.Screens.Menu yellowCircle.Size = purpleCircle.Size = blueCircle.Size = pinkCircle.Size = Vector2.Zero; yellowCircle.Rotation = purpleCircle.Rotation = blueCircle.Rotation = pinkCircle.Rotation = 0; - yellowCircle.Position = new Vector2(0, -300); - purpleCircle.Position = new Vector2(0, 300); - blueCircle.Position = new Vector2(-300, 0); - pinkCircle.Position = new Vector2(300, 0); + yellowCircle.Position = new Vector2(0, -250); + purpleCircle.Position = new Vector2(0, 250); + blueCircle.Position = new Vector2(-250, 0); + pinkCircle.Position = new Vector2(250, 0); } public void Restart() From ac7cabf5e6f6fc20a28379ec8d596abcb99dcd0e Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 10 Oct 2017 14:26:54 +0300 Subject: [PATCH 015/166] Framework update --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index ef889b4ec7..81c9517d04 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit ef889b4ec7e6175d52d64411c15f4f195fd16209 +Subproject commit 81c9517d04196866c363a68ba2d20b9bb8300a7b From 67a6da44f91363fbd6b01b8d073a49fb3dd67416 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 10 Oct 2017 15:02:43 +0300 Subject: [PATCH 016/166] Rings timing adjustment --- osu.Game/Screens/Menu/IntroSequence.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 1aac7c7728..9b588f168f 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -207,7 +207,7 @@ namespace osu.Game.Screens.Menu welcomeText.TransformSpacingTo(new Vector2(20, 0), 1450, Easing.Out); } - using (smallRing.BeginDelayedSequence(200)) + using (smallRing.BeginDelayedSequence(200, true)) { smallRing.ResizeTo(40, 400, Easing.InExpo); smallRing.Foreground.Delay(400).ResizeTo(1, 1500, Easing.OutQuint); @@ -227,8 +227,11 @@ namespace osu.Game.Screens.Menu barBottomRight.MoveTo(new Vector2(120, 120), 900, Easing.OutQuint); } - bigRing.Delay(1950).ResizeTo(400, 550, Easing.InOutQuint); - bigRing.Foreground.Delay(1950).ResizeTo(0.8f, 450, Easing.InExpo).Then().ResizeTo(1, 500, Easing.OutExpo); + using (bigRing.BeginDelayedSequence(1950, true)) + { + bigRing.ResizeTo(400, 550, Easing.OutQuint); + bigRing.Foreground.ResizeTo(1, 700, Easing.InOutQuad); + } using (backgroundFill.BeginDelayedSequence(2317)) { From c34b9aef98d7d3089998ec8299f70dca0e9398ff Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 10 Oct 2017 15:29:29 +0300 Subject: [PATCH 017/166] No need to put a lot of stuff inside the big circular container --- osu.Game/Screens/Menu/IntroSequence.cs | 112 ++++++++++++------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 9b588f168f..d5355cf4ca 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -42,6 +42,62 @@ namespace osu.Game.Screens.Menu RelativeSizeAxes = Axes.Both; Children = new Drawable[] { + mediumRing = new Ring(Color4.White.Opacity(80)), + barsContainer = new Container + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + AutoSizeAxes = Axes.Both, + Children = new Drawable[] + { + barTopLeft = new Container + { + Origin = Anchor.CentreLeft, + Anchor = Anchor.Centre, + Rotation = 45, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White.Opacity(180), + } + }, + barTopRight = new Container + { + Origin = Anchor.CentreRight, + Anchor = Anchor.Centre, + Rotation = -45, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White.Opacity(80), + } + }, + barBottomLeft = new Container + { + Origin = Anchor.CentreLeft, + Anchor = Anchor.Centre, + Rotation = -45, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White.Opacity(230), + } + }, + barBottomRight = new Container + { + Origin = Anchor.CentreRight, + Anchor = Anchor.Centre, + Rotation = 45, + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White.Opacity(130), + } + }, + } + }, + smallRing = new Ring(Color4.White), + bigRing = new Ring(OsuColour.FromHex(@"B6C5E9")), new CircularContainer { Anchor = Anchor.Centre, @@ -50,62 +106,6 @@ namespace osu.Game.Screens.Menu Masking = true, Children = new Drawable[] { - mediumRing = new Ring(Color4.White.Opacity(80)), - barsContainer = new Container - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - AutoSizeAxes = Axes.Both, - Children = new Drawable[] - { - barTopLeft = new Container - { - Origin = Anchor.CentreLeft, - Anchor = Anchor.Centre, - Rotation = 45, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.White.Opacity(180), - } - }, - barTopRight = new Container - { - Origin = Anchor.CentreRight, - Anchor = Anchor.Centre, - Rotation = -45, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.White.Opacity(80), - } - }, - barBottomLeft = new Container - { - Origin = Anchor.CentreLeft, - Anchor = Anchor.Centre, - Rotation = -45, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.White.Opacity(230), - } - }, - barBottomRight = new Container - { - Origin = Anchor.CentreRight, - Anchor = Anchor.Centre, - Rotation = 45, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.White.Opacity(130), - } - }, - } - }, - smallRing = new Ring(Color4.White), - bigRing = new Ring(OsuColour.FromHex(@"B6C5E9")), backgroundFill = new Container { Anchor = Anchor.Centre, From 10a3f7c1d025d420752f36cf2429e101e223f342 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 10 Oct 2017 18:30:46 +0300 Subject: [PATCH 018/166] Use constants instead of magic numbers --- osu.Game/Screens/Menu/IntroSequence.cs | 161 +++++++++++++++++-------- 1 file changed, 110 insertions(+), 51 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index d5355cf4ca..8b91671734 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -14,6 +14,56 @@ namespace osu.Game.Screens.Menu { public class IntroSequence : Container { + //Size + private const int logo_size = 460; + + private const int small_ring_size = 40; + private const int medium_ring_size = 130; + private const int big_ring_size = 400; + + private static readonly Vector2 medium_ring_thickness = new Vector2(0.25f); + private static readonly Vector2 small_ring_thickness = new Vector2(0.5f); + + private static readonly Vector2 bar_size = new Vector2(110, 1.5f); + + private const int colored_circle_size = 416; + + //Time + private const int full_animation_duration = 3000; + + private const int medium_ring_resize_duration = 500; + private const int medium_ring_fade_duration = 1000; + + private const int small_ring_animation_start_delay = 200; + private const int small_ring_resize_duration = 400; + private const int small_ring_fade_duration = 1500; + + private const int text_appear_delay = 350; + private const int text_scale_duration = 250; + private const int text_fade_duration = 1000; + private const int text_spacing_transform_duration = 1450; + + private const int bar_animation_duration = 1000; + private const int bar_resize_delay = 300; + + private const int big_ring_animation_start_delay = 1950; + private const int big_ring_resize_duration = 550; + private const int big_ring_fade_duration = 700; + + private const int background_animation_start_time = 2317; + private const int foreground_animation_start_time = 2350; + + private const int colored_curcle_rotation_delay = 100; + private const int purple_circle_animation_start_time = 2317; + private const int yellow_circle_animation_start_time = 2383; + private const int blue_circle_animation_start_time = 2449; + private const int pink_circle_animation_start_time = 2515; + + //Position + private const int bar_start_offset = 90; + private const int bar_end_offset = 120; + private const int colored_circle_offset = 250; + private readonly OsuSpriteText welcomeText; private readonly OsuLogo logo; @@ -102,7 +152,7 @@ namespace osu.Game.Screens.Menu { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Size = new Vector2(460), + Size = new Vector2(logo_size), Masking = true, Children = new Drawable[] { @@ -197,80 +247,89 @@ namespace osu.Game.Screens.Menu public void Start() { - mediumRing.ResizeTo(130, 500, Easing.InExpo); - mediumRing.Foreground.Delay(500).ResizeTo(1, 1000, Easing.OutQuint); + int duration; - using (welcomeText.BeginDelayedSequence(350)) + mediumRing.ResizeTo(medium_ring_size, medium_ring_resize_duration, Easing.InExpo); + mediumRing.Foreground.Delay(medium_ring_resize_duration).ResizeTo(1, medium_ring_fade_duration, Easing.OutQuint); + + using (welcomeText.BeginDelayedSequence(text_appear_delay)) { - welcomeText.ScaleTo(1, 250, Easing.Out); - welcomeText.FadeIn(1000, Easing.Out); - welcomeText.TransformSpacingTo(new Vector2(20, 0), 1450, Easing.Out); + welcomeText.ScaleTo(1, text_scale_duration, Easing.Out); + welcomeText.FadeIn(text_fade_duration, Easing.Out); + welcomeText.TransformSpacingTo(new Vector2(20, 0), text_spacing_transform_duration, Easing.Out); } - using (smallRing.BeginDelayedSequence(200, true)) + using (smallRing.BeginDelayedSequence(small_ring_animation_start_delay, true)) { - smallRing.ResizeTo(40, 400, Easing.InExpo); - smallRing.Foreground.Delay(400).ResizeTo(1, 1500, Easing.OutQuint); + smallRing.ResizeTo(small_ring_size, small_ring_resize_duration, Easing.InExpo); + smallRing.Foreground.Delay(small_ring_resize_duration).ResizeTo(1, small_ring_fade_duration, Easing.OutQuint); } + duration = bar_animation_duration - bar_resize_delay; using (barsContainer.BeginDelayedSequence(500, true)) { foreach (var bar in barsContainer) { bar.FadeIn(); - bar.Delay(100).ResizeWidthTo(0, 900, Easing.OutExpo); + bar.Delay(bar_resize_delay).ResizeWidthTo(0, duration, Easing.OutExpo); } - barTopLeft.MoveTo(new Vector2(-120, -120), 900, Easing.OutQuint); - barTopRight.MoveTo(new Vector2(120, -120), 900, Easing.OutQuint); - barBottomLeft.MoveTo(new Vector2(-120, 120), 900, Easing.OutQuint); - barBottomRight.MoveTo(new Vector2(120, 120), 900, Easing.OutQuint); + barTopLeft.MoveTo(new Vector2(-bar_end_offset, -bar_end_offset), bar_animation_duration, Easing.OutQuint); + barTopRight.MoveTo(new Vector2(bar_end_offset, -bar_end_offset), bar_animation_duration, Easing.OutQuint); + barBottomLeft.MoveTo(new Vector2(-bar_end_offset, bar_end_offset), bar_animation_duration, Easing.OutQuint); + barBottomRight.MoveTo(new Vector2(bar_end_offset, bar_end_offset), bar_animation_duration, Easing.OutQuint); } - using (bigRing.BeginDelayedSequence(1950, true)) + using (bigRing.BeginDelayedSequence(big_ring_animation_start_delay, true)) { - bigRing.ResizeTo(400, 550, Easing.OutQuint); - bigRing.Foreground.ResizeTo(1, 700, Easing.InOutQuad); + bigRing.ResizeTo(big_ring_size, big_ring_resize_duration, Easing.OutQuint); + bigRing.Foreground.ResizeTo(1, big_ring_fade_duration, Easing.InOutQuad); } - using (backgroundFill.BeginDelayedSequence(2317)) + duration = full_animation_duration - background_animation_start_time; + using (backgroundFill.BeginDelayedSequence(background_animation_start_time)) { - backgroundFill.ResizeHeightTo(1, 650, Easing.InOutQuint); - backgroundFill.RotateTo(-90, 650, Easing.InOutQuint); + backgroundFill.ResizeHeightTo(1, duration, Easing.InOutQuint); + backgroundFill.RotateTo(-90, duration, Easing.InOutQuint); } - using (foregroundFill.BeginDelayedSequence(2350)) + duration = full_animation_duration - foreground_animation_start_time; + using (foregroundFill.BeginDelayedSequence(foreground_animation_start_time)) { - foregroundFill.ResizeWidthTo(1, 650, Easing.InOutQuint); - foregroundFill.RotateTo(-90, 650, Easing.InOutQuint); + foregroundFill.ResizeWidthTo(1, duration, Easing.InOutQuint); + foregroundFill.RotateTo(-90, duration, Easing.InOutQuint); } - using (yellowCircle.BeginDelayedSequence(2383)) + duration = full_animation_duration - purple_circle_animation_start_time; + using (purpleCircle.BeginDelayedSequence(purple_circle_animation_start_time)) { - yellowCircle.MoveToY(-207, 617, Easing.InOutQuad); - yellowCircle.RotateTo(-180, 617, Easing.InOutQuad); - yellowCircle.ResizeTo(414, 617, Easing.InOutSine); + purpleCircle.MoveToY((colored_circle_size - 2) / 2, duration, Easing.InOutQuad); + purpleCircle.Delay(colored_curcle_rotation_delay).RotateTo(-180, duration - colored_curcle_rotation_delay, Easing.InOutQuad); + purpleCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutSine); } - using (purpleCircle.BeginDelayedSequence(2317)) + duration = full_animation_duration - yellow_circle_animation_start_time; + using (yellowCircle.BeginDelayedSequence(yellow_circle_animation_start_time)) { - purpleCircle.MoveToY(207, 683, Easing.InOutQuad); - purpleCircle.RotateTo(-180, 683, Easing.InOutQuad); - purpleCircle.ResizeTo(414, 683, Easing.InOutSine); + yellowCircle.MoveToY(-(colored_circle_size - 2) / 2, duration, Easing.InOutQuad); + yellowCircle.Delay(colored_curcle_rotation_delay).RotateTo(-180, duration - colored_curcle_rotation_delay, Easing.InOutQuad); + yellowCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutSine); } - using (blueCircle.BeginDelayedSequence(2449)) + duration = full_animation_duration - blue_circle_animation_start_time; + using (blueCircle.BeginDelayedSequence(blue_circle_animation_start_time)) { - blueCircle.MoveToX(-207, 551, Easing.InOutQuad); - blueCircle.RotateTo(-180, 551, Easing.InOutQuad); - blueCircle.ResizeTo(414, 551, Easing.InOutSine); + blueCircle.MoveToX(-(colored_circle_size - 2) / 2, duration, Easing.InOutQuad); + blueCircle.Delay(colored_curcle_rotation_delay).RotateTo(-180, duration - colored_curcle_rotation_delay, Easing.InOutQuad); + blueCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutSine); } - using (pinkCircle.BeginDelayedSequence(2515)) + duration = full_animation_duration - pink_circle_animation_start_time; + using (pinkCircle.BeginDelayedSequence(pink_circle_animation_start_time)) { - pinkCircle.MoveToX(208, 485, Easing.InOutQuad); - pinkCircle.RotateTo(-180, 485, Easing.InOutQuad); - pinkCircle.ResizeTo(416, 485, Easing.InOutSine); + pinkCircle.MoveToX(colored_circle_size / 2, duration, Easing.InOutQuad); + pinkCircle.Delay(colored_curcle_rotation_delay).RotateTo(-180, duration - colored_curcle_rotation_delay, Easing.InOutQuad); + pinkCircle.ResizeTo(colored_circle_size, duration, Easing.InOutSine); } logo.Delay(3200).FadeIn(300); @@ -288,16 +347,16 @@ namespace osu.Game.Screens.Menu welcomeText.Alpha = 0; smallRing.Size = mediumRing.Size = bigRing.Size = Vector2.Zero; - mediumRing.Foreground.Size = new Vector2(0.75f); - smallRing.Foreground.Size = new Vector2(0.5f); + mediumRing.Foreground.Size = Vector2.One - medium_ring_thickness; + smallRing.Foreground.Size = Vector2.One - small_ring_thickness; bigRing.Foreground.Size = Vector2.Zero; - barTopLeft.Size = barTopRight.Size = barBottomLeft.Size = barBottomRight.Size = new Vector2(110, 1.5f); + barTopLeft.Size = barTopRight.Size = barBottomLeft.Size = barBottomRight.Size = bar_size; barTopLeft.Alpha = barTopRight.Alpha = barBottomLeft.Alpha = barBottomRight.Alpha = 0; - barTopLeft.Position = new Vector2(-90, -90); - barTopRight.Position = new Vector2(90, -90); - barBottomLeft.Position = new Vector2(-90, 90); - barBottomRight.Position = new Vector2(90, 90); + barTopLeft.Position = new Vector2(-bar_start_offset, -bar_start_offset); + barTopRight.Position = new Vector2(bar_start_offset, -bar_start_offset); + barBottomLeft.Position = new Vector2(-bar_start_offset, bar_start_offset); + barBottomRight.Position = new Vector2(bar_start_offset, bar_start_offset); backgroundFill.Rotation = foregroundFill.Rotation = 0; backgroundFill.Alpha = foregroundFill.Alpha = 1; @@ -305,10 +364,10 @@ namespace osu.Game.Screens.Menu yellowCircle.Size = purpleCircle.Size = blueCircle.Size = pinkCircle.Size = Vector2.Zero; yellowCircle.Rotation = purpleCircle.Rotation = blueCircle.Rotation = pinkCircle.Rotation = 0; - yellowCircle.Position = new Vector2(0, -250); - purpleCircle.Position = new Vector2(0, 250); - blueCircle.Position = new Vector2(-250, 0); - pinkCircle.Position = new Vector2(250, 0); + yellowCircle.Position = new Vector2(0, -colored_circle_offset); + purpleCircle.Position = new Vector2(0, colored_circle_offset); + blueCircle.Position = new Vector2(-colored_circle_offset, 0); + pinkCircle.Position = new Vector2(colored_circle_offset, 0); } public void Restart() From a58e828f541f9bce3252a80fcafafcd4d876289e Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 10 Oct 2017 20:06:18 +0300 Subject: [PATCH 019/166] Timing adjustments --- osu.Game/Screens/Menu/IntroSequence.cs | 97 +++++++++++++------------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 8b91671734..43887edf97 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -21,46 +21,47 @@ namespace osu.Game.Screens.Menu private const int medium_ring_size = 130; private const int big_ring_size = 400; - private static readonly Vector2 medium_ring_thickness = new Vector2(0.25f); - private static readonly Vector2 small_ring_thickness = new Vector2(0.5f); + private static readonly Vector2 medium_ring_thickness = new Vector2(0.3f); + private static readonly Vector2 small_ring_thickness = new Vector2(0.6f); + private static readonly Vector2 big_ring_thickness = new Vector2(0.85f); - private static readonly Vector2 bar_size = new Vector2(110, 1.5f); + private static readonly Vector2 bar_size = new Vector2(105, 1.5f); private const int colored_circle_size = 416; //Time - private const int full_animation_duration = 3000; + private const int full_animation_duration = 2950; - private const int medium_ring_resize_duration = 500; - private const int medium_ring_fade_duration = 1000; + private const int medium_ring_resize_duration = 360; + private const int medium_ring_fade_duration = 420; private const int small_ring_animation_start_delay = 200; - private const int small_ring_resize_duration = 400; - private const int small_ring_fade_duration = 1500; + private const int small_ring_resize_duration = 250; + private const int small_ring_fade_duration = 650; - private const int text_appear_delay = 350; - private const int text_scale_duration = 250; - private const int text_fade_duration = 1000; - private const int text_spacing_transform_duration = 1450; + private const int text_appear_delay = 200; + private const int text_fade_duration = 700; + private const int text_spacing_transform_duration = 1500; - private const int bar_animation_duration = 1000; - private const int bar_resize_delay = 300; + private const int bar_animation_duration = 700; + private const int bar_resize_delay = 150; - private const int big_ring_animation_start_delay = 1950; - private const int big_ring_resize_duration = 550; - private const int big_ring_fade_duration = 700; + private const int big_ring_animation_start_delay = 2000; + private const int big_ring_resize_duration = 500; + private const int big_ring_foreground_resize_delay = 250; + private const int big_ring_fade_duration = 600; - private const int background_animation_start_time = 2317; - private const int foreground_animation_start_time = 2350; + private const int background_animation_start_time = 2250; + private const int foreground_animation_start_time = 2300; - private const int colored_curcle_rotation_delay = 100; - private const int purple_circle_animation_start_time = 2317; - private const int yellow_circle_animation_start_time = 2383; - private const int blue_circle_animation_start_time = 2449; - private const int pink_circle_animation_start_time = 2515; + private const int colored_curcle_rotation_delay = 150; + private const int purple_circle_animation_start_time = 2250; + private const int yellow_circle_animation_start_time = 2315; + private const int blue_circle_animation_start_time = 2380; + private const int pink_circle_animation_start_time = 2445; //Position - private const int bar_start_offset = 90; + private const int bar_start_offset = 80; private const int bar_end_offset = 120; private const int colored_circle_offset = 250; @@ -92,7 +93,7 @@ namespace osu.Game.Screens.Menu RelativeSizeAxes = Axes.Both; Children = new Drawable[] { - mediumRing = new Ring(Color4.White.Opacity(80)), + mediumRing = new Ring(Color4.White.Opacity(130)), barsContainer = new Container { Anchor = Anchor.Centre, @@ -250,28 +251,27 @@ namespace osu.Game.Screens.Menu int duration; mediumRing.ResizeTo(medium_ring_size, medium_ring_resize_duration, Easing.InExpo); - mediumRing.Foreground.Delay(medium_ring_resize_duration).ResizeTo(1, medium_ring_fade_duration, Easing.OutQuint); + mediumRing.Foreground.Delay(medium_ring_resize_duration).ResizeTo(1, medium_ring_fade_duration, Easing.OutQuad); using (welcomeText.BeginDelayedSequence(text_appear_delay)) { - welcomeText.ScaleTo(1, text_scale_duration, Easing.Out); - welcomeText.FadeIn(text_fade_duration, Easing.Out); + welcomeText.FadeIn(text_fade_duration); welcomeText.TransformSpacingTo(new Vector2(20, 0), text_spacing_transform_duration, Easing.Out); } using (smallRing.BeginDelayedSequence(small_ring_animation_start_delay, true)) { smallRing.ResizeTo(small_ring_size, small_ring_resize_duration, Easing.InExpo); - smallRing.Foreground.Delay(small_ring_resize_duration).ResizeTo(1, small_ring_fade_duration, Easing.OutQuint); + smallRing.Foreground.Delay(small_ring_resize_duration).ResizeTo(1, small_ring_fade_duration, Easing.OutQuad); } duration = bar_animation_duration - bar_resize_delay; - using (barsContainer.BeginDelayedSequence(500, true)) + using (barsContainer.BeginDelayedSequence(medium_ring_resize_duration, true)) { foreach (var bar in barsContainer) { bar.FadeIn(); - bar.Delay(bar_resize_delay).ResizeWidthTo(0, duration, Easing.OutExpo); + bar.Delay(bar_resize_delay).ResizeWidthTo(0, duration, Easing.OutQuint); } barTopLeft.MoveTo(new Vector2(-bar_end_offset, -bar_end_offset), bar_animation_duration, Easing.OutQuint); @@ -282,54 +282,54 @@ namespace osu.Game.Screens.Menu using (bigRing.BeginDelayedSequence(big_ring_animation_start_delay, true)) { - bigRing.ResizeTo(big_ring_size, big_ring_resize_duration, Easing.OutQuint); - bigRing.Foreground.ResizeTo(1, big_ring_fade_duration, Easing.InOutQuad); + bigRing.ResizeTo(big_ring_size, big_ring_resize_duration, Easing.InOutQuint); + bigRing.Foreground.Delay(big_ring_foreground_resize_delay).ResizeTo(1, big_ring_fade_duration, Easing.OutExpo); } duration = full_animation_duration - background_animation_start_time; using (backgroundFill.BeginDelayedSequence(background_animation_start_time)) { - backgroundFill.ResizeHeightTo(1, duration, Easing.InOutQuint); - backgroundFill.RotateTo(-90, duration, Easing.InOutQuint); + backgroundFill.ResizeHeightTo(1, duration, Easing.InOutQuart); + backgroundFill.RotateTo(-90, duration, Easing.InOutQuart); } duration = full_animation_duration - foreground_animation_start_time; using (foregroundFill.BeginDelayedSequence(foreground_animation_start_time)) { - foregroundFill.ResizeWidthTo(1, duration, Easing.InOutQuint); - foregroundFill.RotateTo(-90, duration, Easing.InOutQuint); + foregroundFill.ResizeWidthTo(1, duration, Easing.InOutQuart); + foregroundFill.RotateTo(-90, duration, Easing.InOutQuart); } duration = full_animation_duration - purple_circle_animation_start_time; using (purpleCircle.BeginDelayedSequence(purple_circle_animation_start_time)) { purpleCircle.MoveToY((colored_circle_size - 2) / 2, duration, Easing.InOutQuad); - purpleCircle.Delay(colored_curcle_rotation_delay).RotateTo(-180, duration - colored_curcle_rotation_delay, Easing.InOutQuad); - purpleCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutSine); + purpleCircle.Delay(colored_curcle_rotation_delay).RotateTo(-180, duration - colored_curcle_rotation_delay, Easing.OutQuad); + purpleCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutQuad); } duration = full_animation_duration - yellow_circle_animation_start_time; using (yellowCircle.BeginDelayedSequence(yellow_circle_animation_start_time)) { yellowCircle.MoveToY(-(colored_circle_size - 2) / 2, duration, Easing.InOutQuad); - yellowCircle.Delay(colored_curcle_rotation_delay).RotateTo(-180, duration - colored_curcle_rotation_delay, Easing.InOutQuad); - yellowCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutSine); + yellowCircle.Delay(colored_curcle_rotation_delay).RotateTo(-180, duration - colored_curcle_rotation_delay, Easing.OutQuad); + yellowCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutQuad); } duration = full_animation_duration - blue_circle_animation_start_time; using (blueCircle.BeginDelayedSequence(blue_circle_animation_start_time)) { blueCircle.MoveToX(-(colored_circle_size - 2) / 2, duration, Easing.InOutQuad); - blueCircle.Delay(colored_curcle_rotation_delay).RotateTo(-180, duration - colored_curcle_rotation_delay, Easing.InOutQuad); - blueCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutSine); + blueCircle.Delay(colored_curcle_rotation_delay).RotateTo(-180, duration - colored_curcle_rotation_delay, Easing.OutQuad); + blueCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutQuad); } duration = full_animation_duration - pink_circle_animation_start_time; using (pinkCircle.BeginDelayedSequence(pink_circle_animation_start_time)) { pinkCircle.MoveToX(colored_circle_size / 2, duration, Easing.InOutQuad); - pinkCircle.Delay(colored_curcle_rotation_delay).RotateTo(-180, duration - colored_curcle_rotation_delay, Easing.InOutQuad); - pinkCircle.ResizeTo(colored_circle_size, duration, Easing.InOutSine); + pinkCircle.Delay(colored_curcle_rotation_delay).RotateTo(-180, duration - colored_curcle_rotation_delay, Easing.OutQuad); + pinkCircle.ResizeTo(colored_circle_size, duration, Easing.InOutQuad); } logo.Delay(3200).FadeIn(300); @@ -342,14 +342,13 @@ namespace osu.Game.Screens.Menu { logo.Alpha = 0; - welcomeText.Scale = new Vector2(0.9f); - welcomeText.Spacing = Vector2.Zero; + welcomeText.Spacing = new Vector2(5); welcomeText.Alpha = 0; smallRing.Size = mediumRing.Size = bigRing.Size = Vector2.Zero; mediumRing.Foreground.Size = Vector2.One - medium_ring_thickness; smallRing.Foreground.Size = Vector2.One - small_ring_thickness; - bigRing.Foreground.Size = Vector2.Zero; + bigRing.Foreground.Size = Vector2.One - big_ring_thickness; barTopLeft.Size = barTopRight.Size = barBottomLeft.Size = barBottomRight.Size = bar_size; barTopLeft.Alpha = barTopRight.Alpha = barBottomLeft.Alpha = barBottomRight.Alpha = 0; From 57a4a1d8d4ac3297b4bbfa4083c63ae75a075d5e Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 10 Oct 2017 20:07:12 +0300 Subject: [PATCH 020/166] Framework update --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 81c9517d04..d64d5fe880 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 81c9517d04196866c363a68ba2d20b9bb8300a7b +Subproject commit d64d5fe880c017b2f69d79bc5c09f363b0f9ff5d From d3a62082b45eecb9130e74a134ef70497040f574 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 10 Oct 2017 20:20:49 +0300 Subject: [PATCH 021/166] Final adjustments --- osu.Game/Screens/Menu/IntroSequence.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 43887edf97..4c4b48ea5b 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -49,17 +49,19 @@ namespace osu.Game.Screens.Menu private const int big_ring_animation_start_delay = 2000; private const int big_ring_resize_duration = 500; private const int big_ring_foreground_resize_delay = 250; - private const int big_ring_fade_duration = 600; + private const int big_ring_fade_duration = 450; private const int background_animation_start_time = 2250; private const int foreground_animation_start_time = 2300; - private const int colored_curcle_rotation_delay = 150; + private const int colored_curcle_rotation_delay = 110; private const int purple_circle_animation_start_time = 2250; private const int yellow_circle_animation_start_time = 2315; private const int blue_circle_animation_start_time = 2380; private const int pink_circle_animation_start_time = 2445; + private const int logo_fade_duration = 300; + //Position private const int bar_start_offset = 80; private const int bar_end_offset = 120; @@ -332,10 +334,10 @@ namespace osu.Game.Screens.Menu pinkCircle.ResizeTo(colored_circle_size, duration, Easing.InOutQuad); } - logo.Delay(3200).FadeIn(300); + logo.Delay(full_animation_duration).FadeIn(logo_fade_duration); - backgroundFill.Delay(3200).FadeOut(); - foregroundFill.Delay(3500).FadeOut(); + backgroundFill.Delay(full_animation_duration + logo_fade_duration).FadeOut(); + foregroundFill.Delay(full_animation_duration + logo_fade_duration).FadeOut(); } private void setDefaults() From 15160f5116ac0f8905778d9e85e4de99bc49728f Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 10 Oct 2017 20:43:07 +0300 Subject: [PATCH 022/166] Simplify the code by using more delayed sequences --- osu.Game/Screens/Menu/IntroSequence.cs | 64 ++++++++++++-------------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 4c4b48ea5b..c67aa775e9 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -35,11 +35,9 @@ namespace osu.Game.Screens.Menu private const int medium_ring_resize_duration = 360; private const int medium_ring_fade_duration = 420; - private const int small_ring_animation_start_delay = 200; private const int small_ring_resize_duration = 250; private const int small_ring_fade_duration = 650; - private const int text_appear_delay = 200; private const int text_fade_duration = 700; private const int text_spacing_transform_duration = 1500; @@ -54,11 +52,9 @@ namespace osu.Game.Screens.Menu private const int background_animation_start_time = 2250; private const int foreground_animation_start_time = 2300; - private const int colored_curcle_rotation_delay = 110; + private const int colored_circle_rotation_delay = 110; + private const int colored_circles_appear_delay = 80; private const int purple_circle_animation_start_time = 2250; - private const int yellow_circle_animation_start_time = 2315; - private const int blue_circle_animation_start_time = 2380; - private const int pink_circle_animation_start_time = 2445; private const int logo_fade_duration = 300; @@ -253,23 +249,21 @@ namespace osu.Game.Screens.Menu int duration; mediumRing.ResizeTo(medium_ring_size, medium_ring_resize_duration, Easing.InExpo); - mediumRing.Foreground.Delay(medium_ring_resize_duration).ResizeTo(1, medium_ring_fade_duration, Easing.OutQuad); - using (welcomeText.BeginDelayedSequence(text_appear_delay)) + using (BeginDelayedSequence(200, true)) { welcomeText.FadeIn(text_fade_duration); welcomeText.TransformSpacingTo(new Vector2(20, 0), text_spacing_transform_duration, Easing.Out); - } - using (smallRing.BeginDelayedSequence(small_ring_animation_start_delay, true)) - { smallRing.ResizeTo(small_ring_size, small_ring_resize_duration, Easing.InExpo); smallRing.Foreground.Delay(small_ring_resize_duration).ResizeTo(1, small_ring_fade_duration, Easing.OutQuad); } duration = bar_animation_duration - bar_resize_delay; - using (barsContainer.BeginDelayedSequence(medium_ring_resize_duration, true)) + using (BeginDelayedSequence(medium_ring_resize_duration, true)) { + mediumRing.Foreground.ResizeTo(1, medium_ring_fade_duration, Easing.OutQuad); + foreach (var bar in barsContainer) { bar.FadeIn(); @@ -303,35 +297,35 @@ namespace osu.Game.Screens.Menu } duration = full_animation_duration - purple_circle_animation_start_time; - using (purpleCircle.BeginDelayedSequence(purple_circle_animation_start_time)) + using (BeginDelayedSequence(purple_circle_animation_start_time, true)) { purpleCircle.MoveToY((colored_circle_size - 2) / 2, duration, Easing.InOutQuad); - purpleCircle.Delay(colored_curcle_rotation_delay).RotateTo(-180, duration - colored_curcle_rotation_delay, Easing.OutQuad); + purpleCircle.Delay(colored_circle_rotation_delay).RotateTo(-180, duration - colored_circle_rotation_delay, Easing.OutQuad); purpleCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutQuad); - } - duration = full_animation_duration - yellow_circle_animation_start_time; - using (yellowCircle.BeginDelayedSequence(yellow_circle_animation_start_time)) - { - yellowCircle.MoveToY(-(colored_circle_size - 2) / 2, duration, Easing.InOutQuad); - yellowCircle.Delay(colored_curcle_rotation_delay).RotateTo(-180, duration - colored_curcle_rotation_delay, Easing.OutQuad); - yellowCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutQuad); - } + duration -= colored_circles_appear_delay; + using (BeginDelayedSequence(colored_circles_appear_delay, true)) + { + yellowCircle.MoveToY(-(colored_circle_size - 2) / 2, duration, Easing.InOutQuad); + yellowCircle.Delay(colored_circle_rotation_delay).RotateTo(-180, duration - colored_circle_rotation_delay, Easing.OutQuad); + yellowCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutQuad); - duration = full_animation_duration - blue_circle_animation_start_time; - using (blueCircle.BeginDelayedSequence(blue_circle_animation_start_time)) - { - blueCircle.MoveToX(-(colored_circle_size - 2) / 2, duration, Easing.InOutQuad); - blueCircle.Delay(colored_curcle_rotation_delay).RotateTo(-180, duration - colored_curcle_rotation_delay, Easing.OutQuad); - blueCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutQuad); - } + duration -= colored_circles_appear_delay; + using (BeginDelayedSequence(colored_circles_appear_delay, true)) + { + blueCircle.MoveToX(-(colored_circle_size - 2) / 2, duration, Easing.InOutQuad); + blueCircle.Delay(colored_circle_rotation_delay).RotateTo(-180, duration - colored_circle_rotation_delay, Easing.OutQuad); + blueCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutQuad); - duration = full_animation_duration - pink_circle_animation_start_time; - using (pinkCircle.BeginDelayedSequence(pink_circle_animation_start_time)) - { - pinkCircle.MoveToX(colored_circle_size / 2, duration, Easing.InOutQuad); - pinkCircle.Delay(colored_curcle_rotation_delay).RotateTo(-180, duration - colored_curcle_rotation_delay, Easing.OutQuad); - pinkCircle.ResizeTo(colored_circle_size, duration, Easing.InOutQuad); + duration -= colored_circles_appear_delay; + using (BeginDelayedSequence(colored_circles_appear_delay, true)) + { + pinkCircle.MoveToX(colored_circle_size / 2, duration, Easing.InOutQuad); + pinkCircle.Delay(colored_circle_rotation_delay).RotateTo(-180, duration - colored_circle_rotation_delay, Easing.OutQuad); + pinkCircle.ResizeTo(colored_circle_size, duration, Easing.InOutQuad); + } + } + } } logo.Delay(full_animation_duration).FadeIn(logo_fade_duration); From 28a594179f998a833b2ec01e78e086f6d9140ede Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 10 Oct 2017 21:03:35 +0300 Subject: [PATCH 023/166] CI fixes --- osu.Game/Screens/Menu/IntroSequence.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index c67aa775e9..963f069312 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -246,8 +246,6 @@ namespace osu.Game.Screens.Menu public void Start() { - int duration; - mediumRing.ResizeTo(medium_ring_size, medium_ring_resize_duration, Easing.InExpo); using (BeginDelayedSequence(200, true)) @@ -259,7 +257,7 @@ namespace osu.Game.Screens.Menu smallRing.Foreground.Delay(small_ring_resize_duration).ResizeTo(1, small_ring_fade_duration, Easing.OutQuad); } - duration = bar_animation_duration - bar_resize_delay; + int duration = bar_animation_duration - bar_resize_delay; using (BeginDelayedSequence(medium_ring_resize_duration, true)) { mediumRing.Foreground.ResizeTo(1, medium_ring_fade_duration, Easing.OutQuad); @@ -299,28 +297,28 @@ namespace osu.Game.Screens.Menu duration = full_animation_duration - purple_circle_animation_start_time; using (BeginDelayedSequence(purple_circle_animation_start_time, true)) { - purpleCircle.MoveToY((colored_circle_size - 2) / 2, duration, Easing.InOutQuad); + purpleCircle.MoveToY((colored_circle_size - 2) / 2.0f, duration, Easing.InOutQuad); purpleCircle.Delay(colored_circle_rotation_delay).RotateTo(-180, duration - colored_circle_rotation_delay, Easing.OutQuad); purpleCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutQuad); duration -= colored_circles_appear_delay; using (BeginDelayedSequence(colored_circles_appear_delay, true)) { - yellowCircle.MoveToY(-(colored_circle_size - 2) / 2, duration, Easing.InOutQuad); + yellowCircle.MoveToY(-(colored_circle_size - 2) / 2.0f, duration, Easing.InOutQuad); yellowCircle.Delay(colored_circle_rotation_delay).RotateTo(-180, duration - colored_circle_rotation_delay, Easing.OutQuad); yellowCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutQuad); duration -= colored_circles_appear_delay; using (BeginDelayedSequence(colored_circles_appear_delay, true)) { - blueCircle.MoveToX(-(colored_circle_size - 2) / 2, duration, Easing.InOutQuad); + blueCircle.MoveToX(-(colored_circle_size - 2) / 2.0f, duration, Easing.InOutQuad); blueCircle.Delay(colored_circle_rotation_delay).RotateTo(-180, duration - colored_circle_rotation_delay, Easing.OutQuad); blueCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutQuad); duration -= colored_circles_appear_delay; using (BeginDelayedSequence(colored_circles_appear_delay, true)) { - pinkCircle.MoveToX(colored_circle_size / 2, duration, Easing.InOutQuad); + pinkCircle.MoveToX(colored_circle_size / 2.0f, duration, Easing.InOutQuad); pinkCircle.Delay(colored_circle_rotation_delay).RotateTo(-180, duration - colored_circle_rotation_delay, Easing.OutQuad); pinkCircle.ResizeTo(colored_circle_size, duration, Easing.InOutQuad); } From 7cff413ab016a4f2dcdffbfcb060f3d5e2fd1718 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Wed, 11 Oct 2017 20:25:12 +0300 Subject: [PATCH 024/166] Fix wrong beatmap selection in song-select menu on deleting selected beatmap --- osu.Game/Screens/Select/BeatmapCarousel.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index c72f599955..245dfb091c 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -375,6 +375,9 @@ namespace osu.Game.Screens.Select if (group == null) return; + if (selectedGroup == group) + SelectNext(); + groups.Remove(group); panels.Remove(group.Header); foreach (var p in group.BeatmapPanels) @@ -383,9 +386,6 @@ namespace osu.Game.Screens.Select scrollableContent.Remove(group.Header); scrollableContent.RemoveRange(group.BeatmapPanels); - if (selectedGroup == group) - SelectNext(); - computeYPositions(); } From 502940ddf3cb372457de78d2bb6d532e7ef2e2d6 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 14 Oct 2017 05:05:38 +0300 Subject: [PATCH 025/166] Fix deleting last visible beatmap doesn't trigger selecting null beatmap --- osu.Game/Screens/Select/BeatmapCarousel.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 245dfb091c..326b632630 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -181,13 +181,18 @@ namespace osu.Game.Screens.Select public Action HideDifficultyRequested; + private void selectNullBeatmap() + { + selectedGroup = null; + selectedPanel = null; + SelectionChanged?.Invoke(null); + } + public void SelectNext(int direction = 1, bool skipDifficulties = true) { if (groups.All(g => g.State == BeatmapGroupState.Hidden)) { - selectedGroup = null; - selectedPanel = null; - SelectionChanged?.Invoke(null); + selectNullBeatmap(); return; } @@ -376,7 +381,12 @@ namespace osu.Game.Screens.Select return; if (selectedGroup == group) - SelectNext(); + { + if (getVisibleGroups().Count() == 1) + selectNullBeatmap(); + else + SelectNext(); + } groups.Remove(group); panels.Remove(group.Header); From 7a72f2e3f558f6ec765582dbdc74cc1965dfcdb4 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 14 Oct 2017 05:15:18 +0300 Subject: [PATCH 026/166] Make sure we restore the clock rate on exiting --- osu.Game/Screens/Play/Player.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 7af260135e..c0a50b1a6f 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -49,6 +49,7 @@ namespace osu.Game.Screens.Play private IAdjustableClock adjustableSourceClock; private FramedOffsetClock offsetClock; private DecoupleableInterpolatingFramedClock decoupledClock; + private double clockRate; private PauseContainer pauseContainer; @@ -149,6 +150,8 @@ namespace osu.Game.Screens.Play foreach (var mod in working.Mods.Value.OfType()) mod.ApplyToClock(adjustableSourceClock); + clockRate = adjustableSourceClock.Rate; + decoupledClock.ChangeSource(adjustableSourceClock); }); @@ -334,6 +337,8 @@ namespace osu.Game.Screens.Play { if (HasFailed || !ValidForResume || pauseContainer?.AllowExit != false || RulesetContainer?.HasReplayLoaded != false) { + // We want to make sure we restore the clock rate + adjustableSourceClock.Rate = clockRate; fadeOut(); return base.OnExiting(next); } From 22d222354cc89ba786f11a8923d6b0265f58391a Mon Sep 17 00:00:00 2001 From: Shane Woolcock Date: Thu, 26 Oct 2017 18:45:20 +1030 Subject: [PATCH 027/166] Change SettingsItem to use GetBoundCopy to ensure it has the right class for numeric bindables --- osu.Game/Overlays/Settings/SettingsItem.cs | 27 ++++++++++++++-------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index 5a0f25f7e0..e03fc91aa7 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -80,7 +80,7 @@ namespace osu.Game.Overlays.Settings controlWithCurrent?.Current.BindTo(bindable); if (ShowsDefaultIndicator) { - restoreDefaultValueButton.Bindable.BindTo(bindable); + restoreDefaultValueButton.Bindable = bindable.GetBoundCopy(); restoreDefaultValueButton.Bindable.TriggerChange(); } } @@ -134,7 +134,17 @@ namespace osu.Game.Overlays.Settings private class RestoreDefaultValueButton : Box, IHasTooltip { - internal readonly Bindable Bindable = new Bindable(); + private Bindable bindable; + internal Bindable Bindable + { + get { return bindable; } + set + { + bindable = value; + bindable.ValueChanged += newValue => UpdateState(); + bindable.DisabledChanged += disabled => UpdateState(); + } + } private Color4 buttonColour; @@ -142,9 +152,6 @@ namespace osu.Game.Overlays.Settings public RestoreDefaultValueButton() { - Bindable.ValueChanged += value => UpdateState(); - Bindable.DisabledChanged += disabled => UpdateState(); - RelativeSizeAxes = Axes.Y; Width = SettingsOverlay.CONTENT_MARGINS; Alpha = 0f; @@ -160,8 +167,8 @@ namespace osu.Game.Overlays.Settings protected override bool OnClick(InputState state) { - if (!Bindable.Disabled) - Bindable.SetDefault(); + if (bindable != null && !bindable.Disabled) + bindable.SetDefault(); return true; } @@ -186,8 +193,10 @@ namespace osu.Game.Overlays.Settings internal void UpdateState() { - var colour = Bindable.Disabled ? Color4.Gray : buttonColour; - this.FadeTo(Bindable.IsDefault ? 0f : hovering && !Bindable.Disabled ? 1f : 0.5f, 200, Easing.OutQuint); + if (bindable == null) + return; + var colour = bindable.Disabled ? Color4.Gray : buttonColour; + this.FadeTo(bindable.IsDefault ? 0f : hovering && !bindable.Disabled ? 1f : 0.5f, 200, Easing.OutQuint); this.FadeColour(ColourInfo.GradientHorizontal(colour.Opacity(0.8f), colour.Opacity(0)), 200, Easing.OutQuint); } } From e5dae81356fcde259e4de7974f981f58b4074d72 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Thu, 26 Oct 2017 14:42:23 +0300 Subject: [PATCH 028/166] Move testcase to the right place --- osu.Game.Tests/Visual/TestCaseIntro.cs | 42 ++++++++++++++++++++++++++ osu.Game.Tests/osu.Game.Tests.csproj | 1 + 2 files changed, 43 insertions(+) create mode 100644 osu.Game.Tests/Visual/TestCaseIntro.cs diff --git a/osu.Game.Tests/Visual/TestCaseIntro.cs b/osu.Game.Tests/Visual/TestCaseIntro.cs new file mode 100644 index 0000000000..6d03705bf3 --- /dev/null +++ b/osu.Game.Tests/Visual/TestCaseIntro.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK.Graphics; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Timing; +using osu.Game.Screens.Menu; + +namespace osu.Game.Tests.Visual +{ + public class TestCaseIntro : OsuTestCase + { + public TestCaseIntro() + { + IntroSequence intro; + + var rateAdjustClock = new StopwatchClock(true); + var framedClock = new FramedClock(rateAdjustClock); + framedClock.ProcessFrame(); + + Add(new Container + { + RelativeSizeAxes = Axes.Both, + Clock = framedClock, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + }, + intro = new IntroSequence(), + } + }); + + AddStep(@"Restart", intro.Restart); + AddSliderStep("Playback speed", 0.0, 2.0, 1, v => rateAdjustClock.Rate = v); + } + } +} diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index e0e9fb7b5e..31d48097f9 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -110,6 +110,7 @@ + From db3e4e77da165e29ac7b4a434c6d822742d29d0a Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Thu, 26 Oct 2017 14:45:45 +0300 Subject: [PATCH 029/166] Submodules update --- osu-framework | 2 +- osu-resources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 5986f21268..a9eb6eaab7 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 5986f2126832451a5a7ec832a483e1dcec1b38b8 +Subproject commit a9eb6eaab7cd77f881acfdc23664df45e5d31105 diff --git a/osu-resources b/osu-resources index a4418111f8..1e2d394e01 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit a4418111f8ed2350a6fd46fe69258884f0757745 +Subproject commit 1e2d394e017d98f086271ae07fb61859b5d8fadf From 826d806e814e8720c433dbee2f5f9dd4da6bdd49 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Thu, 26 Oct 2017 15:07:58 +0300 Subject: [PATCH 030/166] Submodules update --- osu-framework | 2 +- osu-resources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 5986f21268..a9eb6eaab7 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 5986f2126832451a5a7ec832a483e1dcec1b38b8 +Subproject commit a9eb6eaab7cd77f881acfdc23664df45e5d31105 diff --git a/osu-resources b/osu-resources index a4418111f8..1e2d394e01 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit a4418111f8ed2350a6fd46fe69258884f0757745 +Subproject commit 1e2d394e017d98f086271ae07fb61859b5d8fadf From a7bcae48694a1ead3949cedcf866c59d3b77d751 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Thu, 26 Oct 2017 15:18:06 +0300 Subject: [PATCH 031/166] Add startup value for the slider --- osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs index 4fea69e259..7cabe1f3ab 100644 --- a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs @@ -19,7 +19,7 @@ namespace osu.Game.Screens.Play.ReplaySettings Child = sliderbar = new ReplaySliderBar { LabelText = "Playback speed", - Bindable = new BindableDouble + Bindable = new BindableDouble(1) { Default = 1, MinValue = 0.5, From 8138796ee3f863ce1052cb1c8ccfd448981ccd2a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Nov 2017 14:53:33 +0900 Subject: [PATCH 032/166] Fix VisualTests configuration being completely wrong --- osu.Game/osu.Game.csproj | 15 --------------- osu.sln | 17 ++++++++++------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index a99e97eabb..db27c77188 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -83,21 +83,6 @@ - - true - bin\Debug\ - TRACE;DEBUG - true - 0 - true - full - AnyCPU - false - 6 - prompt - --tests - false - $(SolutionDir)\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll diff --git a/osu.sln b/osu.sln index b1341051f9..e86dd70d0b 100644 --- a/osu.sln +++ b/osu.sln @@ -1,11 +1,11 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio 15 +VisualStudioVersion = 15.0.27004.2006 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game", "osu.Game\osu.Game.csproj", "{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Framework", "osu-framework\osu.Framework\osu.Framework.csproj", "{C76BF5B3-985E-4D39-95FE-97C9C879B83A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Framework", "osu-framework\osu.Framework\osu.Framework.csproj", "{C76BF5B3-985E-4D39-95FE-97C9C879B83A}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Resources", "osu-resources\osu.Game.Resources\osu.Game.Resources.csproj", "{D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}" EndProject @@ -34,8 +34,8 @@ Global {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Debug|Any CPU.Build.0 = Debug|Any CPU {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Release|Any CPU.ActiveCfg = Release|Any CPU {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.Release|Any CPU.Build.0 = Release|Any CPU - {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.VisualTests|Any CPU.ActiveCfg = VisualTests|Any CPU - {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.VisualTests|Any CPU.Build.0 = VisualTests|Any CPU + {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU + {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}.VisualTests|Any CPU.Build.0 = Debug|Any CPU {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Debug|Any CPU.Build.0 = Debug|Any CPU {C76BF5B3-985E-4D39-95FE-97C9C879B83A}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -85,12 +85,15 @@ Global {419659FD-72EA-4678-9EB8-B22A746CED70}.Debug|Any CPU.Build.0 = Debug|Any CPU {419659FD-72EA-4678-9EB8-B22A746CED70}.Release|Any CPU.ActiveCfg = Release|Any CPU {419659FD-72EA-4678-9EB8-B22A746CED70}.Release|Any CPU.Build.0 = Release|Any CPU - {419659FD-72EA-4678-9EB8-B22A746CED70}.VisualTests|Any CPU.ActiveCfg = Debug|Any CPU - {419659FD-72EA-4678-9EB8-B22A746CED70}.VisualTests|Any CPU.Build.0 = Debug|Any CPU + {419659FD-72EA-4678-9EB8-B22A746CED70}.VisualTests|Any CPU.ActiveCfg = VisualTests|Any CPU + {419659FD-72EA-4678-9EB8-B22A746CED70}.VisualTests|Any CPU.Build.0 = VisualTests|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {671B0BEC-2403-45B0-9357-2C97CC517668} + EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution Policies = $0 $0.TextStylePolicy = $1 From cbf543de73f808c9e5c636a463cdab4fa6357b96 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Nov 2017 15:31:38 +0900 Subject: [PATCH 033/166] Apply framework project format revert --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index ef10edfc75..715a8328a8 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit ef10edfc750b39258edbff46019f1d10700548c2 +Subproject commit 715a8328a80af072c31dbc807b3119b3c58df8c6 From bcc30fd9470b6dfc9151929dab0184c7fb4660ca Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Nov 2017 16:03:46 +0900 Subject: [PATCH 034/166] Revert osu-resources --- osu-resources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-resources b/osu-resources index a4418111f8..1750ab8f67 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit a4418111f8ed2350a6fd46fe69258884f0757745 +Subproject commit 1750ab8f6761ab35592fd46da71fbe0c141bfd93 From 15197b9a7650723180606a317a0f93649ae5a6d6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Nov 2017 16:57:59 +0900 Subject: [PATCH 035/166] Use internal less Allows for more dynamic compilation to succeed. No reason for using internal here anyways. --- osu.Game/Screens/Edit/Editor.cs | 2 +- osu.Game/Screens/Loader.cs | 2 +- osu.Game/Screens/Menu/Disclaimer.cs | 6 +++--- osu.Game/Screens/Menu/Intro.cs | 4 ++-- osu.Game/Screens/Menu/MainMenu.cs | 2 +- osu.Game/Screens/OsuScreen.cs | 8 ++++---- osu.Game/Screens/Play/Player.cs | 6 +++--- osu.Game/Screens/Play/PlayerLoader.cs | 4 ++-- osu.Game/Screens/Ranking/Results.cs | 2 +- osu.Game/Screens/Tournament/Drawings.cs | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index c610a24e22..74e55e58ad 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -24,7 +24,7 @@ namespace osu.Game.Screens.Edit { protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg4"); - internal override bool ShowOverlays => false; + public override bool ShowOverlays => false; private readonly Box bottomBackground; private readonly Container screenContainer; diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index af084e740b..295b3603be 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -8,7 +8,7 @@ namespace osu.Game.Screens { internal class Loader : OsuScreen { - internal override bool ShowOverlays => false; + public override bool ShowOverlays => false; public Loader() { diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index 1ac5823ec4..532ee71b72 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -12,15 +12,15 @@ using OpenTK.Graphics; namespace osu.Game.Screens.Menu { - internal class Disclaimer : OsuScreen + public class Disclaimer : OsuScreen { private Intro intro; private readonly SpriteIcon icon; private Color4 iconColour; - internal override bool ShowOverlays => false; + public override bool ShowOverlays => false; - internal override bool HasLocalCursorDisplayed => true; + public override bool HasLocalCursorDisplayed => true; public Disclaimer() { diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 066391b11f..09958472e2 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -32,9 +32,9 @@ namespace osu.Game.Screens.Menu private SampleChannel welcome; private SampleChannel seeya; - internal override bool HasLocalCursorDisplayed => true; + public override bool HasLocalCursorDisplayed => true; - internal override bool ShowOverlays => false; + public override bool ShowOverlays => false; protected override BackgroundScreen CreateBackground() => new BackgroundScreenEmpty(); diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 1c82d15f50..ff902bf28b 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -23,7 +23,7 @@ namespace osu.Game.Screens.Menu { private readonly ButtonSystem buttons; - internal override bool ShowOverlays => buttons.State != MenuState.Initial; + public override bool ShowOverlays => buttons.State != MenuState.Initial; private readonly BackgroundScreenDefault background; private Screen songSelect; diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index ae10d8828b..2a3cba0d49 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -16,7 +16,7 @@ namespace osu.Game.Screens { public abstract class OsuScreen : Screen { - internal BackgroundScreen Background { get; private set; } + public BackgroundScreen Background { get; private set; } /// /// Override to create a BackgroundMode for the current screen. @@ -24,17 +24,17 @@ namespace osu.Game.Screens /// protected virtual BackgroundScreen CreateBackground() => null; - internal virtual bool ShowOverlays => true; + public virtual bool ShowOverlays => true; protected new OsuGameBase Game => base.Game as OsuGameBase; - internal virtual bool HasLocalCursorDisplayed => false; + public virtual bool HasLocalCursorDisplayed => false; /// /// Whether the beatmap or ruleset should be allowed to be changed by the user or game. /// Used to mark exclusive areas where this is strongly prohibited, like gameplay. /// - internal virtual bool AllowBeatmapRulesetChange => true; + public virtual bool AllowBeatmapRulesetChange => true; protected readonly Bindable Beatmap = new Bindable(); diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 589f4b663a..3775b9c933 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -34,13 +34,13 @@ namespace osu.Game.Screens.Play { protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap); - internal override bool ShowOverlays => false; + public override bool ShowOverlays => false; - internal override bool HasLocalCursorDisplayed => !pauseContainer.IsPaused && !HasFailed && RulesetContainer.ProvidingUserCursor; + public override bool HasLocalCursorDisplayed => !pauseContainer.IsPaused && !HasFailed && RulesetContainer.ProvidingUserCursor; public Action RestartRequested; - internal override bool AllowBeatmapRulesetChange => false; + public override bool AllowBeatmapRulesetChange => false; public bool HasFailed { get; private set; } diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index a5248acbe4..71c2ec9a6d 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -24,9 +24,9 @@ namespace osu.Game.Screens.Play private BeatmapMetadataDisplay info; private bool showOverlays = true; - internal override bool ShowOverlays => showOverlays; + public override bool ShowOverlays => showOverlays; - internal override bool AllowBeatmapRulesetChange => false; + public override bool AllowBeatmapRulesetChange => false; protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap); diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index 60ad484673..8e27cb235c 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -31,7 +31,7 @@ namespace osu.Game.Screens.Ranking private ResultModeTabControl modeChangeButtons; - internal override bool AllowBeatmapRulesetChange => false; + public override bool AllowBeatmapRulesetChange => false; private Container currentPage; diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game/Screens/Tournament/Drawings.cs index 3d27552212..e540782fc1 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game/Screens/Tournament/Drawings.cs @@ -29,7 +29,7 @@ namespace osu.Game.Screens.Tournament { private const string results_filename = "drawings_results.txt"; - internal override bool ShowOverlays => false; + public override bool ShowOverlays => false; protected override BackgroundScreen CreateBackground() => new BackgroundScreenDefault(); From 09e0bd7a7853ff4663896e5b66cbfb45e781da8c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Nov 2017 16:58:12 +0900 Subject: [PATCH 036/166] Remove unused class file --- osu.Game/Tests/Visual/TestCaseIntro.cs | 42 -------------------------- 1 file changed, 42 deletions(-) delete mode 100644 osu.Game/Tests/Visual/TestCaseIntro.cs diff --git a/osu.Game/Tests/Visual/TestCaseIntro.cs b/osu.Game/Tests/Visual/TestCaseIntro.cs deleted file mode 100644 index d803caf2b0..0000000000 --- a/osu.Game/Tests/Visual/TestCaseIntro.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using OpenTK.Graphics; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Shapes; -using osu.Framework.Timing; -using osu.Game.Screens.Menu; - -namespace osu.Game.Tests.Visual -{ - internal class TestCaseIntro : OsuTestCase - { - public TestCaseIntro() - { - IntroSequence intro; - - var rateAdjustClock = new StopwatchClock(true); - var framedClock = new FramedClock(rateAdjustClock); - framedClock.ProcessFrame(); - - Add(new Container - { - RelativeSizeAxes = Axes.Both, - Clock = framedClock, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, - }, - intro = new IntroSequence(), - } - }); - - AddStep(@"Restart", intro.Restart); - AddSliderStep("Playback speed", 0.0, 2.0, 1, v => rateAdjustClock.Rate = v); - } - } -} From fd5bc6fe58e086f09cd4814664d624420361806d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Nov 2017 17:06:55 +0900 Subject: [PATCH 037/166] Make ParallaxContainer public --- osu.Game/Graphics/Containers/ParallaxContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Containers/ParallaxContainer.cs b/osu.Game/Graphics/Containers/ParallaxContainer.cs index 3e0ed4b059..362563507b 100644 --- a/osu.Game/Graphics/Containers/ParallaxContainer.cs +++ b/osu.Game/Graphics/Containers/ParallaxContainer.cs @@ -11,7 +11,7 @@ using osu.Framework.Configuration; namespace osu.Game.Graphics.Containers { - internal class ParallaxContainer : Container, IRequireHighFrequencyMousePosition + public class ParallaxContainer : Container, IRequireHighFrequencyMousePosition { public float ParallaxAmount = 0.02f; From 27156aeb9304cafb86534e01b10294724f671844 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Nov 2017 17:07:03 +0900 Subject: [PATCH 038/166] Fix the shit --- osu.Game.Tests/Visual/TestCaseIntro.cs | 7 ++ osu.Game/Screens/Menu/IntroSequence.cs | 138 ++++++++++++------------- 2 files changed, 72 insertions(+), 73 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseIntro.cs b/osu.Game.Tests/Visual/TestCaseIntro.cs index 6d03705bf3..a2375a592e 100644 --- a/osu.Game.Tests/Visual/TestCaseIntro.cs +++ b/osu.Game.Tests/Visual/TestCaseIntro.cs @@ -1,6 +1,8 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; +using System.Collections.Generic; using OpenTK.Graphics; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -12,6 +14,11 @@ namespace osu.Game.Tests.Visual { public class TestCaseIntro : OsuTestCase { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(IntroSequence) + }; + public TestCaseIntro() { IntroSequence intro; diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 963f069312..37c891a13a 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -15,53 +15,7 @@ namespace osu.Game.Screens.Menu public class IntroSequence : Container { //Size - private const int logo_size = 460; - - private const int small_ring_size = 40; - private const int medium_ring_size = 130; - private const int big_ring_size = 400; - - private static readonly Vector2 medium_ring_thickness = new Vector2(0.3f); - private static readonly Vector2 small_ring_thickness = new Vector2(0.6f); - private static readonly Vector2 big_ring_thickness = new Vector2(0.85f); - - private static readonly Vector2 bar_size = new Vector2(105, 1.5f); - - private const int colored_circle_size = 416; - - //Time - private const int full_animation_duration = 2950; - - private const int medium_ring_resize_duration = 360; - private const int medium_ring_fade_duration = 420; - - private const int small_ring_resize_duration = 250; - private const int small_ring_fade_duration = 650; - - private const int text_fade_duration = 700; - private const int text_spacing_transform_duration = 1500; - - private const int bar_animation_duration = 700; - private const int bar_resize_delay = 150; - - private const int big_ring_animation_start_delay = 2000; - private const int big_ring_resize_duration = 500; - private const int big_ring_foreground_resize_delay = 250; - private const int big_ring_fade_duration = 450; - - private const int background_animation_start_time = 2250; - private const int foreground_animation_start_time = 2300; - - private const int colored_circle_rotation_delay = 110; - private const int colored_circles_appear_delay = 80; - private const int purple_circle_animation_start_time = 2250; - - private const int logo_fade_duration = 300; - - //Position - private const int bar_start_offset = 80; - private const int bar_end_offset = 120; - private const int colored_circle_offset = 250; + private const int logo_size = 460; //todo: this should probably be 480 private readonly OsuSpriteText welcomeText; @@ -246,18 +200,51 @@ namespace osu.Game.Screens.Menu public void Start() { - mediumRing.ResizeTo(medium_ring_size, medium_ring_resize_duration, Easing.InExpo); + const int circle_size = 416; + + //Time + const int full_animation_duration = 2950; + + const int medium_ring_resize_duration = 360; + const int medium_ring_fade_duration = 420; + + const int small_ring_resize_duration = 250; + const int small_ring_fade_duration = 650; + + const int text_fade_duration = 700; + const int text_spacing_transform_duration = 1500; + + const int bar_animation_duration = 700; + const int bar_resize_delay = 150; + + const int big_ring_animation_start_delay = 2000; + const int big_ring_resize_duration = 500; + const int big_ring_foreground_resize_delay = 250; + const int big_ring_fade_duration = 450; + + const int background_animation_start_time = 2250; + const int foreground_animation_start_time = 2300; + + const int colored_circle_rotation_delay = 110; + const int colored_circles_appear_delay = 80; + const int purple_circle_animation_start_time = 2250; + + const int logo_fade_duration = 300; + + //Position + const int bar_end_offset = 120; + + mediumRing.ResizeTo(130, medium_ring_resize_duration, Easing.InExpo); using (BeginDelayedSequence(200, true)) { welcomeText.FadeIn(text_fade_duration); welcomeText.TransformSpacingTo(new Vector2(20, 0), text_spacing_transform_duration, Easing.Out); - smallRing.ResizeTo(small_ring_size, small_ring_resize_duration, Easing.InExpo); + smallRing.ResizeTo(40, small_ring_resize_duration, Easing.InExpo); smallRing.Foreground.Delay(small_ring_resize_duration).ResizeTo(1, small_ring_fade_duration, Easing.OutQuad); } - int duration = bar_animation_duration - bar_resize_delay; using (BeginDelayedSequence(medium_ring_resize_duration, true)) { mediumRing.Foreground.ResizeTo(1, medium_ring_fade_duration, Easing.OutQuad); @@ -265,7 +252,7 @@ namespace osu.Game.Screens.Menu foreach (var bar in barsContainer) { bar.FadeIn(); - bar.Delay(bar_resize_delay).ResizeWidthTo(0, duration, Easing.OutQuint); + bar.Delay(bar_resize_delay).ResizeWidthTo(0, bar_animation_duration - bar_resize_delay, Easing.OutQuint); } barTopLeft.MoveTo(new Vector2(-bar_end_offset, -bar_end_offset), bar_animation_duration, Easing.OutQuint); @@ -276,11 +263,11 @@ namespace osu.Game.Screens.Menu using (bigRing.BeginDelayedSequence(big_ring_animation_start_delay, true)) { - bigRing.ResizeTo(big_ring_size, big_ring_resize_duration, Easing.InOutQuint); + bigRing.ResizeTo(400, big_ring_resize_duration, Easing.InOutQuint); bigRing.Foreground.Delay(big_ring_foreground_resize_delay).ResizeTo(1, big_ring_fade_duration, Easing.OutExpo); } - duration = full_animation_duration - background_animation_start_time; + int duration = full_animation_duration - background_animation_start_time; using (backgroundFill.BeginDelayedSequence(background_animation_start_time)) { backgroundFill.ResizeHeightTo(1, duration, Easing.InOutQuart); @@ -297,30 +284,30 @@ namespace osu.Game.Screens.Menu duration = full_animation_duration - purple_circle_animation_start_time; using (BeginDelayedSequence(purple_circle_animation_start_time, true)) { - purpleCircle.MoveToY((colored_circle_size - 2) / 2.0f, duration, Easing.InOutQuad); + purpleCircle.MoveToY((circle_size - 2) / 2.0f, duration, Easing.InOutQuad); purpleCircle.Delay(colored_circle_rotation_delay).RotateTo(-180, duration - colored_circle_rotation_delay, Easing.OutQuad); - purpleCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutQuad); + purpleCircle.ResizeTo(circle_size - 2, duration, Easing.InOutQuad); duration -= colored_circles_appear_delay; using (BeginDelayedSequence(colored_circles_appear_delay, true)) { - yellowCircle.MoveToY(-(colored_circle_size - 2) / 2.0f, duration, Easing.InOutQuad); + yellowCircle.MoveToY(-(circle_size - 2) / 2.0f, duration, Easing.InOutQuad); yellowCircle.Delay(colored_circle_rotation_delay).RotateTo(-180, duration - colored_circle_rotation_delay, Easing.OutQuad); - yellowCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutQuad); + yellowCircle.ResizeTo(circle_size - 2, duration, Easing.InOutQuad); duration -= colored_circles_appear_delay; using (BeginDelayedSequence(colored_circles_appear_delay, true)) { - blueCircle.MoveToX(-(colored_circle_size - 2) / 2.0f, duration, Easing.InOutQuad); + blueCircle.MoveToX(-(circle_size - 2) / 2.0f, duration, Easing.InOutQuad); blueCircle.Delay(colored_circle_rotation_delay).RotateTo(-180, duration - colored_circle_rotation_delay, Easing.OutQuad); - blueCircle.ResizeTo(colored_circle_size - 2, duration, Easing.InOutQuad); + blueCircle.ResizeTo(circle_size - 2, duration, Easing.InOutQuad); duration -= colored_circles_appear_delay; using (BeginDelayedSequence(colored_circles_appear_delay, true)) { - pinkCircle.MoveToX(colored_circle_size / 2.0f, duration, Easing.InOutQuad); + pinkCircle.MoveToX(circle_size / 2.0f, duration, Easing.InOutQuad); pinkCircle.Delay(colored_circle_rotation_delay).RotateTo(-180, duration - colored_circle_rotation_delay, Easing.OutQuad); - pinkCircle.ResizeTo(colored_circle_size, duration, Easing.InOutQuad); + pinkCircle.ResizeTo(circle_size, duration, Easing.InOutQuad); } } } @@ -340,16 +327,19 @@ namespace osu.Game.Screens.Menu welcomeText.Alpha = 0; smallRing.Size = mediumRing.Size = bigRing.Size = Vector2.Zero; - mediumRing.Foreground.Size = Vector2.One - medium_ring_thickness; - smallRing.Foreground.Size = Vector2.One - small_ring_thickness; - bigRing.Foreground.Size = Vector2.One - big_ring_thickness; - barTopLeft.Size = barTopRight.Size = barBottomLeft.Size = barBottomRight.Size = bar_size; + mediumRing.Foreground.Size = Vector2.One - new Vector2(0.7f); + smallRing.Foreground.Size = Vector2.One - new Vector2(0.4f); + bigRing.Foreground.Size = Vector2.One - new Vector2(0.15f); + + barTopLeft.Size = barTopRight.Size = barBottomLeft.Size = barBottomRight.Size = new Vector2(105, 1.5f); barTopLeft.Alpha = barTopRight.Alpha = barBottomLeft.Alpha = barBottomRight.Alpha = 0; - barTopLeft.Position = new Vector2(-bar_start_offset, -bar_start_offset); - barTopRight.Position = new Vector2(bar_start_offset, -bar_start_offset); - barBottomLeft.Position = new Vector2(-bar_start_offset, bar_start_offset); - barBottomRight.Position = new Vector2(bar_start_offset, bar_start_offset); + + const int bar_offset = 80; + barTopLeft.Position = new Vector2(-bar_offset, -bar_offset); + barTopRight.Position = new Vector2(bar_offset, -bar_offset); + barBottomLeft.Position = new Vector2(-bar_offset, bar_offset); + barBottomRight.Position = new Vector2(bar_offset, bar_offset); backgroundFill.Rotation = foregroundFill.Rotation = 0; backgroundFill.Alpha = foregroundFill.Alpha = 1; @@ -357,10 +347,12 @@ namespace osu.Game.Screens.Menu yellowCircle.Size = purpleCircle.Size = blueCircle.Size = pinkCircle.Size = Vector2.Zero; yellowCircle.Rotation = purpleCircle.Rotation = blueCircle.Rotation = pinkCircle.Rotation = 0; - yellowCircle.Position = new Vector2(0, -colored_circle_offset); - purpleCircle.Position = new Vector2(0, colored_circle_offset); - blueCircle.Position = new Vector2(-colored_circle_offset, 0); - pinkCircle.Position = new Vector2(colored_circle_offset, 0); + + const int circle_offset = 250; + yellowCircle.Position = new Vector2(0, -circle_offset); + purpleCircle.Position = new Vector2(0, circle_offset); + blueCircle.Position = new Vector2(-circle_offset, 0); + pinkCircle.Position = new Vector2(circle_offset, 0); } public void Restart() From 6fa02ce9bbd0ec580cc98f029dab46d9683ef66a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Nov 2017 16:57:59 +0900 Subject: [PATCH 039/166] Use internal less Allows for more dynamic compilation to succeed. No reason for using internal here anyways. --- osu.Game/Screens/Edit/Editor.cs | 2 +- osu.Game/Screens/Loader.cs | 2 +- osu.Game/Screens/Menu/Disclaimer.cs | 6 +++--- osu.Game/Screens/Menu/Intro.cs | 4 ++-- osu.Game/Screens/Menu/MainMenu.cs | 2 +- osu.Game/Screens/OsuScreen.cs | 8 ++++---- osu.Game/Screens/Play/Player.cs | 6 +++--- osu.Game/Screens/Play/PlayerLoader.cs | 4 ++-- osu.Game/Screens/Ranking/Results.cs | 2 +- osu.Game/Screens/Tournament/Drawings.cs | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index c610a24e22..74e55e58ad 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -24,7 +24,7 @@ namespace osu.Game.Screens.Edit { protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg4"); - internal override bool ShowOverlays => false; + public override bool ShowOverlays => false; private readonly Box bottomBackground; private readonly Container screenContainer; diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index af084e740b..295b3603be 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -8,7 +8,7 @@ namespace osu.Game.Screens { internal class Loader : OsuScreen { - internal override bool ShowOverlays => false; + public override bool ShowOverlays => false; public Loader() { diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index 1ac5823ec4..532ee71b72 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -12,15 +12,15 @@ using OpenTK.Graphics; namespace osu.Game.Screens.Menu { - internal class Disclaimer : OsuScreen + public class Disclaimer : OsuScreen { private Intro intro; private readonly SpriteIcon icon; private Color4 iconColour; - internal override bool ShowOverlays => false; + public override bool ShowOverlays => false; - internal override bool HasLocalCursorDisplayed => true; + public override bool HasLocalCursorDisplayed => true; public Disclaimer() { diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index ee84cf2d30..fb06edb0b0 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -33,9 +33,9 @@ namespace osu.Game.Screens.Menu private SampleChannel welcome; private SampleChannel seeya; - internal override bool HasLocalCursorDisplayed => true; + public override bool HasLocalCursorDisplayed => true; - internal override bool ShowOverlays => false; + public override bool ShowOverlays => false; protected override BackgroundScreen CreateBackground() => new BackgroundScreenEmpty(); diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 1c82d15f50..ff902bf28b 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -23,7 +23,7 @@ namespace osu.Game.Screens.Menu { private readonly ButtonSystem buttons; - internal override bool ShowOverlays => buttons.State != MenuState.Initial; + public override bool ShowOverlays => buttons.State != MenuState.Initial; private readonly BackgroundScreenDefault background; private Screen songSelect; diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index ae10d8828b..2a3cba0d49 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -16,7 +16,7 @@ namespace osu.Game.Screens { public abstract class OsuScreen : Screen { - internal BackgroundScreen Background { get; private set; } + public BackgroundScreen Background { get; private set; } /// /// Override to create a BackgroundMode for the current screen. @@ -24,17 +24,17 @@ namespace osu.Game.Screens /// protected virtual BackgroundScreen CreateBackground() => null; - internal virtual bool ShowOverlays => true; + public virtual bool ShowOverlays => true; protected new OsuGameBase Game => base.Game as OsuGameBase; - internal virtual bool HasLocalCursorDisplayed => false; + public virtual bool HasLocalCursorDisplayed => false; /// /// Whether the beatmap or ruleset should be allowed to be changed by the user or game. /// Used to mark exclusive areas where this is strongly prohibited, like gameplay. /// - internal virtual bool AllowBeatmapRulesetChange => true; + public virtual bool AllowBeatmapRulesetChange => true; protected readonly Bindable Beatmap = new Bindable(); diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 589f4b663a..3775b9c933 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -34,13 +34,13 @@ namespace osu.Game.Screens.Play { protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap); - internal override bool ShowOverlays => false; + public override bool ShowOverlays => false; - internal override bool HasLocalCursorDisplayed => !pauseContainer.IsPaused && !HasFailed && RulesetContainer.ProvidingUserCursor; + public override bool HasLocalCursorDisplayed => !pauseContainer.IsPaused && !HasFailed && RulesetContainer.ProvidingUserCursor; public Action RestartRequested; - internal override bool AllowBeatmapRulesetChange => false; + public override bool AllowBeatmapRulesetChange => false; public bool HasFailed { get; private set; } diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index a5248acbe4..71c2ec9a6d 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -24,9 +24,9 @@ namespace osu.Game.Screens.Play private BeatmapMetadataDisplay info; private bool showOverlays = true; - internal override bool ShowOverlays => showOverlays; + public override bool ShowOverlays => showOverlays; - internal override bool AllowBeatmapRulesetChange => false; + public override bool AllowBeatmapRulesetChange => false; protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap); diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index 60ad484673..8e27cb235c 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -31,7 +31,7 @@ namespace osu.Game.Screens.Ranking private ResultModeTabControl modeChangeButtons; - internal override bool AllowBeatmapRulesetChange => false; + public override bool AllowBeatmapRulesetChange => false; private Container currentPage; diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game/Screens/Tournament/Drawings.cs index 3d27552212..e540782fc1 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game/Screens/Tournament/Drawings.cs @@ -29,7 +29,7 @@ namespace osu.Game.Screens.Tournament { private const string results_filename = "drawings_results.txt"; - internal override bool ShowOverlays => false; + public override bool ShowOverlays => false; protected override BackgroundScreen CreateBackground() => new BackgroundScreenDefault(); From ed89f039002d97f34522c868c7fac1b596d5d67b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Nov 2017 17:06:55 +0900 Subject: [PATCH 040/166] Make ParallaxContainer public --- osu.Game/Graphics/Containers/ParallaxContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Containers/ParallaxContainer.cs b/osu.Game/Graphics/Containers/ParallaxContainer.cs index 3e0ed4b059..362563507b 100644 --- a/osu.Game/Graphics/Containers/ParallaxContainer.cs +++ b/osu.Game/Graphics/Containers/ParallaxContainer.cs @@ -11,7 +11,7 @@ using osu.Framework.Configuration; namespace osu.Game.Graphics.Containers { - internal class ParallaxContainer : Container, IRequireHighFrequencyMousePosition + public class ParallaxContainer : Container, IRequireHighFrequencyMousePosition { public float ParallaxAmount = 0.02f; From f0c0e8c34c8039cfa4658ca77d125fb0400d7697 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Nov 2017 17:34:36 +0900 Subject: [PATCH 041/166] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 715a8328a8..3c074a0981 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 715a8328a80af072c31dbc807b3119b3c58df8c6 +Subproject commit 3c074a0981844fbaa9f2ecbf879c542f07e2b94d From beb9d621c428abbc5d2cfef498f49671139ef46e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Nov 2017 23:36:52 +0900 Subject: [PATCH 042/166] Revert incorrectly changed GUID --- osu.sln | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.sln b/osu.sln index e86dd70d0b..356ec4cc7b 100644 --- a/osu.sln +++ b/osu.sln @@ -5,7 +5,7 @@ VisualStudioVersion = 15.0.27004.2006 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game", "osu.Game\osu.Game.csproj", "{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Framework", "osu-framework\osu.Framework\osu.Framework.csproj", "{C76BF5B3-985E-4D39-95FE-97C9C879B83A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Framework", "osu-framework\osu.Framework\osu.Framework.csproj", "{C76BF5B3-985E-4D39-95FE-97C9C879B83A}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Resources", "osu-resources\osu.Game.Resources\osu.Game.Resources.csproj", "{D9A367C9-4C1A-489F-9B05-A0CEA2B53B58}" EndProject From f219b7f9fb8fa980c2556245b59781a1eb64abc4 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 2 Nov 2017 19:31:30 +0900 Subject: [PATCH 043/166] Fix bonusScore being stored locally instead of incrementally changing --- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index 5a54c679dd..ec5d47c7c7 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -174,6 +174,7 @@ namespace osu.Game.Rulesets.Scoring private double maxBaseScore; private double rollingMaxBaseScore; private double baseScore; + private double bonusScore; protected ScoreProcessor() { @@ -219,7 +220,6 @@ namespace osu.Game.Rulesets.Scoring protected virtual void OnNewJudgement(Judgement judgement) { - double bonusScore = 0; if (judgement.AffectsCombo) { @@ -271,6 +271,7 @@ namespace osu.Game.Rulesets.Scoring Hits = 0; baseScore = 0; rollingMaxBaseScore = 0; + bonusScore = 0; } } From 6883b3742ff1cc3eb4427194da84c4924829c47d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 2 Nov 2017 20:23:28 +0900 Subject: [PATCH 044/166] Make initial DrawableOsuHitObject initial states not use transforms --- .../Objects/Drawables/DrawableHitCircle.cs | 20 +++++++++++-------- .../Objects/Drawables/DrawableOsuHitObject.cs | 5 +++-- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs index 3184b83202..ed0578d3a4 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -86,15 +86,19 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { base.UpdateInitialState(); - // sane defaults - ring.Show(); - circle.Show(); - number.Show(); - glow.Show(); + // Hide() cannot be used here, because when rewinding, we need these to be the final values - ApproachCircle.Hide(); - ApproachCircle.ScaleTo(new Vector2(4)); - explode.Hide(); + ring.Alpha = 1; + circle.Alpha = 1; + number.Alpha = 1; + glow.Alpha = 1; + + ApproachCircle.Alpha = 0; + ApproachCircle.Scale = new Vector2(4); + explode.Alpha = 0; + flash.Alpha = 0; + + Scale = new Vector2(HitObject.Scale); } protected override void UpdatePreemptState() diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs index 9205f43a6d..7429f084c3 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables protected sealed override void UpdateState(ArmedState state) { - FinishTransforms(); + ClearTransforms(true); using (BeginAbsoluteSequence(HitObject.StartTime - TIME_PREEMPT, true)) { @@ -38,7 +38,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables protected virtual void UpdateInitialState() { - Hide(); + // Hide() cannot be used here, because when rewinding, we need these to be the final values + Alpha = 0; } protected virtual void UpdatePreemptState() From b0785b2f09924b5ef6dd23c83b0f675034929cf1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Nov 2017 19:41:11 +0900 Subject: [PATCH 045/166] Fix a possible horrendous endless auth loop --- osu.Game/Online/API/APIAccess.cs | 1 + osu.Game/Online/API/OAuth.cs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/osu.Game/Online/API/APIAccess.cs b/osu.Game/Online/API/APIAccess.cs index 4e26b1b850..daf56657d2 100644 --- a/osu.Game/Online/API/APIAccess.cs +++ b/osu.Game/Online/API/APIAccess.cs @@ -118,6 +118,7 @@ namespace osu.Game.Online.API //NotificationOverlay.ShowMessage("Login failed!"); log.Add(@"Login failed!"); Password = null; + authentication.Clear(); continue; } diff --git a/osu.Game/Online/API/OAuth.cs b/osu.Game/Online/API/OAuth.cs index 2e00fe6f1b..ca38f72904 100644 --- a/osu.Game/Online/API/OAuth.cs +++ b/osu.Game/Online/API/OAuth.cs @@ -27,6 +27,9 @@ namespace osu.Game.Online.API internal bool AuthenticateWithLogin(string username, string password) { + if (string.IsNullOrEmpty(username)) return false; + if (string.IsNullOrEmpty(password)) return false; + using (var req = new AccessTokenRequestPassword(username, password) { Url = $@"{endpoint}/oauth/token", From b8b05fe8d277fafe6da7c0f5af55105553846716 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Nov 2017 20:54:58 +0900 Subject: [PATCH 046/166] Make the osu! logo shared game-wide There should only ever be one osu! logo. It is now passed around between screens in a superfluous manner. --- osu.Game/Screens/Loader.cs | 14 ++++ osu.Game/Screens/Menu/ButtonSystem.cs | 116 ++++++++++++++++---------- osu.Game/Screens/Menu/Intro.cs | 75 ++++++++++------- osu.Game/Screens/Menu/MainMenu.cs | 26 +++++- osu.Game/Screens/Menu/OsuLogo.cs | 42 ++++++++-- osu.Game/Screens/OsuScreen.cs | 47 +++++++++++ osu.Game/Screens/Play/PlayerLoader.cs | 27 +++--- osu.Game/Screens/Select/Footer.cs | 13 --- osu.Game/Screens/Select/SongSelect.cs | 38 ++++++++- 9 files changed, 289 insertions(+), 109 deletions(-) diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index 295b3603be..6de53aeeb0 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -2,7 +2,9 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; +using osu.Framework.Graphics; using osu.Game.Screens.Menu; +using OpenTK; namespace osu.Game.Screens { @@ -15,6 +17,18 @@ namespace osu.Game.Screens ValidForResume = false; } + protected override void LogoSetup(OsuLogo logo, bool resuming) + { + base.LogoSetup(logo, resuming); + + logo.RelativePositionAxes = Axes.Both; + logo.Triangles = false; + logo.Position = new Vector2(0.9f); + logo.Scale = new Vector2(0.2f); + + logo.FadeInFromZero(5000, Easing.OutQuint); + } + [BackgroundDependencyLoader] private void load(OsuGame game) { diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index e4dbe00a80..9cd92f054f 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -39,12 +39,25 @@ namespace osu.Game.Screens.Menu //todo: make these non-internal somehow. internal const float BUTTON_AREA_HEIGHT = 100; + internal const float BUTTON_WIDTH = 140f; internal const float WEDGE_WIDTH = 20; - public const int EXIT_DELAY = 3000; + private OsuLogo logo; + + public void SetOsuLogo(OsuLogo logo) + { + this.logo = logo; + + if (this.logo != null) + { + this.logo.Action = onOsuLogo; + + // osuLogo.SizeForFlow relies on loading to be complete. + buttonFlow.Position = new Vector2(WEDGE_WIDTH * 2 - (BUTTON_WIDTH + this.logo.SizeForFlow / 4), 0); + } + } - private readonly OsuLogo osuLogo; private readonly Drawable iconFacade; private readonly Container buttonArea; private readonly Box buttonAreaBackground; @@ -99,12 +112,6 @@ namespace osu.Game.Screens.Menu } } }, - osuLogo = new OsuLogo - { - Action = onOsuLogo, - Origin = Anchor.Centre, - Anchor = Anchor.Centre, - } }; buttonsPlay.Add(new Button(@"solo", @"select-6", FontAwesome.fa_user, new Color4(102, 68, 204, 255), () => OnSolo?.Invoke(), WEDGE_WIDTH, Key.P)); @@ -127,14 +134,6 @@ namespace osu.Game.Screens.Menu sampleBack = audio.Sample.Get(@"Menu/select-4"); } - protected override void LoadComplete() - { - base.LoadComplete(); - - // osuLogo.SizeForFlow relies on loading to be complete. - buttonFlow.Position = new Vector2(WEDGE_WIDTH * 2 - (BUTTON_WIDTH + osuLogo.SizeForFlow / 4), 0); - } - protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) { if (args.Repeat) return false; @@ -142,7 +141,7 @@ namespace osu.Game.Screens.Menu switch (args.Key) { case Key.Space: - osuLogo.TriggerOnClick(state); + logo.TriggerOnClick(state); return true; case Key.Escape: switch (State) @@ -215,24 +214,31 @@ namespace osu.Game.Screens.Menu backButton.ContractStyle = 0; settingsButton.ContractStyle = 0; - bool fromInitial = lastState == MenuState.Initial; - if (state == MenuState.TopLevel) buttonArea.FinishTransforms(true); - using (buttonArea.BeginDelayedSequence(fromInitial ? 150 : 0, true)) + using (buttonArea.BeginDelayedSequence(lastState == MenuState.Initial ? 150 : 0, true)) { switch (state) { case MenuState.Exit: case MenuState.Initial: + trackingPosition = false; + buttonAreaBackground.ScaleTo(Vector2.One, 500, Easing.Out); buttonArea.FadeOut(300); - osuLogo.Delay(150) - .Schedule(() => toolbar?.Hide()) - .ScaleTo(1, 800, Easing.OutExpo) - .MoveTo(Vector2.Zero, 800, Easing.OutExpo); + logo?.Delay(150) + .Schedule(() => + { + toolbar?.Hide(); + + logo.ClearTransforms(targetMember: nameof(Position)); + logo.RelativePositionAxes = Axes.Both; + + logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo); + logo.ScaleTo(1, 800, Easing.OutExpo); + }); foreach (Button b in buttonsTopLevel) b.State = ButtonState.Contracted; @@ -240,27 +246,40 @@ namespace osu.Game.Screens.Menu foreach (Button b in buttonsPlay) b.State = ButtonState.Contracted; - if (state == MenuState.Exit) - { - osuLogo.RotateTo(20, EXIT_DELAY * 1.5f); - osuLogo.FadeOut(EXIT_DELAY); - } - else if (lastState == MenuState.TopLevel) + if (state != MenuState.Exit && lastState == MenuState.TopLevel) sampleBack?.Play(); break; case MenuState.TopLevel: buttonAreaBackground.ScaleTo(Vector2.One, 200, Easing.Out); - var sequence = osuLogo - .ScaleTo(0.5f, 200, Easing.In) - .MoveTo(buttonFlow.DrawPosition, 200, Easing.In); + logo.ClearTransforms(targetMember: nameof(Position)); + logo.RelativePositionAxes = Axes.None; - if (fromInitial && osuLogo.Scale.X > 0.5f) - sequence.OnComplete(o => - { - o.Impact(); - toolbar?.Show(); - }); + trackingPosition = true; + + switch (lastState) + { + case MenuState.Initial: + logo.ScaleTo(0.5f, 200, Easing.In); + + trackingPosition = false; + logo + .MoveTo(iconTrackingPosition, lastState == MenuState.EnteringMode ? 0 : 200, Easing.In) + .OnComplete(o => + { + trackingPosition = true; + + if (logo.Scale.X > 0.5f) + { + o.Impact(); + toolbar?.Show(); + } + }); + break; + default: + logo.ScaleTo(0.5f, 200, Easing.OutQuint); + break; + } buttonArea.FadeIn(300); @@ -280,6 +299,8 @@ namespace osu.Game.Screens.Menu case MenuState.EnteringMode: buttonAreaBackground.ScaleTo(new Vector2(2, 0), 300, Easing.InSine); + trackingPosition = true; + buttonsTopLevel.ForEach(b => b.ContractStyle = 1); buttonsPlay.ForEach(b => b.ContractStyle = 1); backButton.ContractStyle = 1; @@ -301,15 +322,26 @@ namespace osu.Game.Screens.Menu } } + private Vector2 iconTrackingPosition => logo.Parent.ToLocalSpace(iconFacade.ScreenSpaceDrawQuad.Centre); + + private bool trackingPosition; + + public void SetLogoTracking(bool value) => trackingPosition = value; + protected override void Update() { //if (OsuGame.IdleTime > 6000 && State != MenuState.Exit) // State = MenuState.Initial; - osuLogo.Interactive = Alpha > 0.2f; - - iconFacade.Width = osuLogo.SizeForFlow * 0.5f; base.Update(); + + if (logo != null) + { + if (trackingPosition) + logo.Position = iconTrackingPosition; + + iconFacade.Width = logo.SizeForFlow * 0.5f; + } } } diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index fb06edb0b0..8553f68b9a 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -14,14 +14,13 @@ using osu.Game.Beatmaps.IO; using osu.Game.Configuration; using osu.Game.Graphics.Containers; using osu.Game.Screens.Backgrounds; +using OpenTK; using OpenTK.Graphics; namespace osu.Game.Screens.Menu { public class Intro : OsuScreen { - private readonly OsuLogo logo; - private const string menu_music_beatmap_hash = "3c8b1fcc9434dbb29e2fb613d3b9eada9d7bb6c125ceb32396c3b53437280c83"; /// @@ -39,32 +38,10 @@ namespace osu.Game.Screens.Menu protected override BackgroundScreen CreateBackground() => new BackgroundScreenEmpty(); - public Intro() - { - Children = new Drawable[] - { - new ParallaxContainer - { - ParallaxAmount = 0.01f, - Children = new Drawable[] - { - logo = new OsuLogo - { - Alpha = 0, - Triangles = false, - Blending = BlendingMode.Additive, - Interactive = false, - Colour = Color4.DarkGray, - Ripple = false - } - } - } - }; - } - private Bindable menuVoice; private Bindable menuMusic; private Track track; + private readonly ParallaxContainer parallax; [BackgroundDependencyLoader] private void load(AudioManager audio, OsuConfigManager config, BeatmapManager beatmaps, Framework.Game game) @@ -121,14 +98,48 @@ namespace osu.Game.Screens.Menu { DidLoadMenu = true; Push(mainMenu); - }, 2300); - }, 600); + }, delay_step_one); + }, delay_step_two); + } - logo.ScaleTo(0.4f); - logo.FadeOut(); + private const double delay_step_one = 2300; + private const double delay_step_two = 600; - logo.ScaleTo(1, 4400, Easing.OutQuint); - logo.FadeIn(20000, Easing.OutQuint); + public const int EXIT_DELAY = 3000; + + protected override void LogoSetup(OsuLogo logo, bool resuming) + { + base.LogoSetup(logo, resuming); + + logo.RelativePositionAxes = Axes.Both; + + logo.Triangles = false; + logo.Colour = Color4.DarkGray; + logo.Ripple = false; + + const int quick_appear = 150; + + int initialMovementTime = logo.Alpha > 0.2f ? quick_appear : 0; + + logo.MoveTo(new Vector2(0.5f), initialMovementTime, Easing.OutQuint); + + if (!resuming) + { + logo.ScaleTo(0.4f); + logo.FadeOut(); + + logo.ScaleTo(1, delay_step_one + delay_step_two, Easing.OutQuint); + logo.FadeIn(delay_step_one + delay_step_two, Easing.OutQuint); + } + else + { + logo + .ScaleTo(1, initialMovementTime, Easing.OutQuint) + .FadeIn(quick_appear, Easing.OutQuint) + .Then() + .RotateTo(20, EXIT_DELAY * 1.5f) + .FadeOut(EXIT_DELAY); + } } protected override void OnSuspending(Screen next) @@ -148,7 +159,7 @@ namespace osu.Game.Screens.Menu if (!(last is MainMenu)) Content.FadeIn(300); - double fadeOutTime = 2000; + double fadeOutTime = EXIT_DELAY; //we also handle the exit transition. if (menuVoice) seeya.Play(); diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index ff902bf28b..77e45c4575 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; +using OpenTK.Graphics; using OpenTK.Input; using osu.Framework.Allocation; using osu.Framework.Graphics; @@ -102,6 +103,29 @@ namespace osu.Game.Screens.Menu Beatmap.ValueChanged += beatmap_ValueChanged; } + protected override void LogoSetup(OsuLogo logo, bool resuming) + { + base.LogoSetup(logo, resuming); + + buttons.SetOsuLogo(logo); + + logo.Triangles = true; + logo.Ripple = false; + + logo.FadeColour(Color4.White, 100, Easing.OutQuint); + logo.FadeIn(100, Easing.OutQuint); + + if (resuming) + buttons.State = MenuState.TopLevel; + } + + protected override void LogoOnSuspending(OsuLogo logo) + { + logo.FadeOut(300, Easing.InSine) + .ScaleTo(0.2f, 300, Easing.InSine) + .OnComplete(l => buttons.SetOsuLogo(null)); + } + private void beatmap_ValueChanged(WorkingBeatmap newValue) { if (!IsCurrentScreen) @@ -135,8 +159,6 @@ namespace osu.Game.Screens.Menu const float length = 300; - buttons.State = MenuState.TopLevel; - Content.FadeIn(length, Easing.OutQuint); Content.MoveTo(new Vector2(0, 0), length, Easing.OutQuint); diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index 6f4a46b10b..297076a78b 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -29,6 +29,8 @@ namespace osu.Game.Screens.Menu { public readonly Color4 OsuPink = OsuColour.FromHex(@"e967a1"); + private const double transition_length = 300; + private readonly Sprite logo; private readonly CircularContainer logoContainer; private readonly Container logoBounceContainer; @@ -54,7 +56,7 @@ namespace osu.Game.Screens.Menu public bool Triangles { - set { colourAndTriangles.Alpha = value ? 1 : 0; } + set { colourAndTriangles.FadeTo(value ? 1 : 0, transition_length, Easing.OutQuint); } } public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => logoContainer.ReceiveMouseInputAt(screenSpacePos); @@ -62,10 +64,9 @@ namespace osu.Game.Screens.Menu public bool Ripple { get { return rippleContainer.Alpha > 0; } - set { rippleContainer.Alpha = value ? 1 : 0; } + set { rippleContainer.FadeTo(value ? 1 : 0, transition_length, Easing.OutQuint); } } - public bool Interactive = true; private readonly Box flashLayer; private readonly Container impactContainer; @@ -76,11 +77,12 @@ namespace osu.Game.Screens.Menu public OsuLogo() { + AlwaysPresent = true; + EarlyActivationMilliseconds = early_activation; Size = new Vector2(default_size); - Anchor = Anchor.Centre; Origin = Anchor.Centre; AutoSizeAxes = Axes.Both; @@ -222,6 +224,27 @@ namespace osu.Game.Screens.Menu ripple.Texture = textures.Get(@"Menu/logo"); } + private double? reservationEndTime; + private Action reservationCallback; + + private bool canFulfillReservation => !reservationEndTime.HasValue || reservationEndTime <= Time.Current; + + public void RequestUsage(Action callback) + { + reservationCallback = callback; + } + + private void fulfillReservation() + { + reservationCallback(this); + reservationCallback = null; + } + + public void ReserveFor(float duration) + { + reservationEndTime = Time.Current + duration; + } + private int lastBeatIndex; protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes) @@ -288,11 +311,16 @@ namespace osu.Game.Screens.Menu { triangles.Velocity = paused_velocity; } + + if (reservationCallback != null && canFulfillReservation) + fulfillReservation(); } + private bool interactive => Action != null && Alpha > 0.2f; + protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) { - if (!Interactive) return false; + if (!interactive) return false; logoBounceContainer.ScaleTo(0.9f, 1000, Easing.Out); return true; @@ -306,7 +334,7 @@ namespace osu.Game.Screens.Menu protected override bool OnClick(InputState state) { - if (!Interactive) return false; + if (!interactive) return false; sampleClick.Play(); @@ -320,7 +348,7 @@ namespace osu.Game.Screens.Menu protected override bool OnHover(InputState state) { - if (!Interactive) return false; + if (!interactive) return false; logoHoverContainer.ScaleTo(1.1f, 500, Easing.OutElastic); return true; diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 2a3cba0d49..412fe02d30 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -10,7 +10,9 @@ using osu.Game.Graphics.Containers; using OpenTK; using osu.Framework.Audio.Sample; using osu.Framework.Audio; +using osu.Framework.Graphics; using osu.Game.Rulesets; +using osu.Game.Screens.Menu; namespace osu.Game.Screens { @@ -30,6 +32,8 @@ namespace osu.Game.Screens public virtual bool HasLocalCursorDisplayed => false; + private OsuLogo logo; + /// /// Whether the beatmap or ruleset should be allowed to be changed by the user or game. /// Used to mark exclusive areas where this is strongly prohibited, like gameplay. @@ -72,9 +76,16 @@ namespace osu.Game.Screens protected override void OnResuming(Screen last) { base.OnResuming(last); + logo.WaitForTransforms().Schedule(() => logoSetup(true)); sampleExit?.Play(); } + protected override void OnSuspending(Screen next) + { + base.OnSuspending(next); + logoOnSuspending(); + } + protected override void OnEntering(Screen last) { OsuScreen lastOsu = last as OsuScreen; @@ -106,11 +117,19 @@ namespace osu.Game.Screens }); } + if ((logo = lastOsu?.logo) == null) + AddInternal(logo = new OsuLogo()); + base.OnEntering(last); + + logo.WaitForTransforms().Schedule(() => logoSetup(false)); } protected override bool OnExiting(Screen next) { + if (ValidForResume && logo != null) + logoOnExiting(); + OsuScreen nextOsu = next as OsuScreen; if (Background != null && !Background.Equals(nextOsu?.Background)) @@ -128,5 +147,33 @@ namespace osu.Game.Screens Beatmap.UnbindAll(); return false; } + + private void logoSetup(bool resuming) => LogoSetup(logo, resuming); + + protected virtual void LogoSetup(OsuLogo logo, bool resuming) + { + logo.Action = null; + logo.FadeOut(300, Easing.OutQuint); + } + + private void logoOnExiting() + { + logo.ClearTransforms(); + LogoOnExiting(logo); + } + + protected virtual void LogoOnExiting(OsuLogo logo) + { + } + + private void logoOnSuspending() + { + logo.ClearTransforms(); + LogoOnSuspending(logo); + } + + protected virtual void LogoOnSuspending(OsuLogo logo) + { + } } } diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index 71c2ec9a6d..054b4c0a0f 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -10,9 +10,9 @@ using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Screens.Backgrounds; -using osu.Game.Screens.Menu; using OpenTK; using osu.Framework.Localisation; +using osu.Game.Screens.Menu; namespace osu.Game.Screens.Play { @@ -20,7 +20,6 @@ namespace osu.Game.Screens.Play { private Player player; - private readonly OsuLogo logo; private BeatmapMetadataDisplay info; private bool showOverlays = true; @@ -39,15 +38,6 @@ namespace osu.Game.Screens.Play showOverlays = false; ValidForResume = true; }; - - Children = new Drawable[] - { - logo = new OsuLogo - { - Scale = new Vector2(0.15f), - Interactive = false, - }, - }; } [BackgroundDependencyLoader] @@ -101,11 +91,24 @@ namespace osu.Game.Screens.Play contentIn(); - logo.Delay(500).MoveToOffset(new Vector2(0, -180), 500, Easing.InOutExpo); info.Delay(750).FadeIn(500); this.Delay(2150).Schedule(pushWhenLoaded); } + protected override void LogoSetup(OsuLogo logo, bool resuming) + { + base.LogoSetup(logo, resuming); + + logo.ClearTransforms(targetMember: nameof(Position)); + logo.RelativePositionAxes = Axes.Both; + + logo.ScaleTo(new Vector2(0.15f), 300, Easing.In); + logo.MoveTo(new Vector2(0.5f), 300, Easing.In); + logo.FadeIn(); + + logo.Delay(500).MoveToOffset(new Vector2(0, -0.24f), 500, Easing.InOutExpo); + } + private void pushWhenLoaded() { if (player.LoadState != LoadState.Ready) diff --git a/osu.Game/Screens/Select/Footer.cs b/osu.Game/Screens/Select/Footer.cs index 00f311e522..40c3cf0fd4 100644 --- a/osu.Game/Screens/Select/Footer.cs +++ b/osu.Game/Screens/Select/Footer.cs @@ -13,7 +13,6 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Input; using osu.Game.Graphics.UserInterface; -using osu.Game.Screens.Menu; namespace osu.Game.Screens.Select { @@ -31,12 +30,9 @@ namespace osu.Game.Screens.Select private const float padding = 80; public Action OnBack; - public Action OnStart; private readonly FillFlowContainer buttons; - public OsuLogo StartButton; - /// Text on the button. /// Colour of the button. /// Hotkey of the button. @@ -106,13 +102,6 @@ namespace osu.Game.Screens.Select Height = 3, Position = new Vector2(0, -3), }, - StartButton = new OsuLogo - { - Anchor = Anchor.BottomRight, - Scale = new Vector2(0.4f), - Position = new Vector2(-70, -25), - Action = () => OnStart?.Invoke() - }, new BackButton { Anchor = Anchor.BottomLeft, @@ -143,8 +132,6 @@ namespace osu.Game.Screens.Select updateModeLight(); } - public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => base.ReceiveMouseInputAt(screenSpacePos) || StartButton.ReceiveMouseInputAt(screenSpacePos); - protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true; protected override bool OnClick(InputState state) => true; diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index e11eed7040..f9e3b0902d 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -20,6 +20,7 @@ using osu.Game.Graphics.Containers; using osu.Game.Overlays; using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Edit; +using osu.Game.Screens.Menu; using osu.Game.Screens.Select.Options; namespace osu.Game.Screens.Select @@ -153,7 +154,6 @@ namespace osu.Game.Screens.Select Add(Footer = new Footer { OnBack = Exit, - OnStart = () => carouselRaisedStart(), }); FooterPanels.Add(BeatmapOptions = new BeatmapOptionsOverlay()); @@ -309,6 +309,41 @@ namespace osu.Game.Screens.Select FilterControl.Activate(); } + private const double logo_transition = 250; + + protected override void LogoSetup(OsuLogo logo, bool resuming) + { + base.LogoSetup(logo, resuming); + + logo.ClearTransforms(); + logo.RelativePositionAxes = Axes.Both; + + Vector2 position = new Vector2(0.95f, 0.96f); + + if (logo.Alpha > 0.8f) + { + logo.MoveTo(position, 500, Easing.OutQuint); + } + else + { + logo.Hide(); + logo.ScaleTo(0.2f); + logo.MoveTo(position); + } + + logo.FadeIn(logo_transition, Easing.OutQuint); + logo.ScaleTo(0.4f, logo_transition, Easing.OutQuint); + + logo.Action = () => carouselRaisedStart(); + } + + protected override void LogoOnExiting(OsuLogo logo) + { + base.LogoOnExiting(logo); + logo.ScaleTo(0.2f, logo_transition, Easing.OutQuint); + logo.FadeOut(logo_transition, Easing.OutQuint); + } + private void beatmap_ValueChanged(WorkingBeatmap beatmap) { if (!IsCurrentScreen) return; @@ -350,6 +385,7 @@ namespace osu.Game.Screens.Select Content.FadeOut(100); FilterControl.Deactivate(); + return base.OnExiting(next); } From fe00ac7e4136d125c97e99ce3c17a128a7c57d47 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 2 Nov 2017 21:21:07 +0900 Subject: [PATCH 047/166] Make DrawableHitObject/ScoreProcessor support rewinding --- .../Objects/Drawables/DrawableHoldNoteTick.cs | 2 +- .../Tests/TestCaseHitObjects.cs | 2 +- .../Objects/Drawables/DrawableHit.cs | 2 +- .../Rulesets/Judgements/DrawableJudgement.cs | 2 +- osu.Game/Rulesets/Judgements/Judgement.cs | 13 +++ .../Objects/Drawables/DrawableHitObject.cs | 87 +++++++++++-------- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 39 ++++++++- osu.Game/Rulesets/UI/RulesetContainer.cs | 3 + 8 files changed, 107 insertions(+), 43 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs index 324f4e4e99..557fbf6ea8 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs @@ -94,7 +94,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables protected override void UpdateState(ArmedState state) { - switch (State) + switch (State.Value) { case ArmedState.Hit: AccentColour = Color4.Green; diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseHitObjects.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseHitObjects.cs index 2ac15c55a7..99526b64ee 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseHitObjects.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseHitObjects.cs @@ -111,7 +111,7 @@ namespace osu.Game.Rulesets.Osu.Tests h.Depth = depth++; if (auto) - h.State = ArmedState.Hit; + h.State.Value = ArmedState.Hit; playfieldContainer.Add(h); var proxyable = h as IDrawableHitObjectWithProxiedApproach; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index 55eaa8dbb8..6c14a71a4c 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -72,7 +72,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables var offset = !AllJudged ? 0 : Time.Current - HitObject.StartTime; using (BeginDelayedSequence(HitObject.StartTime - Time.Current + offset, true)) { - switch (State) + switch (State.Value) { case ArmedState.Idle: this.Delay(HitObject.HitWindowMiss).Expire(); diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs index 12edfd802a..5ab4b7636b 100644 --- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs @@ -83,7 +83,7 @@ namespace osu.Game.Rulesets.Judgements break; } - Expire(); + Expire(true); } } } diff --git a/osu.Game/Rulesets/Judgements/Judgement.cs b/osu.Game/Rulesets/Judgements/Judgement.cs index 0ae33272a7..a1920097d3 100644 --- a/osu.Game/Rulesets/Judgements/Judgement.cs +++ b/osu.Game/Rulesets/Judgements/Judgement.cs @@ -17,6 +17,19 @@ namespace osu.Game.Rulesets.Judgements /// public virtual HitResult MaxResult => HitResult.Perfect; + /// + /// The combo prior to this judgement occurring. + /// + internal int ComboAtJudgement { get; set; } + + /// + /// The highest combo achieved prior to this judgement occurring. + /// + internal int HighestComboAtJudgement { get; set; } + + /// + /// Whether a successful hit occurred. + /// public bool IsHit => Result > HitResult.Miss; /// diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index bcd6734af6..9b4f7e7fc7 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -13,6 +13,7 @@ using OpenTK.Graphics; using osu.Game.Audio; using System.Linq; using osu.Game.Graphics; +using osu.Framework.Configuration; namespace osu.Game.Rulesets.Objects.Drawables { @@ -30,6 +31,9 @@ namespace osu.Game.Rulesets.Objects.Drawables /// public virtual bool DisplayJudgement => true; + public override bool RemoveCompletedTransforms => false; + public override bool RemoveWhenNotAlive => false; + protected DrawableHitObject(HitObject hitObject) { HitObject = hitObject; @@ -40,6 +44,7 @@ namespace osu.Game.Rulesets.Objects.Drawables where TObject : HitObject { public event Action OnJudgement; + public event Action OnJudgementRemoved; public new readonly TObject HitObject; @@ -56,31 +61,42 @@ namespace osu.Game.Rulesets.Objects.Drawables protected List Samples = new List(); + public readonly Bindable State = new Bindable(); + protected DrawableHitObject(TObject hitObject) : base(hitObject) { HitObject = hitObject; } - private ArmedState state; - public ArmedState State + [BackgroundDependencyLoader] + private void load(AudioManager audio) { - get { return state; } - - set + foreach (SampleInfo sample in HitObject.Samples) { - if (state == value) - return; - state = value; + SampleChannel channel = audio.Sample.Get($@"Gameplay/{sample.Bank}-{sample.Name}"); - if (!IsLoaded) - return; + if (channel == null) + continue; + channel.Volume.Value = sample.Volume; + Samples.Add(channel); + } + } + + protected override void LoadComplete() + { + base.LoadComplete(); + + State.ValueChanged += state => + { UpdateState(state); if (State == ArmedState.Hit) PlaySamples(); - } + }; + + State.TriggerChange(); } protected void PlaySamples() @@ -88,16 +104,8 @@ namespace osu.Game.Rulesets.Objects.Drawables Samples.ForEach(s => s?.Play()); } - protected override void LoadComplete() - { - base.LoadComplete(); - - //force application of the state that was set before we loaded. - UpdateState(State); - } - - private bool hasJudgementResult; private bool judgementOccurred; + private bool hasJudgementResult => Judgements.LastOrDefault()?.Result >= HitResult.Miss; /// /// Whether this and all of its nested s have been judged. @@ -110,7 +118,6 @@ namespace osu.Game.Rulesets.Objects.Drawables /// The . protected void AddJudgement(Judgement judgement) { - hasJudgementResult = judgement.Result >= HitResult.Miss; judgementOccurred = true; // Ensure that the judgement is given a valid time offset, because this may not get set by the caller @@ -124,10 +131,10 @@ namespace osu.Game.Rulesets.Objects.Drawables case HitResult.None: break; case HitResult.Miss: - State = ArmedState.Miss; + State.Value = ArmedState.Miss; break; default: - State = ArmedState.Hit; + State.Value = ArmedState.Hit; break; } @@ -170,6 +177,25 @@ namespace osu.Game.Rulesets.Objects.Drawables /// implies that this check occurred after the end time of . protected virtual void CheckForJudgements(bool userTriggered, double timeOffset) { } + protected override void Update() + { + base.Update(); + + var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime; + + while (judgements.Count > 0) + { + var lastJudgement = judgements[judgements.Count - 1]; + if (lastJudgement.TimeOffset + endTime <= Time.Current) + break; + + judgements.RemoveAt(judgements.Count - 1); + State.Value = ArmedState.Idle; + + OnJudgementRemoved?.Invoke(this, lastJudgement); + } + } + protected override void UpdateAfterChildren() { base.UpdateAfterChildren(); @@ -177,21 +203,6 @@ namespace osu.Game.Rulesets.Objects.Drawables UpdateJudgement(false); } - [BackgroundDependencyLoader] - private void load(AudioManager audio) - { - foreach (SampleInfo sample in HitObject.Samples) - { - SampleChannel channel = audio.Sample.Get($@"Gameplay/{sample.Bank}-{sample.Name}"); - - if (channel == null) - continue; - - channel.Volume.Value = sample.Volume; - Samples.Add(channel); - } - } - private List> nestedHitObjects; protected IEnumerable> NestedHitObjects => nestedHitObjects; diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index ec5d47c7c7..4dd88600b2 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -185,6 +185,7 @@ namespace osu.Game.Rulesets.Scoring Debug.Assert(base_portion + combo_portion == 1.0); rulesetContainer.OnJudgement += AddJudgement; + rulesetContainer.OnJudgementRemoved += RemoveJudgement; SimulateAutoplay(rulesetContainer.Beatmap); Reset(true); @@ -213,13 +214,26 @@ namespace osu.Game.Rulesets.Scoring protected void AddJudgement(Judgement judgement) { OnNewJudgement(judgement); - NotifyNewJudgement(judgement); + updateScore(); + NotifyNewJudgement(judgement); UpdateFailed(); } + protected void RemoveJudgement(Judgement judgement) + { + OnJudgementRemoved(judgement); + updateScore(); + } + + /// + /// Applies a judgement. + /// + /// The judgement to apply/ protected virtual void OnNewJudgement(Judgement judgement) { + judgement.ComboAtJudgement = Combo; + judgement.HighestComboAtJudgement = HighestCombo; if (judgement.AffectsCombo) { @@ -242,7 +256,30 @@ namespace osu.Game.Rulesets.Scoring } else if (judgement.IsHit) bonusScore += judgement.NumericResult; + } + /// + /// Removes a judgement. This should reverse everything in . + /// + /// The judgement to remove. + protected virtual void OnJudgementRemoved(Judgement judgement) + { + Combo.Value = judgement.ComboAtJudgement; + HighestCombo.Value = judgement.HighestComboAtJudgement; + + if (judgement.AffectsCombo) + { + baseScore -= judgement.NumericResult; + rollingMaxBaseScore -= judgement.MaxNumericResult; + + Hits--; + } + else if (judgement.IsHit) + bonusScore -= judgement.NumericResult; + } + + private void updateScore() + { if (rollingMaxBaseScore != 0) Accuracy.Value = baseScore / rollingMaxBaseScore; diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 6f53b76031..36dce7218d 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -104,6 +104,7 @@ namespace osu.Game.Rulesets.UI where TObject : HitObject { public event Action OnJudgement; + public event Action OnJudgementRemoved; /// /// The Beatmap @@ -241,6 +242,8 @@ namespace osu.Game.Rulesets.UI OnJudgement?.Invoke(j); }; + drawableObject.OnJudgementRemoved += (d, j) => { OnJudgementRemoved?.Invoke(j); }; + Playfield.Add(drawableObject); } From 8ee13ef0aea5c09b22ece39ba0e439048a8ce148 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 2 Nov 2017 21:33:31 +0900 Subject: [PATCH 048/166] Properties are unnecessary --- osu.Game/Rulesets/Judgements/Judgement.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Judgements/Judgement.cs b/osu.Game/Rulesets/Judgements/Judgement.cs index a1920097d3..684ee0b403 100644 --- a/osu.Game/Rulesets/Judgements/Judgement.cs +++ b/osu.Game/Rulesets/Judgements/Judgement.cs @@ -20,12 +20,12 @@ namespace osu.Game.Rulesets.Judgements /// /// The combo prior to this judgement occurring. /// - internal int ComboAtJudgement { get; set; } + internal int ComboAtJudgement; /// /// The highest combo achieved prior to this judgement occurring. /// - internal int HighestComboAtJudgement { get; set; } + internal int HighestComboAtJudgement; /// /// Whether a successful hit occurred. From 9b2d41f4eb19a5cb729d45e28d7b9d20b932bca4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Nov 2017 21:52:01 +0900 Subject: [PATCH 049/166] Fix quick retry looking bad --- osu.Game/Screens/Play/PlayerLoader.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index 054b4c0a0f..e53026fb8d 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -104,9 +104,9 @@ namespace osu.Game.Screens.Play logo.ScaleTo(new Vector2(0.15f), 300, Easing.In); logo.MoveTo(new Vector2(0.5f), 300, Easing.In); - logo.FadeIn(); + logo.FadeIn(350); - logo.Delay(500).MoveToOffset(new Vector2(0, -0.24f), 500, Easing.InOutExpo); + logo.Delay(resuming ? 0 : 500).MoveToOffset(new Vector2(0, -0.24f), 500, Easing.InOutExpo); } private void pushWhenLoaded() From c99ffb4aa39dbea7b0789a1b97d9bb78d47e17ef Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Nov 2017 21:52:12 +0900 Subject: [PATCH 050/166] Fix potential nullref --- osu.Game/Screens/Menu/ButtonSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 9cd92f054f..6f9b77e18e 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -141,7 +141,7 @@ namespace osu.Game.Screens.Menu switch (args.Key) { case Key.Space: - logo.TriggerOnClick(state); + logo?.TriggerOnClick(state); return true; case Key.Escape: switch (State) From 8f78d84ad6617ba4365cd7dd86c3f4875c9b404b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 2 Nov 2017 21:52:23 +0900 Subject: [PATCH 051/166] Make intro resume slower --- osu.Game/Screens/Menu/Intro.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 8553f68b9a..dcf4a00a9a 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -117,7 +117,7 @@ namespace osu.Game.Screens.Menu logo.Colour = Color4.DarkGray; logo.Ripple = false; - const int quick_appear = 150; + const int quick_appear = 350; int initialMovementTime = logo.Alpha > 0.2f ? quick_appear : 0; From 326891f51c3f7e0a58bb6b62863a1b20d0b1b92c Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 2 Nov 2017 21:54:28 +0900 Subject: [PATCH 052/166] Add "Final" to better determine when to stop processing the hitobject --- osu.Game/Rulesets/Judgements/Judgement.cs | 5 +++++ osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/Judgements/Judgement.cs b/osu.Game/Rulesets/Judgements/Judgement.cs index 684ee0b403..2b5c4aae95 100644 --- a/osu.Game/Rulesets/Judgements/Judgement.cs +++ b/osu.Game/Rulesets/Judgements/Judgement.cs @@ -32,6 +32,11 @@ namespace osu.Game.Rulesets.Judgements /// public bool IsHit => Result > HitResult.Miss; + /// + /// Whether this judgement is the final judgement for the hit object. + /// + public bool Final = true; + /// /// The offset from a perfect hit at which this judgement occurred. /// Populated when added via . diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 9b4f7e7fc7..19bddd05e0 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -105,12 +105,12 @@ namespace osu.Game.Rulesets.Objects.Drawables } private bool judgementOccurred; - private bool hasJudgementResult => Judgements.LastOrDefault()?.Result >= HitResult.Miss; + private bool judgementFinalized => judgements.LastOrDefault()?.Final == true; /// /// Whether this and all of its nested s have been judged. /// - public virtual bool AllJudged => (!ProvidesJudgement || hasJudgementResult) && (NestedHitObjects?.All(h => h.AllJudged) ?? true); + public virtual bool AllJudged => (!ProvidesJudgement || judgementFinalized) && (NestedHitObjects?.All(h => h.AllJudged) ?? true); /// /// Notifies that a new judgement has occurred for this . @@ -159,7 +159,7 @@ namespace osu.Game.Rulesets.Objects.Drawables judgementOccurred |= d.UpdateJudgement(userTriggered); } - if (!ProvidesJudgement || hasJudgementResult || judgementOccurred) + if (!ProvidesJudgement || judgementFinalized || judgementOccurred) return judgementOccurred; var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime; From e2b6003f9864ff412df4d3ebe842f1b13ecc9f17 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 2 Nov 2017 21:55:50 +0900 Subject: [PATCH 053/166] Make taiko use the new "Final" field Ensures that the first hit on HitStrongs is _always_ non-final unless it was a miss. The second hit is always final. --- .../Judgements/TaikoStrongHitJudgement.cs | 4 +--- .../Objects/Drawables/DrawableHit.cs | 15 +++++++++++- .../Objects/Drawables/DrawableHitStrong.cs | 24 +++++++++---------- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongHitJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongHitJudgement.cs index f0b57e5c09..07c499b56c 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongHitJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongHitJudgement.cs @@ -11,9 +11,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements public TaikoStrongHitJudgement() { - base.Result = HitResult.Perfect; + Final = true; } - - public new HitResult Result => base.Result; } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index 6c14a71a4c..abb4c7770e 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -17,6 +17,11 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables /// protected abstract TaikoAction[] HitActions { get; } + /// + /// Whether a second hit is allowed to be processed. + /// + protected bool SecondHitAllowed { get; private set; } + /// /// Whether the last key pressed is a valid hit key. /// @@ -45,7 +50,15 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (!validKeyPressed) AddJudgement(new TaikoJudgement { Result = HitResult.Miss }); else if (hitOffset < HitObject.HitWindowGood) - AddJudgement(new TaikoJudgement { Result = hitOffset < HitObject.HitWindowGreat ? HitResult.Great : HitResult.Good }); + { + AddJudgement(new TaikoJudgement + { + Result = hitOffset < HitObject.HitWindowGreat ? HitResult.Great : HitResult.Good, + Final = !HitObject.IsStrong + }); + + SecondHitAllowed = true; + } else AddJudgement(new TaikoJudgement { Result = HitResult.Miss }); } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHitStrong.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHitStrong.cs index 48812093c4..c07eaf4d8b 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHitStrong.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHitStrong.cs @@ -3,6 +3,7 @@ using System; using System.Linq; +using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Taiko.Judgements; namespace osu.Game.Rulesets.Taiko.Objects.Drawables @@ -24,27 +25,25 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables { } - private bool processedSecondHit; - public override bool AllJudged => processedSecondHit && base.AllJudged; - protected override void CheckForJudgements(bool userTriggered, double timeOffset) { - if (!base.AllJudged) + if (!SecondHitAllowed) { base.CheckForJudgements(userTriggered, timeOffset); return; } if (!userTriggered) + { + if (timeOffset > second_hit_window) + AddJudgement(new TaikoStrongHitJudgement { Result = HitResult.Miss }); return; + } // If we get here, we're assured that the key pressed is the correct secondary key if (Math.Abs(firstHitTime - Time.Current) < second_hit_window) - { - AddJudgement(new TaikoStrongHitJudgement()); - processedSecondHit = true; - } + AddJudgement(new TaikoStrongHitJudgement { Result = HitResult.Great }); } public override bool OnReleased(TaikoAction action) @@ -56,8 +55,11 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables public override bool OnPressed(TaikoAction action) { + if (AllJudged) + return false; + // Check if we've handled the first key - if (!base.AllJudged) + if (!SecondHitAllowed) { // First key hasn't been handled yet, attempt to handle it bool handled = base.OnPressed(action); @@ -72,10 +74,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables return handled; } - // If we've already hit the second key, don't handle this object any further - if (processedSecondHit) - return false; - // Don't handle represses of the first key if (firstHitAction == action) return false; From 0620d0bd7a2e21034d7a96e10acc556c958b79b6 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 2 Nov 2017 21:56:09 +0900 Subject: [PATCH 054/166] AllJudged does not need to be virtual anymore --- osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 19bddd05e0..091af04106 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -110,7 +110,7 @@ namespace osu.Game.Rulesets.Objects.Drawables /// /// Whether this and all of its nested s have been judged. /// - public virtual bool AllJudged => (!ProvidesJudgement || judgementFinalized) && (NestedHitObjects?.All(h => h.AllJudged) ?? true); + public bool AllJudged => (!ProvidesJudgement || judgementFinalized) && (NestedHitObjects?.All(h => h.AllJudged) ?? true); /// /// Notifies that a new judgement has occurred for this . From 240997e4fbbd95617e4cd02af875ad413e4b13cf Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 2 Nov 2017 21:56:18 +0900 Subject: [PATCH 055/166] Remove duplicate property --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs index 8a96640b1e..7199691ae6 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -20,8 +20,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables public bool Tracking; - public override bool RemoveWhenNotAlive => false; - public override bool DisplayJudgement => false; public DrawableSliderTick(SliderTick sliderTick) : base(sliderTick) From 5c2b1d4be2941166b6e7c48c80bf44026375d8c9 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 2 Nov 2017 21:58:29 +0900 Subject: [PATCH 056/166] Update xmldoc --- osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index abb4c7770e..489eacf386 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables protected abstract TaikoAction[] HitActions { get; } /// - /// Whether a second hit is allowed to be processed. + /// Whether a second hit is allowed to be processed. This occurs once this hit object has been hit successfully. /// protected bool SecondHitAllowed { get; private set; } From f7540e28baf59f8c063a1abd11b39d5db550f1e6 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 2 Nov 2017 22:22:53 +0900 Subject: [PATCH 057/166] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index ef10edfc75..c8222d1dc9 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit ef10edfc750b39258edbff46019f1d10700548c2 +Subproject commit c8222d1dc932aafe17ec42bfbe6cbec81851f55d From 3f20caa543897e87b93f2a2da3aeda86b1f004a0 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 2 Nov 2017 23:31:50 +0900 Subject: [PATCH 058/166] Make taiko stop crashing for now --- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index 136da8a532..ac3796f5b8 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -244,7 +244,12 @@ namespace osu.Game.Rulesets.Taiko.UI if (judgedObject.X >= -0.05f && judgedObject is DrawableHit) { // If we're far enough away from the left stage, we should bring outselves in front of it - topLevelHitContainer.Add(judgedObject.CreateProxy()); + // Todo: The following try-catch is temporary for replay rewinding support + try + { + topLevelHitContainer.Add(judgedObject.CreateProxy()); + } + catch { } } hitExplosionContainer.Add(new HitExplosion(judgedObject, isRim)); From 6a206c616baff0070ab852f6136a032864f40093 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 3 Nov 2017 14:34:12 +0900 Subject: [PATCH 059/166] Update in line with framework changes --- osu.Game/Screens/OsuScreen.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 412fe02d30..5ecfcd8e8d 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -76,7 +76,7 @@ namespace osu.Game.Screens protected override void OnResuming(Screen last) { base.OnResuming(last); - logo.WaitForTransforms().Schedule(() => logoSetup(true)); + logo.DelayUntilTransformsFinished().Schedule(() => logoSetup(true)); sampleExit?.Play(); } @@ -122,7 +122,7 @@ namespace osu.Game.Screens base.OnEntering(last); - logo.WaitForTransforms().Schedule(() => logoSetup(false)); + logo.DelayUntilTransformsFinished().Schedule(() => logoSetup(false)); } protected override bool OnExiting(Screen next) From 70ea3e50253210f52b72d8ae7aff00b6d4c19ff1 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 3 Nov 2017 15:29:16 +0900 Subject: [PATCH 060/166] Fix up initial scale of DrawableRepeatPoint --- .../Objects/Drawables/DrawableRepeatPoint.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index bb200c9ecd..235a646ac8 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -47,16 +47,20 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables AddJudgement(new OsuJudgement { Result = drawableSlider.Tracking ? HitResult.Great : HitResult.Miss }); } + protected override void UpdateInitialState() + { + base.UpdateInitialState(); + + Scale = new Vector2(0.5f); + } + protected override void UpdatePreemptState() { var animIn = Math.Min(150, repeatPoint.StartTime - FadeInTime); - this.Animate( - d => d.FadeIn(animIn), - d => d.ScaleTo(0.5f).ScaleTo(1.2f, animIn) - ).Then( - d => d.ScaleTo(1, 150, Easing.Out) - ); + this.FadeIn(animIn).ScaleTo(1.2f, animIn) + .Then() + .ScaleTo(1, 150, Easing.Out); } protected override void UpdateCurrentState(ArmedState state) From 06a62edeb635602211eba9e1f7ab83acb0faa6d1 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 3 Nov 2017 15:30:46 +0900 Subject: [PATCH 061/166] Make DrawableRepeatPoints show up when replayed Fixes #1458 --- .../Objects/Drawables/DrawableRepeatPoint.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index 235a646ac8..200c697a0f 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -18,13 +18,16 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables public double FadeInTime; public double FadeOutTime; - public override bool RemoveWhenNotAlive => false; - - public DrawableRepeatPoint(RepeatPoint repeatPoint, DrawableSlider drawableSlider) : base(repeatPoint) + public DrawableRepeatPoint(RepeatPoint repeatPoint, DrawableSlider drawableSlider) + : base(repeatPoint) { this.repeatPoint = repeatPoint; this.drawableSlider = drawableSlider; + // The containing DrawableSlider is updated before us and clears our transforms, so we need to be + // present to get updated and have UpdateState correctly called when rewinding. + AlwaysPresent = true; + AutoSizeAxes = Axes.Both; Blending = BlendingMode.Additive; Origin = Anchor.Centre; From 60048e6cd1f65d74a0b947e66f8c106c4cccd0ab Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 3 Nov 2017 15:33:24 +0900 Subject: [PATCH 062/166] Fix slider ticks not showing up again once replayed Fixes #1456 --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs index 7199691ae6..9fe475f4aa 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -28,6 +28,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables Size = new Vector2(16) * sliderTick.Scale; + // The containing DrawableSlider is updated before us and clears our transforms, so we need to be + // present to get updated and have UpdateState correctly called when rewinding. + AlwaysPresent = true; + Masking = true; CornerRadius = Size.X / 2; From 5fd311514239d795cefbf272fe806f063c32b5b5 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 3 Nov 2017 15:58:12 +0900 Subject: [PATCH 063/166] Fix slider ball not animating fade/scale after rewinding Fixes #1455 --- .../Objects/Drawables/Pieces/SliderBall.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs index 1986b1431b..2068ad9205 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -101,14 +101,21 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces // If the current time is between the start and end of the slider, we should track mouse input regardless of the cursor position. public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => canCurrentlyTrack || base.ReceiveMouseInputAt(screenSpacePos); + public override void ClearTransforms(bool propagateChildren = false, string targetMember = null) + { + // Consider the case of rewinding - children's transforms are handled internally, so propagating down + // any further will cause weirdness with the Tracking bool below. Let's not propagate further at this point. + base.ClearTransforms(false, targetMember); + } + private bool tracking; public bool Tracking { get { return tracking; } private set { - if (value == tracking) return; - + if (value == tracking) + return; tracking = value; follow.ScaleTo(tracking ? 2.8f : 1, 300, Easing.OutQuint); @@ -123,8 +130,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces base.Update(); // Make sure to use the base version of ReceiveMouseInputAt so that we correctly check the position. - if (Time.Current < slider.EndTime) - Tracking = canCurrentlyTrack && lastState != null && base.ReceiveMouseInputAt(lastState.Mouse.NativeState.Position) && ((Parent as DrawableSlider)?.OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false); + Tracking = canCurrentlyTrack + && lastState != null + && base.ReceiveMouseInputAt(lastState.Mouse.NativeState.Position) + && ((Parent as DrawableSlider)?.OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false); } public void UpdateProgress(double progress, int repeat) From 3adcfa8c385c74a9a3785a246f39126c31335773 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 3 Nov 2017 17:54:35 +0900 Subject: [PATCH 064/166] Many fixes --- ...tCaseIntro.cs => TestCaseIntroSequence.cs} | 15 +- osu.Game.Tests/osu.Game.Tests.csproj | 2 +- osu.Game/Screens/Menu/IntroSequence.cs | 191 ++++++------------ osu.Game/Screens/Menu/LogoVisualisation.cs | 2 +- osu.Game/Screens/Menu/OsuLogo.cs | 17 ++ 5 files changed, 95 insertions(+), 132 deletions(-) rename osu.Game.Tests/Visual/{TestCaseIntro.cs => TestCaseIntroSequence.cs} (75%) diff --git a/osu.Game.Tests/Visual/TestCaseIntro.cs b/osu.Game.Tests/Visual/TestCaseIntroSequence.cs similarity index 75% rename from osu.Game.Tests/Visual/TestCaseIntro.cs rename to osu.Game.Tests/Visual/TestCaseIntroSequence.cs index a2375a592e..ba5cf8ef46 100644 --- a/osu.Game.Tests/Visual/TestCaseIntro.cs +++ b/osu.Game.Tests/Visual/TestCaseIntroSequence.cs @@ -12,16 +12,16 @@ using osu.Game.Screens.Menu; namespace osu.Game.Tests.Visual { - public class TestCaseIntro : OsuTestCase + public class TestCaseIntroSequence : OsuTestCase { public override IReadOnlyList RequiredTypes => new[] { - typeof(IntroSequence) + typeof(OsuLogo), }; - public TestCaseIntro() + public TestCaseIntroSequence() { - IntroSequence intro; + OsuLogo logo; var rateAdjustClock = new StopwatchClock(true); var framedClock = new FramedClock(rateAdjustClock); @@ -38,11 +38,14 @@ namespace osu.Game.Tests.Visual RelativeSizeAxes = Axes.Both, Colour = Color4.Black, }, - intro = new IntroSequence(), + logo = new OsuLogo + { + Anchor = Anchor.Centre, + } } }); - AddStep(@"Restart", intro.Restart); + AddStep(@"Restart", logo.PlayIntro); AddSliderStep("Playback speed", 0.0, 2.0, 1, v => rateAdjustClock.Rate = v); } } diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 31d48097f9..4cc06df609 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -110,7 +110,7 @@ - + diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 37c891a13a..8ca2bbaf14 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.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.Extensions.Color4Extensions; @@ -15,12 +16,10 @@ namespace osu.Game.Screens.Menu public class IntroSequence : Container { //Size - private const int logo_size = 460; //todo: this should probably be 480 + private const float logo_size = 460; //todo: this should probably be 480 private readonly OsuSpriteText welcomeText; - private readonly OsuLogo logo; - private readonly Container barsContainer; private readonly Container barTopLeft; @@ -185,144 +184,95 @@ namespace osu.Game.Screens.Menu Colour = OsuColour.FromHex(@"e967a1"), } }, - logo = new OsuLogo - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Ripple = false, - Interactive = false, - Blending = BlendingMode.Additive, - }, }; - - setDefaults(); } - public void Start() + public void Start(double length) { - const int circle_size = 416; + FinishTransforms(true); + setDefaults(); - //Time - const int full_animation_duration = 2950; + mediumRing.ResizeTo(130, 360, Easing.InExpo).OnComplete(r => r.Foreground.ResizeTo(1, 420, Easing.OutQuad)); - const int medium_ring_resize_duration = 360; - const int medium_ring_fade_duration = 420; - - const int small_ring_resize_duration = 250; - const int small_ring_fade_duration = 650; - - const int text_fade_duration = 700; - const int text_spacing_transform_duration = 1500; - - const int bar_animation_duration = 700; - const int bar_resize_delay = 150; - - const int big_ring_animation_start_delay = 2000; - const int big_ring_resize_duration = 500; - const int big_ring_foreground_resize_delay = 250; - const int big_ring_fade_duration = 450; - - const int background_animation_start_time = 2250; - const int foreground_animation_start_time = 2300; - - const int colored_circle_rotation_delay = 110; - const int colored_circles_appear_delay = 80; - const int purple_circle_animation_start_time = 2250; - - const int logo_fade_duration = 300; - - //Position - const int bar_end_offset = 120; - - mediumRing.ResizeTo(130, medium_ring_resize_duration, Easing.InExpo); + Func remainingTime = () => length - TransformDelay; using (BeginDelayedSequence(200, true)) { - welcomeText.FadeIn(text_fade_duration); - welcomeText.TransformSpacingTo(new Vector2(20, 0), text_spacing_transform_duration, Easing.Out); + welcomeText.FadeIn(700); + welcomeText.TransformSpacingTo(new Vector2(20, 0), 1500, Easing.Out); - smallRing.ResizeTo(40, small_ring_resize_duration, Easing.InExpo); - smallRing.Foreground.Delay(small_ring_resize_duration).ResizeTo(1, small_ring_fade_duration, Easing.OutQuad); - } + smallRing.ResizeTo(logo_size * 0.086f, 250, Easing.InExpo).OnComplete(r => r.Foreground.ResizeTo(1, 650, Easing.OutQuad)); - using (BeginDelayedSequence(medium_ring_resize_duration, true)) - { - mediumRing.Foreground.ResizeTo(1, medium_ring_fade_duration, Easing.OutQuad); - - foreach (var bar in barsContainer) + using (BeginDelayedSequence(160, true)) { - bar.FadeIn(); - bar.Delay(bar_resize_delay).ResizeWidthTo(0, bar_animation_duration - bar_resize_delay, Easing.OutQuint); - } + const int bar_duration = 700; + const int bar_resize = 150; - barTopLeft.MoveTo(new Vector2(-bar_end_offset, -bar_end_offset), bar_animation_duration, Easing.OutQuint); - barTopRight.MoveTo(new Vector2(bar_end_offset, -bar_end_offset), bar_animation_duration, Easing.OutQuint); - barBottomLeft.MoveTo(new Vector2(-bar_end_offset, bar_end_offset), bar_animation_duration, Easing.OutQuint); - barBottomRight.MoveTo(new Vector2(bar_end_offset, bar_end_offset), bar_animation_duration, Easing.OutQuint); - } - - using (bigRing.BeginDelayedSequence(big_ring_animation_start_delay, true)) - { - bigRing.ResizeTo(400, big_ring_resize_duration, Easing.InOutQuint); - bigRing.Foreground.Delay(big_ring_foreground_resize_delay).ResizeTo(1, big_ring_fade_duration, Easing.OutExpo); - } - - int duration = full_animation_duration - background_animation_start_time; - using (backgroundFill.BeginDelayedSequence(background_animation_start_time)) - { - backgroundFill.ResizeHeightTo(1, duration, Easing.InOutQuart); - backgroundFill.RotateTo(-90, duration, Easing.InOutQuart); - } - - duration = full_animation_duration - foreground_animation_start_time; - using (foregroundFill.BeginDelayedSequence(foreground_animation_start_time)) - { - foregroundFill.ResizeWidthTo(1, duration, Easing.InOutQuart); - foregroundFill.RotateTo(-90, duration, Easing.InOutQuart); - } - - duration = full_animation_duration - purple_circle_animation_start_time; - using (BeginDelayedSequence(purple_circle_animation_start_time, true)) - { - purpleCircle.MoveToY((circle_size - 2) / 2.0f, duration, Easing.InOutQuad); - purpleCircle.Delay(colored_circle_rotation_delay).RotateTo(-180, duration - colored_circle_rotation_delay, Easing.OutQuad); - purpleCircle.ResizeTo(circle_size - 2, duration, Easing.InOutQuad); - - duration -= colored_circles_appear_delay; - using (BeginDelayedSequence(colored_circles_appear_delay, true)) - { - yellowCircle.MoveToY(-(circle_size - 2) / 2.0f, duration, Easing.InOutQuad); - yellowCircle.Delay(colored_circle_rotation_delay).RotateTo(-180, duration - colored_circle_rotation_delay, Easing.OutQuad); - yellowCircle.ResizeTo(circle_size - 2, duration, Easing.InOutQuad); - - duration -= colored_circles_appear_delay; - using (BeginDelayedSequence(colored_circles_appear_delay, true)) + foreach (var bar in barsContainer) { - blueCircle.MoveToX(-(circle_size - 2) / 2.0f, duration, Easing.InOutQuad); - blueCircle.Delay(colored_circle_rotation_delay).RotateTo(-180, duration - colored_circle_rotation_delay, Easing.OutQuad); - blueCircle.ResizeTo(circle_size - 2, duration, Easing.InOutQuad); + bar.FadeIn(); + bar.Delay(bar_resize).ResizeWidthTo(0, bar_duration - bar_resize, Easing.OutQuint); + } - duration -= colored_circles_appear_delay; - using (BeginDelayedSequence(colored_circles_appear_delay, true)) + const int bar_end_offset = 120; + barTopLeft.MoveTo(new Vector2(-bar_end_offset, -bar_end_offset), bar_duration, Easing.OutQuint); + barTopRight.MoveTo(new Vector2(bar_end_offset, -bar_end_offset), bar_duration, Easing.OutQuint); + barBottomLeft.MoveTo(new Vector2(-bar_end_offset, bar_end_offset), bar_duration, Easing.OutQuint); + barBottomRight.MoveTo(new Vector2(bar_end_offset, bar_end_offset), bar_duration, Easing.OutQuint); + + using (BeginDelayedSequence(1640, true)) // 2000 + { + bigRing.ResizeTo(logo_size * 0.86f, 500, Easing.InOutQuint); + bigRing.Foreground.Delay(250).ResizeTo(1, 450, Easing.OutExpo); + + using (BeginDelayedSequence(250, true)) // 2250 { - pinkCircle.MoveToX(circle_size / 2.0f, duration, Easing.InOutQuad); - pinkCircle.Delay(colored_circle_rotation_delay).RotateTo(-180, duration - colored_circle_rotation_delay, Easing.OutQuad); - pinkCircle.ResizeTo(circle_size, duration, Easing.InOutQuad); + backgroundFill.ResizeHeightTo(1, remainingTime(), Easing.InOutQuart); + backgroundFill.RotateTo(-90, remainingTime(), Easing.InOutQuart); + + using (BeginDelayedSequence(50, true)) + { + foregroundFill.ResizeWidthTo(1, remainingTime(), Easing.InOutQuart); + foregroundFill.RotateTo(-90, remainingTime(), Easing.InOutQuart); + } + + const float circle_size = logo_size * 0.9f; + + const int rotation_delay = 110; + const int appear_delay = 80; + + purpleCircle.MoveToY(circle_size / 2, remainingTime(), Easing.InOutQuad); + purpleCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.OutQuad); + purpleCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuad); + + using (BeginDelayedSequence(appear_delay, true)) + { + yellowCircle.MoveToY(-circle_size / 2, remainingTime(), Easing.InOutQuad); + yellowCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.OutQuad); + yellowCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuad); + + using (BeginDelayedSequence(appear_delay, true)) + { + blueCircle.MoveToX(-circle_size / 2, remainingTime(), Easing.InOutQuad); + blueCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.OutQuad); + blueCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuad); + + using (BeginDelayedSequence(appear_delay, true)) + { + pinkCircle.MoveToX(circle_size / 2, remainingTime(), Easing.InOutQuad); + pinkCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.OutQuad); + pinkCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuad); + } + } + } } } } } - - logo.Delay(full_animation_duration).FadeIn(logo_fade_duration); - - backgroundFill.Delay(full_animation_duration + logo_fade_duration).FadeOut(); - foregroundFill.Delay(full_animation_duration + logo_fade_duration).FadeOut(); } private void setDefaults() { - logo.Alpha = 0; - welcomeText.Spacing = new Vector2(5); welcomeText.Alpha = 0; @@ -355,13 +305,6 @@ namespace osu.Game.Screens.Menu pinkCircle.Position = new Vector2(circle_offset, 0); } - public void Restart() - { - FinishTransforms(true); - setDefaults(); - Start(); - } - private class Ring : Container { public readonly CircularContainer Foreground; diff --git a/osu.Game/Screens/Menu/LogoVisualisation.cs b/osu.Game/Screens/Menu/LogoVisualisation.cs index 4b8942349d..3e7662a441 100644 --- a/osu.Game/Screens/Menu/LogoVisualisation.cs +++ b/osu.Game/Screens/Menu/LogoVisualisation.cs @@ -19,7 +19,7 @@ using osu.Framework.Allocation; namespace osu.Game.Screens.Menu { - internal class LogoVisualisation : Drawable, IHasAccentColour + public class LogoVisualisation : Drawable, IHasAccentColour { private readonly Bindable beatmap = new Bindable(); diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index 297076a78b..6215cb5660 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -39,6 +39,8 @@ namespace osu.Game.Screens.Menu private readonly Container logoHoverContainer; private readonly LogoVisualisation visualizer; + private readonly IntroSequence intro; + private SampleChannel sampleClick; private SampleChannel sampleBeat; @@ -89,6 +91,10 @@ namespace osu.Game.Screens.Menu Children = new Drawable[] { + intro = new IntroSequence + { + RelativeSizeAxes = Axes.Both, + }, logoHoverContainer = new Container { AutoSizeAxes = Axes.Both, @@ -289,6 +295,17 @@ namespace osu.Game.Screens.Menu } } + public void PlayIntro() + { + const double length = 2950; + const double fade = 300; + + logoHoverContainer.FadeOut().Delay(length).FadeIn(fade); + intro.Show(); + intro.Start(length); + intro.Delay(length + fade).FadeOut(); + } + protected override void Update() { base.Update(); From 3b189c1ffed02f8e758efaaf2cce8c4e789636ca Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 3 Nov 2017 21:20:36 +0900 Subject: [PATCH 065/166] Fix BreakOverlay not properly working with rewinding In various ways: * It wouldn't show up if rewound after the break was complete. * The time would increase backwards if rewind happened during a break. * Etc. * Basically the fix is to use transformations everywhere. BreakOverlay could be refactored further, but this is enough to make it work for now. --- .../Play/BreaksOverlay/BreakOverlay.cs | 37 +++++++++------- .../BreaksOverlay/RemainingTimeCounter.cs | 44 +++++++------------ 2 files changed, 36 insertions(+), 45 deletions(-) diff --git a/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs b/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs index f5062aa40f..b3d08c0c82 100644 --- a/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs +++ b/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs @@ -30,6 +30,8 @@ namespace osu.Game.Screens.Play.BreaksOverlay } } + public override bool RemoveCompletedTransforms => false; + private readonly bool letterboxing; private readonly LetterboxOverlay letterboxOverlay; private readonly Container remainingTimeAdjustmentBox; @@ -101,38 +103,41 @@ namespace osu.Game.Screens.Play.BreaksOverlay if (!b.HasEffect) continue; + using (BeginAbsoluteSequence(b.StartTime, true)) + { + remainingTimeAdjustmentBox + .ResizeWidthTo(remaining_time_container_max_size, fade_duration, Easing.OutQuint) + .Delay(b.Duration - fade_duration) + .ResizeWidthTo(0); + + remainingTimeBox + .ResizeWidthTo(0, b.Duration - fade_duration) + .Then() + .ResizeWidthTo(1); + + remainingTimeCounter.CountTo(b.Duration); + } + using (BeginAbsoluteSequence(b.StartTime)) { - Schedule(() => onBreakIn(b)); + Schedule(() => showBreak(b)); using (BeginDelayedSequence(b.Duration - fade_duration)) - Schedule(onBreakOut); + Schedule(hideBreak); } } } - private void onBreakIn(BreakPeriod b) + private void showBreak(BreakPeriod b) { if (letterboxing) letterboxOverlay.Show(); - remainingTimeAdjustmentBox - .ResizeWidthTo(remaining_time_container_max_size, fade_duration, Easing.OutQuint) - .Delay(b.Duration - fade_duration) - .ResizeWidthTo(0); - - remainingTimeBox - .ResizeWidthTo(0, b.Duration - fade_duration) - .Then() - .ResizeWidthTo(1); - - remainingTimeCounter.StartCounting(b.EndTime); - remainingTimeCounter.Show(); info.Show(); arrowsOverlay.Show(); } - private void onBreakOut() + private void hideBreak() { if (letterboxing) letterboxOverlay.Hide(); diff --git a/osu.Game/Screens/Play/BreaksOverlay/RemainingTimeCounter.cs b/osu.Game/Screens/Play/BreaksOverlay/RemainingTimeCounter.cs index b5d77d0d02..e144ac25da 100644 --- a/osu.Game/Screens/Play/BreaksOverlay/RemainingTimeCounter.cs +++ b/osu.Game/Screens/Play/BreaksOverlay/RemainingTimeCounter.cs @@ -9,18 +9,12 @@ using osu.Game.Beatmaps.Timing; namespace osu.Game.Screens.Play.BreaksOverlay { - public class RemainingTimeCounter : VisibilityContainer + public class RemainingTimeCounter : Container { private const double fade_duration = BreakPeriod.MIN_BREAK_DURATION / 2; private readonly OsuSpriteText counter; - private int? previousSecond; - - private double endTime; - - private bool isCounting; - public RemainingTimeCounter() { AutoSizeAxes = Axes.Both; @@ -31,35 +25,27 @@ namespace osu.Game.Screens.Play.BreaksOverlay TextSize = 33, Font = "Venera", }; + + Alpha = 0; } - public void StartCounting(double endTime) + public void CountTo(double duration) { - this.endTime = endTime; - isCounting = true; - } + double offset = 0; - protected override void Update() - { - base.Update(); - - if (isCounting) + while (duration > 0) { - var currentTime = Clock.CurrentTime; - if (currentTime < endTime) - { - int currentSecond = (int)Math.Ceiling((endTime - Clock.CurrentTime) / 1000.0); - if (currentSecond != previousSecond) - { - counter.Text = currentSecond.ToString(); - previousSecond = currentSecond; - } - } - else isCounting = false; + int seconds = (int)Math.Ceiling(duration / 1000); + counter.Delay(offset).TransformTextTo(seconds.ToString()); + + double localOffset = duration - (seconds - 1) * 1000 + 1; // +1 because we want the duration to be the next second when ceiled + + offset += localOffset; + duration -= localOffset; } } - protected override void PopIn() => this.FadeIn(fade_duration); - protected override void PopOut() => this.FadeOut(fade_duration); + public override void Show() => this.FadeIn(fade_duration); + public override void Hide() => this.FadeOut(fade_duration); } } From edd0d166b1c774cf102cc83208c52c56d6ab8df4 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 4 Nov 2017 00:42:36 +0900 Subject: [PATCH 066/166] Add text transforms to OsuSpriteText --- osu.Game/Graphics/Sprites/OsuSpriteText.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/osu.Game/Graphics/Sprites/OsuSpriteText.cs b/osu.Game/Graphics/Sprites/OsuSpriteText.cs index f5749846be..cbd9d9582d 100644 --- a/osu.Game/Graphics/Sprites/OsuSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuSpriteText.cs @@ -6,6 +6,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.MathUtils; using OpenTK; using OpenTK.Graphics; +using osu.Framework.Graphics.Transforms; namespace osu.Game.Graphics.Sprites { @@ -40,4 +41,23 @@ namespace osu.Game.Graphics.Sprites return base.CreateFallbackCharacterDrawable(); } } + + public static class OsuSpriteTextTransformExtensions + { + /// + /// Sets to a new value after a duration. + /// + /// A to which further transforms can be added. + public static TransformSequence TransformTextTo(this T spriteText, string newText, double duration = 0, Easing easing = Easing.None) + where T : OsuSpriteText + => spriteText.TransformTo(nameof(OsuSpriteText.Text), newText, duration, easing); + + /// + /// Sets to a new value after a duration. + /// + /// A to which further transforms can be added. + public static TransformSequence TransformTextTo(this TransformSequence t, string newText, double duration = 0, Easing easing = Easing.None) + where T : OsuSpriteText + => t.Append(o => o.TransformTextTo(newText, duration, easing)); + } } From 15f69dff813f5ff46e7c31d1208627d12b2fcb6e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 4 Nov 2017 00:57:10 +0900 Subject: [PATCH 067/166] Make mania hit explosions not stick around when rewinding Fixes #1461. --- osu.Game.Rulesets.Mania/UI/HitExplosion.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/UI/HitExplosion.cs b/osu.Game.Rulesets.Mania/UI/HitExplosion.cs index 8164adcebd..433c518929 100644 --- a/osu.Game.Rulesets.Mania/UI/HitExplosion.cs +++ b/osu.Game.Rulesets.Mania/UI/HitExplosion.cs @@ -57,8 +57,10 @@ namespace osu.Game.Rulesets.Mania.UI { base.LoadComplete(); - this.ScaleTo(2f, 600, Easing.OutQuint).FadeOut(500).Expire(); + this.ScaleTo(2f, 600, Easing.OutQuint).FadeOut(500); inner.FadeOut(250); + + Expire(true); } } } From 4854302aaa9065d62aeebc298596e5c4ddaf5414 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 4 Nov 2017 01:02:33 +0900 Subject: [PATCH 068/166] Fix follow points not showing up again after rewinding Fixes #1463. --- .../Objects/Drawables/Connections/FollowPoint.cs | 2 ++ .../Objects/Drawables/Connections/FollowPointRenderer.cs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs index dbf5c6c541..ee0b5e6c50 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs @@ -14,6 +14,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections { private const float width = 8; + public override bool RemoveWhenNotAlive => false; + public FollowPoint() { Origin = Anchor.Centre; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs index 2396e5d129..fca9187047 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs @@ -52,9 +52,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections } } + public override bool RemoveCompletedTransforms => false; + private void update() { Clear(); + if (hitObjects == null) return; From 761d885167d1ea94db18c5798fe7746a954d0b55 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 3 Nov 2017 20:25:21 +0300 Subject: [PATCH 069/166] Add Favourite Beatmaps section in UserProfileOverlay --- .../API/Requests/GetUserBeatmapsRequest.cs | 30 +++++ .../Beatmaps/PaginatedBeatmapContainer.cs | 70 +++++++++++ .../Profile/Sections/BeatmapsSection.cs | 11 ++ .../Profile/Sections/HistoricalSection.cs | 2 +- .../Profile/Sections/PaginatedContainer.cs | 109 +++++++++++++++++ .../Sections/Ranks/PaginatedScoreContainer.cs | 111 +++--------------- .../Overlays/Profile/Sections/RanksSection.cs | 4 +- osu.Game/Overlays/UserProfileOverlay.cs | 2 +- osu.Game/osu.Game.csproj | 3 + 9 files changed, 242 insertions(+), 100 deletions(-) create mode 100644 osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs create mode 100644 osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs create mode 100644 osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs diff --git a/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs b/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs new file mode 100644 index 0000000000..8c243f899b --- /dev/null +++ b/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs @@ -0,0 +1,30 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; + +namespace osu.Game.Online.API.Requests +{ + public class GetUserBeatmapsRequest : APIRequest> + { + private readonly long userId; + private readonly BeatmapSetType type; + private readonly int offset; + + public GetUserBeatmapsRequest(long userId, BeatmapSetType type, int offset = 0) + { + this.userId = userId; + this.type = type; + this.offset = offset; + } + + protected override string Target => $@"users/{userId}/beatmapsets/{type.ToString().ToLower()}?offset={offset}"; + } + + public enum BeatmapSetType + { + Most_Played, + Favourite, + Ranked_And_Approved + } +} diff --git a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs new file mode 100644 index 0000000000..1a1442979f --- /dev/null +++ b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs @@ -0,0 +1,70 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Game.Online.API.Requests; +using osu.Game.Overlays.Direct; +using osu.Game.Users; +using System.Linq; + +namespace osu.Game.Overlays.Profile.Sections.Beatmaps +{ + public class PaginatedBeatmapContainer : PaginatedContainer + { + private const float panel_padding = 10f; + + private readonly BeatmapSetType type; + private string header; + + private DirectPanel playing; + + public PaginatedBeatmapContainer(BeatmapSetType type, Bindable user, string header, string missing) + : base(user, header, missing) + { + this.type = type; + this.header = header; + + ItemsPerPage = 6; + + ItemsContainer.Spacing = new Vector2(panel_padding); + ItemsContainer.Margin = new MarginPadding { Bottom = panel_padding }; + } + + protected override void ShowMore() + { + base.ShowMore(); + + var req = new GetUserBeatmapsRequest(User.Value.Id, type, VisiblePages++ * ItemsPerPage); + + req.Success += sets => + { + ShowMoreButton.FadeTo(sets.Count == ItemsPerPage ? 1 : 0); + ShowMoreLoading.Hide(); + + if (!sets.Any()) return; + + MissingText.Hide(); + + foreach (var s in sets) + { + var panel = new DirectGridPanel(s.ToBeatmapSet(Rulesets)) { Width = 400 }; + ItemsContainer.Add(panel); + + panel.PreviewPlaying.ValueChanged += newValue => + { + if (newValue) + { + if (playing != null && playing != panel) + playing.PreviewPlaying.Value = false; + playing = panel; + } + }; + } + }; + + Api.Queue(req); + } + } +} diff --git a/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs b/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs index 1c39223e6f..48c8c69922 100644 --- a/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs +++ b/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs @@ -1,6 +1,9 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Online.API.Requests; +using osu.Game.Overlays.Profile.Sections.Beatmaps; + namespace osu.Game.Overlays.Profile.Sections { public class BeatmapsSection : ProfileSection @@ -8,5 +11,13 @@ namespace osu.Game.Overlays.Profile.Sections public override string Title => "Beatmaps"; public override string Identifier => "beatmaps"; + + public BeatmapsSection() + { + Children = new[] + { + new PaginatedBeatmapContainer(BeatmapSetType.Favourite, User, "Favourite Beatmaps", "None... yet."), + }; + } } } diff --git a/osu.Game/Overlays/Profile/Sections/HistoricalSection.cs b/osu.Game/Overlays/Profile/Sections/HistoricalSection.cs index d25407f4a3..a4d043d20a 100644 --- a/osu.Game/Overlays/Profile/Sections/HistoricalSection.cs +++ b/osu.Game/Overlays/Profile/Sections/HistoricalSection.cs @@ -14,7 +14,7 @@ namespace osu.Game.Overlays.Profile.Sections public HistoricalSection() { - Child = new PaginatedScoreContainer(ScoreType.Recent, User, "Recent Plays (24h)"); + Child = new PaginatedScoreContainer(ScoreType.Recent, User, "Recent Plays (24h)", "No performance records. :("); } } } diff --git a/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs b/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs new file mode 100644 index 0000000000..d0ccf6af41 --- /dev/null +++ b/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs @@ -0,0 +1,109 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Graphics.Containers; +using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; +using osu.Game.Online.API; +using osu.Game.Rulesets; +using osu.Game.Users; + +namespace osu.Game.Overlays.Profile.Sections +{ + public class PaginatedContainer : FillFlowContainer + { + protected readonly FillFlowContainer ItemsContainer; + protected readonly OsuHoverContainer ShowMoreButton; + protected readonly LoadingAnimation ShowMoreLoading; + protected readonly OsuSpriteText MissingText; + + protected int VisiblePages; + protected int ItemsPerPage; + + protected readonly Bindable User = new Bindable(); + + protected APIAccess Api; + protected RulesetStore Rulesets; + + public PaginatedContainer(Bindable user, string header, string missing) + { + User.BindTo(user); + + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; + Direction = FillDirection.Vertical; + + Children = new Drawable[] + { + new OsuSpriteText + { + TextSize = 15, + Text = header, + Font = "Exo2.0-RegularItalic", + Margin = new MarginPadding { Top = 10, Bottom = 10 }, + }, + ItemsContainer = new FillFlowContainer + { + AutoSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.X, + }, + ShowMoreButton = new OsuHoverContainer + { + Alpha = 0, + Action = ShowMore, + AutoSizeAxes = Axes.Both, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Child = new OsuSpriteText + { + TextSize = 14, + Text = "show more", + } + }, + ShowMoreLoading = new LoadingAnimation + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Size = new Vector2(14), + }, + MissingText = new OsuSpriteText + { + TextSize = 14, + Text = missing + }, + }; + } + + [BackgroundDependencyLoader] + private void load(APIAccess api, RulesetStore rulesets) + { + Api = api; + Rulesets = rulesets; + + User.ValueChanged += onUserChanged; + User.TriggerChange(); + } + + private void onUserChanged(User newUser) + { + VisiblePages = 0; + ItemsContainer.Clear(); + ShowMoreButton.Hide(); + MissingText.Show(); + + if (newUser != null) + ShowMore(); + } + + protected virtual void ShowMore() + { + ShowMoreLoading.Show(); + ShowMoreButton.Hide(); + } + } +} diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs b/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs index 060bb03014..4c2bea4554 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs @@ -1,130 +1,49 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; -using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Game.Graphics.Containers; -using osu.Game.Graphics.Sprites; -using osu.Game.Graphics.UserInterface; -using osu.Game.Online.API; using osu.Game.Online.API.Requests; -using osu.Game.Rulesets; using osu.Game.Users; using System; using System.Linq; namespace osu.Game.Overlays.Profile.Sections.Ranks { - public class PaginatedScoreContainer : FillFlowContainer + public class PaginatedScoreContainer : PaginatedContainer { - private readonly FillFlowContainer scoreContainer; - private readonly OsuSpriteText missing; - private readonly OsuHoverContainer showMoreButton; - private readonly LoadingAnimation showMoreLoading; - private readonly bool includeWeight; private readonly ScoreType type; - private int visiblePages; - private readonly Bindable user = new Bindable(); - - private RulesetStore rulesets; - private APIAccess api; - - public PaginatedScoreContainer(ScoreType type, Bindable user, string header, bool includeWeight = false) + public PaginatedScoreContainer(ScoreType type, Bindable user, string header, string missing, bool includeWeight = false) + : base(user, header, missing) { this.type = type; this.includeWeight = includeWeight; - this.user.BindTo(user); - RelativeSizeAxes = Axes.X; - AutoSizeAxes = Axes.Y; - Direction = FillDirection.Vertical; + ItemsPerPage = 5; - Children = new Drawable[] - { - new OsuSpriteText - { - TextSize = 15, - Text = header, - Font = "Exo2.0-RegularItalic", - Margin = new MarginPadding { Top = 10, Bottom = 10 }, - }, - scoreContainer = new FillFlowContainer - { - AutoSizeAxes = Axes.Y, - RelativeSizeAxes = Axes.X, - Direction = FillDirection.Vertical, - }, - showMoreButton = new OsuHoverContainer - { - Alpha = 0, - Action = showMore, - AutoSizeAxes = Axes.Both, - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - Child = new OsuSpriteText - { - TextSize = 14, - Text = "show more", - } - }, - showMoreLoading = new LoadingAnimation - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - Size = new Vector2(14), - }, - missing = new OsuSpriteText - { - TextSize = 14, - Text = type == ScoreType.Recent ? "No performance records. :(" : "No awesome performance records yet. :(", - }, - }; + ItemsContainer.Direction = FillDirection.Vertical; } - [BackgroundDependencyLoader] - private void load(APIAccess api, RulesetStore rulesets) + protected override void ShowMore() { - this.api = api; - this.rulesets = rulesets; + base.ShowMore(); - user.ValueChanged += user_ValueChanged; - user.TriggerChange(); - } - - private void user_ValueChanged(User newUser) - { - visiblePages = 0; - scoreContainer.Clear(); - showMoreButton.Hide(); - missing.Show(); - - if (newUser != null) - showMore(); - } - - private void showMore() - { - var req = new GetUserScoresRequest(user.Value.Id, type, visiblePages++ * 5); - - showMoreLoading.Show(); - showMoreButton.Hide(); + var req = new GetUserScoresRequest(User.Value.Id, type, VisiblePages++ * ItemsPerPage); req.Success += scores => { foreach (var s in scores) - s.ApplyRuleset(rulesets.GetRuleset(s.OnlineRulesetID)); + s.ApplyRuleset(Rulesets.GetRuleset(s.OnlineRulesetID)); - showMoreButton.FadeTo(scores.Count == 5 ? 1 : 0); - showMoreLoading.Hide(); + ShowMoreButton.FadeTo(scores.Count == ItemsPerPage ? 1 : 0); + ShowMoreLoading.Hide(); if (!scores.Any()) return; - missing.Hide(); + MissingText.Hide(); foreach (OnlineScore score in scores) { @@ -133,7 +52,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks switch (type) { default: - drawableScore = new DrawablePerformanceScore(score, includeWeight ? Math.Pow(0.95, scoreContainer.Count) : (double?)null); + drawableScore = new DrawablePerformanceScore(score, includeWeight ? Math.Pow(0.95, ItemsContainer.Count) : (double?)null); break; case ScoreType.Recent: drawableScore = new DrawableTotalScore(score); @@ -143,11 +62,11 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks drawableScore.RelativeSizeAxes = Axes.X; drawableScore.Height = 60; - scoreContainer.Add(drawableScore); + ItemsContainer.Add(drawableScore); } }; - api.Queue(req); + Api.Queue(req); } } } diff --git a/osu.Game/Overlays/Profile/Sections/RanksSection.cs b/osu.Game/Overlays/Profile/Sections/RanksSection.cs index 553691ef77..7691100d7a 100644 --- a/osu.Game/Overlays/Profile/Sections/RanksSection.cs +++ b/osu.Game/Overlays/Profile/Sections/RanksSection.cs @@ -16,8 +16,8 @@ namespace osu.Game.Overlays.Profile.Sections { Children = new[] { - new PaginatedScoreContainer(ScoreType.Best, User, "Best Performance", true), - new PaginatedScoreContainer(ScoreType.Firsts, User, "First Place Ranks"), + new PaginatedScoreContainer(ScoreType.Best, User, "Best Performance", "No performance records. :(", true), + new PaginatedScoreContainer(ScoreType.Firsts, User, "First Place Ranks", "No awesome performance records yet. :("), }; } } diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index 5032f2d55b..66d8071dd0 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -96,7 +96,7 @@ namespace osu.Game.Overlays new RanksSection(), //new MedalsSection(), new HistoricalSection(), - //new BeatmapsSection(), + new BeatmapsSection(), //new KudosuSection() }; tabs = new ProfileTabControl diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index db27c77188..2388ec4cc2 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -279,6 +279,9 @@ + + + From 48c39b1d19ec9ffb2362641e48dd03f155b49268 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 4 Nov 2017 00:53:58 +0300 Subject: [PATCH 070/166] Add "Ranked & Approved Beatmaps" section --- osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs b/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs index 48c8c69922..708487b8e2 100644 --- a/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs +++ b/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs @@ -17,6 +17,7 @@ namespace osu.Game.Overlays.Profile.Sections Children = new[] { new PaginatedBeatmapContainer(BeatmapSetType.Favourite, User, "Favourite Beatmaps", "None... yet."), + new PaginatedBeatmapContainer(BeatmapSetType.Ranked_And_Approved, User, "Ranked & Approved Beatmaps", "None... yet."), }; } } From 729777a7e0d38e815291d51cb19fa405cc55bacd Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 4 Nov 2017 18:38:02 +0300 Subject: [PATCH 071/166] Remove useless variable --- .../Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs index 1a1442979f..f15798864f 100644 --- a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs @@ -16,7 +16,6 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps private const float panel_padding = 10f; private readonly BeatmapSetType type; - private string header; private DirectPanel playing; @@ -24,7 +23,6 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps : base(user, header, missing) { this.type = type; - this.header = header; ItemsPerPage = 6; From 1afe2c18be781e28c3566317f4c5aa7083f0b5da Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 4 Nov 2017 19:42:28 +0300 Subject: [PATCH 072/166] Fix osu! deleting beatmaps on startup if MenuMusic is disabled --- osu.Game/Screens/Menu/Intro.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index fb06edb0b0..d767d4eb12 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -99,7 +99,9 @@ namespace osu.Game.Screens.Menu welcome = audio.Sample.Get(@"welcome"); seeya = audio.Sample.Get(@"seeya"); - beatmaps.Delete(setInfo); + + if (setInfo.Protected) + beatmaps.Delete(setInfo); } protected override void OnEntering(Screen last) From 2fbd49062690c2bc4dd2402552a1291425abcde3 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 6 Nov 2017 14:58:05 +0900 Subject: [PATCH 073/166] Make RemainingTimeCounter into a Counter --- .../Play/BreaksOverlay/BreakOverlay.cs | 3 ++- .../BreaksOverlay/RemainingTimeCounter.cs | 21 ++++--------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs b/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs index b3d08c0c82..6128a8f3d7 100644 --- a/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs +++ b/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics.Shapes; using osu.Game.Beatmaps.Timing; using osu.Game.Rulesets.Scoring; using System.Collections.Generic; +using osu.Framework.Graphics.UserInterface; namespace osu.Game.Screens.Play.BreaksOverlay { @@ -115,7 +116,7 @@ namespace osu.Game.Screens.Play.BreaksOverlay .Then() .ResizeWidthTo(1); - remainingTimeCounter.CountTo(b.Duration); + remainingTimeCounter.CountTo(b.Duration).CountTo(0, b.Duration); } using (BeginAbsoluteSequence(b.StartTime)) diff --git a/osu.Game/Screens/Play/BreaksOverlay/RemainingTimeCounter.cs b/osu.Game/Screens/Play/BreaksOverlay/RemainingTimeCounter.cs index e144ac25da..9b043a6e90 100644 --- a/osu.Game/Screens/Play/BreaksOverlay/RemainingTimeCounter.cs +++ b/osu.Game/Screens/Play/BreaksOverlay/RemainingTimeCounter.cs @@ -6,10 +6,11 @@ using osu.Game.Graphics.Sprites; using osu.Framework.Graphics; using System; using osu.Game.Beatmaps.Timing; +using osu.Framework.Graphics.UserInterface; namespace osu.Game.Screens.Play.BreaksOverlay { - public class RemainingTimeCounter : Container + public class RemainingTimeCounter : Counter { private const double fade_duration = BreakPeriod.MIN_BREAK_DURATION / 2; @@ -18,7 +19,7 @@ namespace osu.Game.Screens.Play.BreaksOverlay public RemainingTimeCounter() { AutoSizeAxes = Axes.Both; - Child = counter = new OsuSpriteText + InternalChild = counter = new OsuSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, @@ -29,21 +30,7 @@ namespace osu.Game.Screens.Play.BreaksOverlay Alpha = 0; } - public void CountTo(double duration) - { - double offset = 0; - - while (duration > 0) - { - int seconds = (int)Math.Ceiling(duration / 1000); - counter.Delay(offset).TransformTextTo(seconds.ToString()); - - double localOffset = duration - (seconds - 1) * 1000 + 1; // +1 because we want the duration to be the next second when ceiled - - offset += localOffset; - duration -= localOffset; - } - } + protected override void OnCountChanged(double count) => counter.Text = ((int)Math.Ceiling(count / 1000)).ToString(); public override void Show() => this.FadeIn(fade_duration); public override void Hide() => this.FadeOut(fade_duration); From 8d610cfd434c573f3ff1389cf1050937280bdf5e Mon Sep 17 00:00:00 2001 From: Shane Woolcock Date: Mon, 6 Nov 2017 16:57:51 +1030 Subject: [PATCH 074/166] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 3c074a0981..2de91c4f0c 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 3c074a0981844fbaa9f2ecbf879c542f07e2b94d +Subproject commit 2de91c4f0cce97a4a18229d4d63685111ec06c61 From a7c7f7d690b0c17f009d91c737280883b9baaa0c Mon Sep 17 00:00:00 2001 From: Shane Woolcock Date: Mon, 6 Nov 2017 16:58:17 +1030 Subject: [PATCH 075/166] Add precision values to some of the config bindables --- osu.Game/Configuration/OsuConfigManager.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index b000f08369..9598372d2d 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -16,12 +16,12 @@ namespace osu.Game.Configuration Set(OsuSetting.Ruleset, 0, 0, int.MaxValue); Set(OsuSetting.BeatmapDetailTab, BeatmapDetailTab.Details); - Set(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10); - Set(OsuSetting.DisplayStarsMaximum, 10.0, 0, 10); + Set(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10, 0.1); + Set(OsuSetting.DisplayStarsMaximum, 10.0, 0, 10, 0.1); Set(OsuSetting.SelectionRandomType, SelectionRandomType.RandomPermutation); - Set(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1); + Set(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1, 0.01); // Online settings Set(OsuSetting.Username, string.Empty); @@ -41,11 +41,11 @@ namespace osu.Game.Configuration Set(OsuSetting.MenuVoice, true); Set(OsuSetting.MenuMusic, true); - Set(OsuSetting.AudioOffset, 0, -500.0, 500.0); + Set(OsuSetting.AudioOffset, 0, -500.0, 500.0, 1); // Input - Set(OsuSetting.MenuCursorSize, 1.0, 0.5f, 2); - Set(OsuSetting.GameplayCursorSize, 1.0, 0.5f, 2); + Set(OsuSetting.MenuCursorSize, 1.0, 0.5f, 2, 0.01); + Set(OsuSetting.GameplayCursorSize, 1.0, 0.5f, 2, 0.01); Set(OsuSetting.AutoCursorSize, false); Set(OsuSetting.MouseDisableButtons, false); @@ -63,13 +63,13 @@ namespace osu.Game.Configuration Set(OsuSetting.SnakingOutSliders, true); // Gameplay - Set(OsuSetting.DimLevel, 0.3, 0, 1); + Set(OsuSetting.DimLevel, 0.3, 0, 1, 0.01); Set(OsuSetting.ShowInterface, true); Set(OsuSetting.KeyOverlay, false); Set(OsuSetting.FloatingComments, false); - Set(OsuSetting.PlaybackSpeed, 1.0, 0.5f, 2); + Set(OsuSetting.PlaybackSpeed, 1.0, 0.5f, 2, 0.01); // Update Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer); From c7426ebed80d6187b65e1efca94877f48d99a498 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 6 Nov 2017 17:22:22 +0900 Subject: [PATCH 076/166] Fix spinners showing very weird numbers after rewinding Fixes #1462 --- .../Objects/Drawables/Pieces/SpinnerSpmCounter.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerSpmCounter.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerSpmCounter.cs index ebe978f659..774511313a 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerSpmCounter.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerSpmCounter.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; @@ -61,6 +62,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces public void SetRotation(float currentRotation) { + // If we've gone back in time, it's fine to work with a fresh set of records for now + if (records.Count > 0 && Time.Current < records.Last().Time) + records.Clear(); + if (records.Count > 0) { var record = records.Peek(); From ebaef864324c2f630443124c20fa8748ebf486ca Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 6 Nov 2017 21:28:01 +0300 Subject: [PATCH 077/166] Fix hard crash when opening beatmap with zero playcount in beatmap overlay --- osu.Game/Overlays/BeatmapSet/SuccessRate.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/SuccessRate.cs b/osu.Game/Overlays/BeatmapSet/SuccessRate.cs index 9402ed82f4..e22ec3c70c 100644 --- a/osu.Game/Overlays/BeatmapSet/SuccessRate.cs +++ b/osu.Game/Overlays/BeatmapSet/SuccessRate.cs @@ -29,7 +29,10 @@ namespace osu.Game.Overlays.BeatmapSet if (value == beatmap) return; beatmap = value; - var rate = (float)beatmap.OnlineInfo.PassCount / beatmap.OnlineInfo.PlayCount; + int passCount = beatmap.OnlineInfo.PassCount; + int playCount = beatmap.OnlineInfo.PlayCount; + + var rate = (playCount != 0) ? (float)passCount / playCount : 0; successPercent.Text = rate.ToString("P0"); successRate.Length = rate; percentContainer.ResizeWidthTo(successRate.Length, 250, Easing.InOutCubic); From b8b5c67cd2502bbe25a3b90f8f5b501d4274aa5c Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 6 Nov 2017 21:46:28 +0300 Subject: [PATCH 078/166] Apply suggestion concerning the BeatmapSetType enum --- .../API/Requests/GetUserBeatmapsRequest.cs | 22 ++++++++++++++----- osu.Game/Overlays/BeatmapSet/SuccessRate.cs | 2 +- .../Profile/Sections/BeatmapsSection.cs | 2 +- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs b/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs index 8c243f899b..7ad3c32bed 100644 --- a/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs @@ -8,23 +8,35 @@ namespace osu.Game.Online.API.Requests public class GetUserBeatmapsRequest : APIRequest> { private readonly long userId; - private readonly BeatmapSetType type; private readonly int offset; + private readonly string type; public GetUserBeatmapsRequest(long userId, BeatmapSetType type, int offset = 0) { this.userId = userId; - this.type = type; this.offset = offset; + + switch (type) + { + case BeatmapSetType.Favourite: + this.type = type.ToString().ToLower(); + break; + case BeatmapSetType.MostPlayed: + this.type = "most_played"; + break; + case BeatmapSetType.RankedAndApproved: + this.type = "ranked_and_approved"; + break; + } } - protected override string Target => $@"users/{userId}/beatmapsets/{type.ToString().ToLower()}?offset={offset}"; + protected override string Target => $@"users/{userId}/beatmapsets/{type}?offset={offset}"; } public enum BeatmapSetType { - Most_Played, + MostPlayed, Favourite, - Ranked_And_Approved + RankedAndApproved } } diff --git a/osu.Game/Overlays/BeatmapSet/SuccessRate.cs b/osu.Game/Overlays/BeatmapSet/SuccessRate.cs index e22ec3c70c..6df31b9f85 100644 --- a/osu.Game/Overlays/BeatmapSet/SuccessRate.cs +++ b/osu.Game/Overlays/BeatmapSet/SuccessRate.cs @@ -32,7 +32,7 @@ namespace osu.Game.Overlays.BeatmapSet int passCount = beatmap.OnlineInfo.PassCount; int playCount = beatmap.OnlineInfo.PlayCount; - var rate = (playCount != 0) ? (float)passCount / playCount : 0; + var rate = playCount != 0 ? (float)passCount / playCount : 0; successPercent.Text = rate.ToString("P0"); successRate.Length = rate; percentContainer.ResizeWidthTo(successRate.Length, 250, Easing.InOutCubic); diff --git a/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs b/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs index 708487b8e2..f55de9b83f 100644 --- a/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs +++ b/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs @@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Profile.Sections Children = new[] { new PaginatedBeatmapContainer(BeatmapSetType.Favourite, User, "Favourite Beatmaps", "None... yet."), - new PaginatedBeatmapContainer(BeatmapSetType.Ranked_And_Approved, User, "Ranked & Approved Beatmaps", "None... yet."), + new PaginatedBeatmapContainer(BeatmapSetType.RankedAndApproved, User, "Ranked & Approved Beatmaps", "None... yet."), }; } } From 5d846bff7baf34c03dec78c1305775fa3e760563 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 6 Nov 2017 22:05:04 +0300 Subject: [PATCH 079/166] Add (temporarily?) subrequest for each item to provide correct beatmap information --- .../Beatmaps/PaginatedBeatmapContainer.cs | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs index f15798864f..9b623a3db9 100644 --- a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs @@ -47,18 +47,24 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps foreach (var s in sets) { - var panel = new DirectGridPanel(s.ToBeatmapSet(Rulesets)) { Width = 400 }; - ItemsContainer.Add(panel); - - panel.PreviewPlaying.ValueChanged += newValue => + var subReq = new GetBeatmapSetRequest(s.OnlineBeatmapSetID.Value); + subReq.Success += b => { - if (newValue) + var panel = new DirectGridPanel(b.ToBeatmapSet(Rulesets)) { Width = 400 }; + ItemsContainer.Add(panel); + + panel.PreviewPlaying.ValueChanged += newValue => { - if (playing != null && playing != panel) - playing.PreviewPlaying.Value = false; - playing = panel; - } + if (newValue) + { + if (playing != null && playing != panel) + playing.PreviewPlaying.Value = false; + playing = panel; + } + }; }; + + Api.Queue(subReq); } }; From a12052ac51b11cb623a3362fcbfb4e4db1e7f908 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 6 Nov 2017 22:18:37 +0300 Subject: [PATCH 080/166] CI fix --- .../Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs index 9b623a3db9..2ac7a29177 100644 --- a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs @@ -47,6 +47,9 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps foreach (var s in sets) { + if (!s.OnlineBeatmapSetID.HasValue) + continue; + var subReq = new GetBeatmapSetRequest(s.OnlineBeatmapSetID.Value); subReq.Success += b => { From d10dcd82bc572c3914b5989f0b3307e45351eee4 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 7 Nov 2017 02:39:48 +0300 Subject: [PATCH 081/166] Rank Line Graph improvements --- osu.Game/Overlays/Profile/RankChart.cs | 122 +++++++++++++++---------- 1 file changed, 75 insertions(+), 47 deletions(-) diff --git a/osu.Game/Overlays/Profile/RankChart.cs b/osu.Game/Overlays/Profile/RankChart.cs index 2e2286098a..b8690efa2a 100644 --- a/osu.Game/Overlays/Profile/RankChart.cs +++ b/osu.Game/Overlays/Profile/RankChart.cs @@ -24,6 +24,7 @@ namespace osu.Game.Overlays.Profile private readonly RankChartLineGraph graph; private readonly int[] ranks; + private readonly int rankedDays; private const float primary_textsize = 25, secondary_textsize = 13, padding = 10; @@ -33,6 +34,10 @@ namespace osu.Game.Overlays.Profile { this.user = user; + int[] userRanks = user.RankHistory?.Data ?? new[] { user.Statistics.Rank }; + ranks = userRanks.SkipWhile(x => x == 0).ToArray(); + rankedDays = ranks.Length; + Padding = new MarginPadding { Vertical = padding }; Children = new Drawable[] { @@ -64,13 +69,12 @@ namespace osu.Game.Overlays.Profile Origin = Anchor.BottomCentre, RelativeSizeAxes = Axes.X, Y = -secondary_textsize, - DefaultValueCount = 90, - BallRelease = updateRankTexts, - BallMove = showHistoryRankTexts + DefaultValueCount = rankedDays, } }; - ranks = user.RankHistory?.Data ?? new[] { user.Statistics.Rank }; + graph.OnBallMove += showHistoryRankTexts; + graph.OnReset += updateRankTexts; } private void updateRankTexts() @@ -82,8 +86,8 @@ namespace osu.Game.Overlays.Profile private void showHistoryRankTexts(int dayIndex) { - rankText.Text = ranks[dayIndex] > 0 ? $"#{ranks[dayIndex]:#,0}" : "no rank"; - relativeText.Text = dayIndex == ranks.Length ? "Now" : $"{ranks.Length - dayIndex} days ago"; + rankText.Text = $"#{ranks[dayIndex]:#,0}"; + relativeText.Text = dayIndex == rankedDays ? "Now" : $"{rankedDays - dayIndex} days ago"; //plural should be handled in a general way } @@ -96,7 +100,8 @@ namespace osu.Game.Overlays.Profile { // use logarithmic coordinates graph.Values = ranks.Select(x => -(float)Math.Log(x)); - graph.ResetBall(); + graph.SetStaticBallPosition(); + updateRankTexts(); } } @@ -110,67 +115,90 @@ namespace osu.Game.Overlays.Profile return base.Invalidate(invalidation, source, shallPropagate); } + protected override bool OnHover(InputState state) + { + graph.ShowBall(ToLocalSpace(state.Mouse.NativeState.Position).X); + return base.OnHover(state); + } + + protected override bool OnMouseMove(InputState state) + { + graph.MoveBall(ToLocalSpace(state.Mouse.NativeState.Position).X); + return base.OnMouseMove(state); + } + + protected override void OnHoverLost(InputState state) + { + graph.HideBall(); + updateRankTexts(); + base.OnHoverLost(state); + } + private class RankChartLineGraph : LineGraph { - private readonly CircularContainer ball; - private bool ballShown; + private const double fade_duration = 300; + private const double move_duration = 100; - private const double transform_duration = 100; + private readonly CircularContainer staticBall; + private readonly CircularContainer movingBall; - public Action BallMove; - public Action BallRelease; + public Action OnBallMove; + public Action OnReset; public RankChartLineGraph() { - Add(ball = new CircularContainer + Add(staticBall = new CircularContainer { + Origin = Anchor.Centre, Size = new Vector2(8), Masking = true, - Origin = Anchor.Centre, - Alpha = 0, RelativePositionAxes = Axes.Both, - Children = new Drawable[] - { - new Box { RelativeSizeAxes = Axes.Both } - } + Child = new Box { RelativeSizeAxes = Axes.Both } + }); + Add(movingBall = new CircularContainer + { + Origin = Anchor.Centre, + Size = new Vector2(8), + Alpha = 0, + Masking = true, + RelativePositionAxes = Axes.Both, + Child = new Box { RelativeSizeAxes = Axes.Both } }); } - public void ResetBall() + public void SetStaticBallPosition() { - ball.MoveTo(new Vector2(1, GetYPosition(Values.Last())), ballShown ? transform_duration : 0, Easing.OutQuint); - ball.Show(); - BallRelease(); - ballShown = true; + staticBall.Position = new Vector2(1, GetYPosition(Values.Last())); + OnReset.Invoke(); } - protected override bool OnMouseMove(InputState state) + public void ShowBall(float mouseXPosition) { - if (ballShown) - { - var values = (IList)Values; - var position = ToLocalSpace(state.Mouse.NativeState.Position); - int count = Math.Max(values.Count, DefaultValueCount); - int index = (int)Math.Round(position.X / DrawWidth * (count - 1)); - if (index >= count - values.Count) - { - int i = index + values.Count - count; - float y = GetYPosition(values[i]); - if (Math.Abs(y * DrawHeight - position.Y) <= 8f) - { - ball.MoveTo(new Vector2(index / (float)(count - 1), y), transform_duration, Easing.OutQuint); - BallMove(i); - } - } - } - return base.OnMouseMove(state); + int index = calculateIndex(mouseXPosition); + movingBall.Position = calculateBallPosition(mouseXPosition, index); + movingBall.FadeIn(fade_duration); + OnBallMove.Invoke(index); } - protected override void OnHoverLost(InputState state) + public void MoveBall(float mouseXPosition) { - if (ballShown) - ResetBall(); - base.OnHoverLost(state); + int index = calculateIndex(mouseXPosition); + movingBall.MoveTo(calculateBallPosition(mouseXPosition, index), move_duration, Easing.OutQuint); + OnBallMove.Invoke(index); + } + + public void HideBall() + { + movingBall.FadeOut(fade_duration); + OnReset.Invoke(); + } + + private int calculateIndex(float mouseXPosition) => (int)Math.Round(mouseXPosition / DrawWidth * (DefaultValueCount - 1)); + + private Vector2 calculateBallPosition(float mouseXPosition, int index) + { + float y = GetYPosition(Values.ElementAt(index)); + return new Vector2(index / (float)(DefaultValueCount - 1), y); } } } From 28167388d69e9a5fd0f70b6aa52fec69ba0623ca Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 7 Nov 2017 02:53:07 +0300 Subject: [PATCH 082/166] Remove useless calls --- osu.Game/Overlays/Profile/RankChart.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Overlays/Profile/RankChart.cs b/osu.Game/Overlays/Profile/RankChart.cs index b8690efa2a..1caa171c88 100644 --- a/osu.Game/Overlays/Profile/RankChart.cs +++ b/osu.Game/Overlays/Profile/RankChart.cs @@ -101,7 +101,6 @@ namespace osu.Game.Overlays.Profile // use logarithmic coordinates graph.Values = ranks.Select(x => -(float)Math.Log(x)); graph.SetStaticBallPosition(); - updateRankTexts(); } } @@ -130,7 +129,6 @@ namespace osu.Game.Overlays.Profile protected override void OnHoverLost(InputState state) { graph.HideBall(); - updateRankTexts(); base.OnHoverLost(state); } From 461baf3b9729af2607e3ed781c047a45b0b0c662 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 7 Nov 2017 03:05:12 +0300 Subject: [PATCH 083/166] CI fixes --- osu.Game/Overlays/Profile/RankChart.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/Profile/RankChart.cs b/osu.Game/Overlays/Profile/RankChart.cs index 1caa171c88..67f1e4b951 100644 --- a/osu.Game/Overlays/Profile/RankChart.cs +++ b/osu.Game/Overlays/Profile/RankChart.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using System.Collections.Generic; using System.Linq; using OpenTK; using osu.Framework.Allocation; @@ -173,7 +172,7 @@ namespace osu.Game.Overlays.Profile public void ShowBall(float mouseXPosition) { int index = calculateIndex(mouseXPosition); - movingBall.Position = calculateBallPosition(mouseXPosition, index); + movingBall.Position = calculateBallPosition(index); movingBall.FadeIn(fade_duration); OnBallMove.Invoke(index); } @@ -181,7 +180,7 @@ namespace osu.Game.Overlays.Profile public void MoveBall(float mouseXPosition) { int index = calculateIndex(mouseXPosition); - movingBall.MoveTo(calculateBallPosition(mouseXPosition, index), move_duration, Easing.OutQuint); + movingBall.MoveTo(calculateBallPosition(index), move_duration, Easing.OutQuint); OnBallMove.Invoke(index); } @@ -193,7 +192,7 @@ namespace osu.Game.Overlays.Profile private int calculateIndex(float mouseXPosition) => (int)Math.Round(mouseXPosition / DrawWidth * (DefaultValueCount - 1)); - private Vector2 calculateBallPosition(float mouseXPosition, int index) + private Vector2 calculateBallPosition(int index) { float y = GetYPosition(Values.ElementAt(index)); return new Vector2(index / (float)(DefaultValueCount - 1), y); From 1063e18566ae1635dfbcdf468c5c5b1f85e9a152 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 7 Nov 2017 03:16:27 +0300 Subject: [PATCH 084/166] Don't show graph at all if there's no data to use --- osu.Game/Overlays/Profile/RankChart.cs | 46 ++++++++++++++------------ 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/osu.Game/Overlays/Profile/RankChart.cs b/osu.Game/Overlays/Profile/RankChart.cs index 67f1e4b951..88cbd1ec74 100644 --- a/osu.Game/Overlays/Profile/RankChart.cs +++ b/osu.Game/Overlays/Profile/RankChart.cs @@ -62,25 +62,28 @@ namespace osu.Game.Overlays.Profile Font = @"Exo2.0-RegularItalic", TextSize = secondary_textsize }, - graph = new RankChartLineGraph + }; + + if (rankedDays > 0) + { + Add(graph = new RankChartLineGraph { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, RelativeSizeAxes = Axes.X, Y = -secondary_textsize, DefaultValueCount = rankedDays, - } - }; + }); - graph.OnBallMove += showHistoryRankTexts; - graph.OnReset += updateRankTexts; + graph.OnBallMove += showHistoryRankTexts; + } } private void updateRankTexts() { - rankText.Text = user.Statistics.Rank > 0 ? $"#{user.Statistics.Rank:#,0}" : "no rank"; - performanceText.Text = user.Statistics.PP != null ? $"{user.Statistics.PP:#,0}pp" : string.Empty; - relativeText.Text = $"{user.Country?.FullName} #{user.CountryRank:#,0}"; + rankText.Text = rankedDays > 0 ? $"#{user.Statistics.Rank:#,0}" : "no rank"; + performanceText.Text = rankedDays > 0 ? $"{user.Statistics.PP:#,0}pp" : string.Empty; + relativeText.Text = rankedDays > 0 ? $"{user.Country?.FullName} #{user.CountryRank:#,0}" : string.Empty; } private void showHistoryRankTexts(int dayIndex) @@ -93,14 +96,15 @@ namespace osu.Game.Overlays.Profile [BackgroundDependencyLoader] private void load(OsuColour colours) { - graph.Colour = colours.Yellow; - - if (user.Statistics.Rank > 0) + if (graph != null) { + graph.Colour = colours.Yellow; // use logarithmic coordinates graph.Values = ranks.Select(x => -(float)Math.Log(x)); graph.SetStaticBallPosition(); } + + updateRankTexts(); } public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true) @@ -115,19 +119,25 @@ namespace osu.Game.Overlays.Profile protected override bool OnHover(InputState state) { - graph.ShowBall(ToLocalSpace(state.Mouse.NativeState.Position).X); + if (graph != null) + graph.ShowBall(ToLocalSpace(state.Mouse.NativeState.Position).X); return base.OnHover(state); } protected override bool OnMouseMove(InputState state) { - graph.MoveBall(ToLocalSpace(state.Mouse.NativeState.Position).X); + if (graph != null) + graph.MoveBall(ToLocalSpace(state.Mouse.NativeState.Position).X); return base.OnMouseMove(state); } protected override void OnHoverLost(InputState state) { - graph.HideBall(); + if (graph != null) + { + graph.HideBall(); + updateRankTexts(); + } base.OnHoverLost(state); } @@ -140,7 +150,6 @@ namespace osu.Game.Overlays.Profile private readonly CircularContainer movingBall; public Action OnBallMove; - public Action OnReset; public RankChartLineGraph() { @@ -163,11 +172,7 @@ namespace osu.Game.Overlays.Profile }); } - public void SetStaticBallPosition() - { - staticBall.Position = new Vector2(1, GetYPosition(Values.Last())); - OnReset.Invoke(); - } + public void SetStaticBallPosition() => staticBall.Position = new Vector2(1, GetYPosition(Values.Last())); public void ShowBall(float mouseXPosition) { @@ -187,7 +192,6 @@ namespace osu.Game.Overlays.Profile public void HideBall() { movingBall.FadeOut(fade_duration); - OnReset.Invoke(); } private int calculateIndex(float mouseXPosition) => (int)Math.Round(mouseXPosition / DrawWidth * (DefaultValueCount - 1)); From 60e6177b7f2e26de652029551d673ded7d0bbfd7 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 7 Nov 2017 03:26:47 +0300 Subject: [PATCH 085/166] Use null propagation --- osu.Game/Overlays/Profile/RankChart.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/Profile/RankChart.cs b/osu.Game/Overlays/Profile/RankChart.cs index 88cbd1ec74..873fcaa78a 100644 --- a/osu.Game/Overlays/Profile/RankChart.cs +++ b/osu.Game/Overlays/Profile/RankChart.cs @@ -119,15 +119,13 @@ namespace osu.Game.Overlays.Profile protected override bool OnHover(InputState state) { - if (graph != null) - graph.ShowBall(ToLocalSpace(state.Mouse.NativeState.Position).X); + graph?.ShowBall(ToLocalSpace(state.Mouse.NativeState.Position).X); return base.OnHover(state); } protected override bool OnMouseMove(InputState state) { - if (graph != null) - graph.MoveBall(ToLocalSpace(state.Mouse.NativeState.Position).X); + graph?.MoveBall(ToLocalSpace(state.Mouse.NativeState.Position).X); return base.OnMouseMove(state); } From 1b0e7e71452d77e569de0e79d78b890be046ebc6 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 7 Nov 2017 03:44:21 +0300 Subject: [PATCH 086/166] Undo some useless changes --- osu.Game/Overlays/Profile/RankChart.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Profile/RankChart.cs b/osu.Game/Overlays/Profile/RankChart.cs index 873fcaa78a..0171988967 100644 --- a/osu.Game/Overlays/Profile/RankChart.cs +++ b/osu.Game/Overlays/Profile/RankChart.cs @@ -81,9 +81,9 @@ namespace osu.Game.Overlays.Profile private void updateRankTexts() { - rankText.Text = rankedDays > 0 ? $"#{user.Statistics.Rank:#,0}" : "no rank"; - performanceText.Text = rankedDays > 0 ? $"{user.Statistics.PP:#,0}pp" : string.Empty; - relativeText.Text = rankedDays > 0 ? $"{user.Country?.FullName} #{user.CountryRank:#,0}" : string.Empty; + rankText.Text = user.Statistics.Rank > 0 ? $"#{user.Statistics.Rank:#,0}" : "no rank"; + performanceText.Text = user.Statistics.PP != null ? $"{user.Statistics.PP:#,0}pp" : string.Empty; + relativeText.Text = $"{user.Country?.FullName} #{user.CountryRank:#,0}"; } private void showHistoryRankTexts(int dayIndex) From 5946585a6f6013ed8ee9af3fc0bc03930d09a13f Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 7 Nov 2017 12:19:23 +0300 Subject: [PATCH 087/166] Apply suggested changes --- osu.Game/Overlays/Profile/RankChart.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/osu.Game/Overlays/Profile/RankChart.cs b/osu.Game/Overlays/Profile/RankChart.cs index 0171988967..dc2c9e92ca 100644 --- a/osu.Game/Overlays/Profile/RankChart.cs +++ b/osu.Game/Overlays/Profile/RankChart.cs @@ -23,7 +23,6 @@ namespace osu.Game.Overlays.Profile private readonly RankChartLineGraph graph; private readonly int[] ranks; - private readonly int rankedDays; private const float primary_textsize = 25, secondary_textsize = 13, padding = 10; @@ -35,7 +34,6 @@ namespace osu.Game.Overlays.Profile int[] userRanks = user.RankHistory?.Data ?? new[] { user.Statistics.Rank }; ranks = userRanks.SkipWhile(x => x == 0).ToArray(); - rankedDays = ranks.Length; Padding = new MarginPadding { Vertical = padding }; Children = new Drawable[] @@ -64,7 +62,7 @@ namespace osu.Game.Overlays.Profile }, }; - if (rankedDays > 0) + if (ranks.Length > 0) { Add(graph = new RankChartLineGraph { @@ -72,7 +70,7 @@ namespace osu.Game.Overlays.Profile Origin = Anchor.BottomCentre, RelativeSizeAxes = Axes.X, Y = -secondary_textsize, - DefaultValueCount = rankedDays, + DefaultValueCount = ranks.Length, }); graph.OnBallMove += showHistoryRankTexts; @@ -89,7 +87,7 @@ namespace osu.Game.Overlays.Profile private void showHistoryRankTexts(int dayIndex) { rankText.Text = $"#{ranks[dayIndex]:#,0}"; - relativeText.Text = dayIndex == rankedDays ? "Now" : $"{rankedDays - dayIndex} days ago"; + relativeText.Text = dayIndex == ranks.Length ? "Now" : $"{ranks.Length - dayIndex} days ago"; //plural should be handled in a general way } @@ -119,13 +117,13 @@ namespace osu.Game.Overlays.Profile protected override bool OnHover(InputState state) { - graph?.ShowBall(ToLocalSpace(state.Mouse.NativeState.Position).X); + graph?.ShowBall(state.Mouse.Position.X); return base.OnHover(state); } protected override bool OnMouseMove(InputState state) { - graph?.MoveBall(ToLocalSpace(state.Mouse.NativeState.Position).X); + graph?.MoveBall(state.Mouse.Position.X); return base.OnMouseMove(state); } From a46dbee5325e0c98f5e2aa8d43dc9964c562db6d Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 7 Nov 2017 12:38:10 +0300 Subject: [PATCH 088/166] Add Humanizer package --- .../API/Requests/GetUserBeatmapsRequest.cs | 19 ++------- osu.Game/osu.Game.csproj | 3 ++ osu.Game/packages.config | 42 +++++++++++++++++++ 3 files changed, 49 insertions(+), 15 deletions(-) diff --git a/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs b/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs index 7ad3c32bed..66b2cae892 100644 --- a/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.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 Humanizer; using System.Collections.Generic; namespace osu.Game.Online.API.Requests @@ -9,28 +10,16 @@ namespace osu.Game.Online.API.Requests { private readonly long userId; private readonly int offset; - private readonly string type; + private readonly BeatmapSetType type; public GetUserBeatmapsRequest(long userId, BeatmapSetType type, int offset = 0) { this.userId = userId; this.offset = offset; - - switch (type) - { - case BeatmapSetType.Favourite: - this.type = type.ToString().ToLower(); - break; - case BeatmapSetType.MostPlayed: - this.type = "most_played"; - break; - case BeatmapSetType.RankedAndApproved: - this.type = "ranked_and_approved"; - break; - } + this.type = type; } - protected override string Target => $@"users/{userId}/beatmapsets/{type}?offset={offset}"; + protected override string Target => $@"users/{userId}/beatmapsets/{type.ToString().Underscore()}?offset={offset}"; } public enum BeatmapSetType diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 2388ec4cc2..ef2e573443 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -88,6 +88,9 @@ $(SolutionDir)\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll True + + ..\packages\Humanizer.Core.2.2.0\lib\netstandard1.0\Humanizer.dll + $(SolutionDir)\packages\Microsoft.Data.Sqlite.Core.2.0.0\lib\netstandard2.0\Microsoft.Data.Sqlite.dll diff --git a/osu.Game/packages.config b/osu.Game/packages.config index ae7b74ef16..02ace918de 100644 --- a/osu.Game/packages.config +++ b/osu.Game/packages.config @@ -5,6 +5,48 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 8e806cd11c2a8820ecd7fa896a77ea2a8133859a Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 7 Nov 2017 13:43:02 +0300 Subject: [PATCH 089/166] Simplify moving ball behaviour --- osu.Game/Overlays/Profile/RankChart.cs | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/osu.Game/Overlays/Profile/RankChart.cs b/osu.Game/Overlays/Profile/RankChart.cs index dc2c9e92ca..393575ff60 100644 --- a/osu.Game/Overlays/Profile/RankChart.cs +++ b/osu.Game/Overlays/Profile/RankChart.cs @@ -117,13 +117,14 @@ namespace osu.Game.Overlays.Profile protected override bool OnHover(InputState state) { - graph?.ShowBall(state.Mouse.Position.X); + graph?.UpdateBallPosition(state.Mouse.Position.X); + graph?.ShowBall(); return base.OnHover(state); } protected override bool OnMouseMove(InputState state) { - graph?.MoveBall(state.Mouse.Position.X); + graph?.UpdateBallPosition(state.Mouse.Position.X); return base.OnMouseMove(state); } @@ -139,8 +140,7 @@ namespace osu.Game.Overlays.Profile private class RankChartLineGraph : LineGraph { - private const double fade_duration = 300; - private const double move_duration = 100; + private const double fade_duration = 200; private readonly CircularContainer staticBall; private readonly CircularContainer movingBall; @@ -170,25 +170,16 @@ namespace osu.Game.Overlays.Profile public void SetStaticBallPosition() => staticBall.Position = new Vector2(1, GetYPosition(Values.Last())); - public void ShowBall(float mouseXPosition) + public void UpdateBallPosition(float mouseXPosition) { int index = calculateIndex(mouseXPosition); movingBall.Position = calculateBallPosition(index); - movingBall.FadeIn(fade_duration); OnBallMove.Invoke(index); } - public void MoveBall(float mouseXPosition) - { - int index = calculateIndex(mouseXPosition); - movingBall.MoveTo(calculateBallPosition(index), move_duration, Easing.OutQuint); - OnBallMove.Invoke(index); - } + public void ShowBall() => movingBall.FadeIn(fade_duration); - public void HideBall() - { - movingBall.FadeOut(fade_duration); - } + public void HideBall() => movingBall.FadeOut(fade_duration); private int calculateIndex(float mouseXPosition) => (int)Math.Round(mouseXPosition / DrawWidth * (DefaultValueCount - 1)); From 13cc1fcc92e8af93e33b987f6266e61a3c6a7dd5 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Tue, 7 Nov 2017 14:30:44 +0300 Subject: [PATCH 090/166] Fix wrong index offset --- osu.Game/Overlays/Profile/RankChart.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Overlays/Profile/RankChart.cs b/osu.Game/Overlays/Profile/RankChart.cs index 393575ff60..5bd6d30b42 100644 --- a/osu.Game/Overlays/Profile/RankChart.cs +++ b/osu.Game/Overlays/Profile/RankChart.cs @@ -87,6 +87,7 @@ namespace osu.Game.Overlays.Profile private void showHistoryRankTexts(int dayIndex) { rankText.Text = $"#{ranks[dayIndex]:#,0}"; + dayIndex++; relativeText.Text = dayIndex == ranks.Length ? "Now" : $"{ranks.Length - dayIndex} days ago"; //plural should be handled in a general way } From e417eceb98de1f432b3780e770ff254bfe1ec152 Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 22:49:32 +0100 Subject: [PATCH 091/166] Texture in Avatar.cs can not be null. --- osu.Game/Users/Avatar.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Users/Avatar.cs b/osu.Game/Users/Avatar.cs index 111c901ca0..7ced0305fd 100644 --- a/osu.Game/Users/Avatar.cs +++ b/osu.Game/Users/Avatar.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -25,6 +26,9 @@ namespace osu.Game.Users [BackgroundDependencyLoader] private void load(TextureStore textures) { + if (textures == null) + throw new ArgumentNullException(nameof(textures)); + Texture texture = null; if (user != null && user.Id > 1) texture = textures.Get($@"https://a.ppy.sh/{user.Id}"); if (texture == null) texture = textures.Get(@"Online/avatar-guest"); From d5b275fa5368607db4b735587b8d53e9e7585094 Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 22:50:00 +0100 Subject: [PATCH 092/166] The TextureStore in Country.cs can noit be null. --- osu.Game/Users/Country.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Users/Country.cs b/osu.Game/Users/Country.cs index bf06d9f8bc..0c0d12c1cc 100644 --- a/osu.Game/Users/Country.cs +++ b/osu.Game/Users/Country.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 Newtonsoft.Json; using osu.Framework.Allocation; using osu.Framework.Graphics; @@ -45,6 +46,9 @@ namespace osu.Game.Users [BackgroundDependencyLoader] private void load(TextureStore ts) { + if (ts == null) + throw new ArgumentNullException(nameof(ts)); + textures = ts; sprite.Texture = textures.Get($@"Flags/{flagName}"); } From 2518b5e9a0a52674a529604776258e5beb7a8653 Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 22:50:45 +0100 Subject: [PATCH 093/166] Textures in UserCoverBackground.cs can not be null --- osu.Game/Users/UserCoverBackground.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Users/UserCoverBackground.cs b/osu.Game/Users/UserCoverBackground.cs index c0f0d09d9d..68c97fc8fd 100644 --- a/osu.Game/Users/UserCoverBackground.cs +++ b/osu.Game/Users/UserCoverBackground.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Framework.Allocation; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; @@ -19,6 +20,9 @@ namespace osu.Game.Users [BackgroundDependencyLoader] private void load(TextureStore textures) { + if (textures == null) + throw new ArgumentNullException(nameof(textures)); + if (!string.IsNullOrEmpty(user.CoverUrl)) Texture = textures.Get(user.CoverUrl); } From e430256b092c1cc3bfdfbaae75d3a6ec788d24d2 Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 22:51:06 +0100 Subject: [PATCH 094/166] User and colors can not be null in UserPanel.cs --- osu.Game/Users/UserPanel.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index e5518b5845..706ad86bfc 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -38,6 +38,9 @@ namespace osu.Game.Users public UserPanel(User user) { + if (user == null) + throw new ArgumentNullException(nameof(user)); + this.user = user; Height = height - status_height; @@ -173,6 +176,9 @@ namespace osu.Game.Users [BackgroundDependencyLoader(permitNulls: true)] private void load(OsuColour colours, UserProfileOverlay profile) { + if (colours == null) + throw new ArgumentNullException(nameof(colours)); + Status.ValueChanged += displayStatus; Status.ValueChanged += status => statusBg.FadeColour(status?.GetAppropriateColour(colours) ?? colours.Gray5, 500, Easing.OutQuint); From 840946d160483f351808c5f8a1712d04f889c040 Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:08:24 +0100 Subject: [PATCH 095/166] list can not be null in ControlPointInfo.cs --- osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs b/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs index e7035880dd..e46eb8e20a 100644 --- a/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs +++ b/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.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 System.Collections.Generic; using System.Linq; using osu.Framework.Lists; @@ -85,6 +86,9 @@ namespace osu.Game.Beatmaps.ControlPoints private T binarySearch(SortedList list, double time, T prePoint = null) where T : ControlPoint, new() { + if (list == null) + throw new ArgumentNullException(nameof(list)); + if (list.Count == 0) return new T(); From 1f620886cbe283bb9816bf7fd3ad95de53c76a0d Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:09:16 +0100 Subject: [PATCH 096/166] beatmap and line can not be null in OsuLegacyDecoder.cs --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index d775ab409b..3cf3b3a168 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -70,6 +70,11 @@ namespace osu.Game.Beatmaps.Formats private void handleGeneral(Beatmap beatmap, string line) { + if (beatmap == null) + throw new ArgumentNullException(nameof(beatmap)); + if (line == null) + throw new ArgumentNullException(nameof(line)); + var pair = splitKeyVal(line, ':'); var metadata = beatmap.BeatmapInfo.Metadata; From 080c3fabba909854939d156427523e92d455c7af Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:10:06 +0100 Subject: [PATCH 097/166] BeatmapSet and manager can not be null in BeatmapGroup.cs --- osu.Game/Beatmaps/Drawables/BeatmapGroup.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs b/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs index 6e5af29799..163dd7fbe9 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs @@ -72,6 +72,11 @@ namespace osu.Game.Beatmaps.Drawables public BeatmapGroup(BeatmapSetInfo beatmapSet, BeatmapManager manager) { + if (beatmapSet == null) + throw new ArgumentNullException(nameof(beatmapSet)); + if (manager == null) + throw new ArgumentNullException(nameof(manager)); + BeatmapSet = beatmapSet; WorkingBeatmap beatmap = manager.GetWorkingBeatmap(BeatmapSet.Beatmaps.FirstOrDefault()); From 2f47b336e2780945fb493d118ef1439d11cc4039 Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:10:30 +0100 Subject: [PATCH 098/166] beatmap and line can not be null in OsuLegacyDecoder.cs --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 3cf3b3a168..e73e056cb4 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -134,6 +134,11 @@ namespace osu.Game.Beatmaps.Formats private void handleEditor(Beatmap beatmap, string line) { + if (beatmap == null) + throw new ArgumentNullException(nameof(beatmap)); + if (line == null) + throw new ArgumentNullException(nameof(line)); + var pair = splitKeyVal(line, ':'); switch (pair.Key) From cf296d4bb22ca57d81519c52326e20527fbf6b95 Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:10:41 +0100 Subject: [PATCH 099/166] beatmap and line can not be null in OsuLegacyDecoder.cs --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index e73e056cb4..f231342234 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -163,6 +163,11 @@ namespace osu.Game.Beatmaps.Formats private void handleMetadata(Beatmap beatmap, string line) { + if (beatmap == null) + throw new ArgumentNullException(nameof(beatmap)); + if (line == null) + throw new ArgumentNullException(nameof(line)); + var pair = splitKeyVal(line, ':'); var metadata = beatmap.BeatmapInfo.Metadata; From 0287d3d7a05a98a26a9faee9f310fc364c19be46 Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:10:54 +0100 Subject: [PATCH 100/166] beatmap and line can not be null in OsuLegacyDecoder.cs --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index f231342234..d240b7669c 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -209,6 +209,11 @@ namespace osu.Game.Beatmaps.Formats private void handleDifficulty(Beatmap beatmap, string line) { + if (beatmap == null) + throw new ArgumentNullException(nameof(beatmap)); + if (line == null) + throw new ArgumentNullException(nameof(line)); + var pair = splitKeyVal(line, ':'); var difficulty = beatmap.BeatmapInfo.BaseDifficulty; From 34083baa4dc596ea1816af9d254eb816e8fe0a14 Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:11:04 +0100 Subject: [PATCH 101/166] beatmap and line can not be null in OsuLegacyDecoder.cs --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index d240b7669c..0d9d875f86 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -264,6 +264,11 @@ namespace osu.Game.Beatmaps.Formats private void handleEvents(Beatmap beatmap, string line, ref StoryboardSprite storyboardSprite, ref CommandTimelineGroup timelineGroup) { + if (line == null) + throw new ArgumentNullException(nameof(line)); + if (beatmap == null) + throw new ArgumentNullException(nameof(beatmap)); + var depth = 0; while (line.StartsWith(" ") || line.StartsWith("_")) { From d27dced3af926ab0aed4591ba7fb8ac5bf7cb94c Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:11:16 +0100 Subject: [PATCH 102/166] beatmap and line can not be null in OsuLegacyDecoder.cs --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 0d9d875f86..5277044550 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -494,6 +494,11 @@ namespace osu.Game.Beatmaps.Formats private void handleTimingPoints(Beatmap beatmap, string line) { + if (beatmap == null) + throw new ArgumentNullException(nameof(beatmap)); + if (line == null) + throw new ArgumentNullException(nameof(line)); + string[] split = line.Split(','); double time = double.Parse(split[0].Trim(), NumberFormatInfo.InvariantInfo); From 8dc24a52a7fdbe4fcb461a32fe897b1abd72156d Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:11:33 +0100 Subject: [PATCH 103/166] beatmap and line can not be null in OsuLegacyDecoder.cs --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 5277044550..1c7a08d17a 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -585,6 +585,11 @@ namespace osu.Game.Beatmaps.Formats private void handleColours(Beatmap beatmap, string line, ref bool hasCustomColours) { + if (beatmap == null) + throw new ArgumentNullException(nameof(beatmap)); + if (line == null) + throw new ArgumentNullException(nameof(line)); + var pair = splitKeyVal(line, ':'); string[] split = pair.Value.Split(','); From a8acea9cdbfeae752ae8cbd7011c6d89b4056e6d Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:12:30 +0100 Subject: [PATCH 104/166] stream can not be null in BeatmapDecoder.cs --- osu.Game/Beatmaps/Formats/BeatmapDecoder.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs index 962c6ad49a..7e1a87085c 100644 --- a/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs @@ -18,6 +18,9 @@ namespace osu.Game.Beatmaps.Formats public static BeatmapDecoder GetDecoder(StreamReader stream) { + if (stream == null) + throw new ArgumentNullException(nameof(stream)); + string line; do { line = stream.ReadLine()?.Trim(); } while (line != null && line.Length == 0); From 289a1346fc00c850f5045a298d2602133a328752 Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:13:09 +0100 Subject: [PATCH 105/166] beatmap can not be null in DifficultyIcon.cs --- osu.Game/Beatmaps/Drawables/DifficultyIcon.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs b/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs index 1aff764ede..8259da9492 100644 --- a/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs +++ b/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Graphics; @@ -15,6 +16,9 @@ namespace osu.Game.Beatmaps.Drawables public DifficultyIcon(BeatmapInfo beatmap) : base(beatmap) { + if (beatmap == null) + throw new ArgumentNullException(nameof(beatmap)); + this.beatmap = beatmap; Size = new Vector2(20); } From dd3874daa8a6ca865eda007ff49e3c9093bee993 Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:13:32 +0100 Subject: [PATCH 106/166] beatmap can not be null in BeatmapPanel.cs --- osu.Game/Beatmaps/Drawables/BeatmapPanel.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs b/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs index c0705d8f61..e6bf08eb9f 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs @@ -73,6 +73,9 @@ namespace osu.Game.Beatmaps.Drawables public BeatmapPanel(BeatmapInfo beatmap) { + if (beatmap == null) + throw new ArgumentNullException(nameof(beatmap)); + Beatmap = beatmap; Height *= 0.60f; From d7dee57886e98696247ceddf2a030bed46fe4e03 Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:13:56 +0100 Subject: [PATCH 107/166] set can not be null in BeatmapSetCover.cs --- osu.Game/Beatmaps/Drawables/BeatmapSetCover.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetCover.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetCover.cs index df7e0905d0..614ebc236b 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetCover.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetCover.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Framework.Allocation; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; @@ -12,6 +13,9 @@ namespace osu.Game.Beatmaps.Drawables private readonly BeatmapSetInfo set; public BeatmapSetCover(BeatmapSetInfo set) { + if (set == null) + throw new ArgumentNullException(nameof(set)); + this.set = set; } From bc941790329421cec6aee6afc6c69362c0af8030 Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:14:22 +0100 Subject: [PATCH 108/166] workingbeatmap can not be null in BeatmapBackgroundSprite.cs --- osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs b/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs index 9b897b4912..0ac8d12591 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Framework.Allocation; using osu.Framework.Graphics.Sprites; @@ -12,6 +13,9 @@ namespace osu.Game.Beatmaps.Drawables public BeatmapBackgroundSprite(WorkingBeatmap working) { + if (working == null) + throw new ArgumentNullException(nameof(working)); + this.working = working; } From dc317139c90576f1c2d30b9ff885d1818c604610 Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:15:02 +0100 Subject: [PATCH 109/166] beatmap can not be null in BeatmapSetHeader.cs --- osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs index ee75b77747..f1dc933a3f 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -36,6 +36,9 @@ namespace osu.Game.Beatmaps.Drawables public BeatmapSetHeader(WorkingBeatmap beatmap) { + if (beatmap == null) + throw new ArgumentNullException(nameof(beatmap)); + this.beatmap = beatmap; Children = new Drawable[] From 0f539d24f0926d2bdbcff6631ff5d46153c26876 Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:15:21 +0100 Subject: [PATCH 110/166] Localisation can not be null in BeatmapSetHeader.cs --- osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs index f1dc933a3f..6593ea6de2 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -91,6 +91,9 @@ namespace osu.Game.Beatmaps.Drawables [BackgroundDependencyLoader] private void load(LocalisationEngine localisation) { + if (localisation == null) + throw new ArgumentNullException(nameof(localisation)); + title.Current = localisation.GetUnicodePreference(beatmap.Metadata.TitleUnicode, beatmap.Metadata.Title); artist.Current = localisation.GetUnicodePreference(beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist); } From 36ce287b886cde96d9a636c8581d62c4f172bf82 Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:15:51 +0100 Subject: [PATCH 111/166] panels can not be null in BeatmapSetHeader.cs --- osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs index 6593ea6de2..8a589ccd30 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -160,6 +160,9 @@ namespace osu.Game.Beatmaps.Drawables public void AddDifficultyIcons(IEnumerable panels) { + if (panels == null) + throw new ArgumentNullException(nameof(panels)); + foreach (var p in panels) difficultyIcons.Add(new DifficultyIcon(p.Beatmap)); } From a15ab785f28078eb30b821922146c91b27207ee3 Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:16:19 +0100 Subject: [PATCH 112/166] palette can not be null in DifficultyColouredContainer.cs --- osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs b/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs index 41b77f6584..f2bb9c62d7 100644 --- a/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs +++ b/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Framework.Allocation; using osu.Framework.Graphics.Containers; using osu.Game.Graphics; @@ -23,6 +24,9 @@ namespace osu.Game.Beatmaps.Drawables [BackgroundDependencyLoader] private void load(OsuColour palette) { + if (palette == null) + throw new ArgumentNullException(nameof(palette)); + this.palette = palette; AccentColour = getColour(beatmap); } From 1e6f1d07d237cd7bcf484b508b96cd91940724dc Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:16:42 +0100 Subject: [PATCH 113/166] line can not be null in OsuLegacyDecoder.cs --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 1c7a08d17a..2fb14c65f7 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -246,6 +246,9 @@ namespace osu.Game.Beatmaps.Formats /// The line which may contains variables. private void decodeVariables(ref string line) { + if (line == null) + throw new ArgumentNullException(nameof(line)); + while (line.IndexOf('$') >= 0) { string origLine = line; @@ -622,6 +625,9 @@ namespace osu.Game.Beatmaps.Formats private void handleVariables(string line) { + if (line == null) + throw new ArgumentNullException(nameof(line)); + var pair = splitKeyVal(line, '='); variables[pair.Key] = pair.Value; } From 13e75780d71383e7738bdc918efa35b8a60258a1 Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:17:07 +0100 Subject: [PATCH 114/166] beatmap and stream can not be null in OsuLegacyDecoder.cs --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 2fb14c65f7..34ae2ede54 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -644,6 +644,11 @@ namespace osu.Game.Beatmaps.Formats protected override void ParseFile(StreamReader stream, Beatmap beatmap) { + if (beatmap == null) + throw new ArgumentNullException(nameof(beatmap)); + if (stream == null) + throw new ArgumentNullException(nameof(stream)); + beatmap.BeatmapInfo.BeatmapVersion = beatmapVersion; Section section = Section.None; From b2e49c1e7144e78a09ed4553ff613ed198750f0e Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:17:26 +0100 Subject: [PATCH 115/166] line can not be null in OsuLegacyDecoder.cs --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 34ae2ede54..11631e9447 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -725,6 +725,9 @@ namespace osu.Game.Beatmaps.Formats private KeyValuePair splitKeyVal(string line, char separator) { + if (line == null) + throw new ArgumentNullException(nameof(line)); + var split = line.Trim().Split(new[] { separator }, 2); return new KeyValuePair From 567cd6316c7803ea0ccffe818dbd6628101126f8 Mon Sep 17 00:00:00 2001 From: Miterosan Date: Tue, 7 Nov 2017 23:17:45 +0100 Subject: [PATCH 116/166] beatmap can not be null in DifficultyColouredContainer.cs --- osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs b/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs index f2bb9c62d7..57a5abc4c7 100644 --- a/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs +++ b/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs @@ -43,6 +43,9 @@ namespace osu.Game.Beatmaps.Drawables private DifficultyRating getDifficultyRating(BeatmapInfo beatmap) { + if (beatmap == null) + throw new ArgumentNullException(nameof(beatmap)); + var rating = beatmap.StarDifficulty; if (rating < 1.5) return DifficultyRating.Easy; From 97b238d0847d7c86da8bffb66de3e2af533eacce Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 8 Nov 2017 11:20:21 +0900 Subject: [PATCH 117/166] Simplify intro sequence a bit more --- osu.Game/Screens/Menu/IntroSequence.cs | 92 ++++++++++++-------------- 1 file changed, 44 insertions(+), 48 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 8ca2bbaf14..54e6d74189 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -193,76 +193,72 @@ namespace osu.Game.Screens.Menu setDefaults(); mediumRing.ResizeTo(130, 360, Easing.InExpo).OnComplete(r => r.Foreground.ResizeTo(1, 420, Easing.OutQuad)); + smallRing.ResizeTo(logo_size * 0.086f, 250, Easing.InExpo).OnComplete(r => r.Foreground.ResizeTo(1, 650, Easing.OutQuad)); Func remainingTime = () => length - TransformDelay; - using (BeginDelayedSequence(200, true)) + using (BeginDelayedSequence(360, true)) { welcomeText.FadeIn(700); - welcomeText.TransformSpacingTo(new Vector2(20, 0), 1500, Easing.Out); + welcomeText.TransformSpacingTo(new Vector2(20, 0), remainingTime(), Easing.Out); - smallRing.ResizeTo(logo_size * 0.086f, 250, Easing.InExpo).OnComplete(r => r.Foreground.ResizeTo(1, 650, Easing.OutQuad)); + const int bar_duration = 700; + const int bar_resize = 150; - using (BeginDelayedSequence(160, true)) + foreach (var bar in barsContainer) { - const int bar_duration = 700; - const int bar_resize = 150; + bar.FadeIn(); + bar.Delay(bar_resize).ResizeWidthTo(0, bar_duration - bar_resize, Easing.OutQuint); + } - foreach (var bar in barsContainer) + const int bar_end_offset = 120; + barTopLeft.MoveTo(new Vector2(-bar_end_offset, -bar_end_offset), bar_duration, Easing.OutQuint); + barTopRight.MoveTo(new Vector2(bar_end_offset, -bar_end_offset), bar_duration, Easing.OutQuint); + barBottomLeft.MoveTo(new Vector2(-bar_end_offset, bar_end_offset), bar_duration, Easing.OutQuint); + barBottomRight.MoveTo(new Vector2(bar_end_offset, bar_end_offset), bar_duration, Easing.OutQuint); + + using (BeginDelayedSequence(1640, true)) // 2000 + { + bigRing.ResizeTo(logo_size * 0.86f, 500, Easing.InOutQuint); + bigRing.Foreground.Delay(250).ResizeTo(1, 450, Easing.OutExpo); + + using (BeginDelayedSequence(250, true)) // 2250 { - bar.FadeIn(); - bar.Delay(bar_resize).ResizeWidthTo(0, bar_duration - bar_resize, Easing.OutQuint); - } + backgroundFill.ResizeHeightTo(1, remainingTime(), Easing.InOutQuart); + backgroundFill.RotateTo(-90, remainingTime(), Easing.InOutQuart); - const int bar_end_offset = 120; - barTopLeft.MoveTo(new Vector2(-bar_end_offset, -bar_end_offset), bar_duration, Easing.OutQuint); - barTopRight.MoveTo(new Vector2(bar_end_offset, -bar_end_offset), bar_duration, Easing.OutQuint); - barBottomLeft.MoveTo(new Vector2(-bar_end_offset, bar_end_offset), bar_duration, Easing.OutQuint); - barBottomRight.MoveTo(new Vector2(bar_end_offset, bar_end_offset), bar_duration, Easing.OutQuint); - - using (BeginDelayedSequence(1640, true)) // 2000 - { - bigRing.ResizeTo(logo_size * 0.86f, 500, Easing.InOutQuint); - bigRing.Foreground.Delay(250).ResizeTo(1, 450, Easing.OutExpo); - - using (BeginDelayedSequence(250, true)) // 2250 + using (BeginDelayedSequence(50, true)) { - backgroundFill.ResizeHeightTo(1, remainingTime(), Easing.InOutQuart); - backgroundFill.RotateTo(-90, remainingTime(), Easing.InOutQuart); + foregroundFill.ResizeWidthTo(1, remainingTime(), Easing.InOutQuart); + foregroundFill.RotateTo(-90, remainingTime(), Easing.InOutQuart); + } - using (BeginDelayedSequence(50, true)) - { - foregroundFill.ResizeWidthTo(1, remainingTime(), Easing.InOutQuart); - foregroundFill.RotateTo(-90, remainingTime(), Easing.InOutQuart); - } + const float circle_size = logo_size * 0.9f; - const float circle_size = logo_size * 0.9f; + const int rotation_delay = 110; + const int appear_delay = 80; - const int rotation_delay = 110; - const int appear_delay = 80; + purpleCircle.MoveToY(circle_size / 2, remainingTime(), Easing.InOutQuad); + purpleCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.OutQuad); + purpleCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuad); - purpleCircle.MoveToY(circle_size / 2, remainingTime(), Easing.InOutQuad); - purpleCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.OutQuad); - purpleCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuad); + using (BeginDelayedSequence(appear_delay, true)) + { + yellowCircle.MoveToY(-circle_size / 2, remainingTime(), Easing.InOutQuad); + yellowCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.OutQuad); + yellowCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuad); using (BeginDelayedSequence(appear_delay, true)) { - yellowCircle.MoveToY(-circle_size / 2, remainingTime(), Easing.InOutQuad); - yellowCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.OutQuad); - yellowCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuad); + blueCircle.MoveToX(-circle_size / 2, remainingTime(), Easing.InOutQuad); + blueCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.OutQuad); + blueCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuad); using (BeginDelayedSequence(appear_delay, true)) { - blueCircle.MoveToX(-circle_size / 2, remainingTime(), Easing.InOutQuad); - blueCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.OutQuad); - blueCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuad); - - using (BeginDelayedSequence(appear_delay, true)) - { - pinkCircle.MoveToX(circle_size / 2, remainingTime(), Easing.InOutQuad); - pinkCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.OutQuad); - pinkCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuad); - } + pinkCircle.MoveToX(circle_size / 2, remainingTime(), Easing.InOutQuad); + pinkCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.OutQuad); + pinkCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuad); } } } From a72e798b8556812e3f2c6b2c42b372891592fa60 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 8 Nov 2017 11:21:50 +0900 Subject: [PATCH 118/166] bar -> line --- osu.Game/Screens/Menu/IntroSequence.cs | 54 +++++++++++++------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 54e6d74189..c3a45e74a9 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -20,12 +20,12 @@ namespace osu.Game.Screens.Menu private readonly OsuSpriteText welcomeText; - private readonly Container barsContainer; + private readonly Container linesContainer; - private readonly Container barTopLeft; - private readonly Container barBottomLeft; - private readonly Container barTopRight; - private readonly Container barBottomRight; + private readonly Container lineTopLeft; + private readonly Container lineBottomLeft; + private readonly Container lineTopRight; + private readonly Container lineBottomRight; private readonly Ring smallRing; private readonly Ring mediumRing; @@ -45,14 +45,14 @@ namespace osu.Game.Screens.Menu Children = new Drawable[] { mediumRing = new Ring(Color4.White.Opacity(130)), - barsContainer = new Container + linesContainer = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, AutoSizeAxes = Axes.Both, Children = new Drawable[] { - barTopLeft = new Container + lineTopLeft = new Container { Origin = Anchor.CentreLeft, Anchor = Anchor.Centre, @@ -63,7 +63,7 @@ namespace osu.Game.Screens.Menu Colour = Color4.White.Opacity(180), } }, - barTopRight = new Container + lineTopRight = new Container { Origin = Anchor.CentreRight, Anchor = Anchor.Centre, @@ -74,7 +74,7 @@ namespace osu.Game.Screens.Menu Colour = Color4.White.Opacity(80), } }, - barBottomLeft = new Container + lineBottomLeft = new Container { Origin = Anchor.CentreLeft, Anchor = Anchor.Centre, @@ -85,7 +85,7 @@ namespace osu.Game.Screens.Menu Colour = Color4.White.Opacity(230), } }, - barBottomRight = new Container + lineBottomRight = new Container { Origin = Anchor.CentreRight, Anchor = Anchor.Centre, @@ -202,20 +202,20 @@ namespace osu.Game.Screens.Menu welcomeText.FadeIn(700); welcomeText.TransformSpacingTo(new Vector2(20, 0), remainingTime(), Easing.Out); - const int bar_duration = 700; - const int bar_resize = 150; + const int line_duration = 700; + const int line_resize = 150; - foreach (var bar in barsContainer) + foreach (var line in linesContainer) { - bar.FadeIn(); - bar.Delay(bar_resize).ResizeWidthTo(0, bar_duration - bar_resize, Easing.OutQuint); + line.FadeIn(); + line.Delay(line_resize).ResizeWidthTo(0, line_duration - line_resize, Easing.OutQuint); } - const int bar_end_offset = 120; - barTopLeft.MoveTo(new Vector2(-bar_end_offset, -bar_end_offset), bar_duration, Easing.OutQuint); - barTopRight.MoveTo(new Vector2(bar_end_offset, -bar_end_offset), bar_duration, Easing.OutQuint); - barBottomLeft.MoveTo(new Vector2(-bar_end_offset, bar_end_offset), bar_duration, Easing.OutQuint); - barBottomRight.MoveTo(new Vector2(bar_end_offset, bar_end_offset), bar_duration, Easing.OutQuint); + const int line_end_offset = 120; + lineTopLeft.MoveTo(new Vector2(-line_end_offset, -line_end_offset), line_duration, Easing.OutQuint); + lineTopRight.MoveTo(new Vector2(line_end_offset, -line_end_offset), line_duration, Easing.OutQuint); + lineBottomLeft.MoveTo(new Vector2(-line_end_offset, line_end_offset), line_duration, Easing.OutQuint); + lineBottomRight.MoveTo(new Vector2(line_end_offset, line_end_offset), line_duration, Easing.OutQuint); using (BeginDelayedSequence(1640, true)) // 2000 { @@ -278,14 +278,14 @@ namespace osu.Game.Screens.Menu smallRing.Foreground.Size = Vector2.One - new Vector2(0.4f); bigRing.Foreground.Size = Vector2.One - new Vector2(0.15f); - barTopLeft.Size = barTopRight.Size = barBottomLeft.Size = barBottomRight.Size = new Vector2(105, 1.5f); - barTopLeft.Alpha = barTopRight.Alpha = barBottomLeft.Alpha = barBottomRight.Alpha = 0; + lineTopLeft.Size = lineTopRight.Size = lineBottomLeft.Size = lineBottomRight.Size = new Vector2(105, 1.5f); + lineTopLeft.Alpha = lineTopRight.Alpha = lineBottomLeft.Alpha = lineBottomRight.Alpha = 0; - const int bar_offset = 80; - barTopLeft.Position = new Vector2(-bar_offset, -bar_offset); - barTopRight.Position = new Vector2(bar_offset, -bar_offset); - barBottomLeft.Position = new Vector2(-bar_offset, bar_offset); - barBottomRight.Position = new Vector2(bar_offset, bar_offset); + const int line_offset = 80; + lineTopLeft.Position = new Vector2(-line_offset, -line_offset); + lineTopRight.Position = new Vector2(line_offset, -line_offset); + lineBottomLeft.Position = new Vector2(-line_offset, line_offset); + lineBottomRight.Position = new Vector2(line_offset, line_offset); backgroundFill.Rotation = foregroundFill.Rotation = 0; backgroundFill.Alpha = foregroundFill.Alpha = 1; From 7dcdf78608973eea91cabb1a5417f67ea343a702 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 8 Nov 2017 12:06:22 +0900 Subject: [PATCH 119/166] Make bars and circles better --- osu.Game/Screens/Menu/IntroSequence.cs | 86 ++++++++++++++------------ 1 file changed, 47 insertions(+), 39 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index c3a45e74a9..5373270d08 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -187,17 +187,56 @@ namespace osu.Game.Screens.Menu }; } + private void setDefaults() + { + welcomeText.Spacing = new Vector2(5); + welcomeText.Alpha = 0; + + smallRing.Size = mediumRing.Size = bigRing.Size = Vector2.Zero; + + bigRing.Foreground.Size = new Vector2(0.85f); + mediumRing.Foreground.Size = new Vector2(0.7f); + smallRing.Foreground.Size = new Vector2(0.6f); + + foreach (var line in linesContainer) + { + line.Size = new Vector2(105, 1.5f); + line.Alpha = 0; + } + + const int line_offset = 80; + lineTopLeft.Position = new Vector2(-line_offset, -line_offset); + lineTopRight.Position = new Vector2(line_offset, -line_offset); + lineBottomLeft.Position = new Vector2(-line_offset, line_offset); + lineBottomRight.Position = new Vector2(line_offset, line_offset); + + backgroundFill.Rotation = foregroundFill.Rotation = 0; + backgroundFill.Alpha = foregroundFill.Alpha = 1; + backgroundFill.Height = foregroundFill.Width = 0; + + yellowCircle.Size = purpleCircle.Size = blueCircle.Size = pinkCircle.Size = Vector2.Zero; + yellowCircle.Rotation = purpleCircle.Rotation = blueCircle.Rotation = pinkCircle.Rotation = 0; + + const int circle_offset = 250; + yellowCircle.Position = new Vector2(0, -circle_offset); + purpleCircle.Position = new Vector2(0, circle_offset); + blueCircle.Position = new Vector2(-circle_offset, 0); + pinkCircle.Position = new Vector2(circle_offset, 0); + } + public void Start(double length) { FinishTransforms(true); setDefaults(); - mediumRing.ResizeTo(130, 360, Easing.InExpo).OnComplete(r => r.Foreground.ResizeTo(1, 420, Easing.OutQuad)); - smallRing.ResizeTo(logo_size * 0.086f, 250, Easing.InExpo).OnComplete(r => r.Foreground.ResizeTo(1, 650, Easing.OutQuad)); + smallRing.ResizeTo(logo_size * 0.086f, 400, Easing.InOutQuint); + + mediumRing.ResizeTo(130, 340, Easing.OutQuad); + mediumRing.Foreground.ResizeTo(1, 880, Easing.Out); Func remainingTime = () => length - TransformDelay; - using (BeginDelayedSequence(360, true)) + using (BeginDelayedSequence(250, true)) { welcomeText.FadeIn(700); welcomeText.TransformSpacingTo(new Vector2(20, 0), remainingTime(), Easing.Out); @@ -207,11 +246,13 @@ namespace osu.Game.Screens.Menu foreach (var line in linesContainer) { - line.FadeIn(); - line.Delay(line_resize).ResizeWidthTo(0, line_duration - line_resize, Easing.OutQuint); + line.FadeIn(40).ResizeWidthTo(0, line_duration - line_resize, Easing.OutQuint); } const int line_end_offset = 120; + + smallRing.Foreground.ResizeTo(1, line_duration, Easing.OutQuint); + lineTopLeft.MoveTo(new Vector2(-line_end_offset, -line_end_offset), line_duration, Easing.OutQuint); lineTopRight.MoveTo(new Vector2(line_end_offset, -line_end_offset), line_duration, Easing.OutQuint); lineBottomLeft.MoveTo(new Vector2(-line_end_offset, line_end_offset), line_duration, Easing.OutQuint); @@ -267,40 +308,6 @@ namespace osu.Game.Screens.Menu } } - private void setDefaults() - { - welcomeText.Spacing = new Vector2(5); - welcomeText.Alpha = 0; - - smallRing.Size = mediumRing.Size = bigRing.Size = Vector2.Zero; - - mediumRing.Foreground.Size = Vector2.One - new Vector2(0.7f); - smallRing.Foreground.Size = Vector2.One - new Vector2(0.4f); - bigRing.Foreground.Size = Vector2.One - new Vector2(0.15f); - - lineTopLeft.Size = lineTopRight.Size = lineBottomLeft.Size = lineBottomRight.Size = new Vector2(105, 1.5f); - lineTopLeft.Alpha = lineTopRight.Alpha = lineBottomLeft.Alpha = lineBottomRight.Alpha = 0; - - const int line_offset = 80; - lineTopLeft.Position = new Vector2(-line_offset, -line_offset); - lineTopRight.Position = new Vector2(line_offset, -line_offset); - lineBottomLeft.Position = new Vector2(-line_offset, line_offset); - lineBottomRight.Position = new Vector2(line_offset, line_offset); - - backgroundFill.Rotation = foregroundFill.Rotation = 0; - backgroundFill.Alpha = foregroundFill.Alpha = 1; - backgroundFill.Height = foregroundFill.Width = 0; - - yellowCircle.Size = purpleCircle.Size = blueCircle.Size = pinkCircle.Size = Vector2.Zero; - yellowCircle.Rotation = purpleCircle.Rotation = blueCircle.Rotation = pinkCircle.Rotation = 0; - - const int circle_offset = 250; - yellowCircle.Position = new Vector2(0, -circle_offset); - purpleCircle.Position = new Vector2(0, circle_offset); - blueCircle.Position = new Vector2(-circle_offset, 0); - pinkCircle.Position = new Vector2(circle_offset, 0); - } - private class Ring : Container { public readonly CircularContainer Foreground; @@ -317,6 +324,7 @@ namespace osu.Game.Screens.Menu Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Masking = true, + Scale = new Vector2(0.98f), Child = new Box { RelativeSizeAxes = Axes.Both, From 89426e1c11c7c04c11327f3840482af038542840 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 8 Nov 2017 12:07:52 +0900 Subject: [PATCH 120/166] Simplify lines --- osu.Game/Screens/Menu/IntroSequence.cs | 50 +++++++++----------------- 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 5373270d08..c238f77168 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -20,12 +20,12 @@ namespace osu.Game.Screens.Menu private readonly OsuSpriteText welcomeText; - private readonly Container linesContainer; + private readonly Container lines; - private readonly Container lineTopLeft; - private readonly Container lineBottomLeft; - private readonly Container lineTopRight; - private readonly Container lineBottomRight; + private readonly Box lineTopLeft; + private readonly Box lineBottomLeft; + private readonly Box lineTopRight; + private readonly Box lineBottomRight; private readonly Ring smallRing; private readonly Ring mediumRing; @@ -45,56 +45,40 @@ namespace osu.Game.Screens.Menu Children = new Drawable[] { mediumRing = new Ring(Color4.White.Opacity(130)), - linesContainer = new Container + lines = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, AutoSizeAxes = Axes.Both, - Children = new Drawable[] + Children = new [] { - lineTopLeft = new Container + lineTopLeft = new Box { Origin = Anchor.CentreLeft, Anchor = Anchor.Centre, Rotation = 45, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.White.Opacity(180), - } + Colour = Color4.White.Opacity(180), }, - lineTopRight = new Container + lineTopRight = new Box { Origin = Anchor.CentreRight, Anchor = Anchor.Centre, Rotation = -45, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.White.Opacity(80), - } + Colour = Color4.White.Opacity(80), }, - lineBottomLeft = new Container + lineBottomLeft = new Box { Origin = Anchor.CentreLeft, Anchor = Anchor.Centre, Rotation = -45, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.White.Opacity(230), - } + Colour = Color4.White.Opacity(230), }, - lineBottomRight = new Container + lineBottomRight = new Box { Origin = Anchor.CentreRight, Anchor = Anchor.Centre, Rotation = 45, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.White.Opacity(130), - } + Colour = Color4.White.Opacity(130), }, } }, @@ -198,7 +182,7 @@ namespace osu.Game.Screens.Menu mediumRing.Foreground.Size = new Vector2(0.7f); smallRing.Foreground.Size = new Vector2(0.6f); - foreach (var line in linesContainer) + foreach (var line in lines) { line.Size = new Vector2(105, 1.5f); line.Alpha = 0; @@ -244,7 +228,7 @@ namespace osu.Game.Screens.Menu const int line_duration = 700; const int line_resize = 150; - foreach (var line in linesContainer) + foreach (var line in lines) { line.FadeIn(40).ResizeWidthTo(0, line_duration - line_resize, Easing.OutQuint); } From f83c095269449e81464070d6480bd8e55f0b4f2a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 8 Nov 2017 12:10:32 +0900 Subject: [PATCH 121/166] Simplify more --- osu.Game/Screens/Menu/IntroSequence.cs | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index c238f77168..70d4bb4016 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -31,8 +31,8 @@ namespace osu.Game.Screens.Menu private readonly Ring mediumRing; private readonly Ring bigRing; - private readonly Container backgroundFill; - private readonly Container foregroundFill; + private readonly Box backgroundFill; + private readonly Box foregroundFill; private readonly CircularContainer pinkCircle; private readonly CircularContainer blueCircle; @@ -44,7 +44,6 @@ namespace osu.Game.Screens.Menu RelativeSizeAxes = Axes.Both; Children = new Drawable[] { - mediumRing = new Ring(Color4.White.Opacity(130)), lines = new Container { Anchor = Anchor.Centre, @@ -82,8 +81,9 @@ namespace osu.Game.Screens.Menu }, } }, - smallRing = new Ring(Color4.White), bigRing = new Ring(OsuColour.FromHex(@"B6C5E9")), + mediumRing = new Ring(Color4.White.Opacity(130)), + smallRing = new Ring(Color4.White), new CircularContainer { Anchor = Anchor.Centre, @@ -92,16 +92,12 @@ namespace osu.Game.Screens.Menu Masking = true, Children = new Drawable[] { - backgroundFill = new Container + backgroundFill = new Box { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = OsuColour.FromHex(@"C6D8FF").Opacity(160), - } + Colour = OsuColour.FromHex(@"C6D8FF").Opacity(160), }, welcomeText = new OsuSpriteText { @@ -111,16 +107,12 @@ namespace osu.Game.Screens.Menu Font = @"Exo2.0-Light", TextSize = 42, }, - foregroundFill = new Container + foregroundFill = new Box { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.White, - } + Colour = Color4.White, }, } }, From 419f041291fb42d8cb49104d54abdc952cda360a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 8 Nov 2017 12:12:27 +0900 Subject: [PATCH 122/166] Fix text alignment --- osu.Game/Screens/Menu/IntroSequence.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 70d4bb4016..a207af629a 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -104,6 +104,7 @@ namespace osu.Game.Screens.Menu Anchor = Anchor.Centre, Origin = Anchor.Centre, Text = "welcome", + Padding = new MarginPadding { Bottom = 10 }, Font = @"Exo2.0-Light", TextSize = 42, }, From 1771e003f7908340f5358084d597ab0ed0993cd0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 8 Nov 2017 12:13:30 +0900 Subject: [PATCH 123/166] Simplify more --- osu.Game/Screens/Menu/IntroSequence.cs | 32 +++++++------------------- 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index a207af629a..9ac075df92 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -117,49 +117,33 @@ namespace osu.Game.Screens.Menu }, } }, - purpleCircle = new CircularContainer + purpleCircle = new Circle { Anchor = Anchor.Centre, Origin = Anchor.TopCentre, Masking = true, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = OsuColour.FromHex(@"AA92FF"), - } + Colour = OsuColour.FromHex(@"AA92FF"), }, - yellowCircle = new CircularContainer + yellowCircle = new Circle { Anchor = Anchor.Centre, Origin = Anchor.BottomCentre, Masking = true, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = OsuColour.FromHex(@"FFD64C"), - } + Colour = OsuColour.FromHex(@"FFD64C"), }, - blueCircle = new CircularContainer + blueCircle = new Circle { Anchor = Anchor.Centre, Origin = Anchor.CentreRight, Masking = true, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = OsuColour.FromHex(@"8FE5FE"), - } + Colour = OsuColour.FromHex(@"8FE5FE"), }, - pinkCircle = new CircularContainer + pinkCircle = new Circle { Anchor = Anchor.Centre, Origin = Anchor.CentreLeft, Masking = true, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = OsuColour.FromHex(@"e967a1"), - } + Colour = OsuColour.FromHex(@"e967a1"), }, }; } From 713d730d1093b005e54a233231c660d9d2d7692c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 8 Nov 2017 13:21:26 +0900 Subject: [PATCH 124/166] Simplify restart process and defaults initialisation --- osu.Game/Screens/Menu/IntroSequence.cs | 170 +++++++++++-------------- 1 file changed, 76 insertions(+), 94 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 9ac075df92..0c68410c92 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -2,8 +2,10 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Linq; using OpenTK; using OpenTK.Graphics; +using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -15,33 +17,40 @@ namespace osu.Game.Screens.Menu { public class IntroSequence : Container { - //Size private const float logo_size = 460; //todo: this should probably be 480 - private readonly OsuSpriteText welcomeText; + private OsuSpriteText welcomeText; - private readonly Container lines; + private Container lines; - private readonly Box lineTopLeft; - private readonly Box lineBottomLeft; - private readonly Box lineTopRight; - private readonly Box lineBottomRight; + private Box lineTopLeft; + private Box lineBottomLeft; + private Box lineTopRight; + private Box lineBottomRight; - private readonly Ring smallRing; - private readonly Ring mediumRing; - private readonly Ring bigRing; + private Ring smallRing; + private Ring mediumRing; + private Ring bigRing; - private readonly Box backgroundFill; - private readonly Box foregroundFill; + private Box backgroundFill; + private Box foregroundFill; - private readonly CircularContainer pinkCircle; - private readonly CircularContainer blueCircle; - private readonly CircularContainer yellowCircle; - private readonly CircularContainer purpleCircle; + private CircularContainer pinkCircle; + private CircularContainer blueCircle; + private CircularContainer yellowCircle; + private CircularContainer purpleCircle; public IntroSequence() { RelativeSizeAxes = Axes.Both; + } + + [BackgroundDependencyLoader] + private void load() + { + const int line_offset = 80; + const int circle_offset = 250; + Children = new Drawable[] { lines = new Container @@ -55,6 +64,7 @@ namespace osu.Game.Screens.Menu { Origin = Anchor.CentreLeft, Anchor = Anchor.Centre, + Position = new Vector2(-line_offset, -line_offset), Rotation = 45, Colour = Color4.White.Opacity(180), }, @@ -62,6 +72,7 @@ namespace osu.Game.Screens.Menu { Origin = Anchor.CentreRight, Anchor = Anchor.Centre, + Position = new Vector2(line_offset, -line_offset), Rotation = -45, Colour = Color4.White.Opacity(80), }, @@ -69,6 +80,7 @@ namespace osu.Game.Screens.Menu { Origin = Anchor.CentreLeft, Anchor = Anchor.Centre, + Position = new Vector2(-line_offset, line_offset), Rotation = -45, Colour = Color4.White.Opacity(230), }, @@ -76,14 +88,26 @@ namespace osu.Game.Screens.Menu { Origin = Anchor.CentreRight, Anchor = Anchor.Centre, + Position = new Vector2(line_offset, line_offset), Rotation = 45, Colour = Color4.White.Opacity(130), }, } }, - bigRing = new Ring(OsuColour.FromHex(@"B6C5E9")), - mediumRing = new Ring(Color4.White.Opacity(130)), - smallRing = new Ring(Color4.White), + bigRing = new Ring(OsuColour.FromHex(@"B6C5E9"), 0.85f), + mediumRing = new Ring(Color4.White.Opacity(130), 0.7f), + smallRing = new Ring(Color4.White, 0.6f), + welcomeText = new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Text = "welcome", + Padding = new MarginPadding { Bottom = 10 }, + Font = @"Exo2.0-Light", + Alpha = 0, + TextSize = 42, + Spacing = new Vector2(5), + }, new CircularContainer { Anchor = Anchor.Centre, @@ -97,98 +121,65 @@ namespace osu.Game.Screens.Menu Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, + Height = 0, Colour = OsuColour.FromHex(@"C6D8FF").Opacity(160), }, - welcomeText = new OsuSpriteText - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Text = "welcome", - Padding = new MarginPadding { Bottom = 10 }, - Font = @"Exo2.0-Light", - TextSize = 42, - }, foregroundFill = new Box { Anchor = Anchor.Centre, Origin = Anchor.Centre, + Size = Vector2.Zero, RelativeSizeAxes = Axes.Both, + Width = 0, Colour = Color4.White, }, } }, - purpleCircle = new Circle - { - Anchor = Anchor.Centre, - Origin = Anchor.TopCentre, - Masking = true, - Colour = OsuColour.FromHex(@"AA92FF"), - }, yellowCircle = new Circle { Anchor = Anchor.Centre, Origin = Anchor.BottomCentre, - Masking = true, + Position = new Vector2(0, -circle_offset), Colour = OsuColour.FromHex(@"FFD64C"), }, - blueCircle = new Circle - { - Anchor = Anchor.Centre, - Origin = Anchor.CentreRight, - Masking = true, - Colour = OsuColour.FromHex(@"8FE5FE"), - }, pinkCircle = new Circle { Anchor = Anchor.Centre, Origin = Anchor.CentreLeft, - Masking = true, + Position = new Vector2(circle_offset, 0), Colour = OsuColour.FromHex(@"e967a1"), }, + purpleCircle = new Circle + { + Anchor = Anchor.Centre, + Origin = Anchor.TopCentre, + Position = new Vector2(0, circle_offset), + Colour = OsuColour.FromHex(@"AA92FF"), + }, + blueCircle = new Circle + { + Anchor = Anchor.Centre, + Origin = Anchor.CentreRight, + Position = new Vector2(-circle_offset, 0), + Colour = OsuColour.FromHex(@"8FE5FE"), + }, }; - } - - private void setDefaults() - { - welcomeText.Spacing = new Vector2(5); - welcomeText.Alpha = 0; - - smallRing.Size = mediumRing.Size = bigRing.Size = Vector2.Zero; - - bigRing.Foreground.Size = new Vector2(0.85f); - mediumRing.Foreground.Size = new Vector2(0.7f); - smallRing.Foreground.Size = new Vector2(0.6f); foreach (var line in lines) { line.Size = new Vector2(105, 1.5f); line.Alpha = 0; } - - const int line_offset = 80; - lineTopLeft.Position = new Vector2(-line_offset, -line_offset); - lineTopRight.Position = new Vector2(line_offset, -line_offset); - lineBottomLeft.Position = new Vector2(-line_offset, line_offset); - lineBottomRight.Position = new Vector2(line_offset, line_offset); - - backgroundFill.Rotation = foregroundFill.Rotation = 0; - backgroundFill.Alpha = foregroundFill.Alpha = 1; - backgroundFill.Height = foregroundFill.Width = 0; - - yellowCircle.Size = purpleCircle.Size = blueCircle.Size = pinkCircle.Size = Vector2.Zero; - yellowCircle.Rotation = purpleCircle.Rotation = blueCircle.Rotation = pinkCircle.Rotation = 0; - - const int circle_offset = 250; - yellowCircle.Position = new Vector2(0, -circle_offset); - purpleCircle.Position = new Vector2(0, circle_offset); - blueCircle.Position = new Vector2(-circle_offset, 0); - pinkCircle.Position = new Vector2(circle_offset, 0); } public void Start(double length) { - FinishTransforms(true); - setDefaults(); + if (Children.Any()) + { + // restart if we were already run previously. + FinishTransforms(true); + load(); + } smallRing.ResizeTo(logo_size * 0.086f, 400, Easing.InOutQuint); @@ -269,40 +260,31 @@ namespace osu.Game.Screens.Menu } } - private class Ring : Container + private class Ring : Container { - public readonly CircularContainer Foreground; + public readonly Circle Foreground; - public Ring(Color4 ringColour) + public Ring(Color4 ringColour, float foregroundSize) { Anchor = Anchor.Centre; Origin = Anchor.Centre; Children = new[] { - new CircularContainer + new Circle { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, - Masking = true, Scale = new Vector2(0.98f), - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = ringColour, - } + Colour = ringColour, }, - Foreground = new CircularContainer + Foreground = new Circle { + Size = new Vector2(foregroundSize), Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, - Masking = true, - Child = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, - } + Colour = Color4.Black, } }; } From d8d7165164db8353541839e36889c44cda7b1e8d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 8 Nov 2017 13:52:44 +0900 Subject: [PATCH 125/166] Add a test case which starts the game --- osu.Game.Tests/Visual/TestCaseOsuGame.cs | 39 ++++++++++++++++++++++++ osu.Game.Tests/osu.Game.Tests.csproj | 1 + osu.Game/Screens/Loader.cs | 4 +-- osu.Game/Screens/Menu/MainMenu.cs | 11 ++++--- 4 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 osu.Game.Tests/Visual/TestCaseOsuGame.cs diff --git a/osu.Game.Tests/Visual/TestCaseOsuGame.cs b/osu.Game.Tests/Visual/TestCaseOsuGame.cs new file mode 100644 index 0000000000..3f869e7378 --- /dev/null +++ b/osu.Game.Tests/Visual/TestCaseOsuGame.cs @@ -0,0 +1,39 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Timing; +using osu.Game.Screens; +using osu.Game.Screens.Menu; +using OpenTK.Graphics; + +namespace osu.Game.Tests.Visual +{ + public class TestCaseOsuGame : OsuTestCase + { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(OsuLogo), + }; + + public TestCaseOsuGame() + { + var rateAdjustClock = new StopwatchClock(true); + var framedClock = new FramedClock(rateAdjustClock); + framedClock.ProcessFrame(); + + Add(new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + }); + + Add(new Loader()); + + AddSliderStep("Playback speed", 0.0, 2.0, 1, v => rateAdjustClock.Rate = v); + } + } +} diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 4cc06df609..b1081890c8 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -122,6 +122,7 @@ + diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index 6de53aeeb0..6680864368 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -8,7 +8,7 @@ using OpenTK; namespace osu.Game.Screens { - internal class Loader : OsuScreen + public class Loader : OsuScreen { public override bool ShowOverlays => false; @@ -30,7 +30,7 @@ namespace osu.Game.Screens } [BackgroundDependencyLoader] - private void load(OsuGame game) + private void load(OsuGameBase game) { if (game.IsDeployedBuild) LoadComponentAsync(new Disclaimer(), d => Push(d)); diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 77e45c4575..7729211c4c 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -59,13 +59,16 @@ namespace osu.Game.Screens.Menu }; } - [BackgroundDependencyLoader] - private void load(OsuGame game) + [BackgroundDependencyLoader(true)] + private void load(OsuGame game = null) { LoadComponentAsync(background); - buttons.OnSettings = game.ToggleSettings; - buttons.OnDirect = game.ToggleDirect; + if (game != null) + { + buttons.OnSettings = game.ToggleSettings; + buttons.OnDirect = game.ToggleDirect; + } preloadSongSelect(); } From 41fcecf759a4a0c287d3ea28861963d3b68c8b22 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 8 Nov 2017 14:31:11 +0900 Subject: [PATCH 126/166] Add intro in to actual game --- osu.Game/Screens/Menu/Intro.cs | 12 +++++------- osu.Game/Screens/Menu/IntroSequence.cs | 4 ++-- osu.Game/Screens/Menu/OsuLogo.cs | 4 ++-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 490b2b3346..311e453a65 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -117,8 +117,8 @@ namespace osu.Game.Screens.Menu logo.RelativePositionAxes = Axes.Both; - logo.Triangles = false; - logo.Colour = Color4.DarkGray; + logo.Triangles = true; + logo.Colour = Color4.White; logo.Ripple = false; const int quick_appear = 350; @@ -129,11 +129,9 @@ namespace osu.Game.Screens.Menu if (!resuming) { - logo.ScaleTo(0.4f); - logo.FadeOut(); - - logo.ScaleTo(1, delay_step_one + delay_step_two, Easing.OutQuint); - logo.FadeIn(delay_step_one + delay_step_two, Easing.OutQuint); + logo.ScaleTo(1); + logo.FadeIn(); + logo.PlayIntro(); } else { diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 0c68410c92..25265eed76 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -210,12 +210,12 @@ namespace osu.Game.Screens.Menu lineBottomLeft.MoveTo(new Vector2(-line_end_offset, line_end_offset), line_duration, Easing.OutQuint); lineBottomRight.MoveTo(new Vector2(line_end_offset, line_end_offset), line_duration, Easing.OutQuint); - using (BeginDelayedSequence(1640, true)) // 2000 + using (BeginDelayedSequence(length * 0.56, true)) { bigRing.ResizeTo(logo_size * 0.86f, 500, Easing.InOutQuint); bigRing.Foreground.Delay(250).ResizeTo(1, 450, Easing.OutExpo); - using (BeginDelayedSequence(250, true)) // 2250 + using (BeginDelayedSequence(250, true)) { backgroundFill.ResizeHeightTo(1, remainingTime(), Easing.InOutQuart); backgroundFill.RotateTo(-90, remainingTime(), Easing.InOutQuart); diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index 6215cb5660..f7c485cf19 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -297,8 +297,8 @@ namespace osu.Game.Screens.Menu public void PlayIntro() { - const double length = 2950; - const double fade = 300; + const double length = 3150; + const double fade = 200; logoHoverContainer.FadeOut().Delay(length).FadeIn(fade); intro.Show(); From fafca093e8ca56bfab9395f7c571dd956443eb83 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 8 Nov 2017 14:43:15 +0900 Subject: [PATCH 127/166] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 3c074a0981..ded020da31 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 3c074a0981844fbaa9f2ecbf879c542f07e2b94d +Subproject commit ded020da31505c124fa0414e85816e6201f235ed From 7ad498cb2921fca0db5eb906d76019a5beaea750 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 8 Nov 2017 14:45:01 +0900 Subject: [PATCH 128/166] Remove unused puzzle pieces --- osu.Game/Screens/Menu/ButtonSystem.cs | 2 -- osu.Game/Screens/Menu/OsuLogo.cs | 24 ------------------------ 2 files changed, 26 deletions(-) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 6f9b77e18e..33d118d12e 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -326,8 +326,6 @@ namespace osu.Game.Screens.Menu private bool trackingPosition; - public void SetLogoTracking(bool value) => trackingPosition = value; - protected override void Update() { //if (OsuGame.IdleTime > 6000 && State != MenuState.Exit) diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index 297076a78b..5a5b90b3fb 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -224,27 +224,6 @@ namespace osu.Game.Screens.Menu ripple.Texture = textures.Get(@"Menu/logo"); } - private double? reservationEndTime; - private Action reservationCallback; - - private bool canFulfillReservation => !reservationEndTime.HasValue || reservationEndTime <= Time.Current; - - public void RequestUsage(Action callback) - { - reservationCallback = callback; - } - - private void fulfillReservation() - { - reservationCallback(this); - reservationCallback = null; - } - - public void ReserveFor(float duration) - { - reservationEndTime = Time.Current + duration; - } - private int lastBeatIndex; protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes) @@ -311,9 +290,6 @@ namespace osu.Game.Screens.Menu { triangles.Velocity = paused_velocity; } - - if (reservationCallback != null && canFulfillReservation) - fulfillReservation(); } private bool interactive => Action != null && Alpha > 0.2f; From a8bacd1ed48604583bfa94f17bf2e6cd838e2dde Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 8 Nov 2017 14:46:47 +0900 Subject: [PATCH 129/166] Remove unnecessary private method /shrug --- osu.Game/Screens/OsuScreen.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 5ecfcd8e8d..a7e1dd0f25 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -76,7 +76,7 @@ namespace osu.Game.Screens protected override void OnResuming(Screen last) { base.OnResuming(last); - logo.DelayUntilTransformsFinished().Schedule(() => logoSetup(true)); + logo.DelayUntilTransformsFinished().Schedule(() => LogoSetup(logo, true)); sampleExit?.Play(); } @@ -122,7 +122,7 @@ namespace osu.Game.Screens base.OnEntering(last); - logo.DelayUntilTransformsFinished().Schedule(() => logoSetup(false)); + logo.DelayUntilTransformsFinished().Schedule(() => LogoSetup(logo, false)); } protected override bool OnExiting(Screen next) @@ -148,8 +148,6 @@ namespace osu.Game.Screens return false; } - private void logoSetup(bool resuming) => LogoSetup(logo, resuming); - protected virtual void LogoSetup(OsuLogo logo, bool resuming) { logo.Action = null; From c2d4a213b125b77a8418caa3c1187c42cd8e272e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 8 Nov 2017 16:34:03 +0900 Subject: [PATCH 130/166] Rename logo-related methods --- osu.Game/Screens/Loader.cs | 4 ++-- osu.Game/Screens/Menu/Intro.cs | 4 ++-- osu.Game/Screens/Menu/MainMenu.cs | 6 +++--- osu.Game/Screens/OsuScreen.cs | 31 +++++++++++++++++---------- osu.Game/Screens/Play/PlayerLoader.cs | 4 ++-- osu.Game/Screens/Select/SongSelect.cs | 8 +++---- 6 files changed, 33 insertions(+), 24 deletions(-) diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index 6de53aeeb0..8c70e2421b 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -17,9 +17,9 @@ namespace osu.Game.Screens ValidForResume = false; } - protected override void LogoSetup(OsuLogo logo, bool resuming) + protected override void OnArrivedLogo(OsuLogo logo, bool resuming) { - base.LogoSetup(logo, resuming); + base.OnArrivedLogo(logo, resuming); logo.RelativePositionAxes = Axes.Both; logo.Triangles = false; diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 9efe7455f7..2cd51f05db 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -109,9 +109,9 @@ namespace osu.Game.Screens.Menu public const int EXIT_DELAY = 3000; - protected override void LogoSetup(OsuLogo logo, bool resuming) + protected override void OnArrivedLogo(OsuLogo logo, bool resuming) { - base.LogoSetup(logo, resuming); + base.OnArrivedLogo(logo, resuming); logo.RelativePositionAxes = Axes.Both; diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 77e45c4575..6f01199a60 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -103,9 +103,9 @@ namespace osu.Game.Screens.Menu Beatmap.ValueChanged += beatmap_ValueChanged; } - protected override void LogoSetup(OsuLogo logo, bool resuming) + protected override void OnArrivedLogo(OsuLogo logo, bool resuming) { - base.LogoSetup(logo, resuming); + base.OnArrivedLogo(logo, resuming); buttons.SetOsuLogo(logo); @@ -119,7 +119,7 @@ namespace osu.Game.Screens.Menu buttons.State = MenuState.TopLevel; } - protected override void LogoOnSuspending(OsuLogo logo) + protected override void OnSuspendingLogo(OsuLogo logo) { logo.FadeOut(300, Easing.InSine) .ScaleTo(0.2f, 300, Easing.InSine) diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index a7e1dd0f25..2693ad97fa 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -76,14 +76,14 @@ namespace osu.Game.Screens protected override void OnResuming(Screen last) { base.OnResuming(last); - logo.DelayUntilTransformsFinished().Schedule(() => LogoSetup(logo, true)); + logo.DelayUntilTransformsFinished().Schedule(() => OnArrivedLogo(logo, true)); sampleExit?.Play(); } protected override void OnSuspending(Screen next) { base.OnSuspending(next); - logoOnSuspending(); + onSuspendingLogo(); } protected override void OnEntering(Screen last) @@ -122,13 +122,13 @@ namespace osu.Game.Screens base.OnEntering(last); - logo.DelayUntilTransformsFinished().Schedule(() => LogoSetup(logo, false)); + logo.DelayUntilTransformsFinished().Schedule(() => OnArrivedLogo(logo, false)); } protected override bool OnExiting(Screen next) { if (ValidForResume && logo != null) - logoOnExiting(); + onExitingLogo(); OsuScreen nextOsu = next as OsuScreen; @@ -148,29 +148,38 @@ namespace osu.Game.Screens return false; } - protected virtual void LogoSetup(OsuLogo logo, bool resuming) + /// + /// Fired when this screen was entered or resumed and the logo state is required to be adjusted. + /// + protected virtual void OnArrivedLogo(OsuLogo logo, bool resuming) { logo.Action = null; logo.FadeOut(300, Easing.OutQuint); } - private void logoOnExiting() + private void onExitingLogo() { logo.ClearTransforms(); - LogoOnExiting(logo); + OnExitingLogo(logo); } - protected virtual void LogoOnExiting(OsuLogo logo) + /// + /// Fired when this screen was exited to add any outwards transition to the logo. + /// + protected virtual void OnExitingLogo(OsuLogo logo) { } - private void logoOnSuspending() + private void onSuspendingLogo() { logo.ClearTransforms(); - LogoOnSuspending(logo); + OnSuspendingLogo(logo); } - protected virtual void LogoOnSuspending(OsuLogo logo) + /// + /// Fired when this screen was suspended to add any outwards transition to the logo. + /// + protected virtual void OnSuspendingLogo(OsuLogo logo) { } } diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index e53026fb8d..6e96fb8b71 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -95,9 +95,9 @@ namespace osu.Game.Screens.Play this.Delay(2150).Schedule(pushWhenLoaded); } - protected override void LogoSetup(OsuLogo logo, bool resuming) + protected override void OnArrivedLogo(OsuLogo logo, bool resuming) { - base.LogoSetup(logo, resuming); + base.OnArrivedLogo(logo, resuming); logo.ClearTransforms(targetMember: nameof(Position)); logo.RelativePositionAxes = Axes.Both; diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index f9e3b0902d..11e7d452fa 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -311,9 +311,9 @@ namespace osu.Game.Screens.Select private const double logo_transition = 250; - protected override void LogoSetup(OsuLogo logo, bool resuming) + protected override void OnArrivedLogo(OsuLogo logo, bool resuming) { - base.LogoSetup(logo, resuming); + base.OnArrivedLogo(logo, resuming); logo.ClearTransforms(); logo.RelativePositionAxes = Axes.Both; @@ -337,9 +337,9 @@ namespace osu.Game.Screens.Select logo.Action = () => carouselRaisedStart(); } - protected override void LogoOnExiting(OsuLogo logo) + protected override void OnExitingLogo(OsuLogo logo) { - base.LogoOnExiting(logo); + base.OnExitingLogo(logo); logo.ScaleTo(0.2f, logo_transition, Easing.OutQuint); logo.FadeOut(logo_transition, Easing.OutQuint); } From df6c808d28dfe7bfa216646e4fac4de6a030c55d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 8 Nov 2017 17:04:36 +0900 Subject: [PATCH 131/166] Adjust animation to designer-san's liking --- osu.Game/Screens/Menu/IntroSequence.cs | 56 ++++++++++++++------------ 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 25265eed76..f8886f8dc1 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -135,20 +135,6 @@ namespace osu.Game.Screens.Menu }, } }, - yellowCircle = new Circle - { - Anchor = Anchor.Centre, - Origin = Anchor.BottomCentre, - Position = new Vector2(0, -circle_offset), - Colour = OsuColour.FromHex(@"FFD64C"), - }, - pinkCircle = new Circle - { - Anchor = Anchor.Centre, - Origin = Anchor.CentreLeft, - Position = new Vector2(circle_offset, 0), - Colour = OsuColour.FromHex(@"e967a1"), - }, purpleCircle = new Circle { Anchor = Anchor.Centre, @@ -163,6 +149,20 @@ namespace osu.Game.Screens.Menu Position = new Vector2(-circle_offset, 0), Colour = OsuColour.FromHex(@"8FE5FE"), }, + yellowCircle = new Circle + { + Anchor = Anchor.Centre, + Origin = Anchor.BottomCentre, + Position = new Vector2(0, -circle_offset), + Colour = OsuColour.FromHex(@"FFD64C"), + }, + pinkCircle = new Circle + { + Anchor = Anchor.Centre, + Origin = Anchor.CentreLeft, + Position = new Vector2(circle_offset, 0), + Colour = OsuColour.FromHex(@"e967a1"), + }, }; foreach (var line in lines) @@ -170,6 +170,8 @@ namespace osu.Game.Screens.Menu line.Size = new Vector2(105, 1.5f); line.Alpha = 0; } + + Scale = new Vector2(0.5f); } public void Start(double length) @@ -226,32 +228,34 @@ namespace osu.Game.Screens.Menu foregroundFill.RotateTo(-90, remainingTime(), Easing.InOutQuart); } + this.ScaleTo(1, remainingTime(), Easing.InOutCubic); + const float circle_size = logo_size * 0.9f; const int rotation_delay = 110; const int appear_delay = 80; - purpleCircle.MoveToY(circle_size / 2, remainingTime(), Easing.InOutQuad); - purpleCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.OutQuad); - purpleCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuad); + purpleCircle.MoveToY(circle_size / 2, remainingTime(), Easing.InOutQuart); + purpleCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.InOutQuart); + purpleCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuart); using (BeginDelayedSequence(appear_delay, true)) { - yellowCircle.MoveToY(-circle_size / 2, remainingTime(), Easing.InOutQuad); - yellowCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.OutQuad); - yellowCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuad); + yellowCircle.MoveToY(-circle_size / 2, remainingTime(), Easing.InOutQuart); + yellowCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.InOutQuart); + yellowCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuart); using (BeginDelayedSequence(appear_delay, true)) { - blueCircle.MoveToX(-circle_size / 2, remainingTime(), Easing.InOutQuad); - blueCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.OutQuad); - blueCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuad); + blueCircle.MoveToX(-circle_size / 2, remainingTime(), Easing.InOutQuart); + blueCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.InOutQuart); + blueCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuart); using (BeginDelayedSequence(appear_delay, true)) { - pinkCircle.MoveToX(circle_size / 2, remainingTime(), Easing.InOutQuad); - pinkCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.OutQuad); - pinkCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuad); + pinkCircle.MoveToX(circle_size / 2, remainingTime(), Easing.InOutQuart); + pinkCircle.Delay(rotation_delay).RotateTo(-180, remainingTime() - rotation_delay, Easing.InOutQuart); + pinkCircle.ResizeTo(circle_size, remainingTime(), Easing.InOutQuart); } } } From e2005c44316754c2884e01e2dad2bdcc8d4f2761 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 8 Nov 2017 20:36:18 +0900 Subject: [PATCH 132/166] Add comment explaining necessity of AlwaysPresent for now --- osu.Game/Screens/Menu/OsuLogo.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index 5a5b90b3fb..3b79749341 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -77,6 +77,7 @@ namespace osu.Game.Screens.Menu public OsuLogo() { + // Required to make Schedule calls run in OsuScreen even when we are not visible. AlwaysPresent = true; EarlyActivationMilliseconds = early_activation; From edeeefea3b85808bc48e41456e226d213a46eb48 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Wed, 8 Nov 2017 20:42:24 +0300 Subject: [PATCH 133/166] Fix missing text has been shown before api request has been completed --- .../Sections/Beatmaps/PaginatedBeatmapContainer.cs | 8 +++++--- osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs | 4 ++-- .../Profile/Sections/Ranks/PaginatedScoreContainer.cs | 6 +++++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs index 2ac7a29177..2607585573 100644 --- a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs @@ -41,9 +41,11 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps ShowMoreButton.FadeTo(sets.Count == ItemsPerPage ? 1 : 0); ShowMoreLoading.Hide(); - if (!sets.Any()) return; - - MissingText.Hide(); + if (!sets.Any()) + { + MissingText.Show(); + return; + } foreach (var s in sets) { diff --git a/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs b/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs index d0ccf6af41..b75d1bc4d6 100644 --- a/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs @@ -74,7 +74,8 @@ namespace osu.Game.Overlays.Profile.Sections MissingText = new OsuSpriteText { TextSize = 14, - Text = missing + Text = missing, + Alpha = 0, }, }; } @@ -94,7 +95,6 @@ namespace osu.Game.Overlays.Profile.Sections VisiblePages = 0; ItemsContainer.Clear(); ShowMoreButton.Hide(); - MissingText.Show(); if (newUser != null) ShowMore(); diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs b/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs index 4c2bea4554..eab708f978 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs @@ -41,7 +41,11 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks ShowMoreButton.FadeTo(scores.Count == ItemsPerPage ? 1 : 0); ShowMoreLoading.Hide(); - if (!scores.Any()) return; + if (!scores.Any()) + { + MissingText.Show(); + return; + } MissingText.Hide(); From 348083f589e0faff13d33878fd71ed3e6dac94d0 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 9 Nov 2017 14:04:59 +0900 Subject: [PATCH 134/166] Update with framework state transformation Removes explicit initial state setting in DrawableOsuHitObjects. --- osu-framework | 2 +- .../Objects/Drawables/DrawableHitCircle.cs | 21 ++----------------- .../Objects/Drawables/DrawableOsuHitObject.cs | 15 +++++-------- .../Objects/Drawables/DrawableRepeatPoint.cs | 12 +---------- .../Objects/Drawables/DrawableSlider.cs | 14 +++---------- .../Objects/Drawables/DrawableSliderTick.cs | 4 ---- .../Objects/Drawables/DrawableHitObject.cs | 3 +++ 7 files changed, 15 insertions(+), 56 deletions(-) diff --git a/osu-framework b/osu-framework index c8222d1dc9..b70ca3de9e 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit c8222d1dc932aafe17ec42bfbe6cbec81851f55d +Subproject commit b70ca3de9ec1a8eb7fb73fcfd169ff38d00b07cd diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs index ed0578d3a4..a973d2b580 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -58,6 +58,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables }, ApproachCircle = new ApproachCircle { + Alpha = 0, + Scale = new Vector2(4), Colour = AccentColour, } }; @@ -82,25 +84,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables }); } - protected override void UpdateInitialState() - { - base.UpdateInitialState(); - - // Hide() cannot be used here, because when rewinding, we need these to be the final values - - ring.Alpha = 1; - circle.Alpha = 1; - number.Alpha = 1; - glow.Alpha = 1; - - ApproachCircle.Alpha = 0; - ApproachCircle.Scale = new Vector2(4); - explode.Alpha = 0; - flash.Alpha = 0; - - Scale = new Vector2(HitObject.Scale); - } - protected override void UpdatePreemptState() { base.UpdatePreemptState(); diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs index 7429f084c3..e968e5b9df 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -23,12 +23,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables protected sealed override void UpdateState(ArmedState state) { - ClearTransforms(true); + double transformTime = HitObject.StartTime - TIME_PREEMPT; - using (BeginAbsoluteSequence(HitObject.StartTime - TIME_PREEMPT, true)) + TransformStateTo(transformTime, true); + ClearTransformsAfter(transformTime, true); + + using (BeginAbsoluteSequence(transformTime, true)) { - UpdateInitialState(); - UpdatePreemptState(); using (BeginDelayedSequence(TIME_PREEMPT + (Judgements.FirstOrDefault()?.TimeOffset ?? 0), true)) @@ -36,12 +37,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } } - protected virtual void UpdateInitialState() - { - // Hide() cannot be used here, because when rewinding, we need these to be the final values - Alpha = 0; - } - protected virtual void UpdatePreemptState() { this.FadeIn(TIME_FADEIN); diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index 200c697a0f..a9b63ea642 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -24,13 +24,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables this.repeatPoint = repeatPoint; this.drawableSlider = drawableSlider; - // The containing DrawableSlider is updated before us and clears our transforms, so we need to be - // present to get updated and have UpdateState correctly called when rewinding. - AlwaysPresent = true; - AutoSizeAxes = Axes.Both; Blending = BlendingMode.Additive; Origin = Anchor.Centre; + Scale = new Vector2(0.5f); Children = new Drawable[] { @@ -50,13 +47,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables AddJudgement(new OsuJudgement { Result = drawableSlider.Tracking ? HitResult.Great : HitResult.Miss }); } - protected override void UpdateInitialState() - { - base.UpdateInitialState(); - - Scale = new Vector2(0.5f); - } - protected override void UpdatePreemptState() { var animIn = Math.Min(150, repeatPoint.StartTime - FadeInTime); diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 2e6e82ce0c..74454ca555 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -43,7 +43,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables ball = new SliderBall(s) { Scale = new Vector2(s.Scale), - AccentColour = AccentColour + AccentColour = AccentColour, + AlwaysPresent = true, + Alpha = 0 }, initialCircle = new DrawableHitCircle(new HitCircle { @@ -148,16 +150,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } } - protected override void UpdateInitialState() - { - base.UpdateInitialState(); - body.Alpha = 1; - - //we need to be present to handle input events. note that we still don't get enough events (we don't get a position if the mouse hasn't moved since the slider appeared). - ball.AlwaysPresent = true; - ball.Alpha = 0; - } - protected override void UpdateCurrentState(ArmedState state) { ball.FadeIn(); diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs index 9fe475f4aa..7199691ae6 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -28,10 +28,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables Size = new Vector2(16) * sliderTick.Scale; - // The containing DrawableSlider is updated before us and clears our transforms, so we need to be - // present to get updated and have UpdateState correctly called when rewinding. - AlwaysPresent = true; - Masking = true; CornerRadius = Size.X / 2; diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 091af04106..99b62f265d 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -215,6 +215,9 @@ namespace osu.Game.Rulesets.Objects.Drawables nestedHitObjects.Add(h); } + protected override bool AllowStateTransformByParent => false; + protected override bool AllowTransformClearByParent => false; + protected abstract void UpdateState(ArmedState state); } } From 66ee9d163188908c7084bc77635222ec214f8847 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 9 Nov 2017 17:04:04 +0900 Subject: [PATCH 135/166] Update in-line with framework changes --- osu-framework | 2 +- .../Objects/Drawables/DrawableOsuHitObject.cs | 9 +++++++-- osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs | 3 --- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/osu-framework b/osu-framework index b70ca3de9e..ff1e04024d 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit b70ca3de9ec1a8eb7fb73fcfd169ff38d00b07cd +Subproject commit ff1e04024d16c0a6cabec7792573b0d019bd1bba diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs index e968e5b9df..3e0c23a1ab 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -25,8 +25,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { double transformTime = HitObject.StartTime - TIME_PREEMPT; - TransformStateTo(transformTime, true); - ClearTransformsAfter(transformTime, true); + base.ApplyTransformsAt(transformTime, true); + base.ClearTransformsAfter(transformTime, true); using (BeginAbsoluteSequence(transformTime, true)) { @@ -46,6 +46,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { } + // Todo: At some point we need to move these to DrawableHitObject after ensuring that all other Rulesets apply + // transforms in the same way and don't rely on them not being cleared + public override void ClearTransformsAfter(double time, bool propagateChildren = false, string targetMember = null) { } + public override void ApplyTransformsAt(double time, bool propagateChildren = false) { } + private OsuInputManager osuActionInputManager; internal OsuInputManager OsuActionInputManager => osuActionInputManager ?? (osuActionInputManager = GetContainingInputManager() as OsuInputManager); } diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 99b62f265d..091af04106 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -215,9 +215,6 @@ namespace osu.Game.Rulesets.Objects.Drawables nestedHitObjects.Add(h); } - protected override bool AllowStateTransformByParent => false; - protected override bool AllowTransformClearByParent => false; - protected abstract void UpdateState(ArmedState state); } } From 4874371dbffa6e568ddaf9aeda94c07c2e40ccac Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 9 Nov 2017 17:38:20 +0900 Subject: [PATCH 136/166] Rename methods back --- osu.Game/Screens/Loader.cs | 4 ++-- osu.Game/Screens/Menu/Intro.cs | 4 ++-- osu.Game/Screens/Menu/MainMenu.cs | 6 +++--- osu.Game/Screens/OsuScreen.cs | 14 +++++++------- osu.Game/Screens/Play/PlayerLoader.cs | 4 ++-- osu.Game/Screens/Select/SongSelect.cs | 8 ++++---- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index 8c70e2421b..8fe6b2c5a2 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -17,9 +17,9 @@ namespace osu.Game.Screens ValidForResume = false; } - protected override void OnArrivedLogo(OsuLogo logo, bool resuming) + protected override void LogoArriving(OsuLogo logo, bool resuming) { - base.OnArrivedLogo(logo, resuming); + base.LogoArriving(logo, resuming); logo.RelativePositionAxes = Axes.Both; logo.Triangles = false; diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 2cd51f05db..70c2430e10 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -109,9 +109,9 @@ namespace osu.Game.Screens.Menu public const int EXIT_DELAY = 3000; - protected override void OnArrivedLogo(OsuLogo logo, bool resuming) + protected override void LogoArriving(OsuLogo logo, bool resuming) { - base.OnArrivedLogo(logo, resuming); + base.LogoArriving(logo, resuming); logo.RelativePositionAxes = Axes.Both; diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 6f01199a60..8b9dd38a7b 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -103,9 +103,9 @@ namespace osu.Game.Screens.Menu Beatmap.ValueChanged += beatmap_ValueChanged; } - protected override void OnArrivedLogo(OsuLogo logo, bool resuming) + protected override void LogoArriving(OsuLogo logo, bool resuming) { - base.OnArrivedLogo(logo, resuming); + base.LogoArriving(logo, resuming); buttons.SetOsuLogo(logo); @@ -119,7 +119,7 @@ namespace osu.Game.Screens.Menu buttons.State = MenuState.TopLevel; } - protected override void OnSuspendingLogo(OsuLogo logo) + protected override void LogoSuspending(OsuLogo logo) { logo.FadeOut(300, Easing.InSine) .ScaleTo(0.2f, 300, Easing.InSine) diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 2693ad97fa..3dd175ca88 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -76,7 +76,7 @@ namespace osu.Game.Screens protected override void OnResuming(Screen last) { base.OnResuming(last); - logo.DelayUntilTransformsFinished().Schedule(() => OnArrivedLogo(logo, true)); + logo.DelayUntilTransformsFinished().Schedule(() => LogoArriving(logo, true)); sampleExit?.Play(); } @@ -122,7 +122,7 @@ namespace osu.Game.Screens base.OnEntering(last); - logo.DelayUntilTransformsFinished().Schedule(() => OnArrivedLogo(logo, false)); + logo.DelayUntilTransformsFinished().Schedule(() => LogoArriving(logo, false)); } protected override bool OnExiting(Screen next) @@ -151,7 +151,7 @@ namespace osu.Game.Screens /// /// Fired when this screen was entered or resumed and the logo state is required to be adjusted. /// - protected virtual void OnArrivedLogo(OsuLogo logo, bool resuming) + protected virtual void LogoArriving(OsuLogo logo, bool resuming) { logo.Action = null; logo.FadeOut(300, Easing.OutQuint); @@ -160,26 +160,26 @@ namespace osu.Game.Screens private void onExitingLogo() { logo.ClearTransforms(); - OnExitingLogo(logo); + LogoExiting(logo); } /// /// Fired when this screen was exited to add any outwards transition to the logo. /// - protected virtual void OnExitingLogo(OsuLogo logo) + protected virtual void LogoExiting(OsuLogo logo) { } private void onSuspendingLogo() { logo.ClearTransforms(); - OnSuspendingLogo(logo); + LogoSuspending(logo); } /// /// Fired when this screen was suspended to add any outwards transition to the logo. /// - protected virtual void OnSuspendingLogo(OsuLogo logo) + protected virtual void LogoSuspending(OsuLogo logo) { } } diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index 6e96fb8b71..53a2dcc41f 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -95,9 +95,9 @@ namespace osu.Game.Screens.Play this.Delay(2150).Schedule(pushWhenLoaded); } - protected override void OnArrivedLogo(OsuLogo logo, bool resuming) + protected override void LogoArriving(OsuLogo logo, bool resuming) { - base.OnArrivedLogo(logo, resuming); + base.LogoArriving(logo, resuming); logo.ClearTransforms(targetMember: nameof(Position)); logo.RelativePositionAxes = Axes.Both; diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 11e7d452fa..987fef2541 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -311,9 +311,9 @@ namespace osu.Game.Screens.Select private const double logo_transition = 250; - protected override void OnArrivedLogo(OsuLogo logo, bool resuming) + protected override void LogoArriving(OsuLogo logo, bool resuming) { - base.OnArrivedLogo(logo, resuming); + base.LogoArriving(logo, resuming); logo.ClearTransforms(); logo.RelativePositionAxes = Axes.Both; @@ -337,9 +337,9 @@ namespace osu.Game.Screens.Select logo.Action = () => carouselRaisedStart(); } - protected override void OnExitingLogo(OsuLogo logo) + protected override void LogoExiting(OsuLogo logo) { - base.OnExitingLogo(logo); + base.LogoExiting(logo); logo.ScaleTo(0.2f, logo_transition, Easing.OutQuint); logo.FadeOut(logo_transition, Easing.OutQuint); } From 6d56b3c2df8f59f21298580ea5f10ba9c56f0e53 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 9 Nov 2017 17:52:38 +0900 Subject: [PATCH 137/166] Hide triangles during outro --- osu.Game/Screens/Menu/Intro.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 85dc13747f..0445733b23 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -116,8 +116,6 @@ namespace osu.Game.Screens.Menu base.LogoArriving(logo, resuming); logo.RelativePositionAxes = Axes.Both; - - logo.Triangles = true; logo.Colour = Color4.White; logo.Ripple = false; @@ -129,12 +127,16 @@ namespace osu.Game.Screens.Menu if (!resuming) { + logo.Triangles = true; + logo.ScaleTo(1); logo.FadeIn(); logo.PlayIntro(); } else { + logo.Triangles = false; + logo .ScaleTo(1, initialMovementTime, Easing.OutQuint) .FadeIn(quick_appear, Easing.OutQuint) From 598e1652dcdfebfa6fb9e9df0cc6ba464a649960 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 9 Nov 2017 18:12:33 +0900 Subject: [PATCH 138/166] Adjust timings --- osu.Game/Screens/Menu/IntroSequence.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index f8886f8dc1..5fca389708 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -214,8 +214,8 @@ namespace osu.Game.Screens.Menu using (BeginDelayedSequence(length * 0.56, true)) { - bigRing.ResizeTo(logo_size * 0.86f, 500, Easing.InOutQuint); - bigRing.Foreground.Delay(250).ResizeTo(1, 450, Easing.OutExpo); + bigRing.ResizeTo(logo_size, 500, Easing.InOutQuint); + bigRing.Foreground.Delay(250).ResizeTo(1, 850, Easing.OutQuint); using (BeginDelayedSequence(250, true)) { From 724540ceaa614d4b3817410c721ed16432f97055 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 9 Nov 2017 20:33:39 +0900 Subject: [PATCH 139/166] Fix toolbar not appearing at main menu --- osu.Game/Screens/Menu/ButtonSystem.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 33d118d12e..af16fbd71c 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -263,17 +263,15 @@ namespace osu.Game.Screens.Menu logo.ScaleTo(0.5f, 200, Easing.In); trackingPosition = false; + logo .MoveTo(iconTrackingPosition, lastState == MenuState.EnteringMode ? 0 : 200, Easing.In) .OnComplete(o => { trackingPosition = true; - if (logo.Scale.X > 0.5f) - { - o.Impact(); - toolbar?.Show(); - } + o.Impact(); + toolbar?.Show(); }); break; default: From c9353e37950ca5268d6f2ffa26495d0a3b49fc3b Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Thu, 9 Nov 2017 15:49:17 +0300 Subject: [PATCH 140/166] Fix humanizer package path --- osu.Game/osu.Game.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index ab8112504d..97d2879ae0 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -89,7 +89,7 @@ True - ..\packages\Humanizer.Core.2.2.0\lib\netstandard1.0\Humanizer.dll + $(SolutionDir)\packages\Humanizer.Core.2.2.0\lib\netstandard1.0\Humanizer.dll $(SolutionDir)\packages\Microsoft.Data.Sqlite.Core.2.0.0\lib\netstandard2.0\Microsoft.Data.Sqlite.dll From a9b58a2ad24d3e08b43628c691c459091e0946a5 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Thu, 9 Nov 2017 17:12:06 +0300 Subject: [PATCH 141/166] Drawable score visual improvements --- .../Ranks/DrawablePerformanceScore.cs | 2 +- .../Profile/Sections/Ranks/DrawableScore.cs | 142 +++++++++++++----- .../Sections/Ranks/DrawableTotalScore.cs | 2 +- .../Sections/Ranks/PaginatedScoreContainer.cs | 3 - osu.Game/Overlays/UserProfileOverlay.cs | 2 +- 5 files changed, 110 insertions(+), 41 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs index 0380b6c4b7..e6ba5b26ac 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs @@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks } [BackgroundDependencyLoader] - private new void load(OsuColour colour) + private void load(OsuColour colour) { double pp = Score.PP ?? 0; Stats.Add(new OsuSpriteText diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs index 91f5650b92..4fc15a202b 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableScore.cs @@ -7,7 +7,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics; -using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Rulesets.Mods; using osu.Game.Screens.Select.Leaderboards; @@ -15,66 +14,113 @@ using System.Linq; using osu.Framework.Localisation; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; +using OpenTK.Graphics; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Cursor; +using osu.Framework.Input; +using osu.Framework.Extensions.Color4Extensions; +using osu.Game.Graphics.Containers; namespace osu.Game.Overlays.Profile.Sections.Ranks { public abstract class DrawableScore : Container { + private const int fade_duration = 200; + protected readonly FillFlowContainer Stats; private readonly FillFlowContainer metadata; private readonly ModContainer modContainer; protected readonly Score Score; + private readonly Box underscoreLine; + private readonly Box coloredBackground; + private readonly Container background; protected DrawableScore(Score score) { Score = score; + RelativeSizeAxes = Axes.X; + Height = 60; Children = new Drawable[] { - new DrawableRank(score.Rank) + background = new Container { - RelativeSizeAxes = Axes.Y, - Width = 60, - FillMode = FillMode.Fit, - }, - Stats = new FillFlowContainer - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreRight, - Direction = FillDirection.Vertical, - }, - metadata = new FillFlowContainer - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Anchor = Anchor.CentreLeft, - Origin = Anchor.CentreLeft, - Margin = new MarginPadding { Left = 70 }, - Direction = FillDirection.Vertical, - Child = new OsuSpriteText + RelativeSizeAxes = Axes.Both, + Masking = true, + CornerRadius = 3, + Alpha = 0, + EdgeEffect = new EdgeEffectParameters { - Text = score.Date.LocalDateTime.ToShortDateString(), - TextSize = 11, - Colour = OsuColour.Gray(0xAA), - Depth = -1, + Type = EdgeEffectType.Shadow, + Offset = new Vector2(0f, 1f), + Radius = 1f, + Colour = Color4.Black.Opacity(0.2f), }, + Child = coloredBackground = new Box { RelativeSizeAxes = Axes.Both } }, - modContainer = new ModContainer + new Container { - AutoSizeAxes = Axes.Y, - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreRight, - Width = 60, - Margin = new MarginPadding { Right = 150 } - } + RelativeSizeAxes = Axes.Both, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Width = 0.97f, + Children = new Drawable[] + { + underscoreLine = new Box + { + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + RelativeSizeAxes = Axes.X, + Height = 1, + }, + new DrawableRank(score.Rank) + { + RelativeSizeAxes = Axes.Y, + Width = 60, + FillMode = FillMode.Fit, + }, + Stats = new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight, + Direction = FillDirection.Vertical, + }, + metadata = new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Margin = new MarginPadding { Left = 70 }, + Direction = FillDirection.Vertical, + Child = new OsuSpriteText + { + Text = score.Date.LocalDateTime.ToShortDateString(), + TextSize = 11, + Colour = OsuColour.Gray(0xAA), + Depth = -1, + }, + }, + modContainer = new ModContainer + { + AutoSizeAxes = Axes.Y, + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight, + Width = 60, + Margin = new MarginPadding { Right = 160 } + } + } + }, }; } [BackgroundDependencyLoader(true)] private void load(OsuColour colour, LocalisationEngine locale, BeatmapSetOverlay beatmapSetOverlay) { + coloredBackground.Colour = underscoreLine.Colour = colour.Gray4; + Stats.Add(new OsuSpriteText { Text = $"accuracy: {Score.Accuracy:P2}", @@ -86,7 +132,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks Depth = -1, }); - metadata.Add(new OsuHoverContainer + metadata.Add(new MetadataContainer(Score.Beatmap.Metadata.Title, Score.Beatmap.Metadata.Artist) { AutoSizeAxes = Axes.Both, Action = () => @@ -126,6 +172,22 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks }); } + protected override bool OnClick(InputState state) => true; + + protected override bool OnHover(InputState state) + { + background.FadeIn(fade_duration, Easing.OutQuint); + underscoreLine.FadeOut(fade_duration, Easing.OutQuint); + return true; + } + + protected override void OnHoverLost(InputState state) + { + background.FadeOut(fade_duration, Easing.OutQuint); + underscoreLine.FadeIn(fade_duration, Easing.OutQuint); + base.OnHoverLost(state); + } + private class ModContainer : FlowContainer { protected override IEnumerable ComputeLayoutPositions() @@ -135,5 +197,15 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks yield return new Vector2(DrawWidth * i * (count == 1 ? 0 : 1f / (count - 1)), 0); } } + + private class MetadataContainer : OsuHoverContainer, IHasTooltip + { + public string TooltipText { get; set; } + + public MetadataContainer(string title, string artist) + { + TooltipText = $"{artist} - {title}"; + } + } } } diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs index 7aa9d75f02..537b208b39 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs @@ -16,7 +16,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks } [BackgroundDependencyLoader] - private new void load() + private void load() { Stats.Add(new OsuSpriteText { diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs b/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs index 060bb03014..bab78b52fd 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs @@ -140,9 +140,6 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks break; } - drawableScore.RelativeSizeAxes = Axes.X; - drawableScore.Height = 60; - scoreContainer.Add(drawableScore); } }; diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index 5032f2d55b..32c8a83b02 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -91,7 +91,7 @@ namespace osu.Game.Overlays sections = new ProfileSection[] { - new AboutSection(), + //new AboutSection(), //new RecentSection(), new RanksSection(), //new MedalsSection(), From 5eb94f7e68be77e78b836f194daaa91e6e32d993 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 9 Nov 2017 23:24:14 +0900 Subject: [PATCH 142/166] Fix loader pushing children screens before it is displayed itself --- osu.Game/Screens/Loader.cs | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index faa8b7e40a..3afaa02824 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -5,11 +5,14 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Screens.Menu; using OpenTK; +using osu.Framework.Screens; namespace osu.Game.Screens { public class Loader : OsuScreen { + private bool showDisclaimer; + public override bool ShowOverlays => false; public Loader() @@ -21,21 +24,40 @@ namespace osu.Game.Screens { base.LogoArriving(logo, resuming); - logo.RelativePositionAxes = Axes.Both; + logo.RelativePositionAxes = Axes.None; logo.Triangles = false; - logo.Position = new Vector2(0.9f); + logo.Origin = Anchor.BottomRight; + logo.Anchor = Anchor.BottomRight; + logo.Position = new Vector2(-40); logo.Scale = new Vector2(0.2f); logo.FadeInFromZero(5000, Easing.OutQuint); } - [BackgroundDependencyLoader] - private void load(OsuGameBase game) + protected override void OnEntering(Screen last) { - if (game.IsDeployedBuild) + base.OnEntering(last); + + if (showDisclaimer) LoadComponentAsync(new Disclaimer(), d => Push(d)); else LoadComponentAsync(new Intro(), d => Push(d)); } + + protected override void LogoSuspending(OsuLogo logo) + { + base.LogoSuspending(logo); + logo.FadeOut(100).OnComplete(l => + { + l.Anchor = Anchor.TopLeft; + l.Origin = Anchor.Centre; + }); + } + + [BackgroundDependencyLoader] + private void load(OsuGameBase game) + { + showDisclaimer = game.IsDeployedBuild; + } } } From 9e82fc21acd3bf57311d5dc08a9708acf74776f2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 10 Nov 2017 01:10:40 +0900 Subject: [PATCH 143/166] Improve transition when exiting song select Reduces the delay before the main menu appears, but also synchronises the full main menu appearance animation with the logo's apperance. --- osu.Game/Screens/Menu/MainMenu.cs | 18 ++++++++++-------- osu.Game/Screens/Select/SongSelect.cs | 4 ++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 691e8eab04..b0170edfe1 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -119,7 +119,16 @@ namespace osu.Game.Screens.Menu logo.FadeIn(100, Easing.OutQuint); if (resuming) + { buttons.State = MenuState.TopLevel; + + const float length = 300; + + Content.FadeIn(length, Easing.OutQuint); + Content.MoveTo(new Vector2(0, 0), length, Easing.OutQuint); + + sideFlashes.Delay(length).FadeIn(64, Easing.InQuint); + } } protected override void LogoSuspending(OsuLogo logo) @@ -148,7 +157,7 @@ namespace osu.Game.Screens.Menu Content.FadeOut(length, Easing.InSine); Content.MoveTo(new Vector2(-800, 0), length, Easing.InSine); - sideFlashes.FadeOut(length / 4, Easing.OutQuint); + sideFlashes.FadeOut(64, Easing.OutQuint); } protected override void OnResuming(Screen last) @@ -159,13 +168,6 @@ namespace osu.Game.Screens.Menu //we may have consumed our preloaded instance, so let's make another. preloadSongSelect(); - - const float length = 300; - - Content.FadeIn(length, Easing.OutQuint); - Content.MoveTo(new Vector2(0, 0), length, Easing.OutQuint); - - sideFlashes.FadeIn(length / 4, Easing.InQuint); } protected override bool OnExiting(Screen next) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 987fef2541..121a53f699 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -340,8 +340,8 @@ namespace osu.Game.Screens.Select protected override void LogoExiting(OsuLogo logo) { base.LogoExiting(logo); - logo.ScaleTo(0.2f, logo_transition, Easing.OutQuint); - logo.FadeOut(logo_transition, Easing.OutQuint); + logo.ScaleTo(0.2f, logo_transition / 2, Easing.Out); + logo.FadeOut(logo_transition / 2, Easing.Out); } private void beatmap_ValueChanged(WorkingBeatmap beatmap) From bc54d4dd4fa9e4dd7bd159c220fa4ea376aaaa0f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 10 Nov 2017 18:32:15 +0900 Subject: [PATCH 144/166] Ensure we wait for audio track reset before proceeding with player execution --- osu.Game/Screens/Play/Player.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 3775b9c933..fe26e4a1d1 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -17,6 +17,8 @@ using osu.Game.Rulesets.UI; using osu.Game.Screens.Backgrounds; using System; using System.Linq; +using System.Threading; +using System.Threading.Tasks; using osu.Framework.Threading; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Scoring; @@ -142,14 +144,21 @@ namespace osu.Game.Screens.Play userAudioOffset.ValueChanged += v => offsetClock.Offset = v; userAudioOffset.TriggerChange(); - Schedule(() => + Task.Run(() => { adjustableSourceClock.Reset(); - foreach (var mod in working.Mods.Value.OfType()) - mod.ApplyToClock(adjustableSourceClock); + // this is temporary until we have blocking (async.Wait()) audio component methods. + // then we can call ResetAsync().Wait() or the blocking version above. + while (adjustableSourceClock.IsRunning) + Thread.Sleep(1); - decoupledClock.ChangeSource(adjustableSourceClock); + Schedule(() => + { + decoupledClock.ChangeSource(adjustableSourceClock); + foreach (var mod in working.Mods.Value.OfType()) + mod.ApplyToClock(adjustableSourceClock); + }); }); Children = new Drawable[] From 819b0b1970dec8a409850834a1c4e824528ab840 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 10 Nov 2017 18:48:46 +0900 Subject: [PATCH 145/166] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index db625dc65f..5e26808ec7 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit db625dc65fb7ae9be154b03a0968b2f8cedb036d +Subproject commit 5e26808ec77a8fd600cb1cdca3a4b2f62fd0c653 From bd2de899183ebc28262a4466e35c3f2dc09991f9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 10 Nov 2017 19:26:25 +0900 Subject: [PATCH 146/166] Why weren't these fixed previously --- osu.Game.Rulesets.Taiko/Judgements/TaikoStrongHitJudgement.cs | 2 -- osu.Game/Screens/Play/BreaksOverlay/RemainingTimeCounter.cs | 1 - 2 files changed, 3 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongHitJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongHitJudgement.cs index 07c499b56c..e1fe19212b 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongHitJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongHitJudgement.cs @@ -1,8 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Rulesets.Objects.Drawables; - namespace osu.Game.Rulesets.Taiko.Judgements { public class TaikoStrongHitJudgement : TaikoJudgement diff --git a/osu.Game/Screens/Play/BreaksOverlay/RemainingTimeCounter.cs b/osu.Game/Screens/Play/BreaksOverlay/RemainingTimeCounter.cs index 9b043a6e90..0df7bb97e0 100644 --- a/osu.Game/Screens/Play/BreaksOverlay/RemainingTimeCounter.cs +++ b/osu.Game/Screens/Play/BreaksOverlay/RemainingTimeCounter.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 osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Framework.Graphics; using System; From 49731f4c050ed31ab155f4c3e8502801faf7c1ab Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 10 Nov 2017 19:32:09 +0900 Subject: [PATCH 147/166] Remove unused parmeter --- osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs b/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs index 6128a8f3d7..7ef1ef8d8a 100644 --- a/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs +++ b/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs @@ -121,14 +121,14 @@ namespace osu.Game.Screens.Play.BreaksOverlay using (BeginAbsoluteSequence(b.StartTime)) { - Schedule(() => showBreak(b)); + Schedule(showBreak); using (BeginDelayedSequence(b.Duration - fade_duration)) Schedule(hideBreak); } } } - private void showBreak(BreakPeriod b) + private void showBreak() { if (letterboxing) letterboxOverlay.Show(); From 5277c3c1647c86b33c04ee98ea35d1c54fe52aca Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 10 Nov 2017 22:11:25 +0900 Subject: [PATCH 148/166] Set the frame time appropriately to reverse judgements a little better --- osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs b/osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs index f0d68c0467..06f7259f78 100644 --- a/osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs +++ b/osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs @@ -104,7 +104,13 @@ namespace osu.Game.Rulesets.Replays { //if we changed frames, we want to execute once *exactly* on the frame's time. if (currentDirection == time.CompareTo(NextFrame.Time) && advanceFrame()) + { + // If going backwards, we need to execute once _before_ the frame time to reverse any judgements + // that would occur as a result of this frame in forward playback + if (currentDirection == -1) + return currentTime = CurrentFrame.Time - 1; return currentTime = CurrentFrame.Time; + } //if we didn't change frames, we need to ensure we are allowed to run frames in between, else return null. if (inImportantSection) From e742c07f7d3edaf3e703397493ad07f1268e2bae Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 10 Nov 2017 22:17:41 +0900 Subject: [PATCH 149/166] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 68e0072674..1a563d7ce0 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 68e0072674c4bbc4e608120f51cd1d7e91e9500c +Subproject commit 1a563d7ce0834cede2ef587762f98fe580badf3c From 3142832693d28ccc9e7c5d355c374554656a4b58 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 11 Nov 2017 13:00:29 +0900 Subject: [PATCH 150/166] Add precision to playback speed --- osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs index 7cabe1f3ab..bf2909b8ab 100644 --- a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs @@ -23,7 +23,8 @@ namespace osu.Game.Screens.Play.ReplaySettings { Default = 1, MinValue = 0.5, - MaxValue = 2 + MaxValue = 2, + Precision = 0.01, }, }; } From 7d4e1b6f22c9ee350b2cebde7a5cc5e9d8238fbb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 11 Nov 2017 13:00:54 +0900 Subject: [PATCH 151/166] Don't require a local storage variable for restoring playback speed --- osu.Game/Screens/Play/Player.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 2daf8f0765..59d56a5a44 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -51,7 +51,6 @@ namespace osu.Game.Screens.Play private IAdjustableClock adjustableSourceClock; private FramedOffsetClock offsetClock; private DecoupleableInterpolatingFramedClock decoupledClock; - private double clockRate; private PauseContainer pauseContainer; @@ -157,10 +156,7 @@ namespace osu.Game.Screens.Play Schedule(() => { decoupledClock.ChangeSource(adjustableSourceClock); - foreach (var mod in working.Mods.Value.OfType()) - mod.ApplyToClock(adjustableSourceClock); - - clockRate = adjustableSourceClock.Rate; + applyRateFromMods(); }); }); @@ -249,6 +245,13 @@ namespace osu.Game.Screens.Play scoreProcessor.Failed += onFail; } + private void applyRateFromMods() + { + adjustableSourceClock.Rate = 1; + foreach (var mod in Beatmap.Value.Mods.Value.OfType()) + mod.ApplyToClock(adjustableSourceClock); + } + private void initializeStoryboard(bool asyncLoad) { var beatmap = Beatmap.Value.Beatmap; @@ -346,8 +349,9 @@ namespace osu.Game.Screens.Play { if (HasFailed || !ValidForResume || pauseContainer?.AllowExit != false || RulesetContainer?.HasReplayLoaded != false) { - // We want to make sure we restore the clock rate - adjustableSourceClock.Rate = clockRate; + // In the case of replays, we may have changed the playback rate. + applyRateFromMods(); + fadeOut(); return base.OnExiting(next); } From 9e447fcb271fd7ea8391fd38ab31331a2adf2b9e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 11 Nov 2017 15:53:01 +0900 Subject: [PATCH 152/166] Update framework an resources --- osu-framework | 2 +- osu-resources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 1a563d7ce0..36fad894f0 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 1a563d7ce0834cede2ef587762f98fe580badf3c +Subproject commit 36fad894f0657d0fdc998ffd3f2f3fa87e45d67d diff --git a/osu-resources b/osu-resources index a4418111f8..1750ab8f67 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit a4418111f8ed2350a6fd46fe69258884f0757745 +Subproject commit 1750ab8f6761ab35592fd46da71fbe0c141bfd93 From 3d6bb3befec25e93a3b47c93960a4957b8bdd794 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 11 Nov 2017 22:53:50 +0900 Subject: [PATCH 153/166] Add startup argument to disable the version overlay --- osu.Desktop/OsuGameDesktop.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index 990dc789e6..3393bbf7fb 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -18,9 +18,12 @@ namespace osu.Desktop { internal class OsuGameDesktop : OsuGame { + private readonly bool noVersionOverlay; + public OsuGameDesktop(string[] args = null) : base(args) { + noVersionOverlay = args?.Any(a => a == "--no-version-overlay") ?? false; } public override Storage GetStorageForStableInstall() @@ -79,11 +82,14 @@ namespace osu.Desktop { base.LoadComplete(); - LoadComponentAsync(new VersionManager { Depth = int.MinValue }, v => + if (!noVersionOverlay) { - Add(v); - v.State = Visibility.Visible; - }); + LoadComponentAsync(new VersionManager { Depth = int.MinValue }, v => + { + Add(v); + v.State = Visibility.Visible; + }); + } } public override void SetHost(GameHost host) From ae9b7518e00bc3018577327079b0eabd603ee63a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 12 Nov 2017 21:07:14 +0900 Subject: [PATCH 154/166] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 36fad894f0..47aabeaee5 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 36fad894f0657d0fdc998ffd3f2f3fa87e45d67d +Subproject commit 47aabeaee5a8d85a0e6769fd601736f8dc1eb051 From 11077546d1404ae28c51358dde32fbbbc9e43945 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 12 Nov 2017 15:59:11 +0900 Subject: [PATCH 155/166] Load logo async --- osu.Game/Screens/OsuScreen.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 3dd175ca88..25c159ed40 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -118,7 +118,7 @@ namespace osu.Game.Screens } if ((logo = lastOsu?.logo) == null) - AddInternal(logo = new OsuLogo()); + LoadComponentAsync(logo = new OsuLogo(), AddInternal); base.OnEntering(last); From ec758379659e83226a63b747173e2cd17fc03205 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 13 Nov 2017 05:04:21 +0300 Subject: [PATCH 156/166] Replay speed setting visual improvements --- .../Play/ReplaySettings/PlaybackSettings.cs | 47 +++++++++++++++---- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs index bf2909b8ab..8aaf5b5711 100644 --- a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs @@ -3,6 +3,9 @@ using osu.Framework.Timing; using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Graphics.Sprites; namespace osu.Game.Screens.Play.ReplaySettings { @@ -13,19 +16,43 @@ namespace osu.Game.Screens.Play.ReplaySettings public IAdjustableClock AdjustableClock { set; get; } private readonly ReplaySliderBar sliderbar; + private readonly OsuSpriteText multiplierText; public PlaybackSettings() { - Child = sliderbar = new ReplaySliderBar + Children = new Drawable[] { - LabelText = "Playback speed", - Bindable = new BindableDouble(1) + new Container { - Default = 1, - MinValue = 0.5, - MaxValue = 2, - Precision = 0.01, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Children = new Drawable[] + { + new OsuSpriteText + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Text = "Playback speed", + }, + multiplierText = new OsuSpriteText + { + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight, + Text = "1x", + Font = @"Exo2.0-Bold", + } + }, }, + sliderbar = new ReplaySliderBar + { + Bindable = new BindableDouble(1) + { + Default = 1, + MinValue = 0.5, + MaxValue = 2, + Precision = 0.01, + }, + } }; } @@ -37,7 +64,11 @@ namespace osu.Game.Screens.Play.ReplaySettings return; var clockRate = AdjustableClock.Rate; - sliderbar.Bindable.ValueChanged += rateMultiplier => AdjustableClock.Rate = clockRate * rateMultiplier; + sliderbar.Bindable.ValueChanged += rateMultiplier => + { + AdjustableClock.Rate = clockRate * rateMultiplier; + multiplierText.Text = $"{rateMultiplier}x"; + }; } } } From 89e9f847532d0a8283fada2f568d49b616574a2d Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 13 Nov 2017 05:52:05 +0300 Subject: [PATCH 157/166] Add padding to the text container --- .../Screens/Play/ReplaySettings/PlaybackSettings.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs index 8aaf5b5711..71526d72ef 100644 --- a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs @@ -11,6 +11,8 @@ namespace osu.Game.Screens.Play.ReplaySettings { public class PlaybackSettings : ReplayGroup { + private const int padding = 10; + protected override string Title => @"playback"; public IAdjustableClock AdjustableClock { set; get; } @@ -26,6 +28,7 @@ namespace osu.Game.Screens.Play.ReplaySettings { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, + Padding = new MarginPadding { Horizontal = padding }, Children = new Drawable[] { new OsuSpriteText @@ -54,6 +57,8 @@ namespace osu.Game.Screens.Play.ReplaySettings }, } }; + + sliderbar.Bindable.ValueChanged += rateMultiplier => multiplierText.Text = $"{rateMultiplier}x"; } protected override void LoadComplete() @@ -64,11 +69,7 @@ namespace osu.Game.Screens.Play.ReplaySettings return; var clockRate = AdjustableClock.Rate; - sliderbar.Bindable.ValueChanged += rateMultiplier => - { - AdjustableClock.Rate = clockRate * rateMultiplier; - multiplierText.Text = $"{rateMultiplier}x"; - }; + sliderbar.Bindable.ValueChanged += rateMultiplier => AdjustableClock.Rate = clockRate * rateMultiplier; } } } From 51adea2a604350e7b66f7dad4c70406a57308ae4 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Mon, 13 Nov 2017 05:58:19 +0300 Subject: [PATCH 158/166] Convert text to a local variable --- osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs index 71526d72ef..3109552532 100644 --- a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs @@ -18,10 +18,11 @@ namespace osu.Game.Screens.Play.ReplaySettings public IAdjustableClock AdjustableClock { set; get; } private readonly ReplaySliderBar sliderbar; - private readonly OsuSpriteText multiplierText; public PlaybackSettings() { + OsuSpriteText multiplierText; + Children = new Drawable[] { new Container From e006090c5b26bfc26c9569b2eeaaaabaabf3cff5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 13 Nov 2017 13:13:43 +0900 Subject: [PATCH 159/166] Fix SpriteIcon loading textures on the update thread --- osu.Game/Graphics/SpriteIcon.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/osu.Game/Graphics/SpriteIcon.cs b/osu.Game/Graphics/SpriteIcon.cs index d4f9127d54..ca108bfa7a 100644 --- a/osu.Game/Graphics/SpriteIcon.cs +++ b/osu.Game/Graphics/SpriteIcon.cs @@ -57,11 +57,6 @@ namespace osu.Game.Graphics private void load(FontStore store) { this.store = store; - } - - protected override void LoadComplete() - { - base.LoadComplete(); updateTexture(); } From 8adf0a6db32ede8350df91963cf67d50818f0283 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 13 Nov 2017 13:58:44 +0900 Subject: [PATCH 160/166] Null-check in disposal of DatabasedKeyBindingInputManager --- osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs b/osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs index 6dedf7385b..bae14fc1dc 100644 --- a/osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs +++ b/osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs @@ -51,7 +51,9 @@ namespace osu.Game.Input.Bindings protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); - store.KeyBindingChanged -= ReloadMappings; + + if (store != null) + store.KeyBindingChanged -= ReloadMappings; } protected override void ReloadMappings() => KeyBindings = store.Query(ruleset?.ID, variant).ToList(); From ae8407a3f370d5c7df52c90d54f2b71ff98c36cf Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 13 Nov 2017 14:00:35 +0900 Subject: [PATCH 161/166] Fix nested hitobject judgements not being removed --- osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs | 1 + osu.Game/Rulesets/UI/RulesetContainer.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 091af04106..941cedca3f 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -212,6 +212,7 @@ namespace osu.Game.Rulesets.Objects.Drawables nestedHitObjects = new List>(); h.OnJudgement += (d, j) => OnJudgement?.Invoke(d, j); + h.OnJudgementRemoved += (d, j) => OnJudgementRemoved?.Invoke(d, j); nestedHitObjects.Add(h); } diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 36dce7218d..278814ea7e 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -242,7 +242,7 @@ namespace osu.Game.Rulesets.UI OnJudgement?.Invoke(j); }; - drawableObject.OnJudgementRemoved += (d, j) => { OnJudgementRemoved?.Invoke(j); }; + drawableObject.OnJudgementRemoved += (d, j) => OnJudgementRemoved?.Invoke(j); Playfield.Add(drawableObject); } From 0cec51110acbb2aa61cdd49489f0e3b5f5f50ceb Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 13 Nov 2017 17:52:16 +0900 Subject: [PATCH 162/166] Fix replay clock always running 1 frame behind * Fixes swells never completing. * Fixes forward playback missing notes every now and then. * Probably more stuff. --- osu.Game/Rulesets/UI/RulesetInputManager.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Rulesets/UI/RulesetInputManager.cs b/osu.Game/Rulesets/UI/RulesetInputManager.cs index 0419070b42..ddce60d819 100644 --- a/osu.Game/Rulesets/UI/RulesetInputManager.cs +++ b/osu.Game/Rulesets/UI/RulesetInputManager.cs @@ -148,6 +148,7 @@ namespace osu.Game.Rulesets.UI } clock.CurrentTime = newTime.Value; + Clock.ProcessFrame(); } requireMoreUpdateLoops = clock.CurrentTime != parentClock.CurrentTime; From 49a5af60e2fdfe15e60fa69feaf0cc5a03a1e1f5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 13 Nov 2017 18:43:05 +0900 Subject: [PATCH 163/166] Fix multiple order-of-execution issues with osu! logo Also sets better defaults. --- osu.Game/Screens/Loader.cs | 7 +------ osu.Game/Screens/Menu/Intro.cs | 2 -- osu.Game/Screens/Menu/MainMenu.cs | 3 --- osu.Game/Screens/Menu/OsuLogo.cs | 24 ++++++++++++++++++++++++ osu.Game/Screens/OsuScreen.cs | 19 +++++++++++-------- osu.Game/Screens/Play/PlayerLoader.cs | 1 - osu.Game/Screens/Select/SongSelect.cs | 2 -- 7 files changed, 36 insertions(+), 22 deletions(-) diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index 3afaa02824..ca541ea552 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -24,7 +24,6 @@ namespace osu.Game.Screens { base.LogoArriving(logo, resuming); - logo.RelativePositionAxes = Axes.None; logo.Triangles = false; logo.Origin = Anchor.BottomRight; logo.Anchor = Anchor.BottomRight; @@ -47,11 +46,7 @@ namespace osu.Game.Screens protected override void LogoSuspending(OsuLogo logo) { base.LogoSuspending(logo); - logo.FadeOut(100).OnComplete(l => - { - l.Anchor = Anchor.TopLeft; - l.Origin = Anchor.Centre; - }); + logo.FadeOut(100); } [BackgroundDependencyLoader] diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 0445733b23..0cb343c1ac 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -127,8 +127,6 @@ namespace osu.Game.Screens.Menu if (!resuming) { - logo.Triangles = true; - logo.ScaleTo(1); logo.FadeIn(); logo.PlayIntro(); diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index b0170edfe1..90f68ba9f1 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -112,9 +112,6 @@ namespace osu.Game.Screens.Menu buttons.SetOsuLogo(logo); - logo.Triangles = true; - logo.Ripple = false; - logo.FadeColour(Color4.White, 100, Easing.OutQuint); logo.FadeIn(100, Easing.OutQuint); diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index dccb910d86..fb8e755b61 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -221,6 +221,30 @@ namespace osu.Game.Screens.Menu }; } + /// + /// Schedule a new extenral animation. Handled queueing and finishing previous animations in a sane way. + /// + /// The animation to be performed + /// If true, the new animation is delayed until all previous transforms finish. If false, existing transformed are cleared. + internal void AppendAnimatingAction(Action action, bool waitForPrevious) + { + Action runnableAction = () => + { + if (waitForPrevious) + this.DelayUntilTransformsFinished().Schedule(action); + else + { + ClearTransforms(); + action(); + } + }; + + if (IsLoaded) + runnableAction(); + else + Schedule(() => runnableAction()); + } + [BackgroundDependencyLoader] private void load(TextureStore textures, AudioManager audio) { diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 25c159ed40..f5ff9ea036 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -76,7 +76,7 @@ namespace osu.Game.Screens protected override void OnResuming(Screen last) { base.OnResuming(last); - logo.DelayUntilTransformsFinished().Schedule(() => LogoArriving(logo, true)); + logo.AppendAnimatingAction(() => LogoArriving(logo, true), true); sampleExit?.Play(); } @@ -118,11 +118,11 @@ namespace osu.Game.Screens } if ((logo = lastOsu?.logo) == null) - LoadComponentAsync(logo = new OsuLogo(), AddInternal); + LoadComponentAsync(logo = new OsuLogo { Alpha = 0 }, AddInternal); + + logo.AppendAnimatingAction(() => LogoArriving(logo, false), true); base.OnEntering(last); - - logo.DelayUntilTransformsFinished().Schedule(() => LogoArriving(logo, false)); } protected override bool OnExiting(Screen next) @@ -155,12 +155,16 @@ namespace osu.Game.Screens { logo.Action = null; logo.FadeOut(300, Easing.OutQuint); + logo.Anchor = Anchor.TopLeft; + logo.Origin = Anchor.Centre; + logo.RelativePositionAxes = Axes.None; + logo.Triangles = true; + logo.Ripple = true; } private void onExitingLogo() { - logo.ClearTransforms(); - LogoExiting(logo); + logo.AppendAnimatingAction(() => { LogoExiting(logo); }, false); } /// @@ -172,8 +176,7 @@ namespace osu.Game.Screens private void onSuspendingLogo() { - logo.ClearTransforms(); - LogoSuspending(logo); + logo.AppendAnimatingAction(() => { LogoSuspending(logo); }, false); } /// diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index 53a2dcc41f..de67bef004 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -99,7 +99,6 @@ namespace osu.Game.Screens.Play { base.LogoArriving(logo, resuming); - logo.ClearTransforms(targetMember: nameof(Position)); logo.RelativePositionAxes = Axes.Both; logo.ScaleTo(new Vector2(0.15f), 300, Easing.In); diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 121a53f699..5500d06136 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -315,9 +315,7 @@ namespace osu.Game.Screens.Select { base.LogoArriving(logo, resuming); - logo.ClearTransforms(); logo.RelativePositionAxes = Axes.Both; - Vector2 position = new Vector2(0.95f, 0.96f); if (logo.Alpha > 0.8f) From 495155874cf7fa4e4d0d7cb749c09fabd2799529 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 13 Nov 2017 19:02:53 +0900 Subject: [PATCH 164/166] Make sure that the clock is only updated once per time value --- osu-framework | 2 +- osu.Game/Rulesets/UI/RulesetInputManager.cs | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 47aabeaee5..81a3551886 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 47aabeaee5a8d85a0e6769fd601736f8dc1eb051 +Subproject commit 81a35518860cc533c4bf55b407c4e63d47ad11ce diff --git a/osu.Game/Rulesets/UI/RulesetInputManager.cs b/osu.Game/Rulesets/UI/RulesetInputManager.cs index ddce60d819..8c4d6de1fe 100644 --- a/osu.Game/Rulesets/UI/RulesetInputManager.cs +++ b/osu.Game/Rulesets/UI/RulesetInputManager.cs @@ -76,6 +76,8 @@ namespace osu.Game.Rulesets.UI #region Clock control + protected override bool ShouldProcessClock => false; // We handle processing the clock ourselves + private ManualClock clock; private IFrameBasedClock parentClock; @@ -148,10 +150,15 @@ namespace osu.Game.Rulesets.UI } clock.CurrentTime = newTime.Value; - Clock.ProcessFrame(); } requireMoreUpdateLoops = clock.CurrentTime != parentClock.CurrentTime; + + // The manual clock time has changed in the above code. The framed clock now needs to be updated + // to ensure that the its time is valid for our children before input is processed + Clock.ProcessFrame(); + + // Process input base.Update(); } From a2cb9d4086a70f72c735d942b9756d2d4a11cb19 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 13 Nov 2017 19:43:00 +0900 Subject: [PATCH 165/166] Fix audio not playing during player loading Regression due to changed audio initialisation logic. --- osu.Game/Screens/Play/Player.cs | 38 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 59d56a5a44..675d20fe63 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -144,22 +144,6 @@ namespace osu.Game.Screens.Play userAudioOffset.ValueChanged += v => offsetClock.Offset = v; userAudioOffset.TriggerChange(); - Task.Run(() => - { - adjustableSourceClock.Reset(); - - // this is temporary until we have blocking (async.Wait()) audio component methods. - // then we can call ResetAsync().Wait() or the blocking version above. - while (adjustableSourceClock.IsRunning) - Thread.Sleep(1); - - Schedule(() => - { - decoupledClock.ChangeSource(adjustableSourceClock); - applyRateFromMods(); - }); - }); - Children = new Drawable[] { storyboardContainer = new Container @@ -329,10 +313,26 @@ namespace osu.Game.Screens.Play .Delay(250) .FadeIn(250); - this.Delay(750).Schedule(() => + Task.Run(() => { - if (!pauseContainer.IsPaused) - decoupledClock.Start(); + adjustableSourceClock.Reset(); + + // this is temporary until we have blocking (async.Wait()) audio component methods. + // then we can call ResetAsync().Wait() or the blocking version above. + while (adjustableSourceClock.IsRunning) + Thread.Sleep(1); + + Schedule(() => + { + decoupledClock.ChangeSource(adjustableSourceClock); + applyRateFromMods(); + + this.Delay(750).Schedule(() => + { + if (!pauseContainer.IsPaused) + decoupledClock.Start(); + }); + }); }); pauseContainer.Alpha = 0; From 952530e1a8fe6cb2235263584ce38a8a026f68e1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 13 Nov 2017 20:03:58 +0900 Subject: [PATCH 166/166] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 81a3551886..c95b9350ed 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 81a35518860cc533c4bf55b407c4e63d47ad11ce +Subproject commit c95b9350edb6305cfefdf08f902f6f73d336736b