From bb6478cdc3e98dee0cbfb8a6d722d012ae556233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Odg=C3=A5rd=20T=C3=B8rring?= Date: Thu, 10 May 2018 10:15:47 +0200 Subject: [PATCH 01/85] Adds a check to disable music controller's seek --- osu.Game/Overlays/MusicController.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index b4021f2808..0605b211b0 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -206,7 +206,7 @@ namespace osu.Game.Overlays Anchor = Anchor.BottomCentre, Height = progress_height, FillColour = colours.Yellow, - OnSeek = progress => current?.Track.Seek(progress) + OnSeek = progress => ConditionalSeek(progress) } }, }, @@ -219,6 +219,13 @@ namespace osu.Game.Overlays playlist.StateChanged += s => playlistButton.FadeColour(s == Visibility.Visible ? colours.Yellow : Color4.White, 200, Easing.OutQuint); } + private bool? ConditionalSeek(double progress) + { + if (current.Track.Looping) + return current?.Track.Seek(progress); + return false; + } + protected override void LoadComplete() { beatmapBacking.ValueChanged += beatmapChanged; From 5b99d8df62c5176f1400d41c81e88905d7c108e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Odg=C3=A5rd=20T=C3=B8rring?= Date: Thu, 10 May 2018 11:29:19 +0200 Subject: [PATCH 02/85] Fixes private method name capitalization --- osu.Game/Overlays/MusicController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 0605b211b0..ee928b3ccc 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -206,7 +206,7 @@ namespace osu.Game.Overlays Anchor = Anchor.BottomCentre, Height = progress_height, FillColour = colours.Yellow, - OnSeek = progress => ConditionalSeek(progress) + OnSeek = progress => conditionalSeek(progress) } }, }, @@ -219,7 +219,7 @@ namespace osu.Game.Overlays playlist.StateChanged += s => playlistButton.FadeColour(s == Visibility.Visible ? colours.Yellow : Color4.White, 200, Easing.OutQuint); } - private bool? ConditionalSeek(double progress) + private bool? conditionalSeek(double progress) { if (current.Track.Looping) return current?.Track.Seek(progress); From d54a7295f6a72a49cd7d7eece02cbb4cdb30f5b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Odg=C3=A5rd=20T=C3=B8rring?= Date: Thu, 10 May 2018 13:20:04 +0200 Subject: [PATCH 03/85] Adds DisableSeek property to MusicController --- osu.Game/OsuGame.cs | 9 ++++++--- osu.Game/Overlays/MusicController.cs | 6 +++--- osu.Game/Screens/OsuScreen.cs | 2 ++ osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs | 2 ++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index d443ed36ae..4d6b4520fe 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -537,10 +537,13 @@ namespace osu.Game // we only want to apply these restrictions when we are inside a screen stack. // the use case for not applying is in visual/unit tests. - bool applyRestrictions = !currentScreen?.AllowBeatmapRulesetChange ?? false; + bool applyBeatmapRulesetRestrictions = !currentScreen?.AllowBeatmapRulesetChange ?? false; + bool applyUserSeekRestrictions = !currentScreen?.AllowUserSeek ?? false; - Ruleset.Disabled = applyRestrictions; - Beatmap.Disabled = applyRestrictions; + Ruleset.Disabled = applyBeatmapRulesetRestrictions; + Beatmap.Disabled = applyBeatmapRulesetRestrictions; + + musicController.DisableSeek = applyUserSeekRestrictions; mainContent.Padding = new MarginPadding { Top = ToolbarOffset }; diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index ee928b3ccc..9cfce04685 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -221,9 +221,7 @@ namespace osu.Game.Overlays private bool? conditionalSeek(double progress) { - if (current.Track.Looping) - return current?.Track.Seek(progress); - return false; + return DisableSeek ? false : current?.Track.Seek(progress); } protected override void LoadComplete() @@ -235,6 +233,8 @@ namespace osu.Game.Overlays base.LoadComplete(); } + public bool DisableSeek { get; set; } + private void beatmapDisabledChanged(bool disabled) { if (disabled) diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 7a910574e0..48c3d95b0c 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -50,6 +50,8 @@ namespace osu.Game.Screens /// public virtual bool AllowBeatmapRulesetChange => true; + public virtual bool AllowUserSeek => true; + protected readonly Bindable Beatmap = new Bindable(); protected virtual float BackgroundParallaxAmount => 1; diff --git a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs index 1ccc5e2fe8..add02732d4 100644 --- a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs +++ b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs @@ -17,6 +17,8 @@ namespace osu.Game.Screens.Play public override bool AllowBeatmapRulesetChange => false; + public override bool AllowUserSeek => false; + protected const float BACKGROUND_FADE_DURATION = 800; protected float BackgroundOpacity => 1 - (float)DimLevel; From a877855fc615f697d4d205a304d4dde62031e70a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Odg=C3=A5rd=20T=C3=B8rring?= Date: Fri, 11 May 2018 09:39:55 +0200 Subject: [PATCH 04/85] Changes conditionSeek return type to void --- osu.Game/Overlays/MusicController.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 9cfce04685..a0074ccee7 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -219,9 +219,11 @@ namespace osu.Game.Overlays playlist.StateChanged += s => playlistButton.FadeColour(s == Visibility.Visible ? colours.Yellow : Color4.White, 200, Easing.OutQuint); } - private bool? conditionalSeek(double progress) + private void conditionalSeek(double progress) { - return DisableSeek ? false : current?.Track.Seek(progress); + if (DisableSeek) + return; + current?.Track.Seek(progress); } protected override void LoadComplete() From 17ed5e48390cb3d19fb8ae2554b86c6aa60a3985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Odg=C3=A5rd=20T=C3=B8rring?= Date: Fri, 11 May 2018 09:41:31 +0200 Subject: [PATCH 05/85] Moves seek restrictions to Player --- osu.Game/Screens/Play/Player.cs | 2 ++ osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 83958b2912..8989cbaad4 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -45,6 +45,8 @@ namespace osu.Game.Screens.Play public bool AllowLeadIn { get; set; } = true; public bool AllowResults { get; set; } = true; + public override bool AllowUserSeek => false; + private Bindable mouseWheelDisabled; private Bindable userAudioOffset; diff --git a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs index add02732d4..1ccc5e2fe8 100644 --- a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs +++ b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs @@ -17,8 +17,6 @@ namespace osu.Game.Screens.Play public override bool AllowBeatmapRulesetChange => false; - public override bool AllowUserSeek => false; - protected const float BACKGROUND_FADE_DURATION = 800; protected float BackgroundOpacity => 1 - (float)DimLevel; From c55d47ff1085d0b215f3619678bcbac277c63adf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Odg=C3=A5rd=20T=C3=B8rring?= Date: Fri, 11 May 2018 09:56:23 +0200 Subject: [PATCH 06/85] Converts OnSeek assignment to method group --- osu.Game/Overlays/MusicController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index a0074ccee7..45a59a0f87 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -206,7 +206,7 @@ namespace osu.Game.Overlays Anchor = Anchor.BottomCentre, Height = progress_height, FillColour = colours.Yellow, - OnSeek = progress => conditionalSeek(progress) + OnSeek = conditionalSeek } }, }, From a7e7c3a74a2132d173f2be310e2583acd808d126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Odg=C3=A5rd=20T=C3=B8rring?= Date: Sat, 12 May 2018 11:55:52 +0200 Subject: [PATCH 07/85] Enables/Disables seek and Play/Resume on call to beatmapDisabledChanged --- osu.Game/OsuGame.cs | 3 --- osu.Game/Overlays/MusicController.cs | 9 +++++---- osu.Game/Screens/OsuScreen.cs | 2 -- osu.Game/Screens/Play/Player.cs | 2 -- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 4d6b4520fe..4e79ea48ca 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -538,13 +538,10 @@ namespace osu.Game // we only want to apply these restrictions when we are inside a screen stack. // the use case for not applying is in visual/unit tests. bool applyBeatmapRulesetRestrictions = !currentScreen?.AllowBeatmapRulesetChange ?? false; - bool applyUserSeekRestrictions = !currentScreen?.AllowUserSeek ?? false; Ruleset.Disabled = applyBeatmapRulesetRestrictions; Beatmap.Disabled = applyBeatmapRulesetRestrictions; - musicController.DisableSeek = applyUserSeekRestrictions; - mainContent.Padding = new MarginPadding { Top = ToolbarOffset }; CursorOverrideContainer.CanShowCursor = currentScreen?.CursorVisible ?? false; diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 45a59a0f87..8ff8dfb3ad 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -221,9 +221,8 @@ namespace osu.Game.Overlays private void conditionalSeek(double progress) { - if (DisableSeek) - return; - current?.Track.Seek(progress); + if (EnableSeek) + current?.Track.Seek(progress); } protected override void LoadComplete() @@ -235,16 +234,18 @@ namespace osu.Game.Overlays base.LoadComplete(); } - public bool DisableSeek { get; set; } + private bool EnableSeek { get; set; } private void beatmapDisabledChanged(bool disabled) { if (disabled) playlist.Hide(); + playButton.Enabled.Value = !disabled; prevButton.Enabled.Value = !disabled; nextButton.Enabled.Value = !disabled; playlistButton.Enabled.Value = !disabled; + EnableSeek = !disabled; } protected override void UpdateAfterChildren() diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 48c3d95b0c..7a910574e0 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -50,8 +50,6 @@ namespace osu.Game.Screens /// public virtual bool AllowBeatmapRulesetChange => true; - public virtual bool AllowUserSeek => true; - protected readonly Bindable Beatmap = new Bindable(); protected virtual float BackgroundParallaxAmount => 1; diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 2e6db93065..f397d0c3d4 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -45,8 +45,6 @@ namespace osu.Game.Screens.Play public bool AllowLeadIn { get; set; } = true; public bool AllowResults { get; set; } = true; - public override bool AllowUserSeek => false; - private Bindable mouseWheelDisabled; private Bindable userAudioOffset; From 861a8cf9a749a079f983ac38b4bb38fe0704f790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Odg=C3=A5rd=20T=C3=B8rring?= Date: Sat, 12 May 2018 23:10:03 +0200 Subject: [PATCH 08/85] Fixes capitalization of enableSeek --- osu.Game/Overlays/MusicController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 8ff8dfb3ad..0406bb812c 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -221,7 +221,7 @@ namespace osu.Game.Overlays private void conditionalSeek(double progress) { - if (EnableSeek) + if (enableSeek) current?.Track.Seek(progress); } @@ -234,7 +234,7 @@ namespace osu.Game.Overlays base.LoadComplete(); } - private bool EnableSeek { get; set; } + private bool enableSeek { get; set; } private void beatmapDisabledChanged(bool disabled) { @@ -245,7 +245,7 @@ namespace osu.Game.Overlays prevButton.Enabled.Value = !disabled; nextButton.Enabled.Value = !disabled; playlistButton.Enabled.Value = !disabled; - EnableSeek = !disabled; + enableSeek = !disabled; } protected override void UpdateAfterChildren() From 2979cb96a6eae23852f245042a248966e5e802ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Odg=C3=A5rd=20T=C3=B8rring?= Date: Wed, 4 Jul 2018 21:09:28 +0200 Subject: [PATCH 09/85] attemptSeek accesses beatmap Disabled directly --- osu.Game/Overlays/MusicController.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index f7f0d7ec6a..94b69271fd 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -183,7 +183,7 @@ namespace osu.Game.Overlays Anchor = Anchor.BottomCentre, Height = progress_height, FillColour = colours.Yellow, - OnSeek = conditionalSeek + OnSeek = attemptSeek } }, }, @@ -198,9 +198,9 @@ namespace osu.Game.Overlays playlist.StateChanged += s => playlistButton.FadeColour(s == Visibility.Visible ? colours.Yellow : Color4.White, 200, Easing.OutQuint); } - private void conditionalSeek(double progress) + private void attemptSeek(double progress) { - if (enableSeek) + if (!beatmap.Disabled) current?.Track.Seek(progress); } @@ -220,8 +220,6 @@ namespace osu.Game.Overlays base.LoadComplete(); } - private bool enableSeek { get; set; } - private void beatmapDisabledChanged(bool disabled) { if (disabled) @@ -231,7 +229,6 @@ namespace osu.Game.Overlays prevButton.Enabled.Value = !disabled; nextButton.Enabled.Value = !disabled; playlistButton.Enabled.Value = !disabled; - enableSeek = !disabled; } protected override void UpdateAfterChildren() From fb09385f5135c187a281bab6b4fc09fb0adcf46c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 18 Jul 2018 11:01:08 +0900 Subject: [PATCH 10/85] Remove net471 targeting --- osu.Desktop/osu.Desktop.csproj | 2 +- .../osu.Game.Rulesets.Catch.Tests.csproj | 2 +- .../osu.Game.Rulesets.Mania.Tests.csproj | 2 +- osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj | 2 +- .../osu.Game.Rulesets.Taiko.Tests.csproj | 2 +- osu.Game.Tests/osu.Game.Tests.csproj | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 0289db20f0..1d9928134d 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -1,7 +1,7 @@  - net471;netcoreapp2.1 + netcoreapp2.1 WinExe AnyCPU true diff --git a/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj b/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj index 93fa2c4d67..66c81dc14d 100644 --- a/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj +++ b/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj @@ -2,7 +2,7 @@ WinExe - netcoreapp2.1;net471 + netcoreapp2.1 diff --git a/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj b/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj index 77504fdc3c..7427862c0d 100644 --- a/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj +++ b/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj @@ -2,7 +2,7 @@ WinExe - netcoreapp2.1;net471 + netcoreapp2.1 diff --git a/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj b/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj index c5d9b26145..0d0e023e2a 100644 --- a/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj +++ b/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj @@ -2,7 +2,7 @@ WinExe - netcoreapp2.1;net471 + netcoreapp2.1 diff --git a/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj b/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj index dea34d25e7..3c38a48be6 100644 --- a/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj +++ b/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj @@ -2,7 +2,7 @@ WinExe - netcoreapp2.1;net471 + netcoreapp2.1 diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 532915100b..066df5418a 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -2,7 +2,7 @@ WinExe - netcoreapp2.1;net471 + netcoreapp2.1 From 5fe634a3b6907db48657fe97e80694ea8d00da48 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 17 Jul 2018 21:36:33 +0900 Subject: [PATCH 11/85] Click download button to load beatmap --- osu.Game/Overlays/Direct/DownloadButton.cs | 49 ++++++++++++---------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/osu.Game/Overlays/Direct/DownloadButton.cs b/osu.Game/Overlays/Direct/DownloadButton.cs index 7758e171c5..99a5881487 100644 --- a/osu.Game/Overlays/Direct/DownloadButton.cs +++ b/osu.Game/Overlays/Direct/DownloadButton.cs @@ -14,6 +14,7 @@ namespace osu.Game.Overlays.Direct { public class DownloadButton : OsuAnimatedButton { + private readonly BeatmapSetInfo beatmapSet; private readonly SpriteIcon icon; private readonly SpriteIcon checkmark; private readonly BeatmapSetDownloader downloader; @@ -21,11 +22,13 @@ namespace osu.Game.Overlays.Direct private OsuColour colours; - public DownloadButton(BeatmapSetInfo set, bool noVideo = false) + public DownloadButton(BeatmapSetInfo beatmapSet, bool noVideo = false) { + this.beatmapSet = beatmapSet; + AddRange(new Drawable[] { - downloader = new BeatmapSetDownloader(set, noVideo), + downloader = new BeatmapSetDownloader(beatmapSet, noVideo), background = new Box { RelativeSizeAxes = Axes.Both, @@ -47,26 +50,6 @@ namespace osu.Game.Overlays.Direct Icon = FontAwesome.fa_check, } }); - - Action = () => - { - if (downloader.DownloadState == BeatmapSetDownloader.DownloadStatus.Downloading) - { - // todo: replace with ShakeContainer after https://github.com/ppy/osu/pull/2909 is merged. - Content.MoveToX(-5, 50, Easing.OutSine).Then() - .MoveToX(5, 100, Easing.InOutSine).Then() - .MoveToX(-5, 100, Easing.InOutSine).Then() - .MoveToX(0, 50, Easing.InSine); - } - else if (downloader.DownloadState == BeatmapSetDownloader.DownloadStatus.Downloaded) - { - // TODO: Jump to song select with this set when the capability is implemented - } - else - { - downloader.Download(); - } - }; } protected override void LoadComplete() @@ -77,9 +60,29 @@ namespace osu.Game.Overlays.Direct } [BackgroundDependencyLoader(permitNulls: true)] - private void load(OsuColour colours) + private void load(OsuColour colours, OsuGame game) { this.colours = colours; + + Action = () => + { + switch (downloader.DownloadState.Value) + { + case BeatmapSetDownloader.DownloadStatus.Downloading: + // todo: replace with ShakeContainer after https://github.com/ppy/osu/pull/2909 is merged. + Content.MoveToX(-5, 50, Easing.OutSine).Then() + .MoveToX(5, 100, Easing.InOutSine).Then() + .MoveToX(-5, 100, Easing.InOutSine).Then() + .MoveToX(0, 50, Easing.InSine); + break; + case BeatmapSetDownloader.DownloadStatus.Downloaded: + game.PresentBeatmap(beatmapSet); + break; + default: + downloader.Download(); + break; + } + }; } private void updateState(BeatmapSetDownloader.DownloadStatus state) From f1c3fbe6446c3301d6ba6ef2861aa864367c3a66 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 17 Jul 2018 22:20:19 +0900 Subject: [PATCH 12/85] Improve integrity of song select bind/change logic --- osu.Game/OsuGame.cs | 8 +++- osu.Game/Screens/Select/FilterControl.cs | 2 +- osu.Game/Screens/Select/SongSelect.cs | 49 ++++++++++++------------ 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 18a1d018d0..efa211b9d4 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -197,7 +197,13 @@ namespace osu.Game return; } - Beatmap.Value = BeatmapManager.GetWorkingBeatmap(beatmap.Beatmaps.First()); + var databasedSet = BeatmapManager.QueryBeatmapSet(s => s.OnlineBeatmapSetID == beatmap.OnlineBeatmapSetID); + + // Use first beatmap available for current ruleset, else switch ruleset. + var first = databasedSet.Beatmaps.FirstOrDefault(b => b.Ruleset == ruleset.Value) ?? databasedSet.Beatmaps.First(); + + ruleset.Value = first.Ruleset; + Beatmap.Value = BeatmapManager.GetWorkingBeatmap(first); } switch (currentScreen) diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index 278d32b2d5..cd86015c65 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -181,7 +181,7 @@ namespace osu.Game.Screens.Select showConverted.ValueChanged += val => updateCriteria(); ruleset.BindTo(parentRuleset); - ruleset.BindValueChanged(val => updateCriteria(), true); + ruleset.BindValueChanged(_ => updateCriteria(), true); } private void updateCriteria() => FilterChanged?.Invoke(CreateCriteria()); diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 234508a195..f8ceea2bf3 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -67,7 +67,7 @@ namespace osu.Game.Screens.Select private SampleChannel sampleChangeDifficulty; private SampleChannel sampleChangeBeatmap; - protected new readonly Bindable Ruleset = new Bindable(); + public new readonly Bindable Ruleset = new Bindable(); private DependencyContainer dependencies; @@ -138,7 +138,7 @@ namespace osu.Game.Screens.Select Size = new Vector2(carousel_width, 1), Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, - SelectionChanged = updateSelectedBeatmap, + SelectionChanged = b => updateSelectedBeatmap(b, null), BeatmapSetsChanged = carouselBeatmapsLoaded, }, FilterControl = new FilterControl @@ -198,10 +198,6 @@ namespace osu.Game.Screens.Select [BackgroundDependencyLoader(true)] private void load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dialog, OsuColour colours) { - // manual binding to parent ruleset to allow for delayed load in the incoming direction. - base.Ruleset.ValueChanged += r => updateSelectedBeatmap(beatmapNoDebounce); - Ruleset.ValueChanged += r => base.Ruleset.Value = r; - if (Footer != null) { Footer.AddButton(@"random", colours.Green, triggerRandom, Key.F2); @@ -224,15 +220,6 @@ namespace osu.Game.Screens.Select sampleChangeBeatmap = audio.Sample.Get(@"SongSelect/select-expand"); Carousel.BeatmapSets = this.beatmaps.GetAllUsableBeatmapSetsEnumerable(); - - Beatmap.BindDisabledChanged(disabled => Carousel.AllowSelection = !disabled, true); - Beatmap.BindValueChanged(workingBeatmapChanged); - } - - protected override void LoadComplete() - { - base.LoadComplete(); - base.Ruleset.ValueChanged += r => updateSelectedBeatmap(beatmapNoDebounce); } public void Edit(BeatmapInfo beatmap) @@ -298,15 +285,26 @@ namespace osu.Game.Screens.Select /// /// selection has been changed as the result of a user interaction. /// - private void updateSelectedBeatmap(BeatmapInfo beatmap) + private void updateSelectedBeatmap(BeatmapInfo beatmap, RulesetInfo ruleset) { - var ruleset = base.Ruleset.Value; + if (ruleset == null) ruleset = rulesetNoDebounce; + if (beatmap == null) beatmap = beatmapNoDebounce; void performLoad() { WorkingBeatmap working = Beatmap.Value; + bool preview = false; + if (ruleset?.Equals(Ruleset.Value) != true) + { + Ruleset.Value = ruleset; + + // force a filter before attempting to change the beatmap. + // we may still be in the wrong ruleset as there is a debounce delay on ruleset changes. + Carousel.Filter(null, false); + } + // We may be arriving here due to another component changing the bindable Beatmap. // In these cases, the other component has already loaded the beatmap, so we don't need to do so again. if (beatmap?.Equals(Beatmap.Value.BeatmapInfo) != true) @@ -315,11 +313,9 @@ namespace osu.Game.Screens.Select working = beatmaps.GetWorkingBeatmap(beatmap, Beatmap.Value); } - working.Mods.Value = Enumerable.Empty(); Beatmap.Value = working; - Ruleset.Value = ruleset; ensurePlayingSelected(preview); @@ -343,10 +339,7 @@ namespace osu.Game.Screens.Select else sampleChangeBeatmap.Play(); - if (beatmap == Beatmap.Value.BeatmapInfo) - performLoad(); - else - selectionChangedDebounce = Scheduler.AddDelayed(performLoad, 200); + selectionChangedDebounce = Scheduler.AddDelayed(performLoad, 200); } } @@ -494,6 +487,14 @@ namespace osu.Game.Screens.Select private void carouselBeatmapsLoaded() { + // manual binding to parent ruleset to allow for delayed load in the incoming direction. + rulesetNoDebounce = Ruleset.Value = base.Ruleset.Value; + base.Ruleset.ValueChanged += r => updateSelectedBeatmap(null, r); + Ruleset.ValueChanged += r => base.Ruleset.Value = r; + + Beatmap.BindDisabledChanged(disabled => Carousel.AllowSelection = !disabled, true); + Beatmap.BindValueChanged(workingBeatmapChanged); + if (!Beatmap.IsDefault && Beatmap.Value.BeatmapSetInfo?.DeletePending == false && Beatmap.Value.BeatmapSetInfo?.Protected == false && Carousel.SelectBeatmap(Beatmap.Value.BeatmapInfo, false)) return; @@ -502,7 +503,7 @@ namespace osu.Game.Screens.Select { // in the case random selection failed, we want to trigger selectionChanged // to show the dummy beatmap (we have nothing else to display). - updateSelectedBeatmap(null); + updateSelectedBeatmap(null, null); } } From 9611292f4ec03e9f58ea4544e2ef0432e2ed0aaa Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 18 Jul 2018 10:12:14 +0900 Subject: [PATCH 13/85] FilterTask -> PendingFilter --- osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs | 2 +- osu.Game/Screens/Select/BeatmapCarousel.cs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs b/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs index 6d2b37d981..db66c01814 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs @@ -530,7 +530,7 @@ namespace osu.Game.Tests.Visual { public new List Items => base.Items; - public bool PendingFilterTask => FilterTask != null; + public bool PendingFilterTask => PendingFilter != null; } } } diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 3c9a14e1f4..3430d522ca 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -329,13 +329,13 @@ namespace osu.Game.Screens.Select private FilterCriteria activeCriteria = new FilterCriteria(); - protected ScheduledDelegate FilterTask; + protected ScheduledDelegate PendingFilter; public bool AllowSelection = true; public void FlushPendingFilterOperations() { - if (FilterTask?.Completed == false) + if (PendingFilter?.Completed == false) { applyActiveCriteria(false, false); Update(); @@ -356,18 +356,18 @@ namespace osu.Game.Screens.Select void perform() { - FilterTask = null; + PendingFilter = null; root.Filter(activeCriteria); itemsCache.Invalidate(); if (scroll) scrollPositionCache.Invalidate(); } - FilterTask?.Cancel(); - FilterTask = null; + PendingFilter?.Cancel(); + PendingFilter = null; if (debounce) - FilterTask = Scheduler.AddDelayed(perform, 250); + PendingFilter = Scheduler.AddDelayed(perform, 250); else perform(); } From 90840c93840b9b0c1c71effa3aaa493f676da00a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 18 Jul 2018 12:58:28 +0900 Subject: [PATCH 14/85] Fix ArchiveModelManager's model import method not running import logic --- osu.Game/Beatmaps/BeatmapManager.cs | 3 +- osu.Game/Database/ArchiveModelManager.cs | 42 ++++++++++++-------- osu.Game/Database/SingletonContextFactory.cs | 2 +- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 78042349d1..4ff16b604a 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -91,7 +91,8 @@ namespace osu.Game.Beatmaps protected override void Populate(BeatmapSetInfo model, ArchiveReader archive) { - model.Beatmaps = createBeatmapDifficulties(archive); + if (archive != null) + model.Beatmaps = createBeatmapDifficulties(archive); foreach (BeatmapInfo b in model.Beatmaps) { diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index cbf0df3227..0465c0ad73 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using JetBrains.Annotations; using Microsoft.EntityFrameworkCore; using osu.Framework.IO.File; using osu.Framework.Logging; @@ -175,7 +176,24 @@ namespace osu.Game.Database /// The archive to be imported. public TModel Import(ArchiveReader archive) { - TModel item = null; + try + { + return Import(CreateModel(archive), archive); + } + catch (Exception e) + { + Logger.Error(e, $"Model creation of {archive.Name} failed.", LoggingTarget.Database); + return null; + } + } + + /// + /// Import an item from a . + /// + /// The model to be imported. + /// An optional archive to use for model population. + public TModel Import(TModel item, ArchiveReader archive = null) + { delayEvents(); try @@ -186,18 +204,16 @@ namespace osu.Game.Database { if (!write.IsTransactionLeader) throw new InvalidOperationException($"Ensure there is no parent transaction so errors can correctly be handled by {this}"); - // create a new model (don't yet add to database) - item = CreateModel(archive); - var existing = CheckForExisting(item); if (existing != null) { - Logger.Log($"Found existing {typeof(TModel)} for {archive.Name} (ID {existing.ID}). Skipping import.", LoggingTarget.Database); + Logger.Log($"Found existing {typeof(TModel)} for {item} (ID {existing.ID}). Skipping import.", LoggingTarget.Database); return existing; } - item.Files = createFileInfos(archive, Files); + if (archive != null) + item.Files = createFileInfos(archive, Files); Populate(item, archive); @@ -211,11 +227,11 @@ namespace osu.Game.Database } } - Logger.Log($"Import of {archive.Name} successfully completed!", LoggingTarget.Database); + Logger.Log($"Import of {item} successfully completed!", LoggingTarget.Database); } catch (Exception e) { - Logger.Error(e, $"Import of {archive.Name} failed and has been rolled back.", LoggingTarget.Database); + Logger.Error(e, $"Import of {item} failed and has been rolled back.", LoggingTarget.Database); item = null; } finally @@ -227,12 +243,6 @@ namespace osu.Game.Database return item; } - /// - /// Import an item from a . - /// - /// The model to be imported. - public void Import(TModel item) => ModelStore.Add(item); - /// /// Perform an update of the specified item. /// TODO: Support file changes. @@ -385,8 +395,8 @@ namespace osu.Game.Database /// After this method, the model should be in a state ready to commit to a store. /// /// The model to populate. - /// The archive to use as a reference for population. - protected virtual void Populate(TModel model, ArchiveReader archive) + /// The archive to use as a reference for population. May be null. + protected virtual void Populate(TModel model, [CanBeNull] ArchiveReader archive) { } diff --git a/osu.Game/Database/SingletonContextFactory.cs b/osu.Game/Database/SingletonContextFactory.cs index ce3fbf6881..a7158c0583 100644 --- a/osu.Game/Database/SingletonContextFactory.cs +++ b/osu.Game/Database/SingletonContextFactory.cs @@ -14,6 +14,6 @@ namespace osu.Game.Database public OsuDbContext Get() => context; - public DatabaseWriteUsage GetForWrite(bool withTransaction = true) => new DatabaseWriteUsage(context, null); + public DatabaseWriteUsage GetForWrite(bool withTransaction = true) => new DatabaseWriteUsage(context, null) { IsTransactionLeader = true }; } } From 1d52231d4fb1ad53e3052c93c09138b5fe7c86cd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 18 Jul 2018 16:43:46 +0900 Subject: [PATCH 15/85] Remove SingletonContextFactory It is dangerous to use this as it doesn't correctly handle contexts and can cause issues that will never actually arise in normal execution. --- .../Visual/TestCasePlaySongSelect.cs | 7 ++++++- osu.Game/Database/DatabaseContextFactory.cs | 10 +++++----- osu.Game/Database/SingletonContextFactory.cs | 19 ------------------- osu.Game/OsuGameBase.cs | 2 +- osu.Game/Tests/Platform/TestStorage.cs | 8 +++----- 5 files changed, 15 insertions(+), 31 deletions(-) delete mode 100644 osu.Game/Database/SingletonContextFactory.cs diff --git a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs index dab7f7e037..4afb76a7e2 100644 --- a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs @@ -62,7 +62,12 @@ namespace osu.Game.Tests.Visual var storage = new TestStorage(@"TestCasePlaySongSelect"); // this is by no means clean. should be replacing inside of OsuGameBase somehow. - IDatabaseContextFactory factory = new SingletonContextFactory(new OsuDbContext()); + DatabaseContextFactory factory = new DatabaseContextFactory(storage); + + factory.ResetDatabase(); + + using (var usage = factory.Get()) + usage.Migrate(); Dependencies.Cache(rulesets = new RulesetStore(factory)); Dependencies.Cache(manager = new BeatmapManager(storage, factory, rulesets, null, null) diff --git a/osu.Game/Database/DatabaseContextFactory.cs b/osu.Game/Database/DatabaseContextFactory.cs index 5160239c38..c20d4569f6 100644 --- a/osu.Game/Database/DatabaseContextFactory.cs +++ b/osu.Game/Database/DatabaseContextFactory.cs @@ -11,7 +11,7 @@ namespace osu.Game.Database { public class DatabaseContextFactory : IDatabaseContextFactory { - private readonly GameHost host; + private readonly Storage storage; private const string database_name = @"client"; @@ -26,9 +26,9 @@ namespace osu.Game.Database private IDbContextTransaction currentWriteTransaction; - public DatabaseContextFactory(GameHost host) + public DatabaseContextFactory(Storage storage) { - this.host = host; + this.storage = storage; recycleThreadContexts(); } @@ -117,7 +117,7 @@ namespace osu.Game.Database private void recycleThreadContexts() => threadContexts = new ThreadLocal(CreateContext); - protected virtual OsuDbContext CreateContext() => new OsuDbContext(host.Storage.GetDatabaseConnectionString(database_name)) + protected virtual OsuDbContext CreateContext() => new OsuDbContext(storage.GetDatabaseConnectionString(database_name)) { Database = { AutoTransactionsEnabled = false } }; @@ -129,7 +129,7 @@ namespace osu.Game.Database recycleThreadContexts(); GC.Collect(); GC.WaitForPendingFinalizers(); - host.Storage.DeleteDatabase(database_name); + storage.DeleteDatabase(database_name); } } } diff --git a/osu.Game/Database/SingletonContextFactory.cs b/osu.Game/Database/SingletonContextFactory.cs deleted file mode 100644 index a7158c0583..0000000000 --- a/osu.Game/Database/SingletonContextFactory.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -namespace osu.Game.Database -{ - public class SingletonContextFactory : IDatabaseContextFactory - { - private readonly OsuDbContext context; - - public SingletonContextFactory(OsuDbContext context) - { - this.context = context; - } - - public OsuDbContext Get() => context; - - public DatabaseWriteUsage GetForWrite(bool withTransaction = true) => new DatabaseWriteUsage(context, null) { IsTransactionLeader = true }; - } -} diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index a9b74d6740..63cc883844 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -107,7 +107,7 @@ namespace osu.Game { Resources.AddStore(new DllResourceStore(@"osu.Game.Resources.dll")); - dependencies.Cache(contextFactory = new DatabaseContextFactory(Host)); + dependencies.Cache(contextFactory = new DatabaseContextFactory(Host.Storage)); dependencies.Cache(new LargeTextureStore(new RawTextureLoaderStore(new NamespacedResourceStore(Resources, @"Textures")))); diff --git a/osu.Game/Tests/Platform/TestStorage.cs b/osu.Game/Tests/Platform/TestStorage.cs index 5b31c7b4d0..a6b6b5530d 100644 --- a/osu.Game/Tests/Platform/TestStorage.cs +++ b/osu.Game/Tests/Platform/TestStorage.cs @@ -7,13 +7,11 @@ namespace osu.Game.Tests.Platform { public class TestStorage : DesktopStorage { - public TestStorage(string baseName) : base(baseName, null) + public TestStorage(string baseName) + : base(baseName, null) { } - public override string GetDatabaseConnectionString(string name) - { - return "DataSource=:memory:"; - } + public override string GetDatabaseConnectionString(string name) => "Data Source=" + GetUsablePathFor($"{(object)name}.db", true); } } From 6254f4e0f7c584105c4c774d29a5822bf31fe9a9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 18 Jul 2018 18:00:04 +0900 Subject: [PATCH 16/85] Fix tests --- appveyor.yml | 2 -- osu.TestProject.props | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7c08eb9e9c..27f1484e32 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,8 +13,6 @@ install: before_build: - cmd: CodeFileSanity.exe - cmd: nuget restore -verbosity quiet -environment: - TargetFramework: net471 build: project: osu.sln parallel: true diff --git a/osu.TestProject.props b/osu.TestProject.props index c2e6048a60..1369af4aee 100644 --- a/osu.TestProject.props +++ b/osu.TestProject.props @@ -16,6 +16,7 @@ + From 3e738c607af11c868070c0c13a263cfcb8736bf8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 18 Jul 2018 12:58:45 +0900 Subject: [PATCH 17/85] Add more song select tests --- .../Visual/TestCasePlaySongSelect.cs | 139 +++++++++--------- 1 file changed, 72 insertions(+), 67 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs index 4afb76a7e2..b73cf5bbd3 100644 --- a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs @@ -54,11 +54,11 @@ namespace osu.Game.Tests.Visual public new BeatmapCarousel Carousel => base.Carousel; } + private TestSongSelect songSelect; + [BackgroundDependencyLoader] private void load() { - TestSongSelect songSelect = null; - var storage = new TestStorage(@"TestCasePlaySongSelect"); // this is by no means clean. should be replacing inside of OsuGameBase somehow. @@ -75,42 +75,36 @@ namespace osu.Game.Tests.Visual DefaultBeatmap = defaultBeatmap = Beatmap.Default }); - void loadNewSongSelect(bool deleteMaps = false) => AddStep("reload song select", () => - { - if (deleteMaps) - { - manager.Delete(manager.GetAllUsableBeatmapSets()); - Beatmap.SetDefault(); - } + Beatmap.SetDefault(); + } - if (songSelect != null) - { - Remove(songSelect); - songSelect.Dispose(); - } + [SetUp] + public virtual void SetUp() + { + manager?.Delete(manager.GetAllUsableBeatmapSets()); - Add(songSelect = new TestSongSelect()); - }); - - loadNewSongSelect(true); - - AddWaitStep(3); + Child = songSelect = new TestSongSelect(); + } + [Test] + public void TestDummy() + { AddAssert("dummy selected", () => songSelect.CurrentBeatmap == defaultBeatmap); AddAssert("dummy shown on wedge", () => songSelect.CurrentBeatmapDetailsBeatmap == defaultBeatmap); - AddStep("import test maps", () => - { - for (int i = 0; i < 100; i += 10) - manager.Import(createTestBeatmapSet(i)); - }); - + addManyTestMaps(); AddWaitStep(3); + AddAssert("random map selected", () => songSelect.CurrentBeatmap != defaultBeatmap); + } - loadNewSongSelect(); + [Test] + public void TestSorting() + { + addManyTestMaps(); AddWaitStep(3); + AddAssert("random map selected", () => songSelect.CurrentBeatmap != defaultBeatmap); AddStep(@"Sort by Artist", delegate { songSelect.FilterControl.Sort = SortMode.Artist; }); @@ -119,55 +113,66 @@ namespace osu.Game.Tests.Visual AddStep(@"Sort by Difficulty", delegate { songSelect.FilterControl.Sort = SortMode.Difficulty; }); } - private BeatmapSetInfo createTestBeatmapSet(int i) + [Test] + public void TestRulesetChange() { + AddStep("import test maps", () => + { + manager.Import(createTestBeatmapSet(0, rulesets.AvailableRulesets.Where(r => r.ID == 0).ToArray())); + manager.Import(createTestBeatmapSet(1, rulesets.AvailableRulesets.Where(r => r.ID == 0).ToArray())); + }); + } + + private void addManyTestMaps() + { + AddStep("import test maps", () => + { + var usableRulesets = rulesets.AvailableRulesets.Where(r => r.ID != 2).ToArray(); + + for (int i = 0; i < 100; i += 10) + manager.Import(createTestBeatmapSet(i, usableRulesets)); + }); + } + + private BeatmapSetInfo createTestBeatmapSet(int idOffset, RulesetInfo[] rulesets) + { + int j = 0; + RulesetInfo getRuleset() => rulesets[j++ % rulesets.Length]; + + var beatmaps = new List(); + + int setId = 1234 + idOffset; + + for (int i = 0; i < 6; i++) + { + int beatmapId = 1234 + idOffset + i; + + beatmaps.Add(new BeatmapInfo + { + Ruleset = getRuleset(), + OnlineBeatmapID = beatmapId, + Path = "normal.osu", + Version = $"{beatmapId}", + BaseDifficulty = new BeatmapDifficulty + { + OverallDifficulty = 3.5f, + } + }); + } + + return new BeatmapSetInfo { - OnlineBeatmapSetID = 1234 + i, + OnlineBeatmapSetID = setId, Hash = new MemoryStream(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())).ComputeMD5Hash(), Metadata = new BeatmapMetadata { // Create random metadata, then we can check if sorting works based on these - Artist = "MONACA " + RNG.Next(0, 9), - Title = "Black Song " + RNG.Next(0, 9), + Artist = "Some Artist " + RNG.Next(0, 9), + Title = $"Some Song (set id {setId})", AuthorString = "Some Guy " + RNG.Next(0, 9), }, - Beatmaps = new List(new[] - { - new BeatmapInfo - { - OnlineBeatmapID = 1234 + i, - Ruleset = rulesets.AvailableRulesets.First(), - Path = "normal.osu", - Version = "Normal", - BaseDifficulty = new BeatmapDifficulty - { - OverallDifficulty = 3.5f, - } - }, - new BeatmapInfo - { - OnlineBeatmapID = 1235 + i, - Ruleset = rulesets.AvailableRulesets.First(), - Path = "hard.osu", - Version = "Hard", - BaseDifficulty = new BeatmapDifficulty - { - OverallDifficulty = 5, - } - }, - new BeatmapInfo - { - OnlineBeatmapID = 1236 + i, - Ruleset = rulesets.AvailableRulesets.First(), - Path = "insane.osu", - Version = "Insane", - BaseDifficulty = new BeatmapDifficulty - { - OverallDifficulty = 7, - } - }, - }), + Beatmaps = beatmaps }; } } From 693ba8e9949ea023092c6c3f5cf7ad1ce3266be3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 19 Jul 2018 18:43:11 +0900 Subject: [PATCH 18/85] Add more ToString output --- osu.Game/Beatmaps/WorkingBeatmap.cs | 2 ++ osu.Game/Rulesets/RulesetInfo.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 74da978d9c..3cdb1b7385 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -133,6 +133,8 @@ namespace osu.Game.Beatmaps return converted; } + public override string ToString() => BeatmapInfo.ToString(); + public bool BackgroundLoaded => background.IsResultAvailable; public Texture Background => background.Value.Result; public async Task GetBackgroundAsync() => await background.Value; diff --git a/osu.Game/Rulesets/RulesetInfo.cs b/osu.Game/Rulesets/RulesetInfo.cs index 10463fd961..a6a311f6eb 100644 --- a/osu.Game/Rulesets/RulesetInfo.cs +++ b/osu.Game/Rulesets/RulesetInfo.cs @@ -25,5 +25,7 @@ namespace osu.Game.Rulesets public virtual Ruleset CreateInstance() => (Ruleset)Activator.CreateInstance(Type.GetType(InstantiationInfo), this); public bool Equals(RulesetInfo other) => other != null && ID == other.ID && Available == other.Available && Name == other.Name && InstantiationInfo == other.InstantiationInfo; + + public override string ToString() => $"{Name} ({ShortName}) ID: {ID}"; } } From c31676f8f1d1981b83c5b2c184da40753f898c32 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 19 Jul 2018 18:48:40 +0900 Subject: [PATCH 19/85] Rework update methods to separate out ruleset and beatmap changes Combining them was causing complexity and logic errors. --- osu.Game/Screens/Select/SongSelect.cs | 70 ++++++++++++++++----------- 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index f8ceea2bf3..e2e6520ef1 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -138,7 +138,7 @@ namespace osu.Game.Screens.Select Size = new Vector2(carousel_width, 1), Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, - SelectionChanged = b => updateSelectedBeatmap(b, null), + SelectionChanged = updateSelectedBeatmap, BeatmapSetsChanged = carouselBeatmapsLoaded, }, FilterControl = new FilterControl @@ -282,13 +282,31 @@ namespace osu.Game.Screens.Select private BeatmapInfo beatmapNoDebounce; private RulesetInfo rulesetNoDebounce; + private void updateSelectedBeatmap(BeatmapInfo beatmap) + { + if (beatmap?.Equals(beatmapNoDebounce) == true) + return; + + beatmapNoDebounce = beatmap; + performUpdateSelected(); + } + + private void updateSelectedRuleset(RulesetInfo ruleset) + { + if (ruleset?.Equals(rulesetNoDebounce) == true) + return; + + rulesetNoDebounce = ruleset; + performUpdateSelected(); + } + /// /// selection has been changed as the result of a user interaction. /// - private void updateSelectedBeatmap(BeatmapInfo beatmap, RulesetInfo ruleset) + private void performUpdateSelected() { - if (ruleset == null) ruleset = rulesetNoDebounce; - if (beatmap == null) beatmap = beatmapNoDebounce; + var beatmap = beatmapNoDebounce; + var ruleset = rulesetNoDebounce; void performLoad() { @@ -296,7 +314,7 @@ namespace osu.Game.Screens.Select bool preview = false; - if (ruleset?.Equals(Ruleset.Value) != true) + if (ruleset?.Equals(Ruleset.Value) == false) { Ruleset.Value = ruleset; @@ -307,40 +325,33 @@ namespace osu.Game.Screens.Select // We may be arriving here due to another component changing the bindable Beatmap. // In these cases, the other component has already loaded the beatmap, so we don't need to do so again. - if (beatmap?.Equals(Beatmap.Value.BeatmapInfo) != true) + if (!Equals(beatmap, Beatmap.Value.BeatmapInfo)) { preview = beatmap?.BeatmapSetInfoID != Beatmap.Value?.BeatmapInfo.BeatmapSetInfoID; working = beatmaps.GetWorkingBeatmap(beatmap, Beatmap.Value); + + if (beatmap != null) + { + if (beatmap.BeatmapSetInfoID == beatmapNoDebounce?.BeatmapSetInfoID) + sampleChangeDifficulty.Play(); + else + sampleChangeBeatmap.Play(); + } } working.Mods.Value = Enumerable.Empty(); - Beatmap.Value = working; ensurePlayingSelected(preview); - UpdateBeatmap(Beatmap.Value); } - if (beatmap?.Equals(beatmapNoDebounce) == true && ruleset?.Equals(rulesetNoDebounce) == true) - return; - selectionChangedDebounce?.Cancel(); - beatmapNoDebounce = beatmap; - rulesetNoDebounce = ruleset; - if (beatmap == null) performLoad(); else - { - if (beatmap.BeatmapSetInfoID == beatmapNoDebounce?.BeatmapSetInfoID) - sampleChangeDifficulty.Play(); - else - sampleChangeBeatmap.Play(); - selectionChangedDebounce = Scheduler.AddDelayed(performLoad, 200); - } } private void triggerRandom() @@ -487,13 +498,16 @@ namespace osu.Game.Screens.Select private void carouselBeatmapsLoaded() { - // manual binding to parent ruleset to allow for delayed load in the incoming direction. - rulesetNoDebounce = Ruleset.Value = base.Ruleset.Value; - base.Ruleset.ValueChanged += r => updateSelectedBeatmap(null, r); - Ruleset.ValueChanged += r => base.Ruleset.Value = r; + if (rulesetNoDebounce == null) + { + // manual binding to parent ruleset to allow for delayed load in the incoming direction. + rulesetNoDebounce = Ruleset.Value = base.Ruleset.Value; + base.Ruleset.ValueChanged += updateSelectedRuleset; + Ruleset.ValueChanged += r => base.Ruleset.Value = r; - Beatmap.BindDisabledChanged(disabled => Carousel.AllowSelection = !disabled, true); - Beatmap.BindValueChanged(workingBeatmapChanged); + Beatmap.BindDisabledChanged(disabled => Carousel.AllowSelection = !disabled, true); + Beatmap.BindValueChanged(workingBeatmapChanged); + } if (!Beatmap.IsDefault && Beatmap.Value.BeatmapSetInfo?.DeletePending == false && Beatmap.Value.BeatmapSetInfo?.Protected == false && Carousel.SelectBeatmap(Beatmap.Value.BeatmapInfo, false)) @@ -503,7 +517,7 @@ namespace osu.Game.Screens.Select { // in the case random selection failed, we want to trigger selectionChanged // to show the dummy beatmap (we have nothing else to display). - updateSelectedBeatmap(null, null); + performUpdateSelected(); } } From d7f1766ee21a1c52fd935aa6c5ce564066101172 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 19 Jul 2018 18:51:08 +0900 Subject: [PATCH 20/85] wip --- osu.Game.Tests/Visual/TestCasePlaySongSelect.cs | 15 ++++++++++++--- osu.Game/Screens/Select/SongSelect.cs | 8 ++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs index b73cf5bbd3..d1f4340876 100644 --- a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs @@ -86,7 +86,7 @@ namespace osu.Game.Tests.Visual Child = songSelect = new TestSongSelect(); } - [Test] + //[Test] public void TestDummy() { AddAssert("dummy selected", () => songSelect.CurrentBeatmap == defaultBeatmap); @@ -99,7 +99,7 @@ namespace osu.Game.Tests.Visual AddAssert("random map selected", () => songSelect.CurrentBeatmap != defaultBeatmap); } - [Test] + //[Test] public void TestSorting() { addManyTestMaps(); @@ -116,11 +116,20 @@ namespace osu.Game.Tests.Visual [Test] public void TestRulesetChange() { + AddStep("change ruleset", () => Ruleset.Value = rulesets.AvailableRulesets.First(r => r.ID == 2)); + AddStep("import test maps", () => { manager.Import(createTestBeatmapSet(0, rulesets.AvailableRulesets.Where(r => r.ID == 0).ToArray())); - manager.Import(createTestBeatmapSet(1, rulesets.AvailableRulesets.Where(r => r.ID == 0).ToArray())); + manager.Import(createTestBeatmapSet(1, rulesets.AvailableRulesets.Where(r => r.ID == 2).ToArray())); + }); + + AddStep("change ruleset", () => Ruleset.Value = rulesets.AvailableRulesets.First(r => r.ID == 1)); + + AddUntilStep(() => songSelect.Carousel.SelectedBeatmap == null, "no selection"); + + AddStep("change ruleset", () => Ruleset.Value = rulesets.AvailableRulesets.First(r => r.ID == 0)); } private void addManyTestMaps() diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index e2e6520ef1..0f22d9b208 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -13,6 +13,7 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input; +using osu.Framework.Logging; using osu.Framework.Screens; using osu.Framework.Threading; using osu.Game.Beatmaps; @@ -310,12 +311,15 @@ namespace osu.Game.Screens.Select void performLoad() { + Logger.Log($"performLoad with b:{beatmap} r:{ruleset}"); + WorkingBeatmap working = Beatmap.Value; bool preview = false; if (ruleset?.Equals(Ruleset.Value) == false) { + Logger.Log($"ruleset changed from {Ruleset.Value} to {ruleset}"); Ruleset.Value = ruleset; // force a filter before attempting to change the beatmap. @@ -327,6 +331,8 @@ namespace osu.Game.Screens.Select // In these cases, the other component has already loaded the beatmap, so we don't need to do so again. if (!Equals(beatmap, Beatmap.Value.BeatmapInfo)) { + Logger.Log($"beatmap changed from {Beatmap.Value.BeatmapInfo} to {beatmap}"); + preview = beatmap?.BeatmapSetInfoID != Beatmap.Value?.BeatmapInfo.BeatmapSetInfoID; working = beatmaps.GetWorkingBeatmap(beatmap, Beatmap.Value); @@ -467,6 +473,8 @@ namespace osu.Game.Screens.Select /// The working beatmap. protected virtual void UpdateBeatmap(WorkingBeatmap beatmap) { + Logger.Log($"working beatmap updated to {beatmap}"); + if (Background is BackgroundScreenBeatmap backgroundModeBeatmap) { backgroundModeBeatmap.Beatmap = beatmap; From 1502edcdc6f2b194a088225c2dbfbb32b91727e8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 18 Jul 2018 18:57:30 +0900 Subject: [PATCH 21/85] Specify tests directly --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 27f1484e32..4545feade0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -17,6 +17,8 @@ build: project: osu.sln parallel: true verbosity: minimal +test_script: + - cmd: dotnet test --configuration Debug --no-build --test-adapter-path:. --logger:Appveyor after_build: - cmd: inspectcode --o="inspectcodereport.xml" --projects:osu.Game* --caches-home="inspectcode" osu.sln > NUL - cmd: NVika parsereport "inspectcodereport.xml" --treatwarningsaserrors From 64ead0fdf78ca048f9a3f799686091904c9f9180 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 20 Jul 2018 11:32:00 +0900 Subject: [PATCH 22/85] Add more tests and fix one remaining issue case --- .../Visual/TestCasePlaySongSelect.cs | 51 +++++++++++-------- osu.Game/Screens/Select/SongSelect.cs | 17 ++++--- 2 files changed, 40 insertions(+), 28 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs index d1f4340876..0ec7dd059d 100644 --- a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs @@ -82,11 +82,10 @@ namespace osu.Game.Tests.Visual public virtual void SetUp() { manager?.Delete(manager.GetAllUsableBeatmapSets()); - Child = songSelect = new TestSongSelect(); } - //[Test] + [Test] public void TestDummy() { AddAssert("dummy selected", () => songSelect.CurrentBeatmap == defaultBeatmap); @@ -99,7 +98,7 @@ namespace osu.Game.Tests.Visual AddAssert("random map selected", () => songSelect.CurrentBeatmap != defaultBeatmap); } - //[Test] + [Test] public void TestSorting() { addManyTestMaps(); @@ -114,24 +113,35 @@ namespace osu.Game.Tests.Visual } [Test] - public void TestRulesetChange() + public void ImportUnderDifferentRuleset() { - AddStep("change ruleset", () => Ruleset.Value = rulesets.AvailableRulesets.First(r => r.ID == 2)); - - AddStep("import test maps", () => - { - manager.Import(createTestBeatmapSet(0, rulesets.AvailableRulesets.Where(r => r.ID == 0).ToArray())); - manager.Import(createTestBeatmapSet(1, rulesets.AvailableRulesets.Where(r => r.ID == 2).ToArray())); - - }); - - AddStep("change ruleset", () => Ruleset.Value = rulesets.AvailableRulesets.First(r => r.ID == 1)); - + changeRuleset(2); + importForRuleset(0); AddUntilStep(() => songSelect.Carousel.SelectedBeatmap == null, "no selection"); - - AddStep("change ruleset", () => Ruleset.Value = rulesets.AvailableRulesets.First(r => r.ID == 0)); } + [Test] + public void ImportUnderCurrentRuleset() + { + changeRuleset(2); + importForRuleset(2); + importForRuleset(1); + AddUntilStep(() => songSelect.Carousel.SelectedBeatmap.RulesetID == 2, "has selection"); + + changeRuleset(1); + AddUntilStep(() => songSelect.Carousel.SelectedBeatmap.RulesetID == 1, "has selection"); + + changeRuleset(0); + AddUntilStep(() => songSelect.Carousel.SelectedBeatmap == null, "no selection"); + } + + private void importForRuleset(int id) => AddStep($"import test map for ruleset {id}", () => manager.Import(createTestBeatmapSet(getImportId(), rulesets.AvailableRulesets.Where(r => r.ID == id).ToArray()))); + + private static int importId; + private int getImportId() => ++importId; + + private void changeRuleset(int id) => AddStep($"change ruleset to {id}", () => Ruleset.Value = rulesets.AvailableRulesets.First(r => r.ID == id)); + private void addManyTestMaps() { AddStep("import test maps", () => @@ -143,18 +153,16 @@ namespace osu.Game.Tests.Visual }); } - private BeatmapSetInfo createTestBeatmapSet(int idOffset, RulesetInfo[] rulesets) + private BeatmapSetInfo createTestBeatmapSet(int setId, RulesetInfo[] rulesets) { int j = 0; RulesetInfo getRuleset() => rulesets[j++ % rulesets.Length]; var beatmaps = new List(); - int setId = 1234 + idOffset; - for (int i = 0; i < 6; i++) { - int beatmapId = 1234 + idOffset + i; + int beatmapId = setId * 10 + i; beatmaps.Add(new BeatmapInfo { @@ -169,7 +177,6 @@ namespace osu.Game.Tests.Visual }); } - return new BeatmapSetInfo { OnlineBeatmapSetID = setId, diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 0f22d9b208..76e8d695c8 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -309,9 +309,9 @@ namespace osu.Game.Screens.Select var beatmap = beatmapNoDebounce; var ruleset = rulesetNoDebounce; - void performLoad() + void run() { - Logger.Log($"performLoad with b:{beatmap} r:{ruleset}"); + Logger.Log($"updating selection with beatmap:{beatmap?.ID.ToString() ?? "null"} ruleset:{ruleset?.ID.ToString() ?? "null"}"); WorkingBeatmap working = Beatmap.Value; @@ -319,19 +319,24 @@ namespace osu.Game.Screens.Select if (ruleset?.Equals(Ruleset.Value) == false) { - Logger.Log($"ruleset changed from {Ruleset.Value} to {ruleset}"); + Logger.Log($"ruleset changed from \"{Ruleset.Value}\" to \"{ruleset}\""); Ruleset.Value = ruleset; // force a filter before attempting to change the beatmap. // we may still be in the wrong ruleset as there is a debounce delay on ruleset changes. Carousel.Filter(null, false); + + // Filtering only completes after the carousel runs Update. + // If we also have a pending beatmap change we should delay it one frame. + selectionChangedDebounce = Schedule(run); + return; } // We may be arriving here due to another component changing the bindable Beatmap. // In these cases, the other component has already loaded the beatmap, so we don't need to do so again. if (!Equals(beatmap, Beatmap.Value.BeatmapInfo)) { - Logger.Log($"beatmap changed from {Beatmap.Value.BeatmapInfo} to {beatmap}"); + Logger.Log($"beatmap changed from \"{Beatmap.Value.BeatmapInfo}\" to \"{beatmap}\""); preview = beatmap?.BeatmapSetInfoID != Beatmap.Value?.BeatmapInfo.BeatmapSetInfoID; working = beatmaps.GetWorkingBeatmap(beatmap, Beatmap.Value); @@ -355,9 +360,9 @@ namespace osu.Game.Screens.Select selectionChangedDebounce?.Cancel(); if (beatmap == null) - performLoad(); + run(); else - selectionChangedDebounce = Scheduler.AddDelayed(performLoad, 200); + selectionChangedDebounce = Scheduler.AddDelayed(run, 200); } private void triggerRandom() From f200cfe40dec998572f43a1ed1c859c97c7c9d15 Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Fri, 20 Jul 2018 13:05:19 +0300 Subject: [PATCH 23/85] Add labelled text box files --- .../LabelledComponents/LabelledTextBox.cs | 207 ++++++++++++++++++ .../Setup/Components/OsuSetupTextBox.cs | 24 ++ 2 files changed, 231 insertions(+) create mode 100644 osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs create mode 100644 osu.Game/Screens/Edit/Screens/Setup/Components/OsuSetupTextBox.cs diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs new file mode 100644 index 0000000000..e0c734f764 --- /dev/null +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs @@ -0,0 +1,207 @@ +// Copyright (c) 2007-2018 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.Game.Graphics; +using osu.Game.Graphics.Sprites; +using System; + +namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents +{ + public class LabelledTextBox : CompositeDrawable + { + private readonly OsuSetupTextBox textBox; + private readonly Container content; + private readonly OsuSpriteText label; + + public const float LABEL_CONTAINER_WIDTH = 150; + public const float OUTER_CORNER_RADIUS = 15; + public const float INNER_CORNER_RADIUS = 10; + public const float DEFAULT_HEIGHT = 40; + public const float DEFAULT_LABEL_LEFT_PADDING = 15; + public const float DEFAULT_LABEL_TOP_PADDING = 12; + public const float DEFAULT_LABEL_TEXT_SIZE = 16; + + public event Action TextBoxTextChanged; + + public void TriggerTextBoxTextChanged(string newText) + { + TextBoxTextChanged?.Invoke(newText); + } + + private bool readOnly; + public bool ReadOnly + { + get => readOnly; + set + { + textBox.ReadOnly = value; + readOnly = value; + } + } + + private string labelText; + public string LabelText + { + get => labelText; + set + { + labelText = value; + label.Text = value; + } + } + + private float labelTextSize; + public float LabelTextSize + { + get => labelTextSize; + set + { + labelTextSize = value; + label.TextSize = value; + } + } + + private string textBoxPlaceholderText; + public string TextBoxPlaceholderText + { + get => textBoxPlaceholderText; + set + { + textBoxPlaceholderText = value; + textBox.PlaceholderText = value; + } + } + + private string textBoxText; + public string TextBoxText + { + get => textBoxText; + set + { + textBoxText = value; + textBox.Text = value; + TextBoxTextChanged?.Invoke(value); + } + } + + private float height = DEFAULT_HEIGHT; + public float Height + { + get => height; + private set + { + height = value; + textBox.Height = value; + content.Height = value; + } + } + + public MarginPadding Padding + { + get => base.Padding; + set + { + base.Padding = value; + base.Height = Height + base.Padding.Top; + } + } + + public MarginPadding LabelPadding + { + get => label.Padding; + set => label.Padding = value; + } + + public MarginPadding TextBoxPadding + { + get => textBox.Padding; + set => textBox.Padding = value; + } + + public Color4 LabelTextColour + { + get => label.Colour; + set => label.Colour = value; + } + + public Color4 BackgroundColour + { + get => content.Colour; + set => content.Colour = value; + } + + public LabelledTextBox() + { + Masking = true; + CornerRadius = OUTER_CORNER_RADIUS; + RelativeSizeAxes = Axes.X; + base.Height = DEFAULT_HEIGHT + Padding.Top; + + InternalChildren = new Drawable[] + { + new Container + { + RelativeSizeAxes = Axes.X, + Height = DEFAULT_HEIGHT, + CornerRadius = OUTER_CORNER_RADIUS, + Masking = true, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.X, + Height = DEFAULT_HEIGHT, + Colour = OsuColour.FromHex("1c2125"), + }, + new Container + { + RelativeSizeAxes = Axes.X, + Height = DEFAULT_HEIGHT, + Child = new GridContainer + { + RelativeSizeAxes = Axes.X, + Height = DEFAULT_HEIGHT, + Content = new[] + { + new Drawable[] + { + label = new OsuSpriteText + { + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft, + Padding = new MarginPadding { Left = DEFAULT_LABEL_LEFT_PADDING, Top = DEFAULT_LABEL_TOP_PADDING }, + Colour = Color4.White, + TextSize = DEFAULT_LABEL_TEXT_SIZE, + Text = LabelText, + Font = @"Exo2.0-Bold", + }, + textBox = new OsuSetupTextBox + { + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft, + RelativeSizeAxes = Axes.X, + Height = DEFAULT_HEIGHT, + ReadOnly = ReadOnly, + CornerRadius = INNER_CORNER_RADIUS, + }, + }, + }, + ColumnDimensions = new[] + { + new Dimension(GridSizeMode.Absolute, LABEL_CONTAINER_WIDTH), + new Dimension() + } + } + } + } + } + }; + + textBox.OnCommit += delegate { TriggerTextBoxTextChanged(textBox.Text); }; + } + } +} diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/OsuSetupTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/OsuSetupTextBox.cs new file mode 100644 index 0000000000..1a31582291 --- /dev/null +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/OsuSetupTextBox.cs @@ -0,0 +1,24 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; + +namespace osu.Game.Screens.Edit.Screens.Setup.Components +{ + public class OsuSetupTextBox : OsuTextBox + { + protected override float LeftRightPadding => 15; + + [BackgroundDependencyLoader] + private void load(OsuColour osuColour) + { + BorderColour = osuColour.Blue; + } + + protected override Drawable GetDrawableCharacter(char c) => new OsuSpriteText { Text = c.ToString(), Colour = BorderColour, TextSize = CalculatedTextSize }; + } +} From 6dd5c7e5ab46b6fe548eff85ffc6871c232b71d9 Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Fri, 20 Jul 2018 14:28:39 +0300 Subject: [PATCH 24/85] Add test case --- .../Visual/TestCaseLabelledTextBox.cs | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs diff --git a/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs b/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs new file mode 100644 index 0000000000..a9f0375d39 --- /dev/null +++ b/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs @@ -0,0 +1,37 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using NUnit.Framework; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents; +using System; +using System.Collections.Generic; + +namespace osu.Game.Tests.Visual +{ + [TestFixture] + public class TestCaseLabelledTextBox : OsuTestCase + { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(LabelledTextBox), + }; + + [BackgroundDependencyLoader] + private void load() + { + Children = new Drawable[] + { + new LabelledTextBox + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + LabelText = "Testing text", + TextBoxPlaceholderText = "This is definitely working as intended", + Padding = new MarginPadding { Left = 150, Right = 150 } + } + }; + } + } +} From 3c59ccadd05e22af7e8ec7e3dff722e6736ab4dc Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 22 Jul 2018 22:19:58 +0200 Subject: [PATCH 25/85] Fix gameplay always skipping to first hitobject time Regresssed with previous build --- osu.Game/Screens/Play/Player.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 4f37b59e6e..e9e353d698 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -139,7 +139,7 @@ namespace osu.Game.Screens.Play adjustableClock = new DecoupleableInterpolatingFramedClock { IsCoupled = false }; adjustableClock.Seek(AllowLeadIn - ? Math.Min(RulesetContainer.GameplayStartTime, beatmap.HitObjects.First().StartTime - beatmap.BeatmapInfo.AudioLeadIn) + ? Math.Min(0, beatmap.HitObjects.First().StartTime - beatmap.BeatmapInfo.AudioLeadIn) : RulesetContainer.GameplayStartTime); adjustableClock.ProcessFrame(); From 8501967b6a3a61c38a1499e53914a5d5030860a0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 22 Jul 2018 22:47:25 +0200 Subject: [PATCH 26/85] Fix testing regression --- osu.Game.Tests/Visual/TestCasePlaySongSelect.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs index b94fb42bf0..41c45f00f3 100644 --- a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs @@ -54,6 +54,12 @@ namespace osu.Game.Tests.Visual public new BeatmapCarousel Carousel => base.Carousel; } + protected override void Dispose(bool isDisposing) + { + factory.ResetDatabase(); + base.Dispose(isDisposing); + } + [BackgroundDependencyLoader] private void load() { From 479fe983351418fe01f39dc3b62284823f82625f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 22 Jul 2018 22:57:55 +0200 Subject: [PATCH 27/85] Add more prominent sound when skipping --- osu.Game/Screens/Play/SkipOverlay.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/SkipOverlay.cs b/osu.Game/Screens/Play/SkipOverlay.cs index 3e946288d9..06837c9274 100644 --- a/osu.Game/Screens/Play/SkipOverlay.cs +++ b/osu.Game/Screens/Play/SkipOverlay.cs @@ -4,6 +4,8 @@ using System; using osu.Framework; using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Threading; @@ -214,17 +216,21 @@ namespace osu.Game.Screens.Play private Box background; private AspectContainer aspect; + private SampleChannel sampleConfirm; + public Button() { RelativeSizeAxes = Axes.Both; } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OsuColour colours, AudioManager audio) { colourNormal = colours.Yellow; colourHover = colours.YellowDark; + sampleConfirm = audio.Sample.Get(@"SongSelect/confirm-selection"); + Children = new Drawable[] { background = new Box @@ -311,6 +317,8 @@ namespace osu.Game.Screens.Play if (!Enabled) return false; + sampleConfirm.Play(); + box.FlashColour(Color4.White, 500, Easing.OutQuint); aspect.ScaleTo(1.2f, 2000, Easing.OutQuint); From 44a2ae5f9ac83238d151d848580a8ee33bedfdc8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 23 Jul 2018 08:33:47 +0200 Subject: [PATCH 28/85] Fix incorrect variable usage --- osu.Game/Screens/Play/Player.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index e9e353d698..00ba1a8d12 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -139,7 +139,7 @@ namespace osu.Game.Screens.Play adjustableClock = new DecoupleableInterpolatingFramedClock { IsCoupled = false }; adjustableClock.Seek(AllowLeadIn - ? Math.Min(0, beatmap.HitObjects.First().StartTime - beatmap.BeatmapInfo.AudioLeadIn) + ? Math.Min(0, RulesetContainer.GameplayStartTime - beatmap.BeatmapInfo.AudioLeadIn) : RulesetContainer.GameplayStartTime); adjustableClock.ProcessFrame(); From 1b456fd7166a5645d9b3b058a8fbd7783a345518 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 23 Jul 2018 13:11:06 +0200 Subject: [PATCH 29/85] Fix a potential InvalidOperationException when entering song select Closes #3052. --- osu.Game/Screens/Select/Carousel/CarouselGroup.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Select/Carousel/CarouselGroup.cs b/osu.Game/Screens/Select/Carousel/CarouselGroup.cs index 2118cfdc78..ea461e7bd5 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselGroup.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselGroup.cs @@ -79,8 +79,13 @@ namespace osu.Game.Screens.Select.Carousel public override void Filter(FilterCriteria criteria) { base.Filter(criteria); - InternalChildren.Sort((x, y) => x.CompareTo(criteria, y)); - InternalChildren.ForEach(c => c.Filter(criteria)); + + var children = new List(InternalChildren); + + children.Sort((x, y) => x.CompareTo(criteria, y)); + children.ForEach(c => c.Filter(criteria)); + + InternalChildren = children; } protected virtual void ChildItemStateChanged(CarouselItem item, CarouselItemState value) From dd56a2d95fc15a3db53fbf4ad5d3252e79686072 Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Mon, 23 Jul 2018 15:44:10 +0300 Subject: [PATCH 30/85] Apply proposed changes (untested) --- .../Visual/TestCaseLabelledTextBox.cs | 2 +- .../LabelledComponents/LabelledTextBox.cs | 74 +++++++++---------- .../{OsuSetupTextBox.cs => SetupTextBox.cs} | 2 +- 3 files changed, 36 insertions(+), 42 deletions(-) rename osu.Game/Screens/Edit/Screens/Setup/Components/{OsuSetupTextBox.cs => SetupTextBox.cs} (94%) diff --git a/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs b/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs index a9f0375d39..be11562bb0 100644 --- a/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs +++ b/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs @@ -28,7 +28,7 @@ namespace osu.Game.Tests.Visual Anchor = Anchor.Centre, Origin = Anchor.Centre, LabelText = "Testing text", - TextBoxPlaceholderText = "This is definitely working as intended", + PlaceholderText = "This is definitely working as intended", Padding = new MarginPadding { Left = 150, Right = 150 } } }; diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs index e0c734f764..806e6b6f6d 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs @@ -8,29 +8,25 @@ using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using System; +using static osu.Framework.Graphics.UserInterface.TextBox; namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents { public class LabelledTextBox : CompositeDrawable { - private readonly OsuSetupTextBox textBox; + private readonly SetupTextBox textBox; private readonly Container content; private readonly OsuSpriteText label; - public const float LABEL_CONTAINER_WIDTH = 150; - public const float OUTER_CORNER_RADIUS = 15; - public const float INNER_CORNER_RADIUS = 10; - public const float DEFAULT_HEIGHT = 40; - public const float DEFAULT_LABEL_LEFT_PADDING = 15; - public const float DEFAULT_LABEL_TOP_PADDING = 12; - public const float DEFAULT_LABEL_TEXT_SIZE = 16; + private const float label_container_width = 150; + private const float outer_corner_radius = 15; + private const float inner_corner_radius = 10; + private const float default_height = 40; + private const float default_label_left_padding = 15; + private const float default_label_top_padding = 12; + private const float default_label_text_size = 16; - public event Action TextBoxTextChanged; - - public void TriggerTextBoxTextChanged(string newText) - { - TextBoxTextChanged?.Invoke(newText); - } + public event OnCommitHandler TextBoxTextChanged; private bool readOnly; public bool ReadOnly @@ -65,30 +61,30 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents } } - private string textBoxPlaceholderText; - public string TextBoxPlaceholderText + private string placeholderText; + public string PlaceholderText { - get => textBoxPlaceholderText; + get => placeholderText; set { - textBoxPlaceholderText = value; + placeholderText = value; textBox.PlaceholderText = value; } } - private string textBoxText; - public string TextBoxText + private string text; + public string Text { - get => textBoxText; + get => text; set { - textBoxText = value; + text = value; textBox.Text = value; - TextBoxTextChanged?.Invoke(value); + TextBoxTextChanged?.Invoke(textBox, true); } } - private float height = DEFAULT_HEIGHT; + private float height = default_height; public float Height { get => height; @@ -137,34 +133,32 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents public LabelledTextBox() { Masking = true; - CornerRadius = OUTER_CORNER_RADIUS; + CornerRadius = outer_corner_radius; RelativeSizeAxes = Axes.X; - base.Height = DEFAULT_HEIGHT + Padding.Top; + base.Height = default_height + Padding.Top; InternalChildren = new Drawable[] { new Container { - RelativeSizeAxes = Axes.X, - Height = DEFAULT_HEIGHT, - CornerRadius = OUTER_CORNER_RADIUS, + RelativeSizeAxes = Axes.Both, + CornerRadius = outer_corner_radius, Masking = true, Children = new Drawable[] { new Box { - RelativeSizeAxes = Axes.X, - Height = DEFAULT_HEIGHT, + RelativeSizeAxes = Axes.Both, Colour = OsuColour.FromHex("1c2125"), }, new Container { RelativeSizeAxes = Axes.X, - Height = DEFAULT_HEIGHT, + Height = default_height, Child = new GridContainer { RelativeSizeAxes = Axes.X, - Height = DEFAULT_HEIGHT, + Height = default_height, Content = new[] { new Drawable[] @@ -173,26 +167,26 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents { Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, - Padding = new MarginPadding { Left = DEFAULT_LABEL_LEFT_PADDING, Top = DEFAULT_LABEL_TOP_PADDING }, + Padding = new MarginPadding { Left = default_label_left_padding, Top = default_label_top_padding }, Colour = Color4.White, - TextSize = DEFAULT_LABEL_TEXT_SIZE, + TextSize = default_label_text_size, Text = LabelText, Font = @"Exo2.0-Bold", }, - textBox = new OsuSetupTextBox + textBox = new SetupTextBox { Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, RelativeSizeAxes = Axes.X, - Height = DEFAULT_HEIGHT, + Height = default_height, ReadOnly = ReadOnly, - CornerRadius = INNER_CORNER_RADIUS, + CornerRadius = inner_corner_radius, }, }, }, ColumnDimensions = new[] { - new Dimension(GridSizeMode.Absolute, LABEL_CONTAINER_WIDTH), + new Dimension(GridSizeMode.Absolute, label_container_width), new Dimension() } } @@ -201,7 +195,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents } }; - textBox.OnCommit += delegate { TriggerTextBoxTextChanged(textBox.Text); }; + textBox.OnCommit += (_, a) => TextBoxTextChanged?.Invoke(textBox, a); } } } diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/OsuSetupTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs similarity index 94% rename from osu.Game/Screens/Edit/Screens/Setup/Components/OsuSetupTextBox.cs rename to osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs index 1a31582291..206170e1eb 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/OsuSetupTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs @@ -9,7 +9,7 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Screens.Edit.Screens.Setup.Components { - public class OsuSetupTextBox : OsuTextBox + public class SetupTextBox : OsuTextBox { protected override float LeftRightPadding => 15; From 10656be954aa02a2e67fde0cb2f5d0d3e4b968eb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 23 Jul 2018 16:54:52 +0200 Subject: [PATCH 31/85] Add interpolation to repeat point during sliding --- .../Objects/Drawables/DrawableRepeatPoint.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index 26f3ee6bb4..77f813ae1e 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -74,6 +74,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } } + private bool hasRotation; + public void UpdateSnakingPosition(Vector2 start, Vector2 end) { bool isRepeatAtEnd = repeatPoint.RepeatIndex % 2 == 0; @@ -87,15 +89,30 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables int searchStart = isRepeatAtEnd ? curve.Count - 1 : 0; int direction = isRepeatAtEnd ? -1 : 1; + Vector2 aimRotationVector = Vector2.Zero; + // find the next vector2 in the curve which is not equal to our current position to infer a rotation. for (int i = searchStart; i >= 0 && i < curve.Count; i += direction) { if (Precision.AlmostEquals(curve[i], Position)) continue; - Rotation = MathHelper.RadiansToDegrees((float)Math.Atan2(curve[i].Y - Position.Y, curve[i].X - Position.X)); + aimRotationVector = curve[i]; break; } + + float aimRotation = MathHelper.RadiansToDegrees( + (float)Math.Atan2(aimRotationVector.Y - Position.Y, aimRotationVector.X - Position.X)); + + if (!hasRotation || Math.Abs(aimRotation - Rotation) > 180) + { + Rotation = aimRotation; + hasRotation = true; + } + else + { + Rotation = Interpolation.ValueAt(MathHelper.Clamp(Clock.ElapsedFrameTime, 0, 100), Rotation, aimRotation, 0, 600, Easing.OutQuint); + } } } } From a833fa3d924e05df4047d5ba00965819156f4a2a Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Tue, 24 Jul 2018 09:19:45 +0300 Subject: [PATCH 32/85] Update framework and apply suggested changes --- .../Setup/Components/LabelledComponents/LabelledTextBox.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs index 806e6b6f6d..09797e3180 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs @@ -26,7 +26,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents private const float default_label_top_padding = 12; private const float default_label_text_size = 16; - public event OnCommitHandler TextBoxTextChanged; + public event OnCommitHandler OnCommit; private bool readOnly; public bool ReadOnly @@ -80,7 +80,6 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents { text = value; textBox.Text = value; - TextBoxTextChanged?.Invoke(textBox, true); } } @@ -195,7 +194,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents } }; - textBox.OnCommit += (_, a) => TextBoxTextChanged?.Invoke(textBox, a); + textBox.OnCommit += OnCommit; } } } From 2f452c162cb9b9c09dd21dba9780f6630fdb3270 Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Tue, 24 Jul 2018 09:21:01 +0300 Subject: [PATCH 33/85] Make text colour white --- .../Screens/Edit/Screens/Setup/Components/SetupTextBox.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs index 206170e1eb..c3938fae9c 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs @@ -12,13 +12,5 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components public class SetupTextBox : OsuTextBox { protected override float LeftRightPadding => 15; - - [BackgroundDependencyLoader] - private void load(OsuColour osuColour) - { - BorderColour = osuColour.Blue; - } - - protected override Drawable GetDrawableCharacter(char c) => new OsuSpriteText { Text = c.ToString(), Colour = BorderColour, TextSize = CalculatedTextSize }; } } From 765c6e4eccbe0a3744fd6c3dfca1f42aa1522f34 Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Tue, 24 Jul 2018 09:46:24 +0300 Subject: [PATCH 34/85] Remove custom text box --- .../LabelledComponents/LabelledTextBox.cs | 5 +++-- .../Screens/Setup/Components/SetupTextBox.cs | 16 ---------------- 2 files changed, 3 insertions(+), 18 deletions(-) delete mode 100644 osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs index 09797e3180..15723c0eaf 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; using System; using static osu.Framework.Graphics.UserInterface.TextBox; @@ -14,7 +15,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents { public class LabelledTextBox : CompositeDrawable { - private readonly SetupTextBox textBox; + private readonly OsuTextBox textBox; private readonly Container content; private readonly OsuSpriteText label; @@ -172,7 +173,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents Text = LabelText, Font = @"Exo2.0-Bold", }, - textBox = new SetupTextBox + textBox = new OsuTextBox { Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs deleted file mode 100644 index c3938fae9c..0000000000 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Game.Graphics; -using osu.Game.Graphics.Sprites; -using osu.Game.Graphics.UserInterface; - -namespace osu.Game.Screens.Edit.Screens.Setup.Components -{ - public class SetupTextBox : OsuTextBox - { - protected override float LeftRightPadding => 15; - } -} From 0e50e4ee346d6e7f1d06e89a7749b72d95cd239c Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Tue, 24 Jul 2018 10:10:17 +0300 Subject: [PATCH 35/85] Clean code --- .../LabelledComponents/LabelledTextBox.cs | 82 +++++++++---------- 1 file changed, 38 insertions(+), 44 deletions(-) diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs index 15723c0eaf..5f4e88b52c 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs @@ -8,7 +8,6 @@ using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; -using System; using static osu.Framework.Graphics.UserInterface.TextBox; namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents @@ -132,63 +131,58 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents public LabelledTextBox() { - Masking = true; - CornerRadius = outer_corner_radius; RelativeSizeAxes = Axes.X; base.Height = default_height + Padding.Top; + CornerRadius = outer_corner_radius; + Masking = true; - InternalChildren = new Drawable[] + InternalChild = new Container { - new Container + RelativeSizeAxes = Axes.Both, + CornerRadius = outer_corner_radius, + Masking = true, + Children = new Drawable[] { - RelativeSizeAxes = Axes.Both, - CornerRadius = outer_corner_radius, - Masking = true, - Children = new Drawable[] + new Box { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = OsuColour.FromHex("1c2125"), - }, - new Container + RelativeSizeAxes = Axes.Both, + Colour = OsuColour.FromHex("1c2125"), + }, + new Container + { + RelativeSizeAxes = Axes.X, + Height = default_height, + Child = new GridContainer { RelativeSizeAxes = Axes.X, Height = default_height, - Child = new GridContainer + Content = new[] { - RelativeSizeAxes = Axes.X, - Height = default_height, - Content = new[] + new Drawable[] { - new Drawable[] + label = new OsuSpriteText { - label = new OsuSpriteText - { - Anchor = Anchor.TopLeft, - Origin = Anchor.TopLeft, - Padding = new MarginPadding { Left = default_label_left_padding, Top = default_label_top_padding }, - Colour = Color4.White, - TextSize = default_label_text_size, - Text = LabelText, - Font = @"Exo2.0-Bold", - }, - textBox = new OsuTextBox - { - Anchor = Anchor.TopLeft, - Origin = Anchor.TopLeft, - RelativeSizeAxes = Axes.X, - Height = default_height, - ReadOnly = ReadOnly, - CornerRadius = inner_corner_radius, - }, + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft, + Padding = new MarginPadding { Left = default_label_left_padding, Top = default_label_top_padding }, + Colour = Color4.White, + TextSize = default_label_text_size, + Font = @"Exo2.0-Bold", + }, + textBox = new OsuTextBox + { + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft, + RelativeSizeAxes = Axes.X, + Height = default_height, + CornerRadius = inner_corner_radius, }, }, - ColumnDimensions = new[] - { - new Dimension(GridSizeMode.Absolute, label_container_width), - new Dimension() - } + }, + ColumnDimensions = new[] + { + new Dimension(GridSizeMode.Absolute, label_container_width), + new Dimension() } } } From ab9340f4be8ab5410177a0eb4b611437177a28b4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 24 Jul 2018 11:34:06 +0200 Subject: [PATCH 36/85] Fix usage of culture local ToUpper causing incorrect display on Turkish machines Closes #3098. --- osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs | 3 ++- osu.Game/Overlays/Chat/ChannelSection.cs | 3 ++- osu.Game/Overlays/MedalSplash/DrawableMedal.cs | 3 ++- osu.Game/Overlays/Notifications/NotificationSection.cs | 7 ++++--- osu.Game/Overlays/OnScreenDisplay.cs | 5 +++-- osu.Game/Overlays/Settings/SettingsSubsection.cs | 3 ++- osu.Game/Rulesets/Judgements/DrawableJudgement.cs | 3 ++- osu.Game/Screens/Play/Break/BreakInfo.cs | 3 ++- .../Screens/Play/PlayerSettings/PlayerSettingsGroup.cs | 3 ++- osu.Game/Screens/Tournament/Drawings.cs | 3 ++- osu.Game/Screens/Tournament/Group.cs | 5 +++-- 11 files changed, 26 insertions(+), 15 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs index 24e6021421..4e92f49937 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Globalization; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -23,7 +24,7 @@ namespace osu.Game.Beatmaps.Drawables if (value == status) return; status = value; - statusText.Text = Enum.GetName(typeof(BeatmapSetOnlineStatus), Status)?.ToUpper(); + statusText.Text = Enum.GetName(typeof(BeatmapSetOnlineStatus), Status)?.ToUpper(CultureInfo.InvariantCulture); } } diff --git a/osu.Game/Overlays/Chat/ChannelSection.cs b/osu.Game/Overlays/Chat/ChannelSection.cs index 89d9d2231c..2d0c406ef2 100644 --- a/osu.Game/Overlays/Chat/ChannelSection.cs +++ b/osu.Game/Overlays/Chat/ChannelSection.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using System.Globalization; using System.Linq; using OpenTK; using osu.Framework.Graphics; @@ -30,7 +31,7 @@ namespace osu.Game.Overlays.Chat public string Header { get { return header.Text; } - set { header.Text = value.ToUpper(); } + set { header.Text = value.ToUpper(CultureInfo.InvariantCulture); } } public IEnumerable Channels diff --git a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs index ce79e70b1c..222c966a2b 100644 --- a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs +++ b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Globalization; using osu.Framework; using OpenTK; using osu.Framework.Allocation; @@ -62,7 +63,7 @@ namespace osu.Game.Overlays.MedalSplash { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Text = "Medal Unlocked".ToUpper(), + Text = "Medal Unlocked".ToUpper(CultureInfo.InvariantCulture), TextSize = 24, Font = @"Exo2.0-Light", Alpha = 0f, diff --git a/osu.Game/Overlays/Notifications/NotificationSection.cs b/osu.Game/Overlays/Notifications/NotificationSection.cs index c166624d2b..1537c65a1f 100644 --- a/osu.Game/Overlays/Notifications/NotificationSection.cs +++ b/osu.Game/Overlays/Notifications/NotificationSection.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Extensions.IEnumerableExtensions; @@ -55,7 +56,7 @@ namespace osu.Game.Overlays.Notifications set { title = value; - if (titleText != null) titleText.Text = title.ToUpper(); + if (titleText != null) titleText.Text = title.ToUpper(CultureInfo.InvariantCulture); } } @@ -101,7 +102,7 @@ namespace osu.Game.Overlays.Notifications { titleText = new OsuSpriteText { - Text = title.ToUpper(), + Text = title.ToUpper(CultureInfo.InvariantCulture), Font = @"Exo2.0-Black", }, countText = new OsuSpriteText @@ -154,7 +155,7 @@ namespace osu.Game.Overlays.Notifications public string Text { get { return text.Text; } - set { text.Text = value.ToUpper(); } + set { text.Text = value.ToUpper(CultureInfo.InvariantCulture); } } } diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index 5a5b90ee25..ba5bb9c49e 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Configuration.Tracking; @@ -176,9 +177,9 @@ namespace osu.Game.Overlays { Schedule(() => { - textLine1.Text = description.Name.ToUpper(); + textLine1.Text = description.Name.ToUpper(CultureInfo.InvariantCulture); textLine2.Text = description.Value; - textLine3.Text = description.Shortcut.ToUpper(); + textLine3.Text = description.Shortcut.ToUpper(CultureInfo.InvariantCulture); if (string.IsNullOrEmpty(textLine3.Text)) textLine3.Text = "NO KEY BOUND"; diff --git a/osu.Game/Overlays/Settings/SettingsSubsection.cs b/osu.Game/Overlays/Settings/SettingsSubsection.cs index 82589a99bd..4498828118 100644 --- a/osu.Game/Overlays/Settings/SettingsSubsection.cs +++ b/osu.Game/Overlays/Settings/SettingsSubsection.cs @@ -6,6 +6,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; using System.Collections.Generic; +using System.Globalization; using System.Linq; using osu.Framework.Allocation; @@ -51,7 +52,7 @@ namespace osu.Game.Overlays.Settings { new OsuSpriteText { - Text = Header.ToUpper(), + Text = Header.ToUpper(CultureInfo.InvariantCulture), Margin = new MarginPadding { Bottom = 10, Left = SettingsOverlay.CONTENT_MARGINS, Right = SettingsOverlay.CONTENT_MARGINS }, Font = @"Exo2.0-Black", }, diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs index 74ee025823..6fa10977d0 100644 --- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Globalization; using OpenTK; using osu.Framework.Allocation; using osu.Framework.Extensions; @@ -51,7 +52,7 @@ namespace osu.Game.Rulesets.Judgements Child = new SkinnableDrawable($"Play/{Judgement.Result}", _ => JudgementText = new OsuSpriteText { - Text = Judgement.Result.GetDescription().ToUpper(), + Text = Judgement.Result.GetDescription().ToUpper(CultureInfo.InvariantCulture), Font = @"Venera", Colour = judgementColour(Judgement.Result), Scale = new Vector2(0.85f, 1), diff --git a/osu.Game/Screens/Play/Break/BreakInfo.cs b/osu.Game/Screens/Play/Break/BreakInfo.cs index 77c9c967b4..fb7f6cd03b 100644 --- a/osu.Game/Screens/Play/Break/BreakInfo.cs +++ b/osu.Game/Screens/Play/Break/BreakInfo.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Globalization; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; @@ -28,7 +29,7 @@ namespace osu.Game.Screens.Play.Break { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Text = "current progress".ToUpper(), + Text = "current progress".ToUpper(CultureInfo.InvariantCulture), TextSize = 15, Font = "Exo2.0-Black", }, diff --git a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs index 1813d02d02..9a17e7708b 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Globalization; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -94,7 +95,7 @@ namespace osu.Game.Screens.Play.PlayerSettings { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, - Text = Title.ToUpper(), + Text = Title.ToUpper(CultureInfo.InvariantCulture), TextSize = 17, Font = @"Exo2.0-Bold", Margin = new MarginPadding { Left = 10 }, diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game/Screens/Tournament/Drawings.cs index 49a46b96e3..7bc8217329 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game/Screens/Tournament/Drawings.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using System.Threading.Tasks; @@ -323,7 +324,7 @@ namespace osu.Game.Screens.Tournament if (string.IsNullOrEmpty(line)) continue; - if (line.ToUpper().StartsWith("GROUP")) + if (line.ToUpper(CultureInfo.InvariantCulture).StartsWith("GROUP")) continue; // ReSharper disable once AccessToModifiedClosure diff --git a/osu.Game/Screens/Tournament/Group.cs b/osu.Game/Screens/Tournament/Group.cs index b1bcd6052c..f62c26a62e 100644 --- a/osu.Game/Screens/Tournament/Group.cs +++ b/osu.Game/Screens/Tournament/Group.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Text; using osu.Framework.Allocation; @@ -51,7 +52,7 @@ namespace osu.Game.Screens.Tournament Position = new Vector2(0, 7f), - Text = $"GROUP {name.ToUpper()}", + Text = $"GROUP {name.ToUpper(CultureInfo.InvariantCulture)}", TextSize = 8f, Font = @"Exo2.0-Bold", Colour = new Color4(255, 204, 34, 255), @@ -161,7 +162,7 @@ namespace osu.Game.Screens.Tournament Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Text = team.Acronym.ToUpper(), + Text = team.Acronym.ToUpper(CultureInfo.InvariantCulture), TextSize = 10f, Font = @"Exo2.0-Bold" } From b38da34da9df8e8910e293a3a93766b58aab4bf0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 24 Jul 2018 12:11:14 +0200 Subject: [PATCH 37/85] Fix resetting database failing due to incorrect disposal logic --- osu.Game/Database/DatabaseContextFactory.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/osu.Game/Database/DatabaseContextFactory.cs b/osu.Game/Database/DatabaseContextFactory.cs index c20d4569f6..e70d753114 100644 --- a/osu.Game/Database/DatabaseContextFactory.cs +++ b/osu.Game/Database/DatabaseContextFactory.cs @@ -5,6 +5,7 @@ using System; using System.Linq; using System.Threading; using Microsoft.EntityFrameworkCore.Storage; +using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Platform; namespace osu.Game.Database @@ -115,7 +116,11 @@ namespace osu.Game.Database } } - private void recycleThreadContexts() => threadContexts = new ThreadLocal(CreateContext); + private void recycleThreadContexts() + { + threadContexts?.Values.ForEach(c => c.Dispose()); + threadContexts = new ThreadLocal(CreateContext, true); + } protected virtual OsuDbContext CreateContext() => new OsuDbContext(storage.GetDatabaseConnectionString(database_name)) { @@ -127,8 +132,6 @@ namespace osu.Game.Database lock (writeLock) { recycleThreadContexts(); - GC.Collect(); - GC.WaitForPendingFinalizers(); storage.DeleteDatabase(database_name); } } From 1d86083981b80ee725645ce9b10719c384a9687a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 24 Jul 2018 12:11:20 +0200 Subject: [PATCH 38/85] Hide unnecessary log output --- osu.Game/OsuGameBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 63cc883844..bada2a794d 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -224,7 +224,7 @@ namespace osu.Game // todo: we probably want a better (non-destructive) migrations/recovery process at a later point than this. contextFactory.ResetDatabase(); - Logger.Log("Database purged successfully.", LoggingTarget.Database, LogLevel.Important); + Logger.Log("Database purged successfully.", LoggingTarget.Database); // only run once more, then hard bail. using (var db = contextFactory.GetForWrite(false)) From 5364a6148a2b6adcbd77fbde14359cc1d6b9b259 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 24 Jul 2018 14:42:06 +0200 Subject: [PATCH 39/85] Use ToUpperInvariant --- osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs | 3 +-- osu.Game/Overlays/Chat/ChannelSection.cs | 3 +-- osu.Game/Overlays/MedalSplash/DrawableMedal.cs | 3 +-- osu.Game/Overlays/Notifications/NotificationSection.cs | 7 +++---- osu.Game/Overlays/OnScreenDisplay.cs | 5 ++--- osu.Game/Overlays/Settings/SettingsSubsection.cs | 3 +-- osu.Game/Rulesets/Judgements/DrawableJudgement.cs | 3 +-- osu.Game/Screens/Play/Break/BreakInfo.cs | 3 +-- .../Screens/Play/PlayerSettings/PlayerSettingsGroup.cs | 3 +-- osu.Game/Screens/Tournament/Drawings.cs | 3 +-- osu.Game/Screens/Tournament/Group.cs | 5 ++--- 11 files changed, 15 insertions(+), 26 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs index 4e92f49937..c7e97cef55 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using System.Globalization; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -24,7 +23,7 @@ namespace osu.Game.Beatmaps.Drawables if (value == status) return; status = value; - statusText.Text = Enum.GetName(typeof(BeatmapSetOnlineStatus), Status)?.ToUpper(CultureInfo.InvariantCulture); + statusText.Text = Enum.GetName(typeof(BeatmapSetOnlineStatus), Status)?.ToUpperInvariant(); } } diff --git a/osu.Game/Overlays/Chat/ChannelSection.cs b/osu.Game/Overlays/Chat/ChannelSection.cs index 2d0c406ef2..85fdecaaba 100644 --- a/osu.Game/Overlays/Chat/ChannelSection.cs +++ b/osu.Game/Overlays/Chat/ChannelSection.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; -using System.Globalization; using System.Linq; using OpenTK; using osu.Framework.Graphics; @@ -31,7 +30,7 @@ namespace osu.Game.Overlays.Chat public string Header { get { return header.Text; } - set { header.Text = value.ToUpper(CultureInfo.InvariantCulture); } + set { header.Text = value.ToUpperInvariant(); } } public IEnumerable Channels diff --git a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs index 222c966a2b..a27278e002 100644 --- a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs +++ b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using System.Globalization; using osu.Framework; using OpenTK; using osu.Framework.Allocation; @@ -63,7 +62,7 @@ namespace osu.Game.Overlays.MedalSplash { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Text = "Medal Unlocked".ToUpper(CultureInfo.InvariantCulture), + Text = "Medal Unlocked".ToUpperInvariant(), TextSize = 24, Font = @"Exo2.0-Light", Alpha = 0f, diff --git a/osu.Game/Overlays/Notifications/NotificationSection.cs b/osu.Game/Overlays/Notifications/NotificationSection.cs index 1537c65a1f..f41e3e876f 100644 --- a/osu.Game/Overlays/Notifications/NotificationSection.cs +++ b/osu.Game/Overlays/Notifications/NotificationSection.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Globalization; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Extensions.IEnumerableExtensions; @@ -56,7 +55,7 @@ namespace osu.Game.Overlays.Notifications set { title = value; - if (titleText != null) titleText.Text = title.ToUpper(CultureInfo.InvariantCulture); + if (titleText != null) titleText.Text = title.ToUpperInvariant(); } } @@ -102,7 +101,7 @@ namespace osu.Game.Overlays.Notifications { titleText = new OsuSpriteText { - Text = title.ToUpper(CultureInfo.InvariantCulture), + Text = title.ToUpperInvariant(), Font = @"Exo2.0-Black", }, countText = new OsuSpriteText @@ -155,7 +154,7 @@ namespace osu.Game.Overlays.Notifications public string Text { get { return text.Text; } - set { text.Text = value.ToUpper(CultureInfo.InvariantCulture); } + set { text.Text = value.ToUpperInvariant(); } } } diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index ba5bb9c49e..041ceab365 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Globalization; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Configuration.Tracking; @@ -177,9 +176,9 @@ namespace osu.Game.Overlays { Schedule(() => { - textLine1.Text = description.Name.ToUpper(CultureInfo.InvariantCulture); + textLine1.Text = description.Name.ToUpperInvariant(); textLine2.Text = description.Value; - textLine3.Text = description.Shortcut.ToUpper(CultureInfo.InvariantCulture); + textLine3.Text = description.Shortcut.ToUpperInvariant(); if (string.IsNullOrEmpty(textLine3.Text)) textLine3.Text = "NO KEY BOUND"; diff --git a/osu.Game/Overlays/Settings/SettingsSubsection.cs b/osu.Game/Overlays/Settings/SettingsSubsection.cs index 4498828118..9296972749 100644 --- a/osu.Game/Overlays/Settings/SettingsSubsection.cs +++ b/osu.Game/Overlays/Settings/SettingsSubsection.cs @@ -6,7 +6,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; using System.Collections.Generic; -using System.Globalization; using System.Linq; using osu.Framework.Allocation; @@ -52,7 +51,7 @@ namespace osu.Game.Overlays.Settings { new OsuSpriteText { - Text = Header.ToUpper(CultureInfo.InvariantCulture), + Text = Header.ToUpperInvariant(), Margin = new MarginPadding { Bottom = 10, Left = SettingsOverlay.CONTENT_MARGINS, Right = SettingsOverlay.CONTENT_MARGINS }, Font = @"Exo2.0-Black", }, diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs index 6fa10977d0..5de14ae579 100644 --- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Globalization; using OpenTK; using osu.Framework.Allocation; using osu.Framework.Extensions; @@ -52,7 +51,7 @@ namespace osu.Game.Rulesets.Judgements Child = new SkinnableDrawable($"Play/{Judgement.Result}", _ => JudgementText = new OsuSpriteText { - Text = Judgement.Result.GetDescription().ToUpper(CultureInfo.InvariantCulture), + Text = Judgement.Result.GetDescription().ToUpperInvariant(), Font = @"Venera", Colour = judgementColour(Judgement.Result), Scale = new Vector2(0.85f, 1), diff --git a/osu.Game/Screens/Play/Break/BreakInfo.cs b/osu.Game/Screens/Play/Break/BreakInfo.cs index fb7f6cd03b..51d39762d2 100644 --- a/osu.Game/Screens/Play/Break/BreakInfo.cs +++ b/osu.Game/Screens/Play/Break/BreakInfo.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Globalization; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; @@ -29,7 +28,7 @@ namespace osu.Game.Screens.Play.Break { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Text = "current progress".ToUpper(CultureInfo.InvariantCulture), + Text = "current progress".ToUpperInvariant(), TextSize = 15, Font = "Exo2.0-Black", }, diff --git a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs index 9a17e7708b..c4767f404d 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Globalization; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -95,7 +94,7 @@ namespace osu.Game.Screens.Play.PlayerSettings { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, - Text = Title.ToUpper(CultureInfo.InvariantCulture), + Text = Title.ToUpperInvariant(), TextSize = 17, Font = @"Exo2.0-Bold", Margin = new MarginPadding { Left = 10 }, diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game/Screens/Tournament/Drawings.cs index 7bc8217329..63d29d5cd7 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game/Screens/Tournament/Drawings.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Globalization; using System.IO; using System.Linq; using System.Threading.Tasks; @@ -324,7 +323,7 @@ namespace osu.Game.Screens.Tournament if (string.IsNullOrEmpty(line)) continue; - if (line.ToUpper(CultureInfo.InvariantCulture).StartsWith("GROUP")) + if (line.ToUpperInvariant().StartsWith("GROUP")) continue; // ReSharper disable once AccessToModifiedClosure diff --git a/osu.Game/Screens/Tournament/Group.cs b/osu.Game/Screens/Tournament/Group.cs index f62c26a62e..6845d8fc48 100644 --- a/osu.Game/Screens/Tournament/Group.cs +++ b/osu.Game/Screens/Tournament/Group.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; -using System.Globalization; using System.Linq; using System.Text; using osu.Framework.Allocation; @@ -52,7 +51,7 @@ namespace osu.Game.Screens.Tournament Position = new Vector2(0, 7f), - Text = $"GROUP {name.ToUpper(CultureInfo.InvariantCulture)}", + Text = $"GROUP {name.ToUpperInvariant()}", TextSize = 8f, Font = @"Exo2.0-Bold", Colour = new Color4(255, 204, 34, 255), @@ -162,7 +161,7 @@ namespace osu.Game.Screens.Tournament Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Text = team.Acronym.ToUpper(CultureInfo.InvariantCulture), + Text = team.Acronym.ToUpperInvariant(), TextSize = 10f, Font = @"Exo2.0-Bold" } From 3ca112aef0779c29fd7eaeca0dd9d9d24656e661 Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Tue, 24 Jul 2018 22:04:02 +0300 Subject: [PATCH 40/85] Clean code and apply requested changes --- .../LabelledComponents/LabelledTextBox.cs | 124 ++++++------------ 1 file changed, 39 insertions(+), 85 deletions(-) diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs index 5f4e88b52c..9f364c6cf4 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs @@ -27,82 +27,41 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents private const float default_label_text_size = 16; public event OnCommitHandler OnCommit; - - private bool readOnly; + public bool ReadOnly { - get => readOnly; - set - { - textBox.ReadOnly = value; - readOnly = value; - } + get => textBox.ReadOnly; + set => textBox.ReadOnly = value; } - - private string labelText; + public string LabelText { - get => labelText; - set - { - labelText = value; - label.Text = value; - } + get => label.Text; + set => label.Text = value; } - - private float labelTextSize; + public float LabelTextSize { - get => labelTextSize; - set - { - labelTextSize = value; - label.TextSize = value; - } + get => label.TextSize; + set => label.TextSize = value; } - - private string placeholderText; + public string PlaceholderText { - get => placeholderText; - set - { - placeholderText = value; - textBox.PlaceholderText = value; - } + get => textBox.PlaceholderText; + set => textBox.PlaceholderText = value; } - private string text; public string Text { - get => text; - set - { - text = value; - textBox.Text = value; - } - } - - private float height = default_height; - public float Height - { - get => height; - private set - { - height = value; - textBox.Height = value; - content.Height = value; - } + get => textBox.Text; + set => textBox.Text = value; } public MarginPadding Padding { get => base.Padding; - set - { - base.Padding = value; - base.Height = Height + base.Padding.Top; - } + set => base.Padding = value; } public MarginPadding LabelPadding @@ -132,7 +91,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents public LabelledTextBox() { RelativeSizeAxes = Axes.X; - base.Height = default_height + Padding.Top; + Height = default_height; CornerRadius = outer_corner_radius; Masking = true; @@ -148,42 +107,37 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents RelativeSizeAxes = Axes.Both, Colour = OsuColour.FromHex("1c2125"), }, - new Container + new GridContainer { RelativeSizeAxes = Axes.X, Height = default_height, - Child = new GridContainer + Content = new[] { - RelativeSizeAxes = Axes.X, - Height = default_height, - Content = new[] + new Drawable[] { - new Drawable[] + label = new OsuSpriteText { - label = new OsuSpriteText - { - Anchor = Anchor.TopLeft, - Origin = Anchor.TopLeft, - Padding = new MarginPadding { Left = default_label_left_padding, Top = default_label_top_padding }, - Colour = Color4.White, - TextSize = default_label_text_size, - Font = @"Exo2.0-Bold", - }, - textBox = new OsuTextBox - { - Anchor = Anchor.TopLeft, - Origin = Anchor.TopLeft, - RelativeSizeAxes = Axes.X, - Height = default_height, - CornerRadius = inner_corner_radius, - }, + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft, + Padding = new MarginPadding { Left = default_label_left_padding, Top = default_label_top_padding }, + Colour = Color4.White, + TextSize = default_label_text_size, + Font = @"Exo2.0-Bold", + }, + textBox = new OsuTextBox + { + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft, + RelativeSizeAxes = Axes.Both, + Height = 1, + CornerRadius = inner_corner_radius, }, }, - ColumnDimensions = new[] - { - new Dimension(GridSizeMode.Absolute, label_container_width), - new Dimension() - } + }, + ColumnDimensions = new[] + { + new Dimension(GridSizeMode.Absolute, label_container_width), + new Dimension() } } } From 6675c455f3d6761343b969849db8d92d376238c5 Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Tue, 24 Jul 2018 22:33:19 +0300 Subject: [PATCH 41/85] Trim whitespace that magically appeared --- .../Components/LabelledComponents/LabelledTextBox.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs index 9f364c6cf4..fbfb771c8a 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs @@ -27,25 +27,25 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents private const float default_label_text_size = 16; public event OnCommitHandler OnCommit; - + public bool ReadOnly { get => textBox.ReadOnly; set => textBox.ReadOnly = value; } - + public string LabelText { get => label.Text; set => label.Text = value; } - + public float LabelTextSize { get => label.TextSize; set => label.TextSize = value; } - + public string PlaceholderText { get => textBox.PlaceholderText; From da8fc0ee5dd169946155aa4150bf34354c14255e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 25 Jul 2018 07:37:05 +0200 Subject: [PATCH 42/85] ToLower -> ToLowerInvariant --- osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs | 4 ++-- osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs | 2 +- osu.Game/Graphics/ScreenshotManager.cs | 2 +- osu.Game/Online/API/Requests/GetUserScoresRequest.cs | 2 +- osu.Game/Online/API/Requests/PostMessageRequest.cs | 2 +- osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs | 4 ++-- osu.Game/Screens/Multi/Header.cs | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs b/osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs index 64ed08373a..fdc8f362f7 100644 --- a/osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs +++ b/osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs @@ -62,7 +62,7 @@ namespace osu.Game.Rulesets.Mania.Tests return new ScrollingTestContainer(direction) { AutoSizeAxes = Axes.Both, - Child = new NoteContainer(direction, $"note, scrolling {direction.ToString().ToLower()}") + Child = new NoteContainer(direction, $"note, scrolling {direction.ToString().ToLowerInvariant()}") { Child = new DrawableNote(note) { AccentColour = Color4.OrangeRed } } @@ -77,7 +77,7 @@ namespace osu.Game.Rulesets.Mania.Tests return new ScrollingTestContainer(direction) { AutoSizeAxes = Axes.Both, - Child = new NoteContainer(direction, $"hold note, scrolling {direction.ToString().ToLower()}") + Child = new NoteContainer(direction, $"hold note, scrolling {direction.ToString().ToLowerInvariant()}") { Child = new DrawableHoldNote(note) { diff --git a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs index 52d9f31814..26f28c86ca 100644 --- a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs @@ -312,7 +312,7 @@ namespace osu.Game.Beatmaps.Formats omitFirstBarSignature = effectFlags.HasFlag(EffectFlags.OmitFirstBarLine); } - string stringSampleSet = sampleSet.ToString().ToLower(); + string stringSampleSet = sampleSet.ToString().ToLowerInvariant(); if (stringSampleSet == @"none") stringSampleSet = @"normal"; diff --git a/osu.Game/Graphics/ScreenshotManager.cs b/osu.Game/Graphics/ScreenshotManager.cs index 90580c50df..7b3337cb23 100644 --- a/osu.Game/Graphics/ScreenshotManager.cs +++ b/osu.Game/Graphics/ScreenshotManager.cs @@ -134,7 +134,7 @@ namespace osu.Game.Graphics private string getFileName() { var dt = DateTime.Now; - var fileExt = screenshotFormat.ToString().ToLower(); + var fileExt = screenshotFormat.ToString().ToLowerInvariant(); var withoutIndex = $"osu_{dt:yyyy-MM-dd_HH-mm-ss}.{fileExt}"; if (!storage.Exists(withoutIndex)) diff --git a/osu.Game/Online/API/Requests/GetUserScoresRequest.cs b/osu.Game/Online/API/Requests/GetUserScoresRequest.cs index ea14135a61..4d4aa4d957 100644 --- a/osu.Game/Online/API/Requests/GetUserScoresRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserScoresRequest.cs @@ -20,7 +20,7 @@ namespace osu.Game.Online.API.Requests } // ReSharper disable once ImpureMethodCallOnReadonlyValueField - protected override string Target => $@"users/{userId}/scores/{type.ToString().ToLower()}?offset={offset}"; + protected override string Target => $@"users/{userId}/scores/{type.ToString().ToLowerInvariant()}?offset={offset}"; } public enum ScoreType diff --git a/osu.Game/Online/API/Requests/PostMessageRequest.cs b/osu.Game/Online/API/Requests/PostMessageRequest.cs index 44429bdcd5..e0a9fb83b2 100644 --- a/osu.Game/Online/API/Requests/PostMessageRequest.cs +++ b/osu.Game/Online/API/Requests/PostMessageRequest.cs @@ -23,7 +23,7 @@ namespace osu.Game.Online.API.Requests req.Method = HttpMethod.POST; req.AddParameter(@"target_type", message.TargetType.GetDescription()); req.AddParameter(@"target_id", message.TargetId.ToString()); - req.AddParameter(@"is_action", message.IsAction.ToString().ToLower()); + req.AddParameter(@"is_action", message.IsAction.ToString().ToLowerInvariant()); req.AddParameter(@"message", message.Content); return req; diff --git a/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs b/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs index 2a154d1230..3c808d1bee 100644 --- a/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs +++ b/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs @@ -29,7 +29,7 @@ namespace osu.Game.Online.API.Requests } // ReSharper disable once ImpureMethodCallOnReadonlyValueField - protected override string Target => $@"beatmapsets/search?q={query}&m={ruleset.ID ?? 0}&s={(int)searchCategory}&sort={sortCriteria.ToString().ToLower()}_{directionString}"; + protected override string Target => $@"beatmapsets/search?q={query}&m={ruleset.ID ?? 0}&s={(int)searchCategory}&sort={sortCriteria.ToString().ToLowerInvariant()}_{directionString}"; } public enum BeatmapSearchCategory diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs index 0ac8e585f8..c48060bfa9 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs @@ -197,10 +197,10 @@ namespace osu.Game.Rulesets.Objects.Legacy var bank = (LegacyBeatmapDecoder.LegacySampleBank)int.Parse(split[0]); var addbank = (LegacyBeatmapDecoder.LegacySampleBank)int.Parse(split[1]); - string stringBank = bank.ToString().ToLower(); + string stringBank = bank.ToString().ToLowerInvariant(); if (stringBank == @"none") stringBank = null; - string stringAddBank = addbank.ToString().ToLower(); + string stringAddBank = addbank.ToString().ToLowerInvariant(); if (stringAddBank == @"none") stringAddBank = null; diff --git a/osu.Game/Screens/Multi/Header.cs b/osu.Game/Screens/Multi/Header.cs index 46610a36d8..809fc25083 100644 --- a/osu.Game/Screens/Multi/Header.cs +++ b/osu.Game/Screens/Multi/Header.cs @@ -86,7 +86,7 @@ namespace osu.Game.Screens.Multi }, }; - breadcrumbs.Current.ValueChanged += s => screenType.Text = ((MultiplayerScreen)s).Type.ToLower(); + breadcrumbs.Current.ValueChanged += s => screenType.Text = ((MultiplayerScreen)s).Type.ToLowerInvariant(); breadcrumbs.Current.TriggerChange(); } From b60e4b0728cc24a0067d673c6552f12de6e331e9 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 25 Jul 2018 18:34:47 +0900 Subject: [PATCH 43/85] Cleanup --- .../Components/LabelledComponents/LabelledTextBox.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs index fbfb771c8a..4c8e90400a 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs @@ -5,19 +5,15 @@ using OpenTK.Graphics; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; -using static osu.Framework.Graphics.UserInterface.TextBox; namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents { public class LabelledTextBox : CompositeDrawable { - private readonly OsuTextBox textBox; - private readonly Container content; - private readonly OsuSpriteText label; - private const float label_container_width = 150; private const float outer_corner_radius = 15; private const float inner_corner_radius = 10; @@ -26,7 +22,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents private const float default_label_top_padding = 12; private const float default_label_text_size = 16; - public event OnCommitHandler OnCommit; + public event TextBox.OnCommitHandler OnCommit; public bool ReadOnly { @@ -88,6 +84,10 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents set => content.Colour = value; } + private readonly OsuTextBox textBox; + private readonly Container content; + private readonly OsuSpriteText label; + public LabelledTextBox() { RelativeSizeAxes = Axes.X; From 206e3686f2dc2fd98273892f6d5faeee4dfad304 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 25 Jul 2018 18:38:50 +0900 Subject: [PATCH 44/85] Add back blue border --- .../Setup/Components/LabelledComponents/LabelledTextBox.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs index 4c8e90400a..736d785b41 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Allocation; using OpenTK.Graphics; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -145,5 +146,11 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents textBox.OnCommit += OnCommit; } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + textBox.BorderColour = colours.Blue; + } } } From c4b1ba2979ede6c0b00c29c6912801ad6e4d0adf Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Wed, 25 Jul 2018 15:14:40 +0300 Subject: [PATCH 45/85] Remove padding, fix corner radiuses --- .../Visual/TestCaseLabelledTextBox.cs | 10 ++++--- .../LabelledComponents/LabelledTextBox.cs | 27 +++---------------- 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs b/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs index be11562bb0..d41739bfb5 100644 --- a/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs +++ b/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs @@ -4,6 +4,7 @@ using NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; using osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents; using System; using System.Collections.Generic; @@ -21,15 +22,18 @@ namespace osu.Game.Tests.Visual [BackgroundDependencyLoader] private void load() { - Children = new Drawable[] + Child = new Container { - new LabelledTextBox + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.X, + Padding = new MarginPadding { Left = 150, Right = 150 }, + Child = new LabelledTextBox { Anchor = Anchor.Centre, Origin = Anchor.Centre, LabelText = "Testing text", PlaceholderText = "This is definitely working as intended", - Padding = new MarginPadding { Left = 150, Right = 150 } } }; } diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs index 736d785b41..94200b7f4e 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs @@ -16,8 +16,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents public class LabelledTextBox : CompositeDrawable { private const float label_container_width = 150; - private const float outer_corner_radius = 15; - private const float inner_corner_radius = 10; + private const float corner_radius = 15; private const float default_height = 40; private const float default_label_left_padding = 15; private const float default_label_top_padding = 12; @@ -55,24 +54,6 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents set => textBox.Text = value; } - public MarginPadding Padding - { - get => base.Padding; - set => base.Padding = value; - } - - public MarginPadding LabelPadding - { - get => label.Padding; - set => label.Padding = value; - } - - public MarginPadding TextBoxPadding - { - get => textBox.Padding; - set => textBox.Padding = value; - } - public Color4 LabelTextColour { get => label.Colour; @@ -93,13 +74,13 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents { RelativeSizeAxes = Axes.X; Height = default_height; - CornerRadius = outer_corner_radius; + CornerRadius = corner_radius; Masking = true; InternalChild = new Container { RelativeSizeAxes = Axes.Both, - CornerRadius = outer_corner_radius, + CornerRadius = corner_radius, Masking = true, Children = new Drawable[] { @@ -131,7 +112,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents Origin = Anchor.TopLeft, RelativeSizeAxes = Axes.Both, Height = 1, - CornerRadius = inner_corner_radius, + CornerRadius = corner_radius, }, }, }, From ee0522ad8416ed2147c1346ad756b3b31ea1ab97 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 25 Jul 2018 16:45:07 +0200 Subject: [PATCH 46/85] Ignore failing test --- osu.Game.Tests/Visual/TestCasePlaySongSelect.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs index d56b6d04f7..b1ffe04b68 100644 --- a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs @@ -120,6 +120,7 @@ namespace osu.Game.Tests.Visual } [Test] + [Ignore("needs fixing")] public void ImportUnderDifferentRuleset() { changeRuleset(2); From ff2a3a6e9208c6d3fb7324cecea974eef9d2785f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 26 Jul 2018 20:07:16 +0900 Subject: [PATCH 47/85] Fix hitobjects not properly expiring if scrolling in the editor --- .../Objects/Drawables/DrawableOsuHitObject.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs index 02def2189f..5dc141bed0 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -1,11 +1,13 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using System.ComponentModel; using osu.Game.Rulesets.Objects.Drawables; using osu.Framework.Graphics; using System.Linq; using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Scoring; using osu.Game.Skinning; using OpenTK.Graphics; @@ -32,7 +34,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { UpdatePreemptState(); - using (BeginDelayedSequence(HitObject.TimePreempt + (Judgements.FirstOrDefault()?.TimeOffset ?? 0), true)) + var judgementOffset = Math.Min(HitObject.HitWindows.HalfWindowFor(HitResult.Miss), Judgements.FirstOrDefault()?.TimeOffset ?? 0); + + using (BeginDelayedSequence(HitObject.TimePreempt + judgementOffset, true)) UpdateCurrentState(state); } } From 71c49de0312c769922b91250a1de42eb8f7f5831 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 26 Jul 2018 21:00:18 +0900 Subject: [PATCH 48/85] Fix possible nullref if no fruits are ever caught --- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 2f42902fd0..7b06426b07 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -52,6 +52,9 @@ namespace osu.Game.Rulesets.Catch.UI { void runAfterLoaded(Action action) { + if (lastPlateableFruit == null) + return; + // this is required to make this run after the last caught fruit runs UpdateState at least once. // TODO: find a better alternative if (lastPlateableFruit.IsLoaded) From d32a3ff0524696cf274edb1649632e08340cce64 Mon Sep 17 00:00:00 2001 From: phosphene47 Date: Sat, 28 Jul 2018 08:34:51 +1000 Subject: [PATCH 49/85] Esc at the end of play should push to result screen Closes #3060 --- osu.Game/Screens/Play/Player.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 00ba1a8d12..438e5a49e0 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -278,6 +278,8 @@ namespace osu.Game.Screens.Play ScoreProcessor.PopulateScore(score); score.User = RulesetContainer.Replay?.User ?? api.LocalUser.Value; Push(new Results(score)); + + onCompletionEvent = null; }); } } @@ -340,6 +342,14 @@ namespace osu.Game.Screens.Play protected override bool OnExiting(Screen next) { + if (onCompletionEvent != null) + { + // Proceed to result screen if beatmap already finished playing + onCompletionEvent.RunTask(); + + return true; + } + if ((!AllowPause || HasFailed || !ValidForResume || pauseContainer?.IsPaused != false || RulesetContainer?.HasReplayLoaded != false) && (!pauseContainer?.IsResuming ?? true)) { // In the case of replays, we may have changed the playback rate. From 2a9818a1281f8ad6d8567e395ea0e92c04d92b22 Mon Sep 17 00:00:00 2001 From: tgi74000 Date: Sun, 29 Jul 2018 20:42:05 +0200 Subject: [PATCH 50/85] Add support for sliderscorepoint skinning --- .../Objects/Drawables/DrawableSliderTick.cs | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs index db75321eb0..a5ecb63d12 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -8,6 +8,8 @@ using OpenTK.Graphics; using osu.Framework.Graphics.Shapes; using osu.Game.Rulesets.Osu.Judgements; using osu.Game.Rulesets.Scoring; +using osu.Game.Skinning; +using osu.Framework.Graphics.Containers; namespace osu.Game.Rulesets.Osu.Objects.Drawables { @@ -22,23 +24,27 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables public DrawableSliderTick(SliderTick sliderTick) : base(sliderTick) { Size = new Vector2(16) * sliderTick.Scale; - - Masking = true; - CornerRadius = Size.X / 2; - Origin = Anchor.Centre; - BorderThickness = 2; - BorderColour = Color4.White; - InternalChildren = new Drawable[] { - new Box + new SkinnableDrawable("Play/osu/sliderscorepoint", _ => new Container { + Masking = true, RelativeSizeAxes = Axes.Both, - Colour = AccentColour, - Alpha = 0.3f, - } + Origin = Anchor.Centre, + CornerRadius = Size.X / 2, + + BorderThickness = 2, + BorderColour = Color4.White, + + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = AccentColour, + Alpha = 0.3f, + } + }, restrictSize: false) }; } From 52d9461f03c549b5ea565efa0656d5c2c0d05dee Mon Sep 17 00:00:00 2001 From: tgi74000 Date: Sun, 29 Jul 2018 20:51:06 +0200 Subject: [PATCH 51/85] Add support for reversearrow skinning --- .../Objects/Drawables/DrawableRepeatPoint.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index 26f3ee6bb4..ec6b312a80 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -10,6 +10,7 @@ using OpenTK; using osu.Game.Graphics; using osu.Game.Rulesets.Osu.Judgements; using osu.Game.Rulesets.Scoring; +using osu.Game.Skinning; namespace osu.Game.Rulesets.Osu.Objects.Drawables { @@ -33,11 +34,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables InternalChildren = new Drawable[] { - new SpriteIcon + new SkinnableDrawable("Play/osu/reversearrow", _ => new SpriteIcon { RelativeSizeAxes = Axes.Both, Icon = FontAwesome.fa_chevron_right - } + }, restrictSize: false) }; } From 257c035f30d6d11299de92fdff604622af2f5471 Mon Sep 17 00:00:00 2001 From: tgi74000 Date: Sun, 29 Jul 2018 21:28:13 +0200 Subject: [PATCH 52/85] Add support for sliderfollowcircle skinning --- .../Objects/Drawables/Pieces/SliderBall.cs | 13 +++++++++---- 1 file changed, 9 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 92c42af861..17a90dc369 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -10,6 +10,7 @@ using osu.Framework.Input.States; using osu.Game.Rulesets.Objects.Types; using OpenTK; using OpenTK.Graphics; +using osu.Game.Skinning; namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { @@ -33,7 +34,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces } private readonly Slider slider; - public readonly Box FollowCircle; + public readonly Drawable FollowCircle; private readonly Box ball; public SliderBall(Slider slider) @@ -46,13 +47,17 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces BorderThickness = 10; BorderColour = Color4.Orange; - Children = new Drawable[] + Children = new[] { - FollowCircle = new Box + FollowCircle = new Container { + Child = new SkinnableDrawable("Play/osu/sliderfollowcircle", _ => new Box + { + Colour = Color4.Orange, + RelativeSizeAxes = Axes.Both, + }, restrictSize: false), Origin = Anchor.Centre, Anchor = Anchor.Centre, - Colour = Color4.Orange, Width = width, Height = width, Alpha = 0, From 4322475ad2bd5ef4aea7ff20de9cab38e09ed20f Mon Sep 17 00:00:00 2001 From: tgi74000 Date: Sun, 29 Jul 2018 22:29:07 +0200 Subject: [PATCH 53/85] Add support for sliderb skinning (single frame only) --- .../Objects/Drawables/Pieces/SliderBall.cs | 34 ++++++++++++------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs index 17a90dc369..1191ed2fda 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -28,14 +28,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces set { accentColour = value; - if (ball != null) - ball.Colour = value; + if (drawableBall != null) + drawableBall.Colour = value; } } private readonly Slider slider; public readonly Drawable FollowCircle; - private readonly Box ball; + private Drawable drawableBall; public SliderBall(Slider slider) { @@ -55,7 +55,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { Colour = Color4.Orange, RelativeSizeAxes = Axes.Both, - }, restrictSize: false), + }), Origin = Anchor.Centre, Anchor = Anchor.Centre, Width = width, @@ -68,18 +68,26 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces AutoSizeAxes = Axes.Both, Origin = Anchor.Centre, Anchor = Anchor.Centre, - BorderThickness = 10, - BorderColour = Color4.White, Alpha = 1, - Children = new[] + Child = new Container { - ball = new Box + Width = width, + Height = width, + // TODO: support skin filename animation (sliderb0, sliderb1...) + Child = new SkinnableDrawable("Play/osu/sliderb", _ => new CircularContainer { - Colour = AccentColour, - Alpha = 0.4f, - Width = width, - Height = width, - }, + Masking = true, + RelativeSizeAxes = Axes.Both, + BorderThickness = 10, + BorderColour = Color4.White, + Alpha = 1, + Child = drawableBall = new Box + { + Colour = AccentColour, + RelativeSizeAxes = Axes.Both, + Alpha = 0.4f, + } + }), } } }; From 18096490b6c16ca22f1de0022f4047a12d22b830 Mon Sep 17 00:00:00 2001 From: tgi74000 Date: Sun, 29 Jul 2018 23:20:37 +0200 Subject: [PATCH 54/85] Add support for followpoint skinning --- .../Drawables/Connections/FollowPoint.cs | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs index 2c89ddc9cf..1c486d5d1e 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs @@ -7,6 +7,7 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Game.Skinning; namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections { @@ -20,26 +21,27 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections { Origin = Anchor.Centre; - Masking = true; - AutoSizeAxes = Axes.Both; - CornerRadius = width / 2; - EdgeEffect = new EdgeEffectParameters + Child = new SkinnableDrawable("Play/osu/followpoint", _ => new Container { - Type = EdgeEffectType.Glow, - Colour = Color4.White.Opacity(0.2f), - Radius = 4, - }; - - Children = new Drawable[] - { - new Box + Masking = true, + AutoSizeAxes = Axes.Both, + CornerRadius = width / 2, + EdgeEffect = new EdgeEffectParameters + { + Type = EdgeEffectType.Glow, + Colour = Color4.White.Opacity(0.2f), + Radius = 4, + }, + Child = new Box { Size = new Vector2(width), Blending = BlendingMode.Additive, Origin = Anchor.Centre, Anchor = Anchor.Centre, - Alpha = 0.5f, - }, + } + }, restrictSize: false) + { + Alpha = 0.5f, }; } } From 84135c49cae1522abb388154e32c1f481f40647f Mon Sep 17 00:00:00 2001 From: tgi74000 Date: Sun, 29 Jul 2018 23:21:05 +0200 Subject: [PATCH 55/85] Fix small FollowPoint rotation bug --- .../Objects/Drawables/Connections/FollowPointRenderer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs index 4ac3b0c983..61a6e6404a 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs @@ -73,7 +73,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections Vector2 distanceVector = endPosition - startPosition; int distance = (int)distanceVector.Length; - float rotation = (float)Math.Atan2(distanceVector.Y, distanceVector.X); + float rotation = (float)(Math.Atan2(distanceVector.Y, distanceVector.X) * (180 / Math.PI)); double duration = endTime - startTime; for (int d = (int)(PointDistance * 1.5); d < distance - PointDistance; d += PointDistance) From f57ba4ffb17634c6e43a47ba063f4d5dc4dc32b2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 30 Jul 2018 13:00:24 +0900 Subject: [PATCH 56/85] Update framework --- 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 56a1979382..85e9e7e181 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -18,7 +18,7 @@ - + From 0205916b9ec4325b5b0371955107d834dc8740af Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 30 Jul 2018 14:39:45 +0900 Subject: [PATCH 57/85] Revert "Specify tests directly" This reverts commit 1502edcdc6f2b194a088225c2dbfbb32b91727e8. --- appveyor.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 4545feade0..27f1484e32 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -17,8 +17,6 @@ build: project: osu.sln parallel: true verbosity: minimal -test_script: - - cmd: dotnet test --configuration Debug --no-build --test-adapter-path:. --logger:Appveyor after_build: - cmd: inspectcode --o="inspectcodereport.xml" --projects:osu.Game* --caches-home="inspectcode" osu.sln > NUL - cmd: NVika parsereport "inspectcodereport.xml" --treatwarningsaserrors From 8c3583ac54a9e98f48ff4fb073635410002883a7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 30 Jul 2018 14:55:03 +0900 Subject: [PATCH 58/85] Remove newline --- osu.Game/Screens/Play/Player.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 438e5a49e0..cc649960ea 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -346,7 +346,6 @@ namespace osu.Game.Screens.Play { // Proceed to result screen if beatmap already finished playing onCompletionEvent.RunTask(); - return true; } From 338496452d0e0600053b25d35d166b2ddf45e476 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 30 Jul 2018 15:15:51 +0900 Subject: [PATCH 59/85] Move testing package references to somewhere appveyor will find them --- .../osu.Game.Rulesets.Catch.Tests.csproj | 6 ++++++ .../osu.Game.Rulesets.Mania.Tests.csproj | 6 ++++++ .../osu.Game.Rulesets.Osu.Tests.csproj | 6 ++++++ .../osu.Game.Rulesets.Taiko.Tests.csproj | 6 ++++++ osu.Game.Tests/osu.Game.Tests.csproj | 6 ++++++ osu.TestProject.props | 4 ---- 6 files changed, 30 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj b/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj index 66c81dc14d..9bef8f258c 100644 --- a/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj +++ b/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj @@ -1,5 +1,11 @@  + + + + + + WinExe netcoreapp2.1 diff --git a/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj b/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj index 7427862c0d..61057a64a1 100644 --- a/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj +++ b/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj @@ -1,5 +1,11 @@  + + + + + + WinExe netcoreapp2.1 diff --git a/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj b/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj index 0d0e023e2a..9e10a556a4 100644 --- a/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj +++ b/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj @@ -1,5 +1,11 @@  + + + + + + WinExe netcoreapp2.1 diff --git a/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj b/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj index 3c38a48be6..0e29da1549 100644 --- a/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj +++ b/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj @@ -1,5 +1,11 @@  + + + + + + WinExe netcoreapp2.1 diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 066df5418a..478a06ed30 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -1,5 +1,11 @@  + + + + + + WinExe netcoreapp2.1 diff --git a/osu.TestProject.props b/osu.TestProject.props index 1369af4aee..a73a4f8ce2 100644 --- a/osu.TestProject.props +++ b/osu.TestProject.props @@ -13,10 +13,6 @@ - - - - From c6aabc6d2d60a4eb29e0a4847e178a26502e787b Mon Sep 17 00:00:00 2001 From: tgi74000 Date: Mon, 30 Jul 2018 10:52:37 +0200 Subject: [PATCH 60/85] Move the FollowCircle border to its own container --- .../Objects/Drawables/Pieces/SliderBall.cs | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs index 1191ed2fda..0c6e49ca1b 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -35,6 +35,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces private readonly Slider slider; public readonly Drawable FollowCircle; + private Drawable fadeFollowCircle; private Drawable drawableBall; public SliderBall(Slider slider) @@ -44,23 +45,29 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces AutoSizeAxes = Axes.Both; Blending = BlendingMode.Additive; Origin = Anchor.Centre; - BorderThickness = 10; - BorderColour = Color4.Orange; Children = new[] { FollowCircle = new Container { - Child = new SkinnableDrawable("Play/osu/sliderfollowcircle", _ => new Box - { - Colour = Color4.Orange, - RelativeSizeAxes = Axes.Both, - }), Origin = Anchor.Centre, Anchor = Anchor.Centre, Width = width, Height = width, - Alpha = 0, + Child = new SkinnableDrawable("Play/osu/sliderfollowcircle", _ => new CircularContainer + { + RelativeSizeAxes = Axes.Both, + Masking = true, + BorderThickness = 5, + BorderColour = Color4.Orange, + Blending = BlendingMode.Additive, + Child = fadeFollowCircle = new Box + { + Colour = Color4.Orange, + RelativeSizeAxes = Axes.Both, + Alpha = 0, + } + }), }, new CircularContainer { @@ -134,7 +141,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces tracking = value; FollowCircle.ScaleTo(tracking ? 2.8f : 1, 300, Easing.OutQuint); - FollowCircle.FadeTo(tracking ? 0.2f : 0, 300, Easing.OutQuint); + fadeFollowCircle?.FadeTo(tracking ? 0.2f : 0, 300, Easing.OutQuint); } } From 95aa6b262d0fb1165a2446e71debb20c09e529ec Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 30 Jul 2018 16:01:02 +0900 Subject: [PATCH 61/85] Use .NET Core CFS --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7c08eb9e9c..e1691f0708 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,9 +9,9 @@ install: - cmd: git submodule update --init --recursive --depth=5 - cmd: choco install resharper-clt -y - cmd: choco install nvika -y - - cmd: appveyor DownloadFile https://github.com/peppy/CodeFileSanity/releases/download/v0.2.5/CodeFileSanity.exe + - cmd: dotnet tool install CodeFileSanity --version 13.0.0 --global --add-source https://ci.appveyor.com/nuget/codefilesanity before_build: - - cmd: CodeFileSanity.exe + - cmd: codefilesanity - cmd: nuget restore -verbosity quiet environment: TargetFramework: net471 From f4cda695e6b3fc43b2034a8af22f33e06265bb39 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 30 Jul 2018 18:50:59 +0900 Subject: [PATCH 62/85] Improve rotation handling in edge cases --- .../Objects/Drawables/DrawableRepeatPoint.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index 77f813ae1e..27ec6cc529 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -101,17 +101,18 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables break; } - float aimRotation = MathHelper.RadiansToDegrees( - (float)Math.Atan2(aimRotationVector.Y - Position.Y, aimRotationVector.X - Position.X)); + float aimRotation = MathHelper.RadiansToDegrees((float)Math.Atan2(aimRotationVector.Y - Position.Y, aimRotationVector.X - Position.X)); + while (Math.Abs(aimRotation - Rotation) > 180) + aimRotation += aimRotation < Rotation ? 360 : -360; - if (!hasRotation || Math.Abs(aimRotation - Rotation) > 180) + if (!hasRotation) { Rotation = aimRotation; hasRotation = true; } else { - Rotation = Interpolation.ValueAt(MathHelper.Clamp(Clock.ElapsedFrameTime, 0, 100), Rotation, aimRotation, 0, 600, Easing.OutQuint); + Rotation = Interpolation.ValueAt(MathHelper.Clamp(Clock.ElapsedFrameTime, 0, 100), Rotation, aimRotation, 0, 50, Easing.OutQuint); } } } From 21f3ff6e7717b346ba7ebb7f0f9810dac4dc55a7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 30 Jul 2018 18:51:25 +0900 Subject: [PATCH 63/85] Fix slider repeat points appearing far too late --- osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs index 0b729f0956..3495bc1b4b 100644 --- a/osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs @@ -16,6 +16,9 @@ namespace osu.Game.Rulesets.Osu.Objects { base.ApplyDefaultsToSelf(controlPointInfo, difficulty); + // Out preempt should be one span early to give the user ample warning. + TimePreempt += SpanDuration; + // We want to show the first RepeatPoint as the TimePreempt dictates but on short (and possibly fast) sliders // we may need to cut down this time on following RepeatPoints to only show up to two RepeatPoints at any given time. if (RepeatIndex > 0) From 36afae5a2427be890c49b71aede6f17cd0af8a1e Mon Sep 17 00:00:00 2001 From: tgi74000 Date: Mon, 30 Jul 2018 13:43:02 +0200 Subject: [PATCH 64/85] Remove the inner followcircle fade, Fade the entire followcircle instead --- .../Objects/Drawables/Pieces/SliderBall.cs | 8 ++++---- 1 file changed, 4 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 0c6e49ca1b..8fdfbbef7a 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -35,7 +35,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces private readonly Slider slider; public readonly Drawable FollowCircle; - private Drawable fadeFollowCircle; private Drawable drawableBall; public SliderBall(Slider slider) @@ -54,6 +53,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces Anchor = Anchor.Centre, Width = width, Height = width, + Alpha = 0, Child = new SkinnableDrawable("Play/osu/sliderfollowcircle", _ => new CircularContainer { RelativeSizeAxes = Axes.Both, @@ -61,11 +61,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces BorderThickness = 5, BorderColour = Color4.Orange, Blending = BlendingMode.Additive, - Child = fadeFollowCircle = new Box + Child = new Box { Colour = Color4.Orange, RelativeSizeAxes = Axes.Both, - Alpha = 0, + Alpha = 0.2f, } }), }, @@ -141,7 +141,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces tracking = value; FollowCircle.ScaleTo(tracking ? 2.8f : 1, 300, Easing.OutQuint); - fadeFollowCircle?.FadeTo(tracking ? 0.2f : 0, 300, Easing.OutQuint); + FollowCircle.FadeTo(tracking ? 1f : 0, 300, Easing.OutQuint); } } From d9435d24a6270e3a123fc9edc4c7c0c789ea2b20 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jul 2018 12:35:33 +0900 Subject: [PATCH 65/85] Use nuget version --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index e1691f0708..58e22633d0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,7 +9,7 @@ install: - cmd: git submodule update --init --recursive --depth=5 - cmd: choco install resharper-clt -y - cmd: choco install nvika -y - - cmd: dotnet tool install CodeFileSanity --version 13.0.0 --global --add-source https://ci.appveyor.com/nuget/codefilesanity + - cmd: dotnet tool install CodeFileSanity --version 0.0.16 --global before_build: - cmd: codefilesanity - cmd: nuget restore -verbosity quiet From 64b2189df88a795811aa573deaa6cf5ad1d79f36 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jul 2018 12:50:49 +0900 Subject: [PATCH 66/85] Fix case, just in case --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 58e22633d0..36bc79324d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,7 +11,7 @@ install: - cmd: choco install nvika -y - cmd: dotnet tool install CodeFileSanity --version 0.0.16 --global before_build: - - cmd: codefilesanity + - cmd: CodeFileSanity - cmd: nuget restore -verbosity quiet environment: TargetFramework: net471 From ae8bf34fd1df55510646b5e90d6f218925ee92ea Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 31 Jul 2018 13:42:47 +0900 Subject: [PATCH 67/85] Fix breadcrumb testcase failures --- .../Visual/TestCaseScreenBreadcrumbControl.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseScreenBreadcrumbControl.cs b/osu.Game.Tests/Visual/TestCaseScreenBreadcrumbControl.cs index 83bbbfddd1..b70117a3ad 100644 --- a/osu.Game.Tests/Visual/TestCaseScreenBreadcrumbControl.cs +++ b/osu.Game.Tests/Visual/TestCaseScreenBreadcrumbControl.cs @@ -54,11 +54,11 @@ namespace osu.Game.Tests.Visual breadcrumbs.Current.TriggerChange(); - assertCurrent(); + waitForCurrent(); pushNext(); - assertCurrent(); + waitForCurrent(); pushNext(); - assertCurrent(); + waitForCurrent(); AddStep(@"make start current", () => { @@ -66,8 +66,9 @@ namespace osu.Game.Tests.Visual currentScreen = startScreen; }); - assertCurrent(); + waitForCurrent(); pushNext(); + waitForCurrent(); AddAssert(@"only 2 items", () => breadcrumbs.Items.Count() == 2); AddStep(@"exit current", () => changedScreen.Exit()); AddAssert(@"current screen is first", () => startScreen == changedScreen); @@ -80,7 +81,7 @@ namespace osu.Game.Tests.Visual } private void pushNext() => AddStep(@"push next screen", () => currentScreen = ((TestScreen)currentScreen).PushNext()); - private void assertCurrent() => AddAssert(@"changedScreen correct", () => currentScreen == changedScreen); + private void waitForCurrent() => AddUntilStep(() => currentScreen.IsCurrentScreen, "current screen"); private abstract class TestScreen : OsuScreen { From 70338e087a356d3dde16bcc2c548286fa28695c7 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 31 Jul 2018 14:41:31 +0900 Subject: [PATCH 68/85] Disable beatmap download button if not supporter --- .../BeatmapSet/Buttons/DownloadButton.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs b/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs index 223ca1c904..7cfacc9475 100644 --- a/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs +++ b/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs @@ -1,18 +1,25 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using osu.Game.Online.API; +using osu.Game.Users; using OpenTK; +using OpenTK.Graphics; namespace osu.Game.Overlays.BeatmapSet.Buttons { public class DownloadButton : HeaderButton { + private readonly IBindable localUser = new Bindable(); + public DownloadButton(BeatmapSetInfo set, bool noVideo = false) { Width = 120; @@ -86,5 +93,17 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons } }; } + + [BackgroundDependencyLoader] + private void load(APIAccess api) + { + localUser.BindTo(api.LocalUser); + localUser.BindValueChanged(userChanged, true); + Enabled.BindValueChanged(enabledChanged, true); + } + + private void userChanged(User user) => Enabled.Value = user.IsSupporter; + + private void enabledChanged(bool enabled) => this.FadeColour(enabled ? Color4.White : Color4.Gray, 200, Easing.OutQuint); } } From ec31028f1461a6e3c697d636232c80bb722efc56 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 31 Jul 2018 14:50:57 +0900 Subject: [PATCH 69/85] Add tooltip --- osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs b/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs index 7cfacc9475..f3e49f68b1 100644 --- a/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs +++ b/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs @@ -5,6 +5,7 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Cursor; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics; @@ -16,8 +17,10 @@ using OpenTK.Graphics; namespace osu.Game.Overlays.BeatmapSet.Buttons { - public class DownloadButton : HeaderButton + public class DownloadButton : HeaderButton, IHasTooltip { + public string TooltipText => Enabled ? null : "You gotta be an osu!supporter to download for now 'yo"; + private readonly IBindable localUser = new Bindable(); public DownloadButton(BeatmapSetInfo set, bool noVideo = false) From a98bb057e2b9d9a5b284abe53ce203812ff16bb3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jul 2018 15:19:55 +0900 Subject: [PATCH 70/85] Fix follow circle being scaled far larger than it should be --- osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs index 92c42af861..cb28241454 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -120,7 +120,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces return; tracking = value; - FollowCircle.ScaleTo(tracking ? 2.8f : 1, 300, Easing.OutQuint); + FollowCircle.ScaleTo(tracking ? 2f : 1, 300, Easing.OutQuint); FollowCircle.FadeTo(tracking ? 0.2f : 0, 300, Easing.OutQuint); } } From 132241424db9f438c102f2a7aeae41675c3754ed Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jul 2018 15:59:06 +0900 Subject: [PATCH 71/85] Apply FollowPoint alpha to inner container (should not affect legacy skins) --- .../Objects/Drawables/Connections/FollowPoint.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs index 1c486d5d1e..908b9cb3c6 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs @@ -38,11 +38,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections Blending = BlendingMode.Additive, Origin = Anchor.Centre, Anchor = Anchor.Centre, + Alpha = 0.5f, } - }, restrictSize: false) - { - Alpha = 0.5f, - }; + }, restrictSize: false); } } } From 976653fdf95d7f337a274057530c2f543a2b5fe4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jul 2018 16:13:52 +0900 Subject: [PATCH 72/85] Minor formatting fixes --- osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs index 8fdfbbef7a..4560444f69 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -19,6 +19,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces private const float width = 128; private Color4 accentColour = Color4.Black; + /// /// The colour that is used for the slider ball. /// @@ -131,6 +132,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces } private bool tracking; + public bool Tracking { get { return tracking; } From 9ab56bc4ef94853d26e9fa3dddaf6911561aeafa Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jul 2018 16:35:51 +0900 Subject: [PATCH 73/85] Make Ruleset non-public --- osu.Game/Screens/Select/SongSelect.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 6f5dba7e76..1bcd65e30b 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -69,7 +69,7 @@ namespace osu.Game.Screens.Select private SampleChannel sampleChangeDifficulty; private SampleChannel sampleChangeBeatmap; - public new readonly Bindable Ruleset = new Bindable(); + protected new readonly Bindable Ruleset = new Bindable(); private DependencyContainer dependencies; From ea6cab498edf877a040190d358db6d4392767852 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 31 Jul 2018 16:47:13 +0900 Subject: [PATCH 74/85] Add comment --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index 27ec6cc529..0fba62eb60 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -101,6 +101,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables break; } + float aimRotation = MathHelper.RadiansToDegrees((float)Math.Atan2(aimRotationVector.Y - Position.Y, aimRotationVector.X - Position.X)); while (Math.Abs(aimRotation - Rotation) > 180) aimRotation += aimRotation < Rotation ? 360 : -360; @@ -112,6 +113,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } else { + // If we're already snaking, interpolate to smooth out sharp curves (linear sliders, mainly). Rotation = Interpolation.ValueAt(MathHelper.Clamp(Clock.ElapsedFrameTime, 0, 100), Rotation, aimRotation, 0, 50, Easing.OutQuint); } } From 47533f83c3ea27a832ddb0fbd4a6cc37b5863d28 Mon Sep 17 00:00:00 2001 From: Shane Woolcock Date: Tue, 31 Jul 2018 17:56:54 +0930 Subject: [PATCH 75/85] Update TabControl subclasses to use AddInternal --- osu.Game/Graphics/UserInterface/OsuTabControl.cs | 2 +- osu.Game/Overlays/UserProfileOverlay.cs | 2 +- osu.Game/Screens/Edit/Menus/ScreenSelectionTabControl.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuTabControl.cs b/osu.Game/Graphics/UserInterface/OsuTabControl.cs index 1b91d0cad3..e2a0b88b2a 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabControl.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabControl.cs @@ -37,7 +37,7 @@ namespace osu.Game.Graphics.UserInterface { TabContainer.Spacing = new Vector2(10f, 0f); - Add(strip = new Box + AddInternal(strip = new Box { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index 745f2f3def..11b68b0e09 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -195,7 +195,7 @@ namespace osu.Game.Overlays TabContainer.AutoSizeAxes |= Axes.X; TabContainer.Anchor |= Anchor.x1; TabContainer.Origin |= Anchor.x1; - Add(bottom = new Box + AddInternal(bottom = new Box { RelativeSizeAxes = Axes.X, Height = 1, diff --git a/osu.Game/Screens/Edit/Menus/ScreenSelectionTabControl.cs b/osu.Game/Screens/Edit/Menus/ScreenSelectionTabControl.cs index 1471a37a29..f58e5b39eb 100644 --- a/osu.Game/Screens/Edit/Menus/ScreenSelectionTabControl.cs +++ b/osu.Game/Screens/Edit/Menus/ScreenSelectionTabControl.cs @@ -25,7 +25,7 @@ namespace osu.Game.Screens.Edit.Menus TabContainer.AutoSizeAxes = Axes.X; TabContainer.Padding = new MarginPadding(); - Add(new Box + AddInternal(new Box { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, From 4fdca2b1982fc4066ccf208af0f325446b4c9035 Mon Sep 17 00:00:00 2001 From: Shane Woolcock Date: Tue, 31 Jul 2018 21:21:26 +0930 Subject: [PATCH 76/85] Update framework --- 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 85e9e7e181..aa74641d28 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -18,7 +18,7 @@ - + From 4f1736ceb2e6018aebab5e6169de453be5c8806c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Aug 2018 02:58:39 +0900 Subject: [PATCH 77/85] Make squirrel work again --- osu.Desktop/OsuGameDesktop.cs | 10 +++++----- osu.Desktop/Updater/SquirrelUpdateManager.cs | 2 -- osu.Desktop/osu.Desktop.csproj | 8 +++----- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index a4270f22b4..79ac24a1da 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -13,6 +13,7 @@ using osu.Game; using OpenTK.Input; using Microsoft.Win32; using osu.Desktop.Updater; +using osu.Framework; using osu.Framework.Platform.Windows; namespace osu.Desktop @@ -51,11 +52,10 @@ namespace osu.Desktop v.State = Visibility.Visible; }); -#if NET_FRAMEWORK - Add(new SquirrelUpdateManager()); -#else - Add(new SimpleUpdateManager()); -#endif + if (RuntimeInfo.OS == RuntimeInfo.Platform.Windows) + Add(new SquirrelUpdateManager()); + else + Add(new SimpleUpdateManager()); } } diff --git a/osu.Desktop/Updater/SquirrelUpdateManager.cs b/osu.Desktop/Updater/SquirrelUpdateManager.cs index 81da26cff2..1f8bff74f4 100644 --- a/osu.Desktop/Updater/SquirrelUpdateManager.cs +++ b/osu.Desktop/Updater/SquirrelUpdateManager.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -#if NET_FRAMEWORK using System; using System.Threading.Tasks; using osu.Framework.Allocation; @@ -162,4 +161,3 @@ namespace osu.Desktop.Updater } } } -#endif diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 1d9928134d..880ef3b2a9 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -13,9 +13,6 @@ 0.0.0 0.0.0 - - $(DefineConstants);NET_FRAMEWORK - osu.Desktop.Program @@ -29,11 +26,12 @@ + + - - \ No newline at end of file + From 854beaab5f590f3a3e6fc0bd6f788c8fc2ed792e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Aug 2018 02:58:49 +0900 Subject: [PATCH 78/85] Remove only remaining .NET desktop code --- osu.Desktop/Program.cs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index 7e6a07c89f..cc08e08653 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -8,10 +8,6 @@ using osu.Framework; using osu.Framework.Platform; using osu.Game.IPC; -#if NET_FRAMEWORK -using System.Runtime; -#endif - namespace osu.Desktop { public static class Program @@ -19,8 +15,6 @@ namespace osu.Desktop [STAThread] public static int Main(string[] args) { - useMultiCoreJit(); - // Back up the cwd before DesktopGameHost changes it var cwd = Environment.CurrentDirectory; @@ -51,14 +45,5 @@ namespace osu.Desktop return 0; } } - - private static void useMultiCoreJit() - { -#if NET_FRAMEWORK - var directory = Directory.CreateDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Profiles")); - ProfileOptimization.SetProfileRoot(directory.FullName); - ProfileOptimization.StartProfile("Startup.Profile"); -#endif - } } } From 3d136bf207eff2d6ee0d39881eb13cb04beaf6e5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Aug 2018 03:37:59 +0900 Subject: [PATCH 79/85] Remove unused nuspec --- osu.Game/osu.nuspec | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 osu.Game/osu.nuspec diff --git a/osu.Game/osu.nuspec b/osu.Game/osu.nuspec deleted file mode 100644 index bb7d382cee..0000000000 --- a/osu.Game/osu.nuspec +++ /dev/null @@ -1,26 +0,0 @@ - - - - osulazer - 0.0.0 - osulazer - ppy Pty Ltd - Dean Herbert - https://osu.ppy.sh/ - https://puu.sh/tYyXZ/9a01a5d1b0.ico - false - click the circles. to the beat. - click the circles. - testing - Copyright ppy Pty Ltd 2007-2018 - en-AU - - - - - - - - - - From 139f6d8c4fadb14a9e00bb2d16811c57a1462f98 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Aug 2018 12:30:09 +0900 Subject: [PATCH 80/85] Fix incorrect nuspec title --- osu.Desktop/osu.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Desktop/osu.nuspec b/osu.Desktop/osu.nuspec index 316a5443ef..cdd232a9b2 100644 --- a/osu.Desktop/osu.nuspec +++ b/osu.Desktop/osu.nuspec @@ -3,7 +3,7 @@ osulazer 0.0.0 - osulazer + osu!lazer ppy Pty Ltd Dean Herbert https://osu.ppy.sh/ From ecc6d55380a89334702082b8579ebb40334d7bef Mon Sep 17 00:00:00 2001 From: ekrctb Date: Wed, 1 Aug 2018 16:20:29 +0900 Subject: [PATCH 81/85] Fix player loader not gets ready when multiple mouse button is down --- osu.Game/Screens/Play/PlayerLoader.cs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index 4abc0dfcd9..97a728ffb7 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -6,8 +6,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; -using osu.Framework.Input.EventArgs; -using osu.Framework.Input.States; using osu.Framework.Localisation; using osu.Framework.Screens; using osu.Framework.Threading; @@ -123,23 +121,9 @@ namespace osu.Game.Screens.Play logo.Delay(resuming ? 0 : 500).MoveToOffset(new Vector2(0, -0.24f), 500, Easing.InOutExpo); } - private bool weHandledMouseDown; - - protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) - { - weHandledMouseDown = true; - return base.OnMouseDown(state, args); - } - - protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) - { - weHandledMouseDown = false; - return base.OnMouseUp(state, args); - } - private ScheduledDelegate pushDebounce; - private bool readyForPush => player.LoadState == LoadState.Ready && IsHovered && (!GetContainingInputManager().CurrentState.Mouse.HasAnyButtonPressed || weHandledMouseDown); + private bool readyForPush => player.LoadState == LoadState.Ready && IsHovered && GetContainingInputManager()?.DraggedDrawable == null; private void pushWhenLoaded() { From 4224d35a7570c18f16aac0cbb0b7ce5dbfcac9b2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Aug 2018 16:56:36 +0900 Subject: [PATCH 82/85] Use forked squirrel Allows for updating SharpCompress, too. --- osu.Desktop/osu.Desktop.csproj | 2 +- osu.Game/osu.Game.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 880ef3b2a9..87c518b492 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -27,7 +27,7 @@ - + diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index aa74641d28..157b4f71c2 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -19,7 +19,7 @@ - + From 6ce32bd431e91bda590536cb37fd361e0f8f634a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Aug 2018 16:56:46 +0900 Subject: [PATCH 83/85] Update remaining nuget deps --- osu.Desktop/osu.Desktop.csproj | 2 +- .../osu.Game.Rulesets.Catch.Tests.csproj | 2 +- .../osu.Game.Rulesets.Mania.Tests.csproj | 2 +- osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj | 2 +- .../osu.Game.Rulesets.Taiko.Tests.csproj | 2 +- osu.Game.Tests/osu.Game.Tests.csproj | 2 +- osu.Game/osu.Game.csproj | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 87c518b492..6ee9c3155e 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -27,7 +27,7 @@ - + diff --git a/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj b/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj index 9bef8f258c..51343d9e91 100644 --- a/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj +++ b/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj @@ -2,7 +2,7 @@ - + diff --git a/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj b/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj index 61057a64a1..3165f69a6b 100644 --- a/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj +++ b/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj @@ -2,7 +2,7 @@ - + diff --git a/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj b/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj index 9e10a556a4..247d5e18c1 100644 --- a/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj +++ b/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj @@ -2,7 +2,7 @@ - + diff --git a/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj b/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj index 0e29da1549..08a0579561 100644 --- a/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj +++ b/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj @@ -2,7 +2,7 @@ - + diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 478a06ed30..d638af0c38 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -2,7 +2,7 @@ - + diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 157b4f71c2..89e80bd06b 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -18,7 +18,7 @@ - + From 21a19dc5522189f05a7afbfdfee2ab2eaea951b0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Aug 2018 22:07:39 +0900 Subject: [PATCH 84/85] Remove remaining references to net471 --- README.md | 2 +- appveyor_deploy.yml | 6 +-- .../.vscode/launch.json | 36 ++------------- .../.vscode/tasks.json | 46 ++----------------- .../.vscode/launch.json | 36 ++------------- .../.vscode/tasks.json | 46 ++----------------- .../.vscode/launch.json | 36 ++------------- .../.vscode/tasks.json | 46 ++----------------- .../.vscode/launch.json | 36 ++------------- .../.vscode/tasks.json | 46 ++----------------- 10 files changed, 31 insertions(+), 305 deletions(-) diff --git a/README.md b/README.md index a1932b0fdf..a1f478e39a 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Clone the repository including submodules Build and run - Using Visual Studio 2017, Rider or Visual Studio Code (configurations are included) -- From command line using `dotnet run --project osu.Desktop --framework netcoreapp2.1` +- From command line using `dotnet run --project osu.Desktop` If you run into issues building you may need to restore nuget packages (commonly via `dotnet restore`). Visual Studio Code users must run `Restore` task from debug tab before attempt to build. diff --git a/appveyor_deploy.yml b/appveyor_deploy.yml index 0247714cdf..abfe1e4368 100644 --- a/appveyor_deploy.yml +++ b/appveyor_deploy.yml @@ -16,11 +16,9 @@ build_script: - cd osu-deploy - nuget restore -verbosity quiet - msbuild osu.Desktop.Deploy.csproj - - cmd: ..\appveyor-tools\secure-file -decrypt ..\fdc6f19b04.enc -secret %decode_secret% -out bin\Debug\net471\osu.Desktop.Deploy.exe.config - - cd bin\Debug\net471\ - - osu.Desktop.Deploy.exe %code_signing_password% %APPVEYOR_REPO_TAG_NAME% + - cmd: ..\appveyor-tools\secure-file -decrypt ..\fdc6f19b04.enc -secret %decode_secret% -out bin\Debug\netcoreapp2.1\osu.Desktop.Deploy.dll.config + - dotnet bin/Debug/netcoreapp2.1/osu.Desktop.Deploy.dll %code_signing_password% %APPVEYOR_REPO_TAG_NAME% environment: - TargetFramework: net471 decode_secret: secure: i67IC2xj6DjjxmA6Oj2jing3+MwzLkq6CbGsjfZ7rdY= code_signing_password: diff --git a/osu.Game.Rulesets.Catch.Tests/.vscode/launch.json b/osu.Game.Rulesets.Catch.Tests/.vscode/launch.json index 2a82d65014..da9344b6a2 100644 --- a/osu.Game.Rulesets.Catch.Tests/.vscode/launch.json +++ b/osu.Game.Rulesets.Catch.Tests/.vscode/launch.json @@ -2,35 +2,7 @@ "version": "0.2.0", "configurations": [ { - "name": "VisualTests (Debug, net471)", - "windows": { - "type": "clr" - }, - "type": "mono", - "request": "launch", - "program": "${workspaceRoot}/bin/Debug/net471/osu.Game.Rulesets.Catch.Tests.exe", - "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Debug, msbuild)", - "runtimeExecutable": null, - "env": {}, - "console": "internalConsole" - }, - { - "name": "VisualTests (Release, net471)", - "windows": { - "type": "clr" - }, - "type": "mono", - "request": "launch", - "program": "${workspaceRoot}/bin/Release/net471/osu.Game.Rulesets.Catch.Tests.exe", - "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Release, msbuild)", - "runtimeExecutable": null, - "env": {}, - "console": "internalConsole" - }, - { - "name": "VisualTests (Debug, netcoreapp2.1)", + "name": "VisualTests (Debug)", "type": "coreclr", "request": "launch", "program": "dotnet", @@ -38,12 +10,12 @@ "${workspaceRoot}/bin/Debug/netcoreapp2.1/osu.Game.Rulesets.Catch.Tests.dll" ], "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Debug, dotnet)", + "preLaunchTask": "Build (Debug)", "env": {}, "console": "internalConsole" }, { - "name": "VisualTests (Release, netcoreapp2.1)", + "name": "VisualTests (Release)", "type": "coreclr", "request": "launch", "program": "dotnet", @@ -51,7 +23,7 @@ "${workspaceRoot}/bin/Release/netcoreapp2.1/osu.Game.Rulesets.Catch.Tests.dll" ], "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Release, dotnet)", + "preLaunchTask": "Build (Release)", "env": {}, "console": "internalConsole" } diff --git a/osu.Game.Rulesets.Catch.Tests/.vscode/tasks.json b/osu.Game.Rulesets.Catch.Tests/.vscode/tasks.json index 6c6d562512..18a6f8ca70 100644 --- a/osu.Game.Rulesets.Catch.Tests/.vscode/tasks.json +++ b/osu.Game.Rulesets.Catch.Tests/.vscode/tasks.json @@ -4,43 +4,13 @@ "version": "2.0.0", "tasks": [ { - "label": "Build (Debug, msbuild)", - "type": "shell", - "command": "msbuild", - "args": [ - "osu.Game.Rulesets.Catch.Tests.csproj", - "/p:TargetFramework=net471", - "/p:GenerateFullPaths=true", - "/m", - "/verbosity:m" - ], - "group": "build", - "problemMatcher": "$msCompile" - }, - { - "label": "Build (Release, msbuild)", - "type": "shell", - "command": "msbuild", - "args": [ - "osu.Game.Rulesets.Catch.Tests.csproj", - "/p:Configuration=Release", - "/p:TargetFramework=net471", - "/p:GenerateFullPaths=true", - "/m", - "/verbosity:m" - ], - "group": "build", - "problemMatcher": "$msCompile" - }, - { - "label": "Build (Debug, dotnet)", + "label": "Build (Debug)", "type": "shell", "command": "dotnet", "args": [ "build", "--no-restore", "osu.Game.Rulesets.Catch.Tests.csproj", - "/p:TargetFramework=netcoreapp2.1", "/p:GenerateFullPaths=true", "/m", "/verbosity:m" @@ -49,14 +19,13 @@ "problemMatcher": "$msCompile" }, { - "label": "Build (Release, dotnet)", + "label": "Build (Release)", "type": "shell", "command": "dotnet", "args": [ "build", "--no-restore", "osu.Game.Rulesets.Catch.Tests.csproj", - "/p:TargetFramework=netcoreapp2.1", "/p:Configuration=Release", "/p:GenerateFullPaths=true", "/m", @@ -66,16 +35,7 @@ "problemMatcher": "$msCompile" }, { - "label": "Restore (net471)", - "type": "shell", - "command": "nuget", - "args": [ - "restore" - ], - "problemMatcher": [] - }, - { - "label": "Restore (netcoreapp2.1)", + "label": "Restore", "type": "shell", "command": "dotnet", "args": [ diff --git a/osu.Game.Rulesets.Mania.Tests/.vscode/launch.json b/osu.Game.Rulesets.Mania.Tests/.vscode/launch.json index bc41d4ccf9..c781b0e64e 100644 --- a/osu.Game.Rulesets.Mania.Tests/.vscode/launch.json +++ b/osu.Game.Rulesets.Mania.Tests/.vscode/launch.json @@ -2,35 +2,7 @@ "version": "0.2.0", "configurations": [ { - "name": "VisualTests (Debug, net471)", - "windows": { - "type": "clr" - }, - "type": "mono", - "request": "launch", - "program": "${workspaceRoot}/bin/Debug/net471/osu.Game.Rulesets.Mania.Tests.exe", - "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Debug, msbuild)", - "runtimeExecutable": null, - "env": {}, - "console": "internalConsole" - }, - { - "name": "VisualTests (Release, net471)", - "windows": { - "type": "clr" - }, - "type": "mono", - "request": "launch", - "program": "${workspaceRoot}/bin/Release/net471/osu.Game.Rulesets.Mania.Tests.exe", - "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Release, msbuild)", - "runtimeExecutable": null, - "env": {}, - "console": "internalConsole" - }, - { - "name": "VisualTests (Debug, netcoreapp2.1)", + "name": "VisualTests (Debug)", "type": "coreclr", "request": "launch", "program": "dotnet", @@ -38,12 +10,12 @@ "${workspaceRoot}/bin/Debug/netcoreapp2.1/osu.Game.Rulesets.Mania.Tests.dll" ], "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Debug, dotnet)", + "preLaunchTask": "Build (Debug)", "env": {}, "console": "internalConsole" }, { - "name": "VisualTests (Release, netcoreapp2.1)", + "name": "VisualTests (Release)", "type": "coreclr", "request": "launch", "program": "dotnet", @@ -51,7 +23,7 @@ "${workspaceRoot}/bin/Release/netcoreapp2.1/osu.Game.Rulesets.Mania.Tests.dll" ], "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Release, dotnet)", + "preLaunchTask": "Build (Release)", "env": {}, "console": "internalConsole" } diff --git a/osu.Game.Rulesets.Mania.Tests/.vscode/tasks.json b/osu.Game.Rulesets.Mania.Tests/.vscode/tasks.json index 7fc2f7b2ef..608c4340ac 100644 --- a/osu.Game.Rulesets.Mania.Tests/.vscode/tasks.json +++ b/osu.Game.Rulesets.Mania.Tests/.vscode/tasks.json @@ -4,43 +4,13 @@ "version": "2.0.0", "tasks": [ { - "label": "Build (Debug, msbuild)", - "type": "shell", - "command": "msbuild", - "args": [ - "osu.Game.Rulesets.Mania.Tests.csproj", - "/p:TargetFramework=net471", - "/p:GenerateFullPaths=true", - "/m", - "/verbosity:m" - ], - "group": "build", - "problemMatcher": "$msCompile" - }, - { - "label": "Build (Release, msbuild)", - "type": "shell", - "command": "msbuild", - "args": [ - "osu.Game.Rulesets.Mania.Tests.csproj", - "/p:Configuration=Release", - "/p:TargetFramework=net471", - "/p:GenerateFullPaths=true", - "/m", - "/verbosity:m" - ], - "group": "build", - "problemMatcher": "$msCompile" - }, - { - "label": "Build (Debug, dotnet)", + "label": "Build (Debug)", "type": "shell", "command": "dotnet", "args": [ "build", "--no-restore", "osu.Game.Rulesets.Mania.Tests.csproj", - "/p:TargetFramework=netcoreapp2.1", "/p:GenerateFullPaths=true", "/m", "/verbosity:m" @@ -49,14 +19,13 @@ "problemMatcher": "$msCompile" }, { - "label": "Build (Release, dotnet)", + "label": "Build (Release)", "type": "shell", "command": "dotnet", "args": [ "build", "--no-restore", "osu.Game.Rulesets.Mania.Tests.csproj", - "/p:TargetFramework=netcoreapp2.1", "/p:Configuration=Release", "/p:GenerateFullPaths=true", "/m", @@ -66,16 +35,7 @@ "problemMatcher": "$msCompile" }, { - "label": "Restore (net471)", - "type": "shell", - "command": "nuget", - "args": [ - "restore" - ], - "problemMatcher": [] - }, - { - "label": "Restore (netcoreapp2.1)", + "label": "Restore", "type": "shell", "command": "dotnet", "args": [ diff --git a/osu.Game.Rulesets.Osu.Tests/.vscode/launch.json b/osu.Game.Rulesets.Osu.Tests/.vscode/launch.json index 13aba025fd..fe3ecbec47 100644 --- a/osu.Game.Rulesets.Osu.Tests/.vscode/launch.json +++ b/osu.Game.Rulesets.Osu.Tests/.vscode/launch.json @@ -2,35 +2,7 @@ "version": "0.2.0", "configurations": [ { - "name": "VisualTests (Debug, net471)", - "windows": { - "type": "clr" - }, - "type": "mono", - "request": "launch", - "program": "${workspaceRoot}/bin/Debug/net471/osu.Game.Rulesets.Osu.Tests.exe", - "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Debug, msbuild)", - "runtimeExecutable": null, - "env": {}, - "console": "internalConsole" - }, - { - "name": "VisualTests (Release, net471)", - "windows": { - "type": "clr" - }, - "type": "mono", - "request": "launch", - "program": "${workspaceRoot}/bin/Release/net471/osu.Game.Rulesets.Osu.Tests.exe", - "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Release, msbuild)", - "runtimeExecutable": null, - "env": {}, - "console": "internalConsole" - }, - { - "name": "VisualTests (Debug, netcoreapp2.1)", + "name": "VisualTests (Debug)", "type": "coreclr", "request": "launch", "program": "dotnet", @@ -38,12 +10,12 @@ "${workspaceRoot}/bin/Debug/netcoreapp2.1/osu.Game.Rulesets.Osu.Tests.dll" ], "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Debug, dotnet)", + "preLaunchTask": "Build (Debug)", "env": {}, "console": "internalConsole" }, { - "name": "VisualTests (Release, netcoreapp2.1)", + "name": "VisualTests (Release)", "type": "coreclr", "request": "launch", "program": "dotnet", @@ -51,7 +23,7 @@ "${workspaceRoot}/bin/Release/netcoreapp2.1/osu.Game.Rulesets.Osu.Tests.dll" ], "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Release, dotnet)", + "preLaunchTask": "Build (Release)", "env": {}, "console": "internalConsole" } diff --git a/osu.Game.Rulesets.Osu.Tests/.vscode/tasks.json b/osu.Game.Rulesets.Osu.Tests/.vscode/tasks.json index 62cf51382f..ed2a015e11 100644 --- a/osu.Game.Rulesets.Osu.Tests/.vscode/tasks.json +++ b/osu.Game.Rulesets.Osu.Tests/.vscode/tasks.json @@ -4,43 +4,13 @@ "version": "2.0.0", "tasks": [ { - "label": "Build (Debug, msbuild)", - "type": "shell", - "command": "msbuild", - "args": [ - "osu.Game.Rulesets.Osu.Tests.csproj", - "/p:TargetFramework=net471", - "/p:GenerateFullPaths=true", - "/m", - "/verbosity:m" - ], - "group": "build", - "problemMatcher": "$msCompile" - }, - { - "label": "Build (Release, msbuild)", - "type": "shell", - "command": "msbuild", - "args": [ - "osu.Game.Rulesets.Osu.Tests.csproj", - "/p:Configuration=Release", - "/p:TargetFramework=net471", - "/p:GenerateFullPaths=true", - "/m", - "/verbosity:m" - ], - "group": "build", - "problemMatcher": "$msCompile" - }, - { - "label": "Build (Debug, dotnet)", + "label": "Build (Debug)", "type": "shell", "command": "dotnet", "args": [ "build", "--no-restore", "osu.Game.Rulesets.Osu.Tests.csproj", - "/p:TargetFramework=netcoreapp2.1", "/p:GenerateFullPaths=true", "/m", "/verbosity:m" @@ -49,14 +19,13 @@ "problemMatcher": "$msCompile" }, { - "label": "Build (Release, dotnet)", + "label": "Build (Release)", "type": "shell", "command": "dotnet", "args": [ "build", "--no-restore", "osu.Game.Rulesets.Osu.Tests.csproj", - "/p:TargetFramework=netcoreapp2.1", "/p:Configuration=Release", "/p:GenerateFullPaths=true", "/m", @@ -66,16 +35,7 @@ "problemMatcher": "$msCompile" }, { - "label": "Restore (net471)", - "type": "shell", - "command": "nuget", - "args": [ - "restore" - ], - "problemMatcher": [] - }, - { - "label": "Restore (netcoreapp2.1)", + "label": "Restore", "type": "shell", "command": "dotnet", "args": [ diff --git a/osu.Game.Rulesets.Taiko.Tests/.vscode/launch.json b/osu.Game.Rulesets.Taiko.Tests/.vscode/launch.json index df49e177dc..de7bf77070 100644 --- a/osu.Game.Rulesets.Taiko.Tests/.vscode/launch.json +++ b/osu.Game.Rulesets.Taiko.Tests/.vscode/launch.json @@ -2,35 +2,7 @@ "version": "0.2.0", "configurations": [ { - "name": "VisualTests (Debug, net471)", - "windows": { - "type": "clr" - }, - "type": "mono", - "request": "launch", - "program": "${workspaceRoot}/bin/Debug/net471/osu.Game.Rulesets.Taiko.Tests.exe", - "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Debug, msbuild)", - "runtimeExecutable": null, - "env": {}, - "console": "internalConsole" - }, - { - "name": "VisualTests (Release, net471)", - "windows": { - "type": "clr" - }, - "type": "mono", - "request": "launch", - "program": "${workspaceRoot}/bin/Release/net471/osu.Game.Rulesets.Taiko.Tests.exe", - "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Release, msbuild)", - "runtimeExecutable": null, - "env": {}, - "console": "internalConsole" - }, - { - "name": "VisualTests (Debug, netcoreapp2.1)", + "name": "VisualTests (Debug)", "type": "coreclr", "request": "launch", "program": "dotnet", @@ -38,12 +10,12 @@ "${workspaceRoot}/bin/Debug/netcoreapp2.1/osu.Game.Rulesets.Taiko.Tests.dll" ], "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Debug, dotnet)", + "preLaunchTask": "Build (Debug)", "env": {}, "console": "internalConsole" }, { - "name": "VisualTests (Release, netcoreapp2.1)", + "name": "VisualTests (Release)", "type": "coreclr", "request": "launch", "program": "dotnet", @@ -51,7 +23,7 @@ "${workspaceRoot}/bin/Release/netcoreapp2.1/osu.Game.Rulesets.Taiko.Tests.dll" ], "cwd": "${workspaceRoot}", - "preLaunchTask": "Build (Release, dotnet)", + "preLaunchTask": "Build (Release)", "env": {}, "console": "internalConsole" } diff --git a/osu.Game.Rulesets.Taiko.Tests/.vscode/tasks.json b/osu.Game.Rulesets.Taiko.Tests/.vscode/tasks.json index 7c8beed00f..9b91f2c9b9 100644 --- a/osu.Game.Rulesets.Taiko.Tests/.vscode/tasks.json +++ b/osu.Game.Rulesets.Taiko.Tests/.vscode/tasks.json @@ -4,43 +4,13 @@ "version": "2.0.0", "tasks": [ { - "label": "Build (Debug, msbuild)", - "type": "shell", - "command": "msbuild", - "args": [ - "osu.Game.Rulesets.Taiko.Tests.csproj", - "/p:TargetFramework=net471", - "/p:GenerateFullPaths=true", - "/m", - "/verbosity:m" - ], - "group": "build", - "problemMatcher": "$msCompile" - }, - { - "label": "Build (Release, msbuild)", - "type": "shell", - "command": "msbuild", - "args": [ - "osu.Game.Rulesets.Taiko.Tests.csproj", - "/p:Configuration=Release", - "/p:TargetFramework=net471", - "/p:GenerateFullPaths=true", - "/m", - "/verbosity:m" - ], - "group": "build", - "problemMatcher": "$msCompile" - }, - { - "label": "Build (Debug, dotnet)", + "label": "Build (Debug)", "type": "shell", "command": "dotnet", "args": [ "build", "--no-restore", "osu.Game.Rulesets.Taiko.Tests.csproj", - "/p:TargetFramework=netcoreapp2.1", "/p:GenerateFullPaths=true", "/m", "/verbosity:m" @@ -49,14 +19,13 @@ "problemMatcher": "$msCompile" }, { - "label": "Build (Release, dotnet)", + "label": "Build (Release)", "type": "shell", "command": "dotnet", "args": [ "build", "--no-restore", "osu.Game.Rulesets.Taiko.Tests.csproj", - "/p:TargetFramework=netcoreapp2.1", "/p:Configuration=Release", "/p:GenerateFullPaths=true", "/m", @@ -66,16 +35,7 @@ "problemMatcher": "$msCompile" }, { - "label": "Restore (net471)", - "type": "shell", - "command": "nuget", - "args": [ - "restore" - ], - "problemMatcher": [] - }, - { - "label": "Restore (netcoreapp2.1)", + "label": "Restore", "type": "shell", "command": "dotnet", "args": [ From d454dbfdc2106cd79c22a71e19e7cacf4cba370e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 1 Aug 2018 22:34:45 +0900 Subject: [PATCH 85/85] Fix artifact collection --- appveyor_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor_deploy.yml b/appveyor_deploy.yml index abfe1e4368..6d8d95e773 100644 --- a/appveyor_deploy.yml +++ b/appveyor_deploy.yml @@ -24,7 +24,7 @@ environment: code_signing_password: secure: 34tLNqvjmmZEi97MLKfrnQ== artifacts: - - path: 'Releases\*' + - path: 'osu-deploy/releases/*' deploy: - provider: Environment name: github \ No newline at end of file