From 5dc495e41dac27e8f4954c1da82f56830764ae54 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 28 Oct 2016 21:08:32 +0900 Subject: [PATCH 01/25] Avoid accessing the beatmap too early. --- osu.Game/Beatmaps/WorkingBeatmap.cs | 10 +++++----- osu.Game/GameModes/Play/PlaySongSelect.cs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 04c9cadd88..4deed53465 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -12,7 +12,7 @@ namespace osu.Game.Beatmaps { public class WorkingBeatmap : IDisposable { - private BeatmapInfo beatmapInfo; + public BeatmapInfo BeatmapInfo; public readonly ArchiveReader Reader; @@ -25,7 +25,7 @@ namespace osu.Game.Beatmaps try { - using (var stream = new StreamReader(Reader.ReadFile(beatmapInfo.Path))) + using (var stream = new StreamReader(Reader.ReadFile(BeatmapInfo.Path))) beatmap = BeatmapDecoder.GetDecoder(stream)?.Decode(stream); } catch { } @@ -44,7 +44,7 @@ namespace osu.Game.Beatmaps try { - var trackData = Reader.ReadFile(beatmapInfo.Metadata.AudioFile); + var trackData = Reader.ReadFile(BeatmapInfo.Metadata.AudioFile); if (trackData != null) track = new AudioTrackBass(trackData); } @@ -57,7 +57,7 @@ namespace osu.Game.Beatmaps public WorkingBeatmap(BeatmapInfo beatmapInfo = null, ArchiveReader reader = null) { - this.beatmapInfo = beatmapInfo; + this.BeatmapInfo = beatmapInfo; Reader = reader; } @@ -80,7 +80,7 @@ namespace osu.Game.Beatmaps public void TransferTo(WorkingBeatmap working) { - if (track != null && working.beatmapInfo.Metadata.AudioFile == beatmapInfo.Metadata.AudioFile && working.beatmapInfo.BeatmapSet.Path == beatmapInfo.BeatmapSet.Path) + if (track != null && working.BeatmapInfo.Metadata.AudioFile == BeatmapInfo.Metadata.AudioFile && working.BeatmapInfo.BeatmapSet.Path == BeatmapInfo.BeatmapSet.Path) working.track = track; } } diff --git a/osu.Game/GameModes/Play/PlaySongSelect.cs b/osu.Game/GameModes/Play/PlaySongSelect.cs index 4b7bf54fc6..ba2e993b8e 100644 --- a/osu.Game/GameModes/Play/PlaySongSelect.cs +++ b/osu.Game/GameModes/Play/PlaySongSelect.cs @@ -169,7 +169,7 @@ namespace osu.Game.GameModes.Play protected override void OnBeatmapChanged(WorkingBeatmap beatmap) { base.OnBeatmapChanged(beatmap); - selectBeatmap(beatmap.Beatmap.BeatmapInfo); + selectBeatmap(beatmap.BeatmapInfo); } private void selectBeatmap(BeatmapInfo beatmap) @@ -192,7 +192,7 @@ namespace osu.Game.GameModes.Play { selectedBeatmapInfo = beatmap; - if (!beatmap.Equals(Beatmap?.Beatmap?.BeatmapInfo)) + if (!beatmap.Equals(Beatmap?.BeatmapInfo)) { Beatmap = database.GetWorkingBeatmap(beatmap, Beatmap); } From 42ad96778ef27803275149ac7e18d8d446d6f879 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 28 Oct 2016 23:27:59 +0900 Subject: [PATCH 02/25] Tidy shit up; reduce number of unnecssesary events being fired. --- osu.Game/Beatmaps/Drawable/BeatmapGroup.cs | 29 +++++++++++++--------- osu.Game/Beatmaps/Drawable/BeatmapPanel.cs | 4 +-- osu.Game/Beatmaps/Drawable/Panel.cs | 1 - osu.Game/GameModes/Play/PlaySongSelect.cs | 25 ++++++++++++++++--- 4 files changed, 40 insertions(+), 19 deletions(-) diff --git a/osu.Game/Beatmaps/Drawable/BeatmapGroup.cs b/osu.Game/Beatmaps/Drawable/BeatmapGroup.cs index 3b8c458110..9f83e62fcd 100644 --- a/osu.Game/Beatmaps/Drawable/BeatmapGroup.cs +++ b/osu.Game/Beatmaps/Drawable/BeatmapGroup.cs @@ -28,7 +28,7 @@ namespace osu.Game.Beatmaps.Drawable private BeatmapGroupState state; - public IEnumerable BeatmapPanels; + public List BeatmapPanels; public BeatmapGroupState State { @@ -43,9 +43,6 @@ namespace osu.Game.Beatmaps.Drawable difficulties.Show(); header.State = PanelSelectedState.Selected; - - if (SelectedPanel == null) - ((BeatmapPanel)difficulties.Children.FirstOrDefault()).State = PanelSelectedState.Selected; break; case BeatmapGroupState.Collapsed: FadeTo(0.5f, 250); @@ -66,13 +63,13 @@ namespace osu.Game.Beatmaps.Drawable RelativeSizeAxes = Axes.X; BeatmapPanels = beatmapSet.Beatmaps.Select(b => - new BeatmapPanel(this.beatmapSet, b) + new BeatmapPanel(b) { GainedSelection = panelGainedSelection, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, RelativeSizeAxes = Axes.X, - }); + }).ToList(); Children = new[] @@ -117,17 +114,25 @@ namespace osu.Game.Beatmaps.Drawable { State = BeatmapGroupState.Expanded; - SelectionChanged?.Invoke(this, SelectedPanel.Beatmap); + if (SelectedPanel == null) + BeatmapPanels.First().State = PanelSelectedState.Selected; } private void panelGainedSelection(BeatmapPanel panel) { - State = BeatmapGroupState.Expanded; - - if (SelectedPanel != null) SelectedPanel.State = PanelSelectedState.NotSelected; - SelectedPanel = panel; + try + { + if (SelectedPanel == panel) return; - SelectionChanged?.Invoke(this, panel.Beatmap); + if (SelectedPanel != null) + SelectedPanel.State = PanelSelectedState.NotSelected; + SelectedPanel = panel; + } + finally + { + State = BeatmapGroupState.Expanded; + SelectionChanged?.Invoke(this, panel.Beatmap); + } } } diff --git a/osu.Game/Beatmaps/Drawable/BeatmapPanel.cs b/osu.Game/Beatmaps/Drawable/BeatmapPanel.cs index 62b5f63335..cd28e909a8 100644 --- a/osu.Game/Beatmaps/Drawable/BeatmapPanel.cs +++ b/osu.Game/Beatmaps/Drawable/BeatmapPanel.cs @@ -26,7 +26,7 @@ namespace osu.Game.Beatmaps.Drawable GainedSelection?.Invoke(this); } - public BeatmapPanel(BeatmapSetInfo set, BeatmapInfo beatmap) + public BeatmapPanel(BeatmapInfo beatmap) { Beatmap = beatmap; Height *= 0.75f; @@ -67,7 +67,7 @@ namespace osu.Game.Beatmaps.Drawable }, new SpriteText { - Text = $" mapped by {(beatmap.Metadata ?? set.Metadata).Author}", + Text = $" mapped by {(beatmap.Metadata ?? beatmap.BeatmapSet.Metadata).Author}", TextSize = 16, }, } diff --git a/osu.Game/Beatmaps/Drawable/Panel.cs b/osu.Game/Beatmaps/Drawable/Panel.cs index 430c23836d..b0c0821197 100644 --- a/osu.Game/Beatmaps/Drawable/Panel.cs +++ b/osu.Game/Beatmaps/Drawable/Panel.cs @@ -37,7 +37,6 @@ namespace osu.Game.Beatmaps.Drawable set { if (state == value) return; - state = value; switch (state) diff --git a/osu.Game/GameModes/Play/PlaySongSelect.cs b/osu.Game/GameModes/Play/PlaySongSelect.cs index ba2e993b8e..1e2fb9a747 100644 --- a/osu.Game/GameModes/Play/PlaySongSelect.cs +++ b/osu.Game/GameModes/Play/PlaySongSelect.cs @@ -180,8 +180,13 @@ namespace osu.Game.GameModes.Play beatmapSetFlow.Children.Cast().First(b => { var panel = b.BeatmapPanels.FirstOrDefault(p => p.Beatmap.Equals(beatmap)); - panel?.TriggerClick(); - return panel != null; + if (panel != null) + { + panel.State = PanelSelectedState.Selected; + return true; + } + + return false; }); } @@ -228,8 +233,20 @@ namespace osu.Game.GameModes.Play { var group = new BeatmapGroup(beatmapSet) { SelectionChanged = selectionChanged }; beatmapSetFlow.Add(group); - if (beatmapSetFlow.Children.Count() == 1) - group.State = BeatmapGroupState.Expanded; + if (Beatmap == null) + { + if (beatmapSetFlow.Children.Count() == 1) + group.State = BeatmapGroupState.Expanded; + } + else + { + if (selectedBeatmapInfo?.Equals(Beatmap.BeatmapInfo) != true) + { + var panel = group.BeatmapPanels.FirstOrDefault(p => p.Beatmap.Equals(Beatmap.BeatmapInfo)); + if (panel != null) + panel.State = PanelSelectedState.Selected; + } + } }); } From f0e4a252a50dd05c6d2ac7aee684767ce29626f0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 28 Oct 2016 23:35:49 +0900 Subject: [PATCH 03/25] Add some warning comments. --- osu.Game/GameModes/Play/PlaySongSelect.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/GameModes/Play/PlaySongSelect.cs b/osu.Game/GameModes/Play/PlaySongSelect.cs index 1e2fb9a747..179436a0df 100644 --- a/osu.Game/GameModes/Play/PlaySongSelect.cs +++ b/osu.Game/GameModes/Play/PlaySongSelect.cs @@ -166,6 +166,9 @@ namespace osu.Game.GameModes.Play { } + /// + /// The global Beatmap was changed. + /// protected override void OnBeatmapChanged(WorkingBeatmap beatmap) { base.OnBeatmapChanged(beatmap); @@ -177,6 +180,7 @@ namespace osu.Game.GameModes.Play if (beatmap.Equals(selectedBeatmapInfo)) return; + //this is VERY temporary logic. beatmapSetFlow.Children.Cast().First(b => { var panel = b.BeatmapPanels.FirstOrDefault(p => p.Beatmap.Equals(beatmap)); From eb30882b0971ce6d00199198aacbeb6aaa58d0ee Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 28 Oct 2016 23:40:12 +0900 Subject: [PATCH 04/25] More comments. --- osu.Game/Beatmaps/Drawable/BeatmapGroup.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Beatmaps/Drawable/BeatmapGroup.cs b/osu.Game/Beatmaps/Drawable/BeatmapGroup.cs index 9f83e62fcd..21ec4fbde0 100644 --- a/osu.Game/Beatmaps/Drawable/BeatmapGroup.cs +++ b/osu.Game/Beatmaps/Drawable/BeatmapGroup.cs @@ -114,6 +114,7 @@ namespace osu.Game.Beatmaps.Drawable { State = BeatmapGroupState.Expanded; + //we want to make sure one of our children is selected in the case none have been selected yet. if (SelectedPanel == null) BeatmapPanels.First().State = PanelSelectedState.Selected; } From c969e0b4f0299f7908340bb63d227b29e7c289fe Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 29 Oct 2016 03:31:40 +0900 Subject: [PATCH 05/25] Remove forced disposal of WorkingBeatmap. --- osu.Game/GameModes/Play/Player.cs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/osu.Game/GameModes/Play/Player.cs b/osu.Game/GameModes/Play/Player.cs index e5aceeb5d8..5f3e2954a5 100644 --- a/osu.Game/GameModes/Play/Player.cs +++ b/osu.Game/GameModes/Play/Player.cs @@ -30,17 +30,6 @@ namespace osu.Game.GameModes.Play private InterpolatingFramedClock playerClock; private IAdjustableClock sourceClock; - protected override bool OnExiting(GameMode next) - { - if (next == null) - { - //eagerly dispose as the finalizer runs too late right now. - Beatmap?.Dispose(); - } - - return base.OnExiting(next); - } - public override void Load(BaseGame game) { base.Load(game); From d47924ff7b7a37c5160068c3e4e0e0ce97b5a181 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 29 Oct 2016 03:43:52 +0900 Subject: [PATCH 06/25] Fix selection not collapsing when clicking set headers exclusively. --- osu.Game/Beatmaps/Drawable/BeatmapGroup.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Beatmaps/Drawable/BeatmapGroup.cs b/osu.Game/Beatmaps/Drawable/BeatmapGroup.cs index 21ec4fbde0..ebc2ab447c 100644 --- a/osu.Game/Beatmaps/Drawable/BeatmapGroup.cs +++ b/osu.Game/Beatmaps/Drawable/BeatmapGroup.cs @@ -117,6 +117,8 @@ namespace osu.Game.Beatmaps.Drawable //we want to make sure one of our children is selected in the case none have been selected yet. if (SelectedPanel == null) BeatmapPanels.First().State = PanelSelectedState.Selected; + else + SelectionChanged?.Invoke(this, SelectedPanel.Beatmap); } private void panelGainedSelection(BeatmapPanel panel) From a2f995ebe0f16df9a122944cafcfe68740b0e543 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 29 Oct 2016 03:44:27 +0900 Subject: [PATCH 07/25] Remove forgotten parens. --- osu.Game/GameModes/Menu/Button.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/GameModes/Menu/Button.cs b/osu.Game/GameModes/Menu/Button.cs index e8fb4d848c..5599f25ad3 100644 --- a/osu.Game/GameModes/Menu/Button.cs +++ b/osu.Game/GameModes/Menu/Button.cs @@ -128,7 +128,7 @@ namespace osu.Game.GameModes.Menu LoopDelay = duration * 2 }); - icon.Transforms.Add(new TransformPosition() + icon.Transforms.Add(new TransformPosition { StartValue = Vector2.Zero, EndValue = new Vector2(0, -10), @@ -139,7 +139,7 @@ namespace osu.Game.GameModes.Menu LoopDelay = duration }); - icon.Transforms.Add(new TransformScale() + icon.Transforms.Add(new TransformScale { StartValue = new Vector2(1, 0.9f), EndValue = Vector2.One, @@ -150,7 +150,7 @@ namespace osu.Game.GameModes.Menu LoopDelay = duration }); - icon.Transforms.Add(new TransformPosition() + icon.Transforms.Add(new TransformPosition { StartValue = new Vector2(0, -10), EndValue = Vector2.Zero, @@ -161,7 +161,7 @@ namespace osu.Game.GameModes.Menu LoopDelay = duration }); - icon.Transforms.Add(new TransformScale() + icon.Transforms.Add(new TransformScale { StartValue = Vector2.One, EndValue = new Vector2(1, 0.9f), From f156ac25bee65c97f83e77ff441db809a6d2b50c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 29 Oct 2016 04:17:56 +0900 Subject: [PATCH 08/25] Fix nunit hint path. --- osu.Game.Tests/osu.Game.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 04c09b3a2c..af6fa91661 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -33,7 +33,7 @@ - $(SolutionDir)\packages\NUnit.2.6.4\lib\nunit.framework.dll + $(SolutionDir)\packages\NUnit.3.5.0\lib\nunit.framework.dll $(SolutionDir)\packages\ppy.OpenTK.2.0.50727.1339\lib\net45\OpenTK.dll From d8ca11bf0dc268b71fc3453b4da94a6b7ba4d996 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 29 Oct 2016 04:29:43 +0900 Subject: [PATCH 09/25] Use Any instead of First to avoid potential throw. --- osu.Game/GameModes/Play/PlaySongSelect.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/GameModes/Play/PlaySongSelect.cs b/osu.Game/GameModes/Play/PlaySongSelect.cs index 179436a0df..309cd3119b 100644 --- a/osu.Game/GameModes/Play/PlaySongSelect.cs +++ b/osu.Game/GameModes/Play/PlaySongSelect.cs @@ -181,7 +181,7 @@ namespace osu.Game.GameModes.Play return; //this is VERY temporary logic. - beatmapSetFlow.Children.Cast().First(b => + beatmapSetFlow.Children.Cast().Any(b => { var panel = b.BeatmapPanels.FirstOrDefault(p => p.Beatmap.Equals(beatmap)); if (panel != null) From ed4413ff247fcb8fa173470a4aa7c1faeb03fe63 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 29 Oct 2016 16:55:57 +0900 Subject: [PATCH 10/25] Framework bump~. --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 13af08782c..dd9faf4609 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 13af08782cfb4de054b2fb11a2cf8311ff895949 +Subproject commit dd9faf46095a761558abc6cb11ecd0e7498dba4e From ef9d2b5b3c10c5a093eed7a7a2a1f97d6c5f0865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adonais=20Romero=20Gonz=C3=A1lez?= Date: Sat, 29 Oct 2016 18:26:12 -0500 Subject: [PATCH 11/25] Minor improvements to combo counters --- osu.Game/GameModes/Play/ComboCounter.cs | 5 +++-- osu.Game/GameModes/Play/Osu/OsuComboCounter.cs | 11 ++++++++++- osu.Game/GameModes/Play/Taiko/TaikoComboCounter.cs | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/osu.Game/GameModes/Play/ComboCounter.cs b/osu.Game/GameModes/Play/ComboCounter.cs index ebc89c102e..ffeed048f0 100644 --- a/osu.Game/GameModes/Play/ComboCounter.cs +++ b/osu.Game/GameModes/Play/ComboCounter.cs @@ -31,6 +31,8 @@ namespace osu.Game.GameModes.Play protected virtual EasingTypes PopOutEasing => EasingTypes.None; protected virtual float PopOutInitialAlpha => 0.75f; + protected virtual double FadeOutDuration => 100; + /// /// Duration in milliseconds for the counter roll-up animation for each element. /// @@ -60,7 +62,6 @@ namespace osu.Game.GameModes.Play } } - protected ulong prevCount; protected ulong count; /// @@ -204,7 +205,7 @@ namespace osu.Game.GameModes.Play private void updateCount(ulong value, bool rolling = false) { - prevCount = count; + ulong prevCount = count; count = value; if (!rolling) { diff --git a/osu.Game/GameModes/Play/Osu/OsuComboCounter.cs b/osu.Game/GameModes/Play/Osu/OsuComboCounter.cs index 253d1c7f8e..c1f76b2632 100644 --- a/osu.Game/GameModes/Play/Osu/OsuComboCounter.cs +++ b/osu.Game/GameModes/Play/Osu/OsuComboCounter.cs @@ -92,6 +92,11 @@ namespace osu.Game.GameModes.Play.Osu protected override void OnCountRolling(ulong currentValue, ulong newValue) { ScheduledPopOutCurrentId++; + + // Hides displayed count if was increasing from 0 to 1 but didn't finish + if (currentValue == 0 && newValue == 0) + DisplayedCountSpriteText.FadeOut(FadeOutDuration); + base.OnCountRolling(currentValue, newValue); } @@ -116,13 +121,17 @@ namespace osu.Game.GameModes.Play.Osu protected override void OnCountChange(ulong currentValue, ulong newValue) { ScheduledPopOutCurrentId++; + + if (newValue == 0) + DisplayedCountSpriteText.FadeOut(); + base.OnCountChange(currentValue, newValue); } protected override void OnDisplayedCountRolling(ulong currentValue, ulong newValue) { if (newValue == 0) - DisplayedCountSpriteText.FadeOut(PopOutDuration); + DisplayedCountSpriteText.FadeOut(FadeOutDuration); else DisplayedCountSpriteText.Show(); diff --git a/osu.Game/GameModes/Play/Taiko/TaikoComboCounter.cs b/osu.Game/GameModes/Play/Taiko/TaikoComboCounter.cs index bd12d35315..70afd31988 100644 --- a/osu.Game/GameModes/Play/Taiko/TaikoComboCounter.cs +++ b/osu.Game/GameModes/Play/Taiko/TaikoComboCounter.cs @@ -43,7 +43,7 @@ namespace osu.Game.GameModes.Play.Taiko protected override void OnDisplayedCountRolling(ulong currentValue, ulong newValue) { if (newValue == 0) - DisplayedCountSpriteText.FadeOut(AnimationDuration); + DisplayedCountSpriteText.FadeOut(FadeOutDuration); else DisplayedCountSpriteText.Show(); From fd0900eb3cd0880782d75dd0f2163785578fe1ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adonais=20Romero=20Gonz=C3=A1lez?= Date: Sat, 29 Oct 2016 18:42:40 -0500 Subject: [PATCH 12/25] I knew I forgot something >:( --- osu.Game/GameModes/Play/Catch/CatchComboCounter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/GameModes/Play/Catch/CatchComboCounter.cs b/osu.Game/GameModes/Play/Catch/CatchComboCounter.cs index dc87e65eec..cf6f153ea1 100644 --- a/osu.Game/GameModes/Play/Catch/CatchComboCounter.cs +++ b/osu.Game/GameModes/Play/Catch/CatchComboCounter.cs @@ -19,7 +19,7 @@ namespace osu.Game.GameModes.Play.Catch protected override bool CanPopOutWhileRolling => true; protected virtual double FadeOutDelay => 1000; - protected virtual double FadeOutDuration => 300; + protected override double FadeOutDuration => 300; protected override string FormatCount(ulong count) { From d544fba9020dab4df01d06531cb8860732f10977 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 31 Oct 2016 13:44:31 +0900 Subject: [PATCH 13/25] Update framework. --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index dd9faf4609..059520c918 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit dd9faf46095a761558abc6cb11ecd0e7498dba4e +Subproject commit 059520c91803855835c734bb6d9b56e90238fe78 From e5f948dccc4d68e13d3fe6de6f62ed698037768f Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 31 Oct 2016 16:16:11 -0600 Subject: [PATCH 14/25] Fade song select wedges in --- osu.Game/GameModes/Play/PlaySongSelect.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/GameModes/Play/PlaySongSelect.cs b/osu.Game/GameModes/Play/PlaySongSelect.cs index 309cd3119b..fd552971a7 100644 --- a/osu.Game/GameModes/Play/PlaySongSelect.cs +++ b/osu.Game/GameModes/Play/PlaySongSelect.cs @@ -35,6 +35,7 @@ namespace osu.Game.GameModes.Play private ScrollContainer scrollContainer; private FlowContainer beatmapSetFlow; private TrackManager trackManager; + private Container wedgeContainer; /// Optionally provide a database to use instead of the OsuGame one. public PlaySongSelect(BeatmapDatabase database = null) @@ -45,7 +46,7 @@ namespace osu.Game.GameModes.Play const float bottomToolHeight = 50; Children = new Drawable[] { - new Container + wedgeContainer = new Container { RelativeSizeAxes = Axes.Both, Size = Vector2.One, @@ -141,6 +142,8 @@ namespace osu.Game.GameModes.Play trackManager = game.Audio.Track; Task.Factory.StartNew(addBeatmapSets); + + wedgeContainer.FadeInFromZero(250); } protected override void OnEntering(GameMode last) From b86f308af69ac5d4f1835b62c455bd1d523292f5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 1 Nov 2016 23:24:14 +0900 Subject: [PATCH 15/25] Add async workflow. --- osu-framework | 2 +- .../Tests/TestCaseChatDisplay.cs | 2 +- .../Tests/TestCaseHitObjects.cs | 2 +- osu.Desktop.VisualTests/VisualTestGame.cs | 2 +- osu.Game/Beatmaps/Drawable/BeatmapGroup.cs | 38 ++++++++------- .../Objects/Catch/Drawable/DrawableFruit.cs | 2 +- .../Beatmaps/Objects/DrawableHitObject.cs | 5 +- .../Objects/Mania/Drawable/DrawableNote.cs | 2 +- .../Objects/Osu/Drawable/DrawableCircle.cs | 14 +++--- .../Taiko/Drawable/DrawableTaikoHit.cs | 2 +- osu.Game/Database/BeatmapDatabase.cs | 3 ++ osu.Game/GameModes/BackgroundMode.cs | 26 +++++++++- .../Backgrounds/BackgroundModeCustom.cs | 2 +- .../Backgrounds/BackgroundModeDefault.cs | 2 +- osu.Game/GameModes/GameModeWhiteBox.cs | 2 +- osu.Game/GameModes/Menu/Button.cs | 2 +- osu.Game/GameModes/Menu/ButtonSystem.cs | 2 +- osu.Game/GameModes/Menu/Intro.cs | 37 ++++++++++----- osu.Game/GameModes/Menu/MainMenu.cs | 30 ++++++++---- osu.Game/GameModes/Menu/OsuLogo.cs | 8 +++- osu.Game/GameModes/Multiplayer/Match.cs | 1 + .../GameModes/Play/Catch/CatchPlayfield.cs | 2 +- osu.Game/GameModes/Play/ComboCounter.cs | 2 +- osu.Game/GameModes/Play/HitRenderer.cs | 2 +- .../GameModes/Play/Mania/ManiaComboCounter.cs | 2 +- .../GameModes/Play/Mania/ManiaPlayfield.cs | 2 +- .../GameModes/Play/Osu/OsuComboCounter.cs | 2 +- osu.Game/GameModes/Play/Osu/OsuPlayfield.cs | 2 +- osu.Game/GameModes/Play/PlaySongSelect.cs | 33 +++++++++---- osu.Game/GameModes/Play/Player.cs | 2 +- .../GameModes/Play/Taiko/TaikoPlayfield.cs | 2 +- osu.Game/Graphics/Background/Background.cs | 6 ++- .../Graphics/Containers/ParallaxContainer.cs | 2 +- .../Graphics/Cursor/OsuCursorContainer.cs | 2 +- osu.Game/Graphics/UserInterface/KeyCounter.cs | 2 +- .../Graphics/UserInterface/RollingCounter.cs | 2 +- .../Graphics/UserInterface/StarCounter.cs | 6 ++- .../UserInterface/Volume/VolumeControl.cs | 2 +- .../UserInterface/Volume/VolumeMeter.cs | 2 +- .../Online/Chat/Display/ChannelDisplay.cs | 2 +- osu.Game/Online/Chat/Display/ChatLine.cs | 2 +- osu.Game/OsuGame.cs | 47 +++++++++++++------ osu.Game/OsuGameBase.cs | 2 +- osu.Game/Overlays/ChatConsole.cs | 2 +- osu.Game/Overlays/Options.cs | 2 +- osu.Game/Overlays/Toolbar.cs | 20 ++++---- osu.Game/Overlays/ToolbarModeButton.cs | 2 +- osu.Game/Overlays/ToolbarModeSelector.cs | 2 +- 48 files changed, 224 insertions(+), 118 deletions(-) diff --git a/osu-framework b/osu-framework index 059520c918..3b2e4f12bd 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 059520c91803855835c734bb6d9b56e90238fe78 +Subproject commit 3b2e4f12bd9a4299a052aea6198db9dbefff86f4 diff --git a/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs b/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs index efc9b5dfa3..98e1c2de08 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs @@ -34,7 +34,7 @@ namespace osu.Desktop.VisualTests.Tests private ChannelDisplay channelDisplay; - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs index fecaad00e4..cf66829ceb 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs @@ -19,7 +19,7 @@ namespace osu.Desktop.VisualTests.Tests protected override IFrameBasedClock Clock => ourClock; - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Desktop.VisualTests/VisualTestGame.cs b/osu.Desktop.VisualTests/VisualTestGame.cs index 6618427bed..5fba0209e2 100644 --- a/osu.Desktop.VisualTests/VisualTestGame.cs +++ b/osu.Desktop.VisualTests/VisualTestGame.cs @@ -18,7 +18,7 @@ namespace osu.Desktop.VisualTests { class VisualTestGame : OsuGameBase { - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); Add(new TestBrowser()); diff --git a/osu.Game/Beatmaps/Drawable/BeatmapGroup.cs b/osu.Game/Beatmaps/Drawable/BeatmapGroup.cs index ebc2ab447c..673394553e 100644 --- a/osu.Game/Beatmaps/Drawable/BeatmapGroup.cs +++ b/osu.Game/Beatmaps/Drawable/BeatmapGroup.cs @@ -4,7 +4,10 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading; +using System.Threading.Tasks; using osu.Framework; +using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; @@ -40,6 +43,10 @@ namespace osu.Game.Beatmaps.Drawable { case BeatmapGroupState.Expanded: FadeTo(1, 250); + + //if (!difficulties.Children.All(d => IsLoaded)) + // Task.WhenAll(difficulties.Children.Select(d => d.Preload(Game))).ContinueWith(t => difficulties.Show()); + //else difficulties.Show(); header.State = PanelSelectedState.Selected; @@ -62,16 +69,6 @@ namespace osu.Game.Beatmaps.Drawable AutoSizeAxes = Axes.Y; RelativeSizeAxes = Axes.X; - BeatmapPanels = beatmapSet.Beatmaps.Select(b => - new BeatmapPanel(b) - { - GainedSelection = panelGainedSelection, - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight, - RelativeSizeAxes = Axes.X, - }).ToList(); - - Children = new[] { new FlowContainer @@ -96,20 +93,29 @@ namespace osu.Game.Beatmaps.Drawable Padding = new MarginPadding { Left = 75 }, Spacing = new Vector2(0, 5), Direction = FlowDirection.VerticalOnly, - Alpha = 0, - Children = BeatmapPanels } } } }; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); - State = BeatmapGroupState.Collapsed; - } - + + BeatmapPanels = beatmapSet.Beatmaps.Select(b => new BeatmapPanel(b) + { + GainedSelection = panelGainedSelection, + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + RelativeSizeAxes = Axes.X, + }).ToList(); + + //for the time being, let's completely load the difficulty panels in the background. + //this likely won't scale so well, but allows us to completely async the loading flow. + Task.WhenAll(BeatmapPanels.Select(panel => panel.Preload(game, p => difficulties.Add(panel)))).Wait(); + } + private void headerGainedSelection(BeatmapSetHeader panel) { State = BeatmapGroupState.Expanded; diff --git a/osu.Game/Beatmaps/Objects/Catch/Drawable/DrawableFruit.cs b/osu.Game/Beatmaps/Objects/Catch/Drawable/DrawableFruit.cs index 3a3883ab3b..ba3c1c90b6 100644 --- a/osu.Game/Beatmaps/Objects/Catch/Drawable/DrawableFruit.cs +++ b/osu.Game/Beatmaps/Objects/Catch/Drawable/DrawableFruit.cs @@ -28,7 +28,7 @@ namespace osu.Game.Beatmaps.Objects.Catch.Drawable Position = new Vector2(h.Position, -0.1f); } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/Beatmaps/Objects/DrawableHitObject.cs b/osu.Game/Beatmaps/Objects/DrawableHitObject.cs index 0f8502b54f..d6b459b0d1 100644 --- a/osu.Game/Beatmaps/Objects/DrawableHitObject.cs +++ b/osu.Game/Beatmaps/Objects/DrawableHitObject.cs @@ -37,10 +37,9 @@ namespace osu.Game.Beatmaps.Objects } } - public override void Load(BaseGame game) + protected override void LoadComplete() { - base.Load(game); - + base.LoadComplete(); UpdateState(state); } diff --git a/osu.Game/Beatmaps/Objects/Mania/Drawable/DrawableNote.cs b/osu.Game/Beatmaps/Objects/Mania/Drawable/DrawableNote.cs index 939dc645cd..d4fe46317d 100644 --- a/osu.Game/Beatmaps/Objects/Mania/Drawable/DrawableNote.cs +++ b/osu.Game/Beatmaps/Objects/Mania/Drawable/DrawableNote.cs @@ -20,7 +20,7 @@ namespace osu.Game.Beatmaps.Objects.Mania.Drawable Scale = new Vector2(0.1f); } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); Texture = game.Textures.Get(@"Menu/logo"); diff --git a/osu.Game/Beatmaps/Objects/Osu/Drawable/DrawableCircle.cs b/osu.Game/Beatmaps/Objects/Osu/Drawable/DrawableCircle.cs index be2b7495f6..0f1538953a 100644 --- a/osu.Game/Beatmaps/Objects/Osu/Drawable/DrawableCircle.cs +++ b/osu.Game/Beatmaps/Objects/Osu/Drawable/DrawableCircle.cs @@ -64,7 +64,7 @@ namespace osu.Game.Beatmaps.Objects.Osu.Drawable Size = new Vector2(100); } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); @@ -131,7 +131,7 @@ namespace osu.Game.Beatmaps.Objects.Osu.Drawable }; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); number.Texture = game.Textures.Get(@"Play/osu/number@2x"); @@ -159,7 +159,7 @@ namespace osu.Game.Beatmaps.Objects.Osu.Drawable }; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); layer3.Texture = game.Textures.Get(@"Play/osu/ring-glow@2x"); @@ -185,7 +185,7 @@ namespace osu.Game.Beatmaps.Objects.Osu.Drawable }; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); ring.Texture = game.Textures.Get(@"Play/osu/ring@2x"); @@ -241,7 +241,7 @@ namespace osu.Game.Beatmaps.Objects.Osu.Drawable { private Texture tex; - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); @@ -302,7 +302,7 @@ namespace osu.Game.Beatmaps.Objects.Osu.Drawable }; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); disc.Texture = game.Textures.Get(@"Play/osu/disc@2x"); @@ -318,7 +318,7 @@ namespace osu.Game.Beatmaps.Objects.Osu.Drawable { private Texture tex; - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/Beatmaps/Objects/Taiko/Drawable/DrawableTaikoHit.cs b/osu.Game/Beatmaps/Objects/Taiko/Drawable/DrawableTaikoHit.cs index c0354124c7..b2eecb8f05 100644 --- a/osu.Game/Beatmaps/Objects/Taiko/Drawable/DrawableTaikoHit.cs +++ b/osu.Game/Beatmaps/Objects/Taiko/Drawable/DrawableTaikoHit.cs @@ -23,7 +23,7 @@ namespace osu.Game.Beatmaps.Objects.Taiko.Drawable Position = new Vector2(1.1f, 0.5f); } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/Database/BeatmapDatabase.cs b/osu.Game/Database/BeatmapDatabase.cs index 5d0834bad7..bb98daf6bc 100644 --- a/osu.Game/Database/BeatmapDatabase.cs +++ b/osu.Game/Database/BeatmapDatabase.cs @@ -128,6 +128,9 @@ namespace osu.Game.Database public ArchiveReader GetReader(BeatmapSetInfo beatmapSet) { + if (string.IsNullOrEmpty(beatmapSet.Path)) + return null; + return ArchiveReader.GetReader(storage, beatmapSet.Path); } diff --git a/osu.Game/GameModes/BackgroundMode.cs b/osu.Game/GameModes/BackgroundMode.cs index f6ee9d10e4..641a95b27f 100644 --- a/osu.Game/GameModes/BackgroundMode.cs +++ b/osu.Game/GameModes/BackgroundMode.cs @@ -12,6 +12,7 @@ using OpenTK; using osu.Framework.Graphics; using osu.Framework.Input; using osu.Framework; +using System.Threading; namespace osu.Game.GameModes { @@ -31,11 +32,32 @@ namespace osu.Game.GameModes return false; } - public override void Load(BaseGame game) + BaseGame game; + + protected override void Load(BaseGame game) { base.Load(game); + this.game = game; + } - Content.Scale *= 1 + (x_movement_amount / DrawSize.X) * 2; + public override bool Push(GameMode mode) + { + //don't actually push until we've finished loading. + if (!mode.IsLoaded) + { + mode.Preload(game, d => Push((BackgroundMode)d)); + return true; + } + + base.Push(mode); + + return true; + } + + protected override void Update() + { + base.Update(); + Content.Scale = new Vector2(1 + (x_movement_amount / DrawSize.X) * 2); } protected override void OnEntering(GameMode last) diff --git a/osu.Game/GameModes/Backgrounds/BackgroundModeCustom.cs b/osu.Game/GameModes/Backgrounds/BackgroundModeCustom.cs index 7b1756436f..a603b3904e 100644 --- a/osu.Game/GameModes/Backgrounds/BackgroundModeCustom.cs +++ b/osu.Game/GameModes/Backgrounds/BackgroundModeCustom.cs @@ -15,7 +15,7 @@ namespace osu.Game.GameModes.Backgrounds this.textureName = textureName; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); Add(new Background(textureName)); diff --git a/osu.Game/GameModes/Backgrounds/BackgroundModeDefault.cs b/osu.Game/GameModes/Backgrounds/BackgroundModeDefault.cs index 542e9b58b7..bbfa559742 100644 --- a/osu.Game/GameModes/Backgrounds/BackgroundModeDefault.cs +++ b/osu.Game/GameModes/Backgrounds/BackgroundModeDefault.cs @@ -8,7 +8,7 @@ namespace osu.Game.GameModes.Backgrounds { public class BackgroundModeDefault : BackgroundMode { - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/GameModes/GameModeWhiteBox.cs b/osu.Game/GameModes/GameModeWhiteBox.cs index 8556a8b496..d4a0893cba 100644 --- a/osu.Game/GameModes/GameModeWhiteBox.cs +++ b/osu.Game/GameModes/GameModeWhiteBox.cs @@ -77,7 +77,7 @@ namespace osu.Game.GameModes Content.FadeIn(transition_time, EasingTypes.OutExpo); } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/GameModes/Menu/Button.cs b/osu.Game/GameModes/Menu/Button.cs index 5599f25ad3..779501a448 100644 --- a/osu.Game/GameModes/Menu/Button.cs +++ b/osu.Game/GameModes/Menu/Button.cs @@ -48,7 +48,7 @@ namespace osu.Game.GameModes.Menu AutoSizeAxes = Axes.Both; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); Alpha = 0; diff --git a/osu.Game/GameModes/Menu/ButtonSystem.cs b/osu.Game/GameModes/Menu/ButtonSystem.cs index b607d65df6..25371cb506 100644 --- a/osu.Game/GameModes/Menu/ButtonSystem.cs +++ b/osu.Game/GameModes/Menu/ButtonSystem.cs @@ -53,7 +53,7 @@ namespace osu.Game.GameModes.Menu RelativeSizeAxes = Axes.Both; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/GameModes/Menu/Intro.cs b/osu.Game/GameModes/Menu/Intro.cs index 2973f83b6b..8b9c9a8353 100644 --- a/osu.Game/GameModes/Menu/Intro.cs +++ b/osu.Game/GameModes/Menu/Intro.cs @@ -1,7 +1,7 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; +using System.Threading; using osu.Framework.Audio.Sample; using osu.Framework.Audio.Track; using osu.Framework.GameModes; @@ -10,8 +10,6 @@ using osu.Framework.Graphics.Transformations; using osu.Game.GameModes.Backgrounds; using OpenTK.Graphics; using osu.Framework; -using osu.Framework.Configuration; -using osu.Game.Beatmaps; namespace osu.Game.GameModes.Menu { @@ -24,12 +22,14 @@ namespace osu.Game.GameModes.Menu /// internal bool DidLoadMenu; + MainMenu mainMenu; + private AudioSample welcome; + private AudioTrack bgm; + protected override BackgroundMode CreateBackground() => new BackgroundModeEmpty(); - public override void Load(BaseGame game) + public Intro() { - base.Load(game); - Children = new Drawable[] { logo = new OsuLogo() @@ -41,12 +41,21 @@ namespace osu.Game.GameModes.Menu Ripple = false } }; + } - AudioSample welcome = game.Audio.Sample.Get(@"welcome"); + protected override void Load(BaseGame game) + { + base.Load(game); - AudioTrack bgm = game.Audio.Track.Get(@"circles"); + welcome = game.Audio.Sample.Get(@"welcome"); + + bgm = game.Audio.Track.Get(@"circles"); bgm.Looping = true; + } + protected override void LoadComplete() + { + base.LoadComplete(); Scheduler.Add(delegate { welcome.Play(); @@ -60,13 +69,17 @@ namespace osu.Game.GameModes.Menu Scheduler.AddDelayed(delegate { DidLoadMenu = true; - Push(new MainMenu()); + Push(mainMenu); }, 2900); - logo.ScaleTo(0); + logo.ScaleTo(0.4f); + logo.FadeOut(); - logo.ScaleTo(1, 5900, EasingTypes.OutQuint); - logo.FadeIn(30000, EasingTypes.OutQuint); + logo.ScaleTo(1, 4400, EasingTypes.OutQuint); + logo.FadeIn(20000, EasingTypes.OutQuint); + + mainMenu = new MainMenu(); + mainMenu.Preload(Game); } protected override void OnSuspending(GameMode next) diff --git a/osu.Game/GameModes/Menu/MainMenu.cs b/osu.Game/GameModes/Menu/MainMenu.cs index 475d4c8dea..f4b9da2bfe 100644 --- a/osu.Game/GameModes/Menu/MainMenu.cs +++ b/osu.Game/GameModes/Menu/MainMenu.cs @@ -1,6 +1,7 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Linq; using osu.Framework.GameModes; using osu.Framework.GameModes.Testing; using osu.Framework.Graphics; @@ -15,6 +16,7 @@ using osu.Game.Graphics.Containers; using OpenTK; using osu.Framework; using osu.Game.Overlays; +using System.Threading.Tasks; namespace osu.Game.GameModes.Menu { @@ -23,13 +25,13 @@ namespace osu.Game.GameModes.Menu private ButtonSystem buttons; public override string Name => @"Main Menu"; - protected override BackgroundMode CreateBackground() => new BackgroundModeDefault(); + private BackgroundMode background; - public override void Load(BaseGame game) + protected override BackgroundMode CreateBackground() => background; + + public MainMenu() { - base.Load(game); - - OsuGame osu = (OsuGame)game; + background = new BackgroundModeDefault(); Children = new Drawable[] { @@ -40,7 +42,6 @@ namespace osu.Game.GameModes.Menu { buttons = new ButtonSystem() { - Alpha = 0, OnChart = delegate { Push(new ChartListing()); }, OnDirect = delegate { Push(new OnlineListing()); }, OnEdit = delegate { Push(new EditSongSelect()); }, @@ -48,13 +49,26 @@ namespace osu.Game.GameModes.Menu OnMulti = delegate { Push(new Lobby()); }, OnTest = delegate { Push(new TestBrowser()); }, OnExit = delegate { Scheduler.AddDelayed(Exit, ButtonSystem.EXIT_DELAY); }, - OnSettings = osu.Options.ToggleVisibility, } } } }; + } - buttons.FadeIn(500); + protected override void Load(BaseGame game) + { + base.Load(game); + + background.Preload(game); + + OsuGame osu = (OsuGame)game; + buttons.OnSettings = osu.Options.ToggleVisibility; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + buttons.FadeInFromZero(500); } protected override void OnSuspending(GameMode next) diff --git a/osu.Game/GameModes/Menu/OsuLogo.cs b/osu.Game/GameModes/Menu/OsuLogo.cs index 57fbcdd0e5..889b7ccb32 100644 --- a/osu.Game/GameModes/Menu/OsuLogo.cs +++ b/osu.Game/GameModes/Menu/OsuLogo.cs @@ -101,12 +101,16 @@ namespace osu.Game.GameModes.Menu }; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); - logo.Texture = game.Textures.Get(@"Menu/logo"); ripple.Texture = game.Textures.Get(@"Menu/logo"); + } + + protected override void LoadComplete() + { + base.LoadComplete(); ripple.ScaleTo(1.1f, 500); ripple.FadeOut(500); diff --git a/osu.Game/GameModes/Multiplayer/Match.cs b/osu.Game/GameModes/Multiplayer/Match.cs index 0b12ade697..e4db8ea19f 100644 --- a/osu.Game/GameModes/Multiplayer/Match.cs +++ b/osu.Game/GameModes/Multiplayer/Match.cs @@ -25,6 +25,7 @@ namespace osu.Game.GameModes.Multiplayer protected override void OnEntering(GameMode last) { base.OnEntering(last); + Background.FadeColour(Color4.DarkGray, 500); } diff --git a/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs b/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs index a9c781c138..bf1b3f67a2 100644 --- a/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs +++ b/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs @@ -20,7 +20,7 @@ namespace osu.Game.GameModes.Play.Catch Origin = Anchor.BottomCentre; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/GameModes/Play/ComboCounter.cs b/osu.Game/GameModes/Play/ComboCounter.cs index ffeed048f0..8d5f55f775 100644 --- a/osu.Game/GameModes/Play/ComboCounter.cs +++ b/osu.Game/GameModes/Play/ComboCounter.cs @@ -120,7 +120,7 @@ namespace osu.Game.GameModes.Play TextSize = 80; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/GameModes/Play/HitRenderer.cs b/osu.Game/GameModes/Play/HitRenderer.cs index c31fb2848e..d77aaab50f 100644 --- a/osu.Game/GameModes/Play/HitRenderer.cs +++ b/osu.Game/GameModes/Play/HitRenderer.cs @@ -39,7 +39,7 @@ namespace osu.Game.GameModes.Play protected virtual List Convert(List objects) => Converter.Convert(objects); - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/GameModes/Play/Mania/ManiaComboCounter.cs b/osu.Game/GameModes/Play/Mania/ManiaComboCounter.cs index 58fd92c73b..8d1c6d5b57 100644 --- a/osu.Game/GameModes/Play/Mania/ManiaComboCounter.cs +++ b/osu.Game/GameModes/Play/Mania/ManiaComboCounter.cs @@ -31,7 +31,7 @@ namespace osu.Game.GameModes.Play.Mania protected override float PopOutInitialAlpha => 1.0f; protected override double PopOutDuration => 300; - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs b/osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs index ed21c52e81..99cd0012cc 100644 --- a/osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs +++ b/osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs @@ -23,7 +23,7 @@ namespace osu.Game.GameModes.Play.Mania Origin = Anchor.BottomCentre; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/GameModes/Play/Osu/OsuComboCounter.cs b/osu.Game/GameModes/Play/Osu/OsuComboCounter.cs index c1f76b2632..f0fc4cf580 100644 --- a/osu.Game/GameModes/Play/Osu/OsuComboCounter.cs +++ b/osu.Game/GameModes/Play/Osu/OsuComboCounter.cs @@ -33,7 +33,7 @@ namespace osu.Game.GameModes.Play.Osu } } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs b/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs index b9a616ada3..111dd608c1 100644 --- a/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs +++ b/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs @@ -20,7 +20,7 @@ namespace osu.Game.GameModes.Play.Osu Origin = Anchor.Centre; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/GameModes/Play/PlaySongSelect.cs b/osu.Game/GameModes/Play/PlaySongSelect.cs index 309cd3119b..f244ee76b5 100644 --- a/osu.Game/GameModes/Play/PlaySongSelect.cs +++ b/osu.Game/GameModes/Play/PlaySongSelect.cs @@ -120,7 +120,7 @@ namespace osu.Game.GameModes.Play }; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); @@ -217,15 +217,20 @@ namespace osu.Game.GameModes.Play selectedBeatmapGroup = group; } - private void ensurePlayingSelected() + private async Task ensurePlayingSelected() { - var track = Beatmap?.Track; + AudioTrack track = null; - if (track != null) + await Task.Run(() => track = Beatmap?.Track); + + Schedule(delegate { - trackManager.SetExclusive(track); - track.Start(); - } + if (track != null) + { + trackManager.SetExclusive(track); + track.Start(); + } + }); } private void addBeatmapSet(BeatmapSetInfo beatmapSet) @@ -233,14 +238,19 @@ namespace osu.Game.GameModes.Play beatmapSet = database.GetWithChildren(beatmapSet.BeatmapSetID); beatmapSet.Beatmaps.ForEach(b => database.GetChildren(b)); beatmapSet.Beatmaps = beatmapSet.Beatmaps.OrderBy(b => b.BaseDifficulty.OverallDifficulty).ToList(); - Schedule(() => + var group = new BeatmapGroup(beatmapSet) { SelectionChanged = selectionChanged }; + + group.Preload(Game, g => { - var group = new BeatmapGroup(beatmapSet) { SelectionChanged = selectionChanged }; beatmapSetFlow.Add(group); + if (Beatmap == null) { if (beatmapSetFlow.Children.Count() == 1) + { group.State = BeatmapGroupState.Expanded; + return; + } } else { @@ -248,9 +258,14 @@ namespace osu.Game.GameModes.Play { var panel = group.BeatmapPanels.FirstOrDefault(p => p.Beatmap.Equals(Beatmap.BeatmapInfo)); if (panel != null) + { panel.State = PanelSelectedState.Selected; + return; + } } } + + group.State = BeatmapGroupState.Collapsed; }); } diff --git a/osu.Game/GameModes/Play/Player.cs b/osu.Game/GameModes/Play/Player.cs index 5f3e2954a5..860e077588 100644 --- a/osu.Game/GameModes/Play/Player.cs +++ b/osu.Game/GameModes/Play/Player.cs @@ -30,7 +30,7 @@ namespace osu.Game.GameModes.Play private InterpolatingFramedClock playerClock; private IAdjustableClock sourceClock; - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs b/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs index 18e22ffd02..9d2231667e 100644 --- a/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs +++ b/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs @@ -20,7 +20,7 @@ namespace osu.Game.GameModes.Play.Taiko Origin = Anchor.Centre; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/Graphics/Background/Background.cs b/osu.Game/Graphics/Background/Background.cs index 0624734363..bb5b229f8b 100644 --- a/osu.Game/Graphics/Background/Background.cs +++ b/osu.Game/Graphics/Background/Background.cs @@ -9,6 +9,8 @@ using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework; +using System.Threading.Tasks; +using osu.Framework.Graphics.Textures; namespace osu.Game.Graphics.Background { @@ -25,7 +27,9 @@ namespace osu.Game.Graphics.Background Depth = float.MinValue; } - public override void Load(BaseGame game) + Texture texture; + + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/Graphics/Containers/ParallaxContainer.cs b/osu.Game/Graphics/Containers/ParallaxContainer.cs index ad5a0a559c..3b385af893 100644 --- a/osu.Game/Graphics/Containers/ParallaxContainer.cs +++ b/osu.Game/Graphics/Containers/ParallaxContainer.cs @@ -27,7 +27,7 @@ namespace osu.Game.Graphics.Containers protected override Container Content => content; - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); } diff --git a/osu.Game/Graphics/Cursor/OsuCursorContainer.cs b/osu.Game/Graphics/Cursor/OsuCursorContainer.cs index 2ede018778..49e6bc84f5 100644 --- a/osu.Game/Graphics/Cursor/OsuCursorContainer.cs +++ b/osu.Game/Graphics/Cursor/OsuCursorContainer.cs @@ -37,7 +37,7 @@ namespace osu.Game.Graphics.Cursor AutoSizeAxes = Axes.Both; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/Graphics/UserInterface/KeyCounter.cs b/osu.Game/Graphics/UserInterface/KeyCounter.cs index 0c65740354..f56a0a3853 100644 --- a/osu.Game/Graphics/UserInterface/KeyCounter.cs +++ b/osu.Game/Graphics/UserInterface/KeyCounter.cs @@ -59,7 +59,7 @@ namespace osu.Game.Graphics.UserInterface Name = name; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); Children = new Drawable[] diff --git a/osu.Game/Graphics/UserInterface/RollingCounter.cs b/osu.Game/Graphics/UserInterface/RollingCounter.cs index 33a1677bd9..80f1b345b6 100644 --- a/osu.Game/Graphics/UserInterface/RollingCounter.cs +++ b/osu.Game/Graphics/UserInterface/RollingCounter.cs @@ -119,7 +119,7 @@ namespace osu.Game.Graphics.UserInterface AutoSizeAxes = Axes.Both; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/Graphics/UserInterface/StarCounter.cs b/osu.Game/Graphics/UserInterface/StarCounter.cs index a01d0baab1..cff8fc65fe 100644 --- a/osu.Game/Graphics/UserInterface/StarCounter.cs +++ b/osu.Game/Graphics/UserInterface/StarCounter.cs @@ -107,7 +107,7 @@ namespace osu.Game.Graphics.UserInterface }; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); @@ -131,7 +131,11 @@ namespace osu.Game.Graphics.UserInterface stars.Add(star); starContainer.Add(star); } + } + protected override void LoadComplete() + { + base.LoadComplete(); // Animate initial state from zero. transformCount(0, Count); } diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index de4c441336..4d86483262 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -32,7 +32,7 @@ namespace osu.Game.Graphics.UserInterface.Volume Origin = Anchor.BottomRight; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { VolumeGlobal.ValueChanged += volumeChanged; VolumeSample.ValueChanged += volumeChanged; diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs index b88d819afd..64cb59175c 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs @@ -57,7 +57,7 @@ namespace osu.Game.Graphics.UserInterface.Volume }; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); updateFill(); diff --git a/osu.Game/Online/Chat/Display/ChannelDisplay.cs b/osu.Game/Online/Chat/Display/ChannelDisplay.cs index 7ab351080b..98fa40679b 100644 --- a/osu.Game/Online/Chat/Display/ChannelDisplay.cs +++ b/osu.Game/Online/Chat/Display/ChannelDisplay.cs @@ -59,7 +59,7 @@ namespace osu.Game.Online.Chat.Display channel.NewMessagesArrived -= newMessages; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); newMessages(channel.Messages); diff --git a/osu.Game/Online/Chat/Display/ChatLine.cs b/osu.Game/Online/Chat/Display/ChatLine.cs index 47503ae53c..1b827e048e 100644 --- a/osu.Game/Online/Chat/Display/ChatLine.cs +++ b/osu.Game/Online/Chat/Display/ChatLine.cs @@ -27,7 +27,7 @@ namespace osu.Game.Online.Chat.Display const float padding = 200; const float text_size = 20; - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 2515ace38e..af078395df 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -2,6 +2,7 @@ //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Threading; using osu.Framework.Configuration; using osu.Framework.GameModes; using osu.Game.Configuration; @@ -46,7 +47,7 @@ namespace osu.Game host.Size = new Vector2(Config.Get(OsuConfig.Width), Config.Get(OsuConfig.Height)); } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { if (!Host.IsPrimaryInstance) { @@ -64,23 +65,18 @@ namespace osu.Game Audio.VolumeSample.Weld(Config.GetBindable(OsuConfig.VolumeEffect)); Audio.VolumeTrack.Weld(Config.GetBindable(OsuConfig.VolumeMusic)); + PlayMode = Config.GetBindable(OsuConfig.PlayMode); + Add(new Drawable[] { new VolumeControlReceptor { RelativeSizeAxes = Axes.Both, ActivateRequested = delegate { volume.Show(); } }, - intro = new Intro + mainContent = new Container { - Beatmap = Beatmap + RelativeSizeAxes = Axes.Both, }, - Toolbar = new Toolbar - { - OnHome = delegate { MainMenu?.MakeCurrent(); }, - OnSettings = Options.ToggleVisibility, - OnPlayModeChange = delegate (PlayMode m) { PlayMode.Value = m; }, - }, - Chat = new ChatConsole(API), volume = new VolumeControl { VolumeGlobal = Audio.Volume, @@ -93,12 +89,31 @@ namespace osu.Game } }); - intro.ModePushed += modeAdded; - intro.Exited += modeRemoved; + (intro = new Intro + { + Beatmap = Beatmap + }).Preload(game, d => + { + mainContent.Add(d); - PlayMode = Config.GetBindable(OsuConfig.PlayMode); - PlayMode.ValueChanged += delegate { Toolbar.SetGameMode(PlayMode.Value); }; - PlayMode.TriggerChange(); + intro.ModePushed += modeAdded; + intro.Exited += modeRemoved; + intro.DisplayAsRoot(); + }); + + (Chat = new ChatConsole(API)).Preload(game, Add); + + (Toolbar = new Toolbar + { + OnHome = delegate { MainMenu?.MakeCurrent(); }, + OnSettings = Options.ToggleVisibility, + OnPlayModeChange = delegate (PlayMode m) { PlayMode.Value = m; }, + }).Preload(game, t => + { + PlayMode.ValueChanged += delegate { Toolbar.SetGameMode(PlayMode.Value); }; + PlayMode.TriggerChange(); + Add(Toolbar); + }); Cursor.Alpha = 0; } @@ -117,6 +132,8 @@ namespace osu.Game public Action ModeChanged; + private Container mainContent; + private void modeChanged(GameMode newMode) { // - Ability to change window size diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index bfa07d72c8..7a4c72715e 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -55,7 +55,7 @@ namespace osu.Game throw new NotImplementedException(); } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/Overlays/ChatConsole.cs b/osu.Game/Overlays/ChatConsole.cs index 37a8bec860..c5aec21364 100644 --- a/osu.Game/Overlays/ChatConsole.cs +++ b/osu.Game/Overlays/ChatConsole.cs @@ -55,7 +55,7 @@ namespace osu.Game.Overlays }); } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); initializeChannels(); diff --git a/osu.Game/Overlays/Options.cs b/osu.Game/Overlays/Options.cs index 8855b5bfc0..b413d175c5 100644 --- a/osu.Game/Overlays/Options.cs +++ b/osu.Game/Overlays/Options.cs @@ -17,7 +17,7 @@ namespace osu.Game.Overlays { private const float width = 300; - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); diff --git a/osu.Game/Overlays/Toolbar.cs b/osu.Game/Overlays/Toolbar.cs index 5e85dd832e..b6fde4d59d 100644 --- a/osu.Game/Overlays/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar.cs @@ -24,6 +24,7 @@ namespace osu.Game.Overlays public Action OnPlayModeChange; private ToolbarModeSelector modeSelector; + private ToolbarButton userButton; private const int transition_time = 200; @@ -39,13 +40,8 @@ namespace osu.Game.Overlays FadeOut(transition_time, EasingTypes.InQuint); } - public override void Load(BaseGame game) + public Toolbar() { - base.Load(game); - - RelativeSizeAxes = Axes.X; - Size = new Vector2(1, height); - Children = new Drawable[] { new Box @@ -93,10 +89,9 @@ namespace osu.Game.Overlays { Icon = FontAwesome.search }, - new ToolbarButton + userButton = new ToolbarButton { Icon = FontAwesome.user, - Text = ((OsuGame)game).Config.Get(OsuConfig.Username) }, new ToolbarButton { @@ -105,6 +100,15 @@ namespace osu.Game.Overlays } } }; + + RelativeSizeAxes = Axes.X; + Size = new Vector2(1, height); + } + + protected override void Load(BaseGame game) + { + base.Load(game); + userButton.Text = ((OsuGame)game).Config.Get(OsuConfig.Username); } public void SetGameMode(PlayMode mode) => modeSelector.SetGameMode(mode); diff --git a/osu.Game/Overlays/ToolbarModeButton.cs b/osu.Game/Overlays/ToolbarModeButton.cs index 678a953fb1..bd01089a60 100644 --- a/osu.Game/Overlays/ToolbarModeButton.cs +++ b/osu.Game/Overlays/ToolbarModeButton.cs @@ -43,7 +43,7 @@ namespace osu.Game.Overlays } } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); DrawableIcon.TextSize *= 1.4f; diff --git a/osu.Game/Overlays/ToolbarModeSelector.cs b/osu.Game/Overlays/ToolbarModeSelector.cs index 934a52ec8b..420491395e 100644 --- a/osu.Game/Overlays/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/ToolbarModeSelector.cs @@ -30,7 +30,7 @@ namespace osu.Game.Overlays RelativeSizeAxes = Axes.Y; } - public override void Load(BaseGame game) + protected override void Load(BaseGame game) { base.Load(game); From 0edfeaaff928dd843807cd376cd1ce9a2bf0f396 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 1 Nov 2016 09:22:49 -0600 Subject: [PATCH 16/25] Move wedgeContainer transition to OnEntering --- osu.Game/GameModes/Play/PlaySongSelect.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/GameModes/Play/PlaySongSelect.cs b/osu.Game/GameModes/Play/PlaySongSelect.cs index fd552971a7..b7f61f9f8a 100644 --- a/osu.Game/GameModes/Play/PlaySongSelect.cs +++ b/osu.Game/GameModes/Play/PlaySongSelect.cs @@ -142,14 +142,13 @@ namespace osu.Game.GameModes.Play trackManager = game.Audio.Track; Task.Factory.StartNew(addBeatmapSets); - - wedgeContainer.FadeInFromZero(250); } protected override void OnEntering(GameMode last) { base.OnEntering(last); ensurePlayingSelected(); + wedgeContainer.FadeInFromZero(250); } protected override void OnResuming(GameMode last) From 774b47c1fe4e40c8849591954249d8ddcb5256eb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 2 Nov 2016 00:53:13 +0900 Subject: [PATCH 17/25] Don't cache drawable for no reason. --- osu.Game/Overlays/ToolbarModeSelector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/ToolbarModeSelector.cs b/osu.Game/Overlays/ToolbarModeSelector.cs index 420491395e..c97b7f9d92 100644 --- a/osu.Game/Overlays/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/ToolbarModeSelector.cs @@ -90,7 +90,7 @@ namespace osu.Game.Overlays activeMode.Invalidate(); } - private Cached activeMode = new Cached(); + private Cached activeMode = new Cached(); protected override void UpdateLayout() { From c78e3efc66032ca16834d7e6d795acdcee31c9ad Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 2 Nov 2016 01:02:34 +0900 Subject: [PATCH 18/25] Schedule some illegal calls. --- osu.Game/GameModes/Edit/Editor.cs | 4 ++-- osu.Game/GameModes/Multiplayer/Match.cs | 4 ++-- osu.Game/GameModes/Play/ModSelect.cs | 4 ++-- osu.Game/GameModes/Ranking/Results.cs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/osu.Game/GameModes/Edit/Editor.cs b/osu.Game/GameModes/Edit/Editor.cs index fbefb38752..495e2eef8e 100644 --- a/osu.Game/GameModes/Edit/Editor.cs +++ b/osu.Game/GameModes/Edit/Editor.cs @@ -19,12 +19,12 @@ namespace osu.Game.GameModes.Edit protected override void OnEntering(GameMode last) { base.OnEntering(last); - Background.FadeColour(Color4.DarkGray, 500); + Background.Schedule(() => Background.FadeColour(Color4.DarkGray, 500)); } protected override bool OnExiting(GameMode next) { - Background.FadeColour(Color4.White, 500); + Background.Schedule(() => Background.FadeColour(Color4.White, 500)); return base.OnExiting(next); } } diff --git a/osu.Game/GameModes/Multiplayer/Match.cs b/osu.Game/GameModes/Multiplayer/Match.cs index e4db8ea19f..d5dfdffdb3 100644 --- a/osu.Game/GameModes/Multiplayer/Match.cs +++ b/osu.Game/GameModes/Multiplayer/Match.cs @@ -26,12 +26,12 @@ namespace osu.Game.GameModes.Multiplayer { base.OnEntering(last); - Background.FadeColour(Color4.DarkGray, 500); + Background.Schedule(() => Background.FadeColour(Color4.DarkGray, 500)); } protected override bool OnExiting(GameMode next) { - Background.FadeColour(Color4.White, 500); + Background.Schedule(() => Background.FadeColour(Color4.White, 500)); return base.OnExiting(next); } } diff --git a/osu.Game/GameModes/Play/ModSelect.cs b/osu.Game/GameModes/Play/ModSelect.cs index 525fdeeb94..33cb00ce35 100644 --- a/osu.Game/GameModes/Play/ModSelect.cs +++ b/osu.Game/GameModes/Play/ModSelect.cs @@ -19,12 +19,12 @@ namespace osu.Game.GameModes.Play protected override void OnEntering(GameMode last) { base.OnEntering(last); - Background.FadeColour(Color4.DarkGray, 500); + Background.Schedule(() => Background.FadeColour(Color4.DarkGray, 500)); } protected override bool OnExiting(GameMode next) { - Background.FadeColour(Color4.White, 500); + Background.Schedule(() => Background.FadeColour(Color4.White, 500)); return base.OnExiting(next); } } diff --git a/osu.Game/GameModes/Ranking/Results.cs b/osu.Game/GameModes/Ranking/Results.cs index 2ffb1660c1..5c941e85a8 100644 --- a/osu.Game/GameModes/Ranking/Results.cs +++ b/osu.Game/GameModes/Ranking/Results.cs @@ -14,12 +14,12 @@ namespace osu.Game.GameModes.Ranking protected override void OnEntering(GameMode last) { base.OnEntering(last); - Background.FadeColour(Color4.DarkGray, 500); + Background.Schedule(() => Background.FadeColour(Color4.DarkGray, 500)); } protected override bool OnExiting(GameMode next) { - Background.FadeColour(Color4.White, 500); + Background.Schedule(() => Background.FadeColour(Color4.White, 500)); return base.OnExiting(next); } } From 3d611dd57bb1c57a69c76d23dd1a2e83d6e87486 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 2 Nov 2016 01:02:48 +0900 Subject: [PATCH 19/25] Improve coodination of startup sequence. --- osu.Game/GameModes/Menu/Intro.cs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/osu.Game/GameModes/Menu/Intro.cs b/osu.Game/GameModes/Menu/Intro.cs index 8b9c9a8353..308eb157d3 100644 --- a/osu.Game/GameModes/Menu/Intro.cs +++ b/osu.Game/GameModes/Menu/Intro.cs @@ -59,27 +59,27 @@ namespace osu.Game.GameModes.Menu Scheduler.Add(delegate { welcome.Play(); + + Scheduler.AddDelayed(delegate + { + bgm.Start(); + + mainMenu = new MainMenu(); + mainMenu.Preload(Game); + + Scheduler.AddDelayed(delegate + { + DidLoadMenu = true; + Push(mainMenu); + }, 2300); + }, 600); }); - Scheduler.AddDelayed(delegate - { - bgm.Start(); - }, 600); - - Scheduler.AddDelayed(delegate - { - DidLoadMenu = true; - Push(mainMenu); - }, 2900); - logo.ScaleTo(0.4f); logo.FadeOut(); logo.ScaleTo(1, 4400, EasingTypes.OutQuint); logo.FadeIn(20000, EasingTypes.OutQuint); - - mainMenu = new MainMenu(); - mainMenu.Preload(Game); } protected override void OnSuspending(GameMode next) From 128ec8f7673e78c3e18d0f625ce59b7097648306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Tue, 1 Nov 2016 22:21:09 +0100 Subject: [PATCH 20/25] Fix beatmap panel border alpha being way too large. --- osu.Game/Beatmaps/Drawable/Panel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/Drawable/Panel.cs b/osu.Game/Beatmaps/Drawable/Panel.cs index b0c0821197..befcab40e8 100644 --- a/osu.Game/Beatmaps/Drawable/Panel.cs +++ b/osu.Game/Beatmaps/Drawable/Panel.cs @@ -53,7 +53,7 @@ namespace osu.Game.Beatmaps.Drawable protected virtual void Selected() { - BorderColour = new Color4(BorderColour.R, BorderColour.G, BorderColour.B, 255); + BorderColour = new Color4(BorderColour.R, BorderColour.G, BorderColour.B, 1f); GlowRadius = 10; BorderThickness = 2.5f; } From 50de8528a5414c89606d16307006e456121f6f09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Tue, 1 Nov 2016 22:57:11 +0100 Subject: [PATCH 21/25] Use better glow in beatmap selection. --- osu.Game/Beatmaps/Drawable/Panel.cs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/osu.Game/Beatmaps/Drawable/Panel.cs b/osu.Game/Beatmaps/Drawable/Panel.cs index b0c0821197..e1c7f41d28 100644 --- a/osu.Game/Beatmaps/Drawable/Panel.cs +++ b/osu.Game/Beatmaps/Drawable/Panel.cs @@ -23,7 +23,6 @@ namespace osu.Game.Beatmaps.Drawable Masking = true; CornerRadius = 10; BorderColour = new Color4(221, 255, 255, 0); - GlowColour = new Color4(102, 204, 255, 100); RelativeSizeAxes = Axes.X; } @@ -54,21 +53,29 @@ namespace osu.Game.Beatmaps.Drawable protected virtual void Selected() { BorderColour = new Color4(BorderColour.R, BorderColour.G, BorderColour.B, 255); - GlowRadius = 10; BorderThickness = 2.5f; + + EdgeEffect = new EdgeEffect + { + Type = EdgeEffectType.Glow, + Colour = new Color4(150, 204, 255, 150), + Radius = 20, + Roundness = 10, + }; } protected virtual void Deselected() { BorderColour = new Color4(BorderColour.R, BorderColour.G, BorderColour.B, 0); - GlowRadius = 0; BorderThickness = 0; + + EdgeEffect = new EdgeEffect { Type = EdgeEffectType.None }; } - protected override bool OnClick(InputState state) - { - State = PanelSelectedState.Selected; - return true; + protected override bool OnClick(InputState state) + { + State = PanelSelectedState.Selected; + return true; } } From 617a3f5c4f0f99bdd72c6f299326491703ec819e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 2 Nov 2016 10:22:46 +0900 Subject: [PATCH 22/25] Adjust glow colour slightly. --- osu.Game/Beatmaps/Drawable/Panel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/Drawable/Panel.cs b/osu.Game/Beatmaps/Drawable/Panel.cs index e1c7f41d28..d2b1793b30 100644 --- a/osu.Game/Beatmaps/Drawable/Panel.cs +++ b/osu.Game/Beatmaps/Drawable/Panel.cs @@ -58,7 +58,7 @@ namespace osu.Game.Beatmaps.Drawable EdgeEffect = new EdgeEffect { Type = EdgeEffectType.Glow, - Colour = new Color4(150, 204, 255, 150), + Colour = new Color4(130, 204, 255, 150), Radius = 20, Roundness = 10, }; From 14ff355b183b37b3be9716bde3830eb1db27e7af Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 2 Nov 2016 16:47:24 +0900 Subject: [PATCH 23/25] Update framework. --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 059520c918..b0a06ff37b 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 059520c91803855835c734bb6d9b56e90238fe78 +Subproject commit b0a06ff37b1c9594b5d64bdcfca8c250bf2889b2 From 046d51e39e55d056650cd9215fdd6805d15f695b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 3 Nov 2016 16:41:54 +0900 Subject: [PATCH 24/25] Update framework. --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 3b2e4f12bd..92b49515ee 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 3b2e4f12bd9a4299a052aea6198db9dbefff86f4 +Subproject commit 92b49515eeae2f6a7c96247b8c3eda97e5514780 From 7a54fdfffbfe7b27ddea6cc8c839e1c76c3df908 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 3 Nov 2016 16:59:16 +0900 Subject: [PATCH 25/25] Fix ImportBeatmapTest. --- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index b81ac8b966..eb8e9260df 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -55,6 +55,9 @@ namespace osu.Game.Tests.Beatmaps.IO var osu = new OsuGameBase(); host.Add(osu); + while (!osu.IsLoaded) + Thread.Sleep(1); + //reset beatmap database (sqlite and storage backing) osu.Beatmaps.Reset();