From ab462a232f50977dd22a485e2a6296bcd022d320 Mon Sep 17 00:00:00 2001 From: Matthias Coenraerds Date: Fri, 4 Jan 2019 20:13:32 +0100 Subject: [PATCH 01/35] Implement clear scores on beatmap --- osu.Game/Scoring/ScoreManager.cs | 4 +- osu.Game/Screens/Select/ClearScoreDialog.cs | 46 +++++++++++++++++++ .../Select/Leaderboards/BeatmapLeaderboard.cs | 2 +- osu.Game/Screens/Select/SongSelect.cs | 23 +++++++--- 4 files changed, 64 insertions(+), 11 deletions(-) create mode 100644 osu.Game/Screens/Select/ClearScoreDialog.cs diff --git a/osu.Game/Scoring/ScoreManager.cs b/osu.Game/Scoring/ScoreManager.cs index 663f441f2f..fc50178ba8 100644 --- a/osu.Game/Scoring/ScoreManager.cs +++ b/osu.Game/Scoring/ScoreManager.cs @@ -55,9 +55,7 @@ namespace osu.Game.Scoring public Score GetScore(ScoreInfo score) => new LegacyDatabasedScore(score, rulesets, beatmaps, Files.Store); - public List GetAllUsableScores() => ModelStore.ConsumableItems.Where(s => !s.DeletePending).ToList(); - - public IEnumerable QueryScores(Expression> query) => ModelStore.ConsumableItems.AsNoTracking().Where(query); + public IEnumerable GetAllUsableScores() => ModelStore.ConsumableItems.Where(s => !s.DeletePending); public ScoreInfo Query(Expression> query) => ModelStore.ConsumableItems.AsNoTracking().FirstOrDefault(query); } diff --git a/osu.Game/Screens/Select/ClearScoreDialog.cs b/osu.Game/Screens/Select/ClearScoreDialog.cs new file mode 100644 index 0000000000..38577902e9 --- /dev/null +++ b/osu.Game/Screens/Select/ClearScoreDialog.cs @@ -0,0 +1,46 @@ +using osu.Framework.Allocation; +using osu.Game.Beatmaps; +using osu.Game.Graphics; +using osu.Game.Overlays.Dialog; +using osu.Game.Scoring; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace osu.Game.Screens.Select +{ + public class ClearScoresDialog : PopupDialog + { + private ScoreManager manager; + + [BackgroundDependencyLoader] + private void load(ScoreManager beatmapManager) + { + manager = beatmapManager; + } + + public ClearScoresDialog(BeatmapSetInfo beatmap, IEnumerable scores, Action refresh) + { + BodyText = $@"{beatmap.Metadata?.Artist} - {beatmap.Metadata?.Title}"; + + Icon = FontAwesome.fa_eraser; + HeaderText = $@"Clearing {scores.Count()} local score(s). Are you sure?"; + Buttons = new PopupDialogButton[] + { + new PopupDialogOkButton + { + Text = @"Yes. Please.", + Action = () => + { + manager.Delete(scores.ToList()); + refresh(); + } + }, + new PopupDialogCancelButton + { + Text = @"No, I'm still attached.", + }, + }; + } + } +} diff --git a/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs b/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs index 9f8726c86a..8d91be9ca1 100644 --- a/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs @@ -55,7 +55,7 @@ namespace osu.Game.Screens.Select.Leaderboards { if (Scope == BeatmapLeaderboardScope.Local) { - Scores = scoreManager.QueryScores(s => s.Beatmap.ID == Beatmap.ID).ToArray(); + Scores = scoreManager.GetAllUsableScores().Where(s => s.Beatmap.ID == Beatmap.ID).ToArray(); PlaceholderState = Scores.Any() ? PlaceholderState.Successful : PlaceholderState.NoScores; return null; } diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index f65cc0e49d..e70ff42418 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -1,11 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; -using System.Collections.Generic; -using System.Linq; -using osuTK; -using osuTK.Input; using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Sample; @@ -13,8 +8,8 @@ using osu.Framework.Audio.Track; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Logging; using osu.Framework.Input.Events; +using osu.Framework.Logging; using osu.Framework.Screens; using osu.Framework.Threading; using osu.Game.Beatmaps; @@ -31,6 +26,11 @@ using osu.Game.Screens.Menu; using osu.Game.Screens.Play; using osu.Game.Screens.Select.Options; using osu.Game.Skinning; +using osuTK; +using osuTK.Input; +using System; +using System.Collections.Generic; +using System.Linq; namespace osu.Game.Screens.Select { @@ -227,7 +227,7 @@ namespace osu.Game.Screens.Select BeatmapOptions.AddButton(@"Delete", @"all difficulties", FontAwesome.fa_trash, colours.Pink, () => delete(Beatmap.Value.BeatmapSetInfo), Key.Number4, float.MaxValue); BeatmapOptions.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, colours.Purple, null, Key.Number1); - BeatmapOptions.AddButton(@"Clear", @"local scores", FontAwesome.fa_eraser, colours.Purple, null, Key.Number2); + BeatmapOptions.AddButton(@"Clear", @"local scores", FontAwesome.fa_eraser, colours.Purple, () => clearScores(Beatmap.Value.BeatmapSetInfo), Key.Number2); } if (this.beatmaps == null) @@ -625,6 +625,15 @@ namespace osu.Game.Screens.Select dialogOverlay?.Push(new BeatmapDeleteDialog(beatmap)); } + private void clearScores(BeatmapSetInfo beatmap) + { + if (beatmap == null || beatmap.ID <= 0) return; + + if (BeatmapDetails.Leaderboard.Scores == null || !BeatmapDetails.Leaderboard.Scores.Any()) return; + + dialogOverlay?.Push(new ClearScoresDialog(beatmap, BeatmapDetails.Leaderboard.Scores, () => BeatmapDetails.Leaderboard.RefreshScores())); + } + public override bool OnPressed(GlobalAction action) { if (!IsCurrentScreen) return false; From 3879348ee4d4384680371a7b33976dab81462e76 Mon Sep 17 00:00:00 2001 From: Matthias Coenraerds Date: Fri, 4 Jan 2019 20:13:32 +0100 Subject: [PATCH 02/35] Implement clear scores on beatmap --- osu.Game/Scoring/ScoreManager.cs | 4 +- osu.Game/Screens/Select/ClearScoreDialog.cs | 49 +++++++++++++++++++ .../Select/Leaderboards/BeatmapLeaderboard.cs | 2 +- osu.Game/Screens/Select/SongSelect.cs | 23 ++++++--- 4 files changed, 67 insertions(+), 11 deletions(-) create mode 100644 osu.Game/Screens/Select/ClearScoreDialog.cs diff --git a/osu.Game/Scoring/ScoreManager.cs b/osu.Game/Scoring/ScoreManager.cs index 663f441f2f..fc50178ba8 100644 --- a/osu.Game/Scoring/ScoreManager.cs +++ b/osu.Game/Scoring/ScoreManager.cs @@ -55,9 +55,7 @@ namespace osu.Game.Scoring public Score GetScore(ScoreInfo score) => new LegacyDatabasedScore(score, rulesets, beatmaps, Files.Store); - public List GetAllUsableScores() => ModelStore.ConsumableItems.Where(s => !s.DeletePending).ToList(); - - public IEnumerable QueryScores(Expression> query) => ModelStore.ConsumableItems.AsNoTracking().Where(query); + public IEnumerable GetAllUsableScores() => ModelStore.ConsumableItems.Where(s => !s.DeletePending); public ScoreInfo Query(Expression> query) => ModelStore.ConsumableItems.AsNoTracking().FirstOrDefault(query); } diff --git a/osu.Game/Screens/Select/ClearScoreDialog.cs b/osu.Game/Screens/Select/ClearScoreDialog.cs new file mode 100644 index 0000000000..4051d76e99 --- /dev/null +++ b/osu.Game/Screens/Select/ClearScoreDialog.cs @@ -0,0 +1,49 @@ +// 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.Game.Beatmaps; +using osu.Game.Graphics; +using osu.Game.Overlays.Dialog; +using osu.Game.Scoring; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace osu.Game.Screens.Select +{ + public class ClearScoresDialog : PopupDialog + { + private ScoreManager manager; + + [BackgroundDependencyLoader] + private void load(ScoreManager beatmapManager) + { + manager = beatmapManager; + } + + public ClearScoresDialog(BeatmapSetInfo beatmap, IEnumerable scores, Action refresh) + { + BodyText = $@"{beatmap.Metadata?.Artist} - {beatmap.Metadata?.Title}"; + + Icon = FontAwesome.fa_eraser; + HeaderText = $@"Clearing {scores.Count()} local score(s). Are you sure?"; + Buttons = new PopupDialogButton[] + { + new PopupDialogOkButton + { + Text = @"Yes. Please.", + Action = () => + { + manager.Delete(scores.ToList()); + refresh(); + } + }, + new PopupDialogCancelButton + { + Text = @"No, I'm still attached.", + }, + }; + } + } +} diff --git a/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs b/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs index 9f8726c86a..8d91be9ca1 100644 --- a/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs @@ -55,7 +55,7 @@ namespace osu.Game.Screens.Select.Leaderboards { if (Scope == BeatmapLeaderboardScope.Local) { - Scores = scoreManager.QueryScores(s => s.Beatmap.ID == Beatmap.ID).ToArray(); + Scores = scoreManager.GetAllUsableScores().Where(s => s.Beatmap.ID == Beatmap.ID).ToArray(); PlaceholderState = Scores.Any() ? PlaceholderState.Successful : PlaceholderState.NoScores; return null; } diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index f65cc0e49d..e70ff42418 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -1,11 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; -using System.Collections.Generic; -using System.Linq; -using osuTK; -using osuTK.Input; using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Sample; @@ -13,8 +8,8 @@ using osu.Framework.Audio.Track; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Logging; using osu.Framework.Input.Events; +using osu.Framework.Logging; using osu.Framework.Screens; using osu.Framework.Threading; using osu.Game.Beatmaps; @@ -31,6 +26,11 @@ using osu.Game.Screens.Menu; using osu.Game.Screens.Play; using osu.Game.Screens.Select.Options; using osu.Game.Skinning; +using osuTK; +using osuTK.Input; +using System; +using System.Collections.Generic; +using System.Linq; namespace osu.Game.Screens.Select { @@ -227,7 +227,7 @@ namespace osu.Game.Screens.Select BeatmapOptions.AddButton(@"Delete", @"all difficulties", FontAwesome.fa_trash, colours.Pink, () => delete(Beatmap.Value.BeatmapSetInfo), Key.Number4, float.MaxValue); BeatmapOptions.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, colours.Purple, null, Key.Number1); - BeatmapOptions.AddButton(@"Clear", @"local scores", FontAwesome.fa_eraser, colours.Purple, null, Key.Number2); + BeatmapOptions.AddButton(@"Clear", @"local scores", FontAwesome.fa_eraser, colours.Purple, () => clearScores(Beatmap.Value.BeatmapSetInfo), Key.Number2); } if (this.beatmaps == null) @@ -625,6 +625,15 @@ namespace osu.Game.Screens.Select dialogOverlay?.Push(new BeatmapDeleteDialog(beatmap)); } + private void clearScores(BeatmapSetInfo beatmap) + { + if (beatmap == null || beatmap.ID <= 0) return; + + if (BeatmapDetails.Leaderboard.Scores == null || !BeatmapDetails.Leaderboard.Scores.Any()) return; + + dialogOverlay?.Push(new ClearScoresDialog(beatmap, BeatmapDetails.Leaderboard.Scores, () => BeatmapDetails.Leaderboard.RefreshScores())); + } + public override bool OnPressed(GlobalAction action) { if (!IsCurrentScreen) return false; From 6d44672bfa35769d550863f63d2e537c7b94bc5f Mon Sep 17 00:00:00 2001 From: Matthias Coenraerds Date: Fri, 4 Jan 2019 20:32:52 +0100 Subject: [PATCH 03/35] Filename does not match contained type --- .../{ClearScoreDialog.cs => BeatmapClearScoresDialog.cs} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename osu.Game/Screens/Select/{ClearScoreDialog.cs => BeatmapClearScoresDialog.cs} (88%) diff --git a/osu.Game/Screens/Select/ClearScoreDialog.cs b/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs similarity index 88% rename from osu.Game/Screens/Select/ClearScoreDialog.cs rename to osu.Game/Screens/Select/BeatmapClearScoresDialog.cs index 4051d76e99..e14fae56a5 100644 --- a/osu.Game/Screens/Select/ClearScoreDialog.cs +++ b/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs @@ -12,7 +12,7 @@ using System.Linq; namespace osu.Game.Screens.Select { - public class ClearScoresDialog : PopupDialog + public class BeatmapClearScoresDialog : PopupDialog { private ScoreManager manager; @@ -22,7 +22,7 @@ namespace osu.Game.Screens.Select manager = beatmapManager; } - public ClearScoresDialog(BeatmapSetInfo beatmap, IEnumerable scores, Action refresh) + public BeatmapClearScoresDialog(BeatmapSetInfo beatmap, IEnumerable scores, Action refresh) { BodyText = $@"{beatmap.Metadata?.Artist} - {beatmap.Metadata?.Title}"; From a93c26ccfd50d93fdc1cfcbd49f2562f6252ce7a Mon Sep 17 00:00:00 2001 From: Matthias Coenraerds Date: Fri, 4 Jan 2019 20:32:52 +0100 Subject: [PATCH 04/35] Filename does not match contained type --- .../{ClearScoreDialog.cs => BeatmapClearScoresDialog.cs} | 4 ++-- osu.Game/Screens/Select/SongSelect.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename osu.Game/Screens/Select/{ClearScoreDialog.cs => BeatmapClearScoresDialog.cs} (88%) diff --git a/osu.Game/Screens/Select/ClearScoreDialog.cs b/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs similarity index 88% rename from osu.Game/Screens/Select/ClearScoreDialog.cs rename to osu.Game/Screens/Select/BeatmapClearScoresDialog.cs index 4051d76e99..e14fae56a5 100644 --- a/osu.Game/Screens/Select/ClearScoreDialog.cs +++ b/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs @@ -12,7 +12,7 @@ using System.Linq; namespace osu.Game.Screens.Select { - public class ClearScoresDialog : PopupDialog + public class BeatmapClearScoresDialog : PopupDialog { private ScoreManager manager; @@ -22,7 +22,7 @@ namespace osu.Game.Screens.Select manager = beatmapManager; } - public ClearScoresDialog(BeatmapSetInfo beatmap, IEnumerable scores, Action refresh) + public BeatmapClearScoresDialog(BeatmapSetInfo beatmap, IEnumerable scores, Action refresh) { BodyText = $@"{beatmap.Metadata?.Artist} - {beatmap.Metadata?.Title}"; diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index e70ff42418..c194a191a6 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -631,7 +631,7 @@ namespace osu.Game.Screens.Select if (BeatmapDetails.Leaderboard.Scores == null || !BeatmapDetails.Leaderboard.Scores.Any()) return; - dialogOverlay?.Push(new ClearScoresDialog(beatmap, BeatmapDetails.Leaderboard.Scores, () => BeatmapDetails.Leaderboard.RefreshScores())); + dialogOverlay?.Push(new BeatmapClearScoresDialog(beatmap, BeatmapDetails.Leaderboard.Scores, () => BeatmapDetails.Leaderboard.RefreshScores())); } public override bool OnPressed(GlobalAction action) From 472325b885b4ba54e2b9c4a7383c0d2997298d51 Mon Sep 17 00:00:00 2001 From: Matthias Coenraerds Date: Sun, 6 Jan 2019 13:37:30 +0100 Subject: [PATCH 05/35] Verify leaderboard scope to be local --- osu.Game/Screens/Select/SongSelect.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index c194a191a6..d651243a51 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -24,6 +24,7 @@ using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Edit; using osu.Game.Screens.Menu; using osu.Game.Screens.Play; +using osu.Game.Screens.Select.Leaderboards; using osu.Game.Screens.Select.Options; using osu.Game.Skinning; using osuTK; @@ -627,6 +628,8 @@ namespace osu.Game.Screens.Select private void clearScores(BeatmapSetInfo beatmap) { + if (BeatmapDetails.Leaderboard.Scope != BeatmapLeaderboardScope.Local) return; + if (beatmap == null || beatmap.ID <= 0) return; if (BeatmapDetails.Leaderboard.Scores == null || !BeatmapDetails.Leaderboard.Scores.Any()) return; From 562c9e56fbda6c85dc2ab98402296ec461232eeb Mon Sep 17 00:00:00 2001 From: Matthias Coenraerds Date: Sun, 6 Jan 2019 13:38:43 +0100 Subject: [PATCH 06/35] Fix naming --- osu.Game/Screens/Select/BeatmapClearScoresDialog.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs b/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs index e14fae56a5..45a192d2ad 100644 --- a/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs +++ b/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs @@ -17,9 +17,9 @@ namespace osu.Game.Screens.Select private ScoreManager manager; [BackgroundDependencyLoader] - private void load(ScoreManager beatmapManager) + private void load(ScoreManager scoreManager) { - manager = beatmapManager; + manager = scoreManager; } public BeatmapClearScoresDialog(BeatmapSetInfo beatmap, IEnumerable scores, Action refresh) From 097062caf78bd7985fa4d1af9b675743191a6671 Mon Sep 17 00:00:00 2001 From: Microgolf Date: Tue, 8 Jan 2019 17:57:03 +0100 Subject: [PATCH 07/35] Addresses requested changes --- osu.Game/Scoring/ScoreManager.cs | 4 +++- osu.Game/Screens/Select/BeatmapClearScoresDialog.cs | 7 +++---- osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs | 2 +- osu.Game/Screens/Select/SongSelect.cs | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/osu.Game/Scoring/ScoreManager.cs b/osu.Game/Scoring/ScoreManager.cs index fc50178ba8..663f441f2f 100644 --- a/osu.Game/Scoring/ScoreManager.cs +++ b/osu.Game/Scoring/ScoreManager.cs @@ -55,7 +55,9 @@ namespace osu.Game.Scoring public Score GetScore(ScoreInfo score) => new LegacyDatabasedScore(score, rulesets, beatmaps, Files.Store); - public IEnumerable GetAllUsableScores() => ModelStore.ConsumableItems.Where(s => !s.DeletePending); + public List GetAllUsableScores() => ModelStore.ConsumableItems.Where(s => !s.DeletePending).ToList(); + + public IEnumerable QueryScores(Expression> query) => ModelStore.ConsumableItems.AsNoTracking().Where(query); public ScoreInfo Query(Expression> query) => ModelStore.ConsumableItems.AsNoTracking().FirstOrDefault(query); } diff --git a/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs b/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs index 45a192d2ad..c99e9eb428 100644 --- a/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs +++ b/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs @@ -22,12 +22,11 @@ namespace osu.Game.Screens.Select manager = scoreManager; } - public BeatmapClearScoresDialog(BeatmapSetInfo beatmap, IEnumerable scores, Action refresh) + public BeatmapClearScoresDialog(BeatmapInfo beatmap, Action refresh) { BodyText = $@"{beatmap.Metadata?.Artist} - {beatmap.Metadata?.Title}"; - Icon = FontAwesome.fa_eraser; - HeaderText = $@"Clearing {scores.Count()} local score(s). Are you sure?"; + HeaderText = $@"Clearing all local scores. Are you sure?"; Buttons = new PopupDialogButton[] { new PopupDialogOkButton @@ -35,7 +34,7 @@ namespace osu.Game.Screens.Select Text = @"Yes. Please.", Action = () => { - manager.Delete(scores.ToList()); + manager.Delete(manager.QueryScores(s => !s.DeletePending && s.Beatmap.ID == beatmap.ID).ToList()); refresh(); } }, diff --git a/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs b/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs index 8d91be9ca1..0ecf36fddd 100644 --- a/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs @@ -55,7 +55,7 @@ namespace osu.Game.Screens.Select.Leaderboards { if (Scope == BeatmapLeaderboardScope.Local) { - Scores = scoreManager.GetAllUsableScores().Where(s => s.Beatmap.ID == Beatmap.ID).ToArray(); + Scores = scoreManager.QueryScores(s => !s.DeletePending && s.Beatmap.ID == Beatmap.ID).ToArray(); PlaceholderState = Scores.Any() ? PlaceholderState.Successful : PlaceholderState.NoScores; return null; } diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index d651243a51..9d8e58a496 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -228,7 +228,7 @@ namespace osu.Game.Screens.Select BeatmapOptions.AddButton(@"Delete", @"all difficulties", FontAwesome.fa_trash, colours.Pink, () => delete(Beatmap.Value.BeatmapSetInfo), Key.Number4, float.MaxValue); BeatmapOptions.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, colours.Purple, null, Key.Number1); - BeatmapOptions.AddButton(@"Clear", @"local scores", FontAwesome.fa_eraser, colours.Purple, () => clearScores(Beatmap.Value.BeatmapSetInfo), Key.Number2); + BeatmapOptions.AddButton(@"Clear", @"local scores", FontAwesome.fa_eraser, colours.Purple, () => clearScores(Beatmap.Value.BeatmapInfo), Key.Number2); } if (this.beatmaps == null) @@ -626,7 +626,7 @@ namespace osu.Game.Screens.Select dialogOverlay?.Push(new BeatmapDeleteDialog(beatmap)); } - private void clearScores(BeatmapSetInfo beatmap) + private void clearScores(BeatmapInfo beatmap) { if (BeatmapDetails.Leaderboard.Scope != BeatmapLeaderboardScope.Local) return; @@ -634,7 +634,7 @@ namespace osu.Game.Screens.Select if (BeatmapDetails.Leaderboard.Scores == null || !BeatmapDetails.Leaderboard.Scores.Any()) return; - dialogOverlay?.Push(new BeatmapClearScoresDialog(beatmap, BeatmapDetails.Leaderboard.Scores, () => BeatmapDetails.Leaderboard.RefreshScores())); + dialogOverlay?.Push(new BeatmapClearScoresDialog(beatmap, () => BeatmapDetails.Leaderboard.RefreshScores())); } public override bool OnPressed(GlobalAction action) From f4a6612d483e05a1cfa4fa0eeeb8885f85469705 Mon Sep 17 00:00:00 2001 From: Joehu Date: Thu, 28 Feb 2019 15:43:04 -0800 Subject: [PATCH 08/35] Fade out taskbar tooltip after clicking --- osu.Game/Overlays/Toolbar/ToolbarButton.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Overlays/Toolbar/ToolbarButton.cs b/osu.Game/Overlays/Toolbar/ToolbarButton.cs index 4d8fbb99ac..855c7ad823 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarButton.cs @@ -139,6 +139,7 @@ namespace osu.Game.Overlays.Toolbar protected override bool OnClick(ClickEvent e) { HoverBackground.FlashColour(Color4.White.Opacity(100), 500, Easing.OutQuint); + tooltipContainer.FadeOut(100); return base.OnClick(e); } From 67928ac1fe6e5dc170e1893e1d96e438e91830cf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 09:49:11 +0900 Subject: [PATCH 09/35] Remove pointless check --- osu.Game/Screens/Select/SongSelect.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 9d8e58a496..5d63524001 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -628,8 +628,6 @@ namespace osu.Game.Screens.Select private void clearScores(BeatmapInfo beatmap) { - if (BeatmapDetails.Leaderboard.Scope != BeatmapLeaderboardScope.Local) return; - if (beatmap == null || beatmap.ID <= 0) return; if (BeatmapDetails.Leaderboard.Scores == null || !BeatmapDetails.Leaderboard.Scores.Any()) return; From 80b5f1c5239277c0003c9bbedaf85be7832da620 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 09:49:36 +0900 Subject: [PATCH 10/35] Fix code formatting issues --- osu.Game/Screens/Select/BeatmapClearScoresDialog.cs | 3 +-- osu.Game/Screens/Select/SongSelect.cs | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs b/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs index c99e9eb428..aec6211076 100644 --- a/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs +++ b/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs @@ -7,7 +7,6 @@ using osu.Game.Graphics; using osu.Game.Overlays.Dialog; using osu.Game.Scoring; using System; -using System.Collections.Generic; using System.Linq; namespace osu.Game.Screens.Select @@ -26,7 +25,7 @@ namespace osu.Game.Screens.Select { BodyText = $@"{beatmap.Metadata?.Artist} - {beatmap.Metadata?.Title}"; Icon = FontAwesome.fa_eraser; - HeaderText = $@"Clearing all local scores. Are you sure?"; + HeaderText = @"Clearing all local scores. Are you sure?"; Buttons = new PopupDialogButton[] { new PopupDialogOkButton diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 5d63524001..6697c1cebc 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -24,7 +24,6 @@ using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Edit; using osu.Game.Screens.Menu; using osu.Game.Screens.Play; -using osu.Game.Screens.Select.Leaderboards; using osu.Game.Screens.Select.Options; using osu.Game.Skinning; using osuTK; From acc2113027edb05b31171aca8e2f0d0c7b7a9cbe Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 10:09:03 +0900 Subject: [PATCH 11/35] Make operation run asynchronously --- .../Select/BeatmapClearScoresDialog.cs | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs b/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs index aec6211076..d720a8c69a 100644 --- a/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs +++ b/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs @@ -8,20 +8,15 @@ using osu.Game.Overlays.Dialog; using osu.Game.Scoring; using System; using System.Linq; +using System.Threading.Tasks; namespace osu.Game.Screens.Select { public class BeatmapClearScoresDialog : PopupDialog { - private ScoreManager manager; + private ScoreManager scoreManager; - [BackgroundDependencyLoader] - private void load(ScoreManager scoreManager) - { - manager = scoreManager; - } - - public BeatmapClearScoresDialog(BeatmapInfo beatmap, Action refresh) + public BeatmapClearScoresDialog(BeatmapInfo beatmap, Action onCompletion) { BodyText = $@"{beatmap.Metadata?.Artist} - {beatmap.Metadata?.Title}"; Icon = FontAwesome.fa_eraser; @@ -33,8 +28,8 @@ namespace osu.Game.Screens.Select Text = @"Yes. Please.", Action = () => { - manager.Delete(manager.QueryScores(s => !s.DeletePending && s.Beatmap.ID == beatmap.ID).ToList()); - refresh(); + Task.Run(() => scoreManager.Delete(scoreManager.QueryScores(s => !s.DeletePending && s.Beatmap.ID == beatmap.ID).ToList())) + .ContinueWith(t => Schedule(onCompletion)); } }, new PopupDialogCancelButton @@ -43,5 +38,11 @@ namespace osu.Game.Screens.Select }, }; } + + [BackgroundDependencyLoader] + private void load(ScoreManager scoreManager) + { + this.scoreManager = scoreManager; + } } } From d4041d5d4225c0ec3b1999c93a8545dd540f3db3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 10:25:21 +0900 Subject: [PATCH 12/35] Automate includes of files in ArchiveModelManager use cases --- osu.Game/Beatmaps/BeatmapStore.cs | 11 ++++----- osu.Game/Database/ArchiveModelManager.cs | 2 +- ...ableDatabaseBackedStoreWithFileIncludes.cs | 23 +++++++++++++++++++ osu.Game/Scoring/ScoreStore.cs | 3 +-- osu.Game/Skinning/SkinStore.cs | 8 +------ 5 files changed, 31 insertions(+), 16 deletions(-) create mode 100644 osu.Game/Database/MutableDatabaseBackedStoreWithFileIncludes.cs diff --git a/osu.Game/Beatmaps/BeatmapStore.cs b/osu.Game/Beatmaps/BeatmapStore.cs index 6786a780b6..f4b7b1d74f 100644 --- a/osu.Game/Beatmaps/BeatmapStore.cs +++ b/osu.Game/Beatmaps/BeatmapStore.cs @@ -12,7 +12,7 @@ namespace osu.Game.Beatmaps /// /// Handles the storage and retrieval of Beatmaps/BeatmapSets to the database backing /// - public class BeatmapStore : MutableDatabaseBackedStore + public class BeatmapStore : MutableDatabaseBackedStoreWithFileIncludes { public event Action BeatmapHidden; public event Action BeatmapRestored; @@ -64,18 +64,17 @@ namespace osu.Game.Beatmaps protected override IQueryable AddIncludesForDeletion(IQueryable query) => base.AddIncludesForDeletion(query) - .Include(s => s.Beatmaps).ThenInclude(b => b.Metadata) - .Include(s => s.Beatmaps).ThenInclude(b => b.BaseDifficulty) .Include(s => s.Metadata) - .Include(s => s.Beatmaps).ThenInclude(b => b.Scores); + .Include(s => s.Beatmaps).ThenInclude(b => b.Scores) + .Include(s => s.Beatmaps).ThenInclude(b => b.BaseDifficulty) + .Include(s => s.Beatmaps).ThenInclude(b => b.Metadata); protected override IQueryable AddIncludesForConsumption(IQueryable query) => base.AddIncludesForConsumption(query) .Include(s => s.Metadata) .Include(s => s.Beatmaps).ThenInclude(s => s.Ruleset) .Include(s => s.Beatmaps).ThenInclude(b => b.BaseDifficulty) - .Include(s => s.Beatmaps).ThenInclude(b => b.Metadata) - .Include(s => s.Files).ThenInclude(f => f.FileInfo); + .Include(s => s.Beatmaps).ThenInclude(b => b.Metadata); protected override void Purge(List items, OsuDbContext context) { diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index 86c97df191..5b4a191682 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -108,7 +108,7 @@ namespace osu.Game.Database a.Invoke(); } - protected ArchiveModelManager(Storage storage, IDatabaseContextFactory contextFactory, MutableDatabaseBackedStore modelStore, IIpcHost importHost = null) + protected ArchiveModelManager(Storage storage, IDatabaseContextFactory contextFactory, MutableDatabaseBackedStoreWithFileIncludes modelStore, IIpcHost importHost = null) { ContextFactory = contextFactory; diff --git a/osu.Game/Database/MutableDatabaseBackedStoreWithFileIncludes.cs b/osu.Game/Database/MutableDatabaseBackedStoreWithFileIncludes.cs new file mode 100644 index 0000000000..3419a87507 --- /dev/null +++ b/osu.Game/Database/MutableDatabaseBackedStoreWithFileIncludes.cs @@ -0,0 +1,23 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Linq; +using Microsoft.EntityFrameworkCore; +using osu.Framework.Platform; + +namespace osu.Game.Database +{ + public abstract class MutableDatabaseBackedStoreWithFileIncludes : MutableDatabaseBackedStore + where T : class, IHasPrimaryKey, ISoftDelete, IHasFiles + where U : INamedFileInfo + { + protected MutableDatabaseBackedStoreWithFileIncludes(IDatabaseContextFactory contextFactory, Storage storage = null) + : base(contextFactory, storage) + { + } + + protected override IQueryable AddIncludesForConsumption(IQueryable query) => + base.AddIncludesForConsumption(query) + .Include(s => s.Files).ThenInclude(f => f.FileInfo); + } +} diff --git a/osu.Game/Scoring/ScoreStore.cs b/osu.Game/Scoring/ScoreStore.cs index 745bb6cc29..9627481f4d 100644 --- a/osu.Game/Scoring/ScoreStore.cs +++ b/osu.Game/Scoring/ScoreStore.cs @@ -8,7 +8,7 @@ using osu.Game.Database; namespace osu.Game.Scoring { - public class ScoreStore : MutableDatabaseBackedStore + public class ScoreStore : MutableDatabaseBackedStoreWithFileIncludes { public ScoreStore(IDatabaseContextFactory factory, Storage storage) : base(factory, storage) @@ -17,7 +17,6 @@ namespace osu.Game.Scoring protected override IQueryable AddIncludesForConsumption(IQueryable query) => base.AddIncludesForConsumption(query) - .Include(s => s.Files).ThenInclude(f => f.FileInfo) .Include(s => s.Beatmap) .Include(s => s.Ruleset); } diff --git a/osu.Game/Skinning/SkinStore.cs b/osu.Game/Skinning/SkinStore.cs index e80b03b935..31cadb0a24 100644 --- a/osu.Game/Skinning/SkinStore.cs +++ b/osu.Game/Skinning/SkinStore.cs @@ -1,22 +1,16 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System.Linq; -using Microsoft.EntityFrameworkCore; using osu.Framework.Platform; using osu.Game.Database; namespace osu.Game.Skinning { - public class SkinStore : MutableDatabaseBackedStore + public class SkinStore : MutableDatabaseBackedStoreWithFileIncludes { public SkinStore(DatabaseContextFactory contextFactory, Storage storage = null) : base(contextFactory, storage) { } - - protected override IQueryable AddIncludesForConsumption(IQueryable query) => - base.AddIncludesForConsumption(query) - .Include(s => s.Files).ThenInclude(f => f.FileInfo); } } From 0300f0d665dc8886f3f7f2f8a10e8df98ffe5914 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 10:47:45 +0900 Subject: [PATCH 13/35] Ensure deletions are correct without relying on FK cascade rule --- .../Database/MutableDatabaseBackedStoreWithFileIncludes.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Database/MutableDatabaseBackedStoreWithFileIncludes.cs b/osu.Game/Database/MutableDatabaseBackedStoreWithFileIncludes.cs index 3419a87507..5d6ff6b09b 100644 --- a/osu.Game/Database/MutableDatabaseBackedStoreWithFileIncludes.cs +++ b/osu.Game/Database/MutableDatabaseBackedStoreWithFileIncludes.cs @@ -19,5 +19,9 @@ namespace osu.Game.Database protected override IQueryable AddIncludesForConsumption(IQueryable query) => base.AddIncludesForConsumption(query) .Include(s => s.Files).ThenInclude(f => f.FileInfo); + + protected override IQueryable AddIncludesForDeletion(IQueryable query) => + base.AddIncludesForDeletion(query) + .Include(s => s.Files); // don't include FileInfo. these are handled by the FileStore itself. } } From 49cbaecf4c8f046c5f4058878ac0e4f41206a7dd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 10:52:53 +0900 Subject: [PATCH 14/35] Update licence header --- osu.Game/Screens/Select/BeatmapClearScoresDialog.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs b/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs index d720a8c69a..5fa50e00b9 100644 --- a/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs +++ b/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Game.Beatmaps; From 19ce1f28696616e224467a5e450d103151fa86c0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 13:43:16 +0900 Subject: [PATCH 15/35] Remove second conditional --- osu.Game/Screens/Select/SongSelect.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index fd3c4e003e..c794d32d49 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -625,8 +625,6 @@ namespace osu.Game.Screens.Select { if (beatmap == null || beatmap.ID <= 0) return; - if (BeatmapDetails.Leaderboard.Scores == null || !BeatmapDetails.Leaderboard.Scores.Any()) return; - dialogOverlay?.Push(new BeatmapClearScoresDialog(beatmap, () => BeatmapDetails.Leaderboard.RefreshScores())); } From f7b6c014e4ed33b8f7ca4632eb5e1e4423a5bd33 Mon Sep 17 00:00:00 2001 From: build Date: Fri, 1 Mar 2019 14:46:48 +0900 Subject: [PATCH 16/35] Fastlane initial setup --- .gitignore | 1 + Gemfile | 6 ++ Gemfile.lock | 171 ++++++++++++++++++++++++++++++++++++++++++++ fastlane/Appfile | 2 + fastlane/Fastfile | 57 +++++++++++++++ fastlane/Matchfile | 1 + fastlane/Pluginfile | 6 ++ fastlane/README.md | 54 ++++++++++++++ osu.iOS.props | 4 +- osu.iOS/Info.plist | 24 +++---- 10 files changed, 312 insertions(+), 14 deletions(-) create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 fastlane/Appfile create mode 100644 fastlane/Fastfile create mode 100644 fastlane/Matchfile create mode 100644 fastlane/Pluginfile create mode 100644 fastlane/README.md diff --git a/.gitignore b/.gitignore index 6186cb870d..0e2850a01c 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ tools/** build/tools/** +fastlane/report.xml # Build results bin/[Dd]ebug/ diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000000..cdd3a6b349 --- /dev/null +++ b/Gemfile @@ -0,0 +1,6 @@ +source "https://rubygems.org" + +gem "fastlane" + +plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') +eval_gemfile(plugins_path) if File.exist?(plugins_path) diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000000..8962cbdefe --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,171 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.0) + addressable (2.6.0) + public_suffix (>= 2.0.2, < 4.0) + atomos (0.1.3) + babosa (1.0.2) + claide (1.0.2) + colored (1.2) + colored2 (3.1.2) + commander-fastlane (4.4.6) + highline (~> 1.7.2) + declarative (0.0.10) + declarative-option (0.1.0) + digest-crc (0.4.1) + domain_name (0.5.20180417) + unf (>= 0.0.5, < 1.0.0) + dotenv (2.7.1) + emoji_regex (1.0.1) + excon (0.62.0) + faraday (0.15.4) + multipart-post (>= 1.2, < 3) + faraday-cookie_jar (0.0.6) + faraday (>= 0.7.4) + http-cookie (~> 1.0.0) + faraday_middleware (0.13.1) + faraday (>= 0.7.4, < 1.0) + fastimage (2.1.5) + fastlane (2.116.1) + CFPropertyList (>= 2.3, < 4.0.0) + addressable (>= 2.3, < 3.0.0) + babosa (>= 1.0.2, < 2.0.0) + bundler (>= 1.12.0, < 3.0.0) + colored + commander-fastlane (>= 4.4.6, < 5.0.0) + dotenv (>= 2.1.1, < 3.0.0) + emoji_regex (>= 0.1, < 2.0) + excon (>= 0.45.0, < 1.0.0) + faraday (~> 0.9) + faraday-cookie_jar (~> 0.0.6) + faraday_middleware (~> 0.9) + fastimage (>= 2.1.0, < 3.0.0) + gh_inspector (>= 1.1.2, < 2.0.0) + google-api-client (>= 0.21.2, < 0.24.0) + google-cloud-storage (>= 1.15.0, < 2.0.0) + highline (>= 1.7.2, < 2.0.0) + json (< 3.0.0) + mini_magick (~> 4.5.1) + multi_json + multi_xml (~> 0.5) + multipart-post (~> 2.0.0) + plist (>= 3.1.0, < 4.0.0) + public_suffix (~> 2.0.0) + rubyzip (>= 1.2.2, < 2.0.0) + security (= 0.1.3) + simctl (~> 1.6.3) + slack-notifier (>= 2.0.0, < 3.0.0) + terminal-notifier (>= 1.6.2, < 2.0.0) + terminal-table (>= 1.4.5, < 2.0.0) + tty-screen (>= 0.6.3, < 1.0.0) + tty-spinner (>= 0.8.0, < 1.0.0) + word_wrap (~> 1.0.0) + xcodeproj (>= 1.6.0, < 2.0.0) + xcpretty (~> 0.3.0) + xcpretty-travis-formatter (>= 0.0.3) + fastlane-plugin-clean_testflight_testers (0.2.0) + fastlane-plugin-souyuz (0.8.1) + souyuz (>= 0.8.1) + gh_inspector (1.1.3) + google-api-client (0.23.9) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.5, < 0.7.0) + httpclient (>= 2.8.1, < 3.0) + mime-types (~> 3.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.0) + signet (~> 0.9) + google-cloud-core (1.3.0) + google-cloud-env (~> 1.0) + google-cloud-env (1.0.5) + faraday (~> 0.11) + google-cloud-storage (1.16.0) + digest-crc (~> 0.4) + google-api-client (~> 0.23) + google-cloud-core (~> 1.2) + googleauth (>= 0.6.2, < 0.10.0) + googleauth (0.6.7) + faraday (~> 0.12) + jwt (>= 1.4, < 3.0) + memoist (~> 0.16) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (~> 0.7) + highline (1.7.10) + http-cookie (1.0.3) + domain_name (~> 0.5) + httpclient (2.8.3) + json (2.2.0) + jwt (2.1.0) + memoist (0.16.0) + mime-types (3.2.2) + mime-types-data (~> 3.2015) + mime-types-data (3.2018.0812) + mini_magick (4.5.1) + mini_portile2 (2.4.0) + multi_json (1.13.1) + multi_xml (0.6.0) + multipart-post (2.0.0) + nanaimo (0.2.6) + naturally (2.2.0) + nokogiri (1.10.1) + mini_portile2 (~> 2.4.0) + os (1.0.0) + plist (3.5.0) + public_suffix (2.0.5) + representable (3.0.4) + declarative (< 0.1.0) + declarative-option (< 0.2.0) + uber (< 0.2.0) + retriable (3.1.2) + rouge (2.0.7) + rubyzip (1.2.2) + security (0.1.3) + signet (0.11.0) + addressable (~> 2.3) + faraday (~> 0.9) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + simctl (1.6.5) + CFPropertyList + naturally + slack-notifier (2.3.2) + souyuz (0.8.1) + fastlane (>= 2.29.0) + highline (~> 1.7) + nokogiri (~> 1.7) + terminal-notifier (1.8.0) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + tty-cursor (0.6.1) + tty-screen (0.6.5) + tty-spinner (0.9.0) + tty-cursor (~> 0.6.0) + uber (0.1.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.5) + unicode-display_width (1.4.1) + word_wrap (1.0.0) + xcodeproj (1.8.1) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.2.6) + xcpretty (0.3.0) + rouge (~> 2.0.7) + xcpretty-travis-formatter (1.0.0) + xcpretty (~> 0.2, >= 0.0.7) + +PLATFORMS + ruby + +DEPENDENCIES + fastlane + fastlane-plugin-clean_testflight_testers + fastlane-plugin-souyuz + +BUNDLED WITH + 2.0.1 diff --git a/fastlane/Appfile b/fastlane/Appfile new file mode 100644 index 0000000000..083de66985 --- /dev/null +++ b/fastlane/Appfile @@ -0,0 +1,2 @@ +app_identifier("sh.ppy.osulazer") # The bundle identifier of your app +apple_id("apple-dev@ppy.sh") # Your Apple email address diff --git a/fastlane/Fastfile b/fastlane/Fastfile new file mode 100644 index 0000000000..49f47135db --- /dev/null +++ b/fastlane/Fastfile @@ -0,0 +1,57 @@ +update_fastlane + +default_platform(:ios) + +platform :ios do + lane :clean_dryrun do + clean_testflight_testers(days_of_inactivity:45, dry_run: true) + end + + # Specify a custom number for what's "inactive" + lane :clean do + clean_testflight_testers(days_of_inactivity: 45) # 120 days, so about 4 months + end + + lane :update_version do |options| + options[:plist_path] = '../osu.iOS/Info.plist' + app_version(options) + end + + desc 'Deploy to testflight' + lane :beta do |options| + provision( + type: 'appstore' + ) + + build( + build_configuration: 'Release', + build_platform: 'iPhone' + ) + + pilot( + skip_waiting_for_build_processing: true, + changelog: "i am woot poot", + ipa: './osu.iOS/bin/iPhone/Release/osu.iOS.ipa' + ) + end + + desc 'Compile the project' + lane :build do + souyuz( + platform: "ios", + build_target: "osu_iOS", + plist_path: "../osu.iOS/Info.plist" + ) + end + + desc 'Install provisioning profiles using match' + lane :provision do |options| + if Helper.is_ci? + # CI should not do stuff in ADP + options[:readonly] = true + end + + # update provisioning profiles + match(options) + end +end diff --git a/fastlane/Matchfile b/fastlane/Matchfile new file mode 100644 index 0000000000..40c974b09e --- /dev/null +++ b/fastlane/Matchfile @@ -0,0 +1 @@ +git_url('https://github.com/peppy/apple-certificates') diff --git a/fastlane/Pluginfile b/fastlane/Pluginfile new file mode 100644 index 0000000000..0b4207fc5f --- /dev/null +++ b/fastlane/Pluginfile @@ -0,0 +1,6 @@ +# Autogenerated by fastlane +# +# Ensure this file is checked in to source control! + +gem 'fastlane-plugin-clean_testflight_testers' +gem 'fastlane-plugin-souyuz' diff --git a/fastlane/README.md b/fastlane/README.md new file mode 100644 index 0000000000..70e5a52b1a --- /dev/null +++ b/fastlane/README.md @@ -0,0 +1,54 @@ +fastlane documentation +================ +# Installation + +Make sure you have the latest version of the Xcode command line tools installed: + +``` +xcode-select --install +``` + +Install _fastlane_ using +``` +[sudo] gem install fastlane -NV +``` +or alternatively using `brew cask install fastlane` + +# Available Actions +## iOS +### ios clean_dryrun +``` +fastlane ios clean_dryrun +``` + +### ios clean +``` +fastlane ios clean +``` + +### ios update_version +``` +fastlane ios update_version +``` + +### ios beta +``` +fastlane ios beta +``` +Deploy to testflight +### ios build +``` +fastlane ios build +``` +Compile the project +### ios provision +``` +fastlane ios provision +``` +Install provisioning profiles using match + +---- + +This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run. +More information about fastlane can be found on [fastlane.tools](https://fastlane.tools). +The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools). diff --git a/osu.iOS.props b/osu.iOS.props index 16eeb46683..099369f66a 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -35,7 +35,7 @@ prompt 4 - iPhone Developer + iPhone Distribution true true Entitlements.plist @@ -113,4 +113,4 @@ - \ No newline at end of file + diff --git a/osu.iOS/Info.plist b/osu.iOS/Info.plist index fe711fc03c..f0bd70b00f 100644 --- a/osu.iOS/Info.plist +++ b/osu.iOS/Info.plist @@ -2,6 +2,14 @@ + CFBundleIdentifier + sh.ppy.osulazer + CFBundleName + osu! + CFBundleShortVersionString + 0.1 + CFBundleVersion + 2019.301.0 LSRequiresIPhoneOS MinimumOSVersion @@ -17,6 +25,10 @@ armv7 + UIRequiresFullScreen + + UIStatusBarHidden + UISupportedInterfaceOrientations UIInterfaceOrientationPortrait @@ -26,17 +38,5 @@ XSAppIconAssets Assets.xcassets/AppIcon.appiconset - UIStatusBarHidden - - UIRequiresFullScreen - - CFBundleIdentifier - sh.ppy.osulazer - CFBundleName - osu! - CFBundleShortVersionString - 0.1 - CFBundleVersion - 0.1.1 From dd1bba5ad2a1a34882f890f3c0753980d4bfe0d4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 16:02:43 +0900 Subject: [PATCH 17/35] Add nuget restore --- Gemfile.lock | 2 ++ fastlane/Fastfile | 4 ++++ fastlane/Pluginfile | 1 + 3 files changed, 7 insertions(+) diff --git a/Gemfile.lock b/Gemfile.lock index 8962cbdefe..325c518231 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -67,6 +67,7 @@ GEM fastlane-plugin-clean_testflight_testers (0.2.0) fastlane-plugin-souyuz (0.8.1) souyuz (>= 0.8.1) + fastlane-plugin-xamarin (0.6.3) gh_inspector (1.1.3) google-api-client (0.23.9) addressable (~> 2.5, >= 2.5.1) @@ -166,6 +167,7 @@ DEPENDENCIES fastlane fastlane-plugin-clean_testflight_testers fastlane-plugin-souyuz + fastlane-plugin-xamarin BUNDLED WITH 2.0.1 diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 49f47135db..b176a1c52b 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -37,6 +37,10 @@ platform :ios do desc 'Compile the project' lane :build do + nuget_restore( + project_path: 'osu.iOS.sln' + ) + souyuz( platform: "ios", build_target: "osu_iOS", diff --git a/fastlane/Pluginfile b/fastlane/Pluginfile index 0b4207fc5f..9f4f47f213 100644 --- a/fastlane/Pluginfile +++ b/fastlane/Pluginfile @@ -4,3 +4,4 @@ gem 'fastlane-plugin-clean_testflight_testers' gem 'fastlane-plugin-souyuz' +gem 'fastlane-plugin-xamarin' From 43f1099e778c6546687950552f83679ee864d07b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 17:19:41 +0900 Subject: [PATCH 18/35] Automate change notes --- fastlane/Fastfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index b176a1c52b..81d39356bd 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -28,9 +28,13 @@ platform :ios do build_platform: 'iPhone' ) + client = HTTPClient.new + changelog = client.get_content 'https://gist.githubusercontent.com/peppy/ab89c29dcc0dce95f39eb218e8fad197/raw' + changelog.gsub!('$BUILD_ID', options[:build]) + pilot( - skip_waiting_for_build_processing: true, - changelog: "i am woot poot", + wait_processing_interval: 600, + changelog: changelog, ipa: './osu.iOS/bin/iPhone/Release/osu.iOS.ipa' ) end From a6ed64754ce522ee10a63b7bb660e943ea08b530 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 17:20:03 +0900 Subject: [PATCH 19/35] Reset bundle version --- osu.iOS/Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.iOS/Info.plist b/osu.iOS/Info.plist index f0bd70b00f..0627feab78 100644 --- a/osu.iOS/Info.plist +++ b/osu.iOS/Info.plist @@ -9,7 +9,7 @@ CFBundleShortVersionString 0.1 CFBundleVersion - 2019.301.0 + 0.1.0 LSRequiresIPhoneOS MinimumOSVersion From 2dacd754a3b6e7d1a9a83dcb64645c4fcf4ab631 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 17:20:13 +0900 Subject: [PATCH 20/35] Update fastlane version --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 325c518231..17c0db12e7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -27,7 +27,7 @@ GEM faraday_middleware (0.13.1) faraday (>= 0.7.4, < 1.0) fastimage (2.1.5) - fastlane (2.116.1) + fastlane (2.117.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.3, < 3.0.0) babosa (>= 1.0.2, < 2.0.0) From c0440ca4fe6aa326a36f8c316b9fc361fb3a1781 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 17:20:28 +0900 Subject: [PATCH 21/35] Always update version number in beta lane --- fastlane/Fastfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 81d39356bd..c33e44e877 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -19,6 +19,8 @@ platform :ios do desc 'Deploy to testflight' lane :beta do |options| + update_version(options) + provision( type: 'appstore' ) From 70d1c6fba4526e22eaf35fe4b6cde61368edee45 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 17:37:28 +0900 Subject: [PATCH 22/35] Wait longer --- fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index c33e44e877..78507b3aa9 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -35,7 +35,7 @@ platform :ios do changelog.gsub!('$BUILD_ID', options[:build]) pilot( - wait_processing_interval: 600, + wait_processing_interval: 900, changelog: changelog, ipa: './osu.iOS/bin/iPhone/Release/osu.iOS.ipa' ) From 0df49e6df370305155edc9498fbf31560bea5438 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 17:37:41 +0900 Subject: [PATCH 23/35] Clean up config further --- fastlane/Fastfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 78507b3aa9..3f64bcdf19 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -3,12 +3,12 @@ update_fastlane default_platform(:ios) platform :ios do - lane :clean_dryrun do + lane :testflight_prune_dry do clean_testflight_testers(days_of_inactivity:45, dry_run: true) end # Specify a custom number for what's "inactive" - lane :clean do + lane :testflight_prune do clean_testflight_testers(days_of_inactivity: 45) # 120 days, so about 4 months end @@ -57,11 +57,9 @@ platform :ios do desc 'Install provisioning profiles using match' lane :provision do |options| if Helper.is_ci? - # CI should not do stuff in ADP options[:readonly] = true end - # update provisioning profiles match(options) end end From 521e2a30ae5ce3d8bb2f97624071426f169bcf08 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 18:16:17 +0900 Subject: [PATCH 24/35] Update readme --- fastlane/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fastlane/README.md b/fastlane/README.md index 70e5a52b1a..53bbc62cae 100644 --- a/fastlane/README.md +++ b/fastlane/README.md @@ -16,14 +16,14 @@ or alternatively using `brew cask install fastlane` # Available Actions ## iOS -### ios clean_dryrun +### ios testflight_prune_dry ``` -fastlane ios clean_dryrun +fastlane ios testflight_prune_dry ``` -### ios clean +### ios testflight_prune ``` -fastlane ios clean +fastlane ios testflight_prune ``` ### ios update_version From 9885913fff0775f53c29c949f18946ddeba4f997 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 19:59:39 +0900 Subject: [PATCH 25/35] Fix iOS builds not being able to read their deploy version --- osu.Game/OsuGameBase.cs | 8 ++++---- osu.iOS/AppDelegate.cs | 4 ++-- osu.iOS/OsuGameIOS.cs | 14 ++++++++++++++ osu.iOS/osu.iOS.csproj | 1 + 4 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 osu.iOS/OsuGameIOS.cs diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 487ef10ffb..43f18456d3 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -75,9 +75,9 @@ namespace osu.Game private Bindable fpsDisplayVisible; - protected AssemblyName AssemblyName => Assembly.GetEntryAssembly()?.GetName() ?? new AssemblyName { Version = new Version() }; + protected virtual Version AssemblyVersion => Assembly.GetEntryAssembly()?.GetName()?.Version ?? new Version(); - public bool IsDeployedBuild => AssemblyName.Version.Major > 0; + public bool IsDeployedBuild => AssemblyVersion.Major > 0; public string Version { @@ -86,8 +86,8 @@ namespace osu.Game if (!IsDeployedBuild) return @"local " + (DebugUtils.IsDebug ? @"debug" : @"release"); - var assembly = AssemblyName; - return $@"{assembly.Version.Major}.{assembly.Version.Minor}.{assembly.Version.Build}"; + var version = AssemblyVersion; + return $@"{version.Major}.{version.Minor}.{version.Build}"; } } diff --git a/osu.iOS/AppDelegate.cs b/osu.iOS/AppDelegate.cs index 97621e1e52..058e246ed8 100644 --- a/osu.iOS/AppDelegate.cs +++ b/osu.iOS/AppDelegate.cs @@ -1,4 +1,4 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using Foundation; @@ -10,6 +10,6 @@ namespace osu.iOS [Register("AppDelegate")] public class AppDelegate : GameAppDelegate { - protected override Framework.Game CreateGame() => new OsuGame(); + protected override Framework.Game CreateGame() => new OsuGameIOS(); } } diff --git a/osu.iOS/OsuGameIOS.cs b/osu.iOS/OsuGameIOS.cs new file mode 100644 index 0000000000..b94119af55 --- /dev/null +++ b/osu.iOS/OsuGameIOS.cs @@ -0,0 +1,14 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System; +using Foundation; +using osu.Game; + +namespace osu.iOS +{ + public class OsuGameIOS : OsuGame + { + protected override Version AssemblyVersion => new Version(NSBundle.MainBundle.InfoDictionary["CFBundleVersion"].ToString()); + } +} diff --git a/osu.iOS/osu.iOS.csproj b/osu.iOS/osu.iOS.csproj index 9c69dd40ba..9df3ad5516 100644 --- a/osu.iOS/osu.iOS.csproj +++ b/osu.iOS/osu.iOS.csproj @@ -48,6 +48,7 @@ + From 431d43950055dab1891b19224a29d3fa20390241 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 20:15:09 +0900 Subject: [PATCH 26/35] Make attribute public --- 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 43f18456d3..643a673faf 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -75,7 +75,7 @@ namespace osu.Game private Bindable fpsDisplayVisible; - protected virtual Version AssemblyVersion => Assembly.GetEntryAssembly()?.GetName()?.Version ?? new Version(); + public virtual Version AssemblyVersion => Assembly.GetEntryAssembly()?.GetName().Version ?? new Version(); public bool IsDeployedBuild => AssemblyVersion.Major > 0; From 02fb41a3123a23670108a92cbfaf0fa828ec8f42 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 1 Mar 2019 20:17:39 +0900 Subject: [PATCH 27/35] Use style heuristics --- osu.sln.DotSettings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index a4551422cb..5363d6dddf 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -219,7 +219,7 @@ Code Cleanup (peppy) ExpressionBody ExpressionBody - False + True True True True From c01990d00587ba3f652ae4623c8a2d13de562860 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 20:52:34 +0900 Subject: [PATCH 28/35] Fix callback potentially not getting fired --- osu.Game/Screens/Select/BeatmapClearScoresDialog.cs | 2 +- osu.Game/Screens/Select/SongSelect.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs b/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs index 5fa50e00b9..a37327f2c3 100644 --- a/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs +++ b/osu.Game/Screens/Select/BeatmapClearScoresDialog.cs @@ -29,7 +29,7 @@ namespace osu.Game.Screens.Select Action = () => { Task.Run(() => scoreManager.Delete(scoreManager.QueryScores(s => !s.DeletePending && s.Beatmap.ID == beatmap.ID).ToList())) - .ContinueWith(t => Schedule(onCompletion)); + .ContinueWith(_ => onCompletion); } }, new PopupDialogCancelButton diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index c794d32d49..866c7e0926 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -625,7 +625,9 @@ namespace osu.Game.Screens.Select { if (beatmap == null || beatmap.ID <= 0) return; - dialogOverlay?.Push(new BeatmapClearScoresDialog(beatmap, () => BeatmapDetails.Leaderboard.RefreshScores())); + dialogOverlay?.Push(new BeatmapClearScoresDialog(beatmap, () => + // schedule done here rather than inside the dialog as the dialog may fade out and never callback. + Schedule(() => BeatmapDetails.Leaderboard.RefreshScores()))); } public override bool OnPressed(GlobalAction action) From 7f1f812f297a155328cb5a37d29bfb7c302285c5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 22:06:42 +0900 Subject: [PATCH 29/35] Update framework --- osu.Game/osu.Game.csproj | 2 +- osu.iOS.props | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index f8d89ec8a5..8f9a7cd14b 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -16,7 +16,7 @@ - + diff --git a/osu.iOS.props b/osu.iOS.props index 099369f66a..499878347b 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -105,8 +105,8 @@ - - + + From 180aee6048e69c7119849a9037a85fbcefaa3137 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Mar 2019 23:20:34 +0900 Subject: [PATCH 30/35] Fix iOS build --- osu.iOS/OsuGameIOS.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.iOS/OsuGameIOS.cs b/osu.iOS/OsuGameIOS.cs index b94119af55..6cf18df9a6 100644 --- a/osu.iOS/OsuGameIOS.cs +++ b/osu.iOS/OsuGameIOS.cs @@ -9,6 +9,6 @@ namespace osu.iOS { public class OsuGameIOS : OsuGame { - protected override Version AssemblyVersion => new Version(NSBundle.MainBundle.InfoDictionary["CFBundleVersion"].ToString()); + public override Version AssemblyVersion => new Version(NSBundle.MainBundle.InfoDictionary["CFBundleVersion"].ToString()); } } From 7151fe06dc9672532589e0bfad0b91f0fcd46263 Mon Sep 17 00:00:00 2001 From: Joehu Date: Fri, 1 Mar 2019 19:24:28 -0800 Subject: [PATCH 31/35] Normalize repo readme format --- README.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 8cfc2ffebf..abddb1faa1 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,24 @@ -# osu! [![Build status](https://ci.appveyor.com/api/projects/status/u2p01nx7l6og8buh?svg=true)](https://ci.appveyor.com/project/peppy/osu) [![CodeFactor](https://www.codefactor.io/repository/github/ppy/osu/badge)](https://www.codefactor.io/repository/github/ppy/osu) [![dev chat](https://discordapp.com/api/guilds/188630481301012481/widget.png?style=shield)](https://discord.gg/ppy) +# osu! + +[![Build status](https://ci.appveyor.com/api/projects/status/u2p01nx7l6og8buh?svg=true)](https://ci.appveyor.com/project/peppy/osu) [![CodeFactor](https://www.codefactor.io/repository/github/ppy/osu/badge)](https://www.codefactor.io/repository/github/ppy/osu) [![dev chat](https://discordapp.com/api/guilds/188630481301012481/widget.png?style=shield)](https://discord.gg/ppy) Rhythm is just a *click* away. The future of [osu!](https://osu.ppy.sh) and the beginning of an open era! Commonly known by the codename "osu!lazer". Pew pew. -# Status +## Status This project is still heavily under development, but is in a state where users are encouraged to try it out and keep it installed alongside the stable osu! client. It will continue to evolve over the coming months and hopefully bring some new unique features to the table. We are accepting bug reports (please report with as much detail as possible). Feature requests are welcome as long as you read and understand the contribution guidelines listed below. -# Requirements +## Requirements - A desktop platform with the [.NET Core SDK 2.2](https://www.microsoft.com/net/learn/get-started) or higher installed. - When working with the codebase, we recommend using an IDE with intellisense and syntax highlighting, such as [Visual Studio 2017+](https://visualstudio.microsoft.com/vs/), [Jetbrains Rider](https://www.jetbrains.com/rider/) or [Visual Studio Code](https://code.visualstudio.com/). - Note that there are **[additional requirements for Windows 7 and Windows 8.1](https://docs.microsoft.com/en-us/dotnet/core/windows-prerequisites?tabs=netcore2x)** which you may need to manually install if your operating system is not up-to-date. -# Running osu! +## Running osu! -## Releases +### Releases If you are not interested in developing the game, please head over to the [releases](https://github.com/ppy/osu/releases) to download a precompiled build with automatic updating enabled. @@ -26,7 +28,7 @@ If you are not interested in developing the game, please head over to the [relea If your platform is not listed above, there is still a chance you can manually build it by following the instructions below. -## Downloading the source code +### Downloading the source code Clone the repository **including submodules**: @@ -41,7 +43,7 @@ To update the source code to the latest commit, run the following command inside git pull ``` -## Building +### Building Build configurations for the recommended IDEs (listed above) are included. You should use the provided Build/Run functionality of your IDE to get things going. When testing or building new components, it's highly encouraged you use the `VisualTests` project/configuration. More information on this provided below. @@ -57,7 +59,7 @@ If you are not interested in debugging osu!, you can add `-c Release` to gain pe If the build fails, try to restore nuget packages with `dotnet restore`. -### A note for Linux users +#### A note for Linux users On Linux, the environment variable `LD_LIBRARY_PATH` must point to the build directory, located at `osu.Desktop/bin/Debug/$NETCORE_VERSION`. @@ -69,15 +71,15 @@ For example, you can run osu! with the following command: LD_LIBRARY_PATH="$(pwd)/osu.Desktop/bin/Debug/netcoreapp2.2" dotnet run --project osu.Desktop ``` -## Testing with resource/framework modifications +### Testing with resource/framework modifications Sometimes it may be necessary to cross-test changes in [osu-resources](https://github.com/ppy/osu-resources) or [osu-framework](https://github.com/ppy/osu-framework). This can be achieved by running some commands as documented on the [osu-resources](https://github.com/ppy/osu-resources/wiki/Testing-local-resources-checkout-with-other-projects) and [osu-framework](https://github.com/ppy/osu-framework/wiki/Testing-local-framework-checkout-with-other-projects) wiki pages. -## Code analysis +### Code analysis Code analysis can be run with `powershell ./build.ps1` or `build.sh`. This is currently only supported under windows due to [resharper cli shortcomings](https://youtrack.jetbrains.com/issue/RSRP-410004). Alternatively, you can install resharper or use rider to get inline support in your IDE of choice. -# Contributing +## Contributing We welcome all contributions, but keep in mind that we already have a lot of the UI designed. If you wish to work on something with the intention on having it included in the official distribution, please open an issue for discussion and we will give you what you need from a design perspective to proceed. If you want to make *changes* to the design, we recommend you open an issue with your intentions before spending too much time, to ensure no effort is wasted. @@ -87,7 +89,7 @@ Contributions can be made via pull requests to this repository. We hope to credi Note that while we already have certain standards in place, nothing is set in stone. If you have an issue with the way code is structured; with any libraries we are using; with any processes involved with contributing, *please* bring it up. I welcome all feedback so we can make contributing to this project as pain-free as possible. -# Licence +## Licence The osu! client code and framework are licensed under the [MIT licence](https://opensource.org/licenses/MIT). Please see [the licence file](LICENCE) for more information. [tl;dr](https://tldrlegal.com/license/mit-license) you can do whatever you want as long as you include the original copyright and license notice in any copy of the software/source. From 83a02d32f77a9bb88efc1778abfecfd5b069591e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 2 Mar 2019 13:25:59 +0900 Subject: [PATCH 32/35] Fix a few incorrect fonts --- osu.Game/Overlays/Chat/ChatLine.cs | 2 +- osu.Game/Screens/Menu/Disclaimer.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index a679f33e3a..55f3bfd260 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -88,7 +88,7 @@ namespace osu.Game.Overlays.Chat Drawable effectedUsername = username = new OsuSpriteText { Colour = hasBackground ? customUsernameColour : username_colours[message.Sender.Id % username_colours.Length], - Font = OsuFont.GetFont(size: TextSize, weight: FontWeight.Bold, italics: true) + Font = OsuFont.GetFont(size: TextSize, weight: FontWeight.SemiBold, italics: true) }; if (hasBackground) diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index 8c1cfdcda1..23a9cb2120 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -70,7 +70,7 @@ namespace osu.Game.Screens.Menu textFlow.AddParagraph("Things may not work as expected", t => t.Font = t.Font.With(size: 20)); textFlow.NewParagraph(); - Action format = t => t.Font = OsuFont.GetFont(size: 15, weight: FontWeight.Bold); + Action format = t => t.Font = OsuFont.GetFont(size: 15, weight: FontWeight.SemiBold); textFlow.AddParagraph("Detailed bug reports are welcomed via github issues.", format); textFlow.NewParagraph(); From 268ea6a836159de56093eaafe602abc0a2f0ecbe Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 2 Mar 2019 13:28:16 +0900 Subject: [PATCH 33/35] Wrong line --- osu.Game/Overlays/Chat/ChatLine.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index 55f3bfd260..908ec5f026 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -88,7 +88,7 @@ namespace osu.Game.Overlays.Chat Drawable effectedUsername = username = new OsuSpriteText { Colour = hasBackground ? customUsernameColour : username_colours[message.Sender.Id % username_colours.Length], - Font = OsuFont.GetFont(size: TextSize, weight: FontWeight.SemiBold, italics: true) + Font = OsuFont.GetFont(size: TextSize, weight: FontWeight.Bold, italics: true) }; if (hasBackground) @@ -137,7 +137,7 @@ namespace osu.Game.Overlays.Chat { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, - Font = OsuFont.GetFont(size: TextSize * 0.75f, weight: FontWeight.Bold, fixedWidth: true) + Font = OsuFont.GetFont(size: TextSize * 0.75f, weight: FontWeight.SemiBold, fixedWidth: true) }, new MessageSender(message.Sender) { From 5487b011d674202b0425899ec88809e8a8d64e72 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 2 Mar 2019 14:34:56 +0900 Subject: [PATCH 34/35] Fix some inspections rider isn't able to deal with automatically --- .../Visual/TestCaseBeatmapScoresContainer.cs | 25 ++++++++----------- .../Components/Timeline/TimelineArea.cs | 6 +++-- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs index 6ad11ae6c4..bb55c0b1e8 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs @@ -23,9 +23,6 @@ namespace osu.Game.Tests.Visual [System.ComponentModel.Description("in BeatmapOverlay")] public class TestCaseBeatmapScoresContainer : OsuTestCase { - private readonly IEnumerable scores; - private readonly IEnumerable anotherScores; - private readonly APIScoreInfo topScoreInfo; private readonly Box background; public TestCaseBeatmapScoresContainer() @@ -47,15 +44,7 @@ namespace osu.Game.Tests.Visual } }; - AddStep("scores pack 1", () => scoresContainer.Scores = scores); - AddStep("scores pack 2", () => scoresContainer.Scores = anotherScores); - AddStep("only top score", () => scoresContainer.Scores = new[] { topScoreInfo }); - AddStep("remove scores", () => scoresContainer.Scores = null); - AddStep("resize to big", () => container.ResizeWidthTo(1, 300)); - AddStep("resize to normal", () => container.ResizeWidthTo(0.8f, 300)); - AddStep("online scores", () => scoresContainer.Beatmap = new BeatmapInfo { OnlineBeatmapID = 75, Ruleset = new OsuRuleset().RulesetInfo }); - - scores = new[] + IEnumerable scores = new[] { new APIScoreInfo { @@ -168,7 +157,7 @@ namespace osu.Game.Tests.Visual s.Statistics.Add(HitResult.Meh, RNG.Next(2000)); } - anotherScores = new[] + IEnumerable anotherScores = new[] { new APIScoreInfo { @@ -280,7 +269,7 @@ namespace osu.Game.Tests.Visual s.Statistics.Add(HitResult.Meh, RNG.Next(2000)); } - topScoreInfo = new APIScoreInfo + var topScoreInfo = new APIScoreInfo { User = new User { @@ -305,6 +294,14 @@ namespace osu.Game.Tests.Visual topScoreInfo.Statistics.Add(HitResult.Great, RNG.Next(2000)); topScoreInfo.Statistics.Add(HitResult.Good, RNG.Next(2000)); topScoreInfo.Statistics.Add(HitResult.Meh, RNG.Next(2000)); + + AddStep("scores pack 1", () => scoresContainer.Scores = scores); + AddStep("scores pack 2", () => scoresContainer.Scores = anotherScores); + AddStep("only top score", () => scoresContainer.Scores = new[] { topScoreInfo }); + AddStep("remove scores", () => scoresContainer.Scores = null); + AddStep("resize to big", () => container.ResizeWidthTo(1, 300)); + AddStep("resize to normal", () => container.ResizeWidthTo(0.8f, 300)); + AddStep("online scores", () => scoresContainer.Beatmap = new BeatmapInfo { OnlineBeatmapID = 75, Ruleset = new OsuRuleset().RulesetInfo }); } [BackgroundDependencyLoader] diff --git a/osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineArea.cs b/osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineArea.cs index 42657ef3f7..3b24925f2c 100644 --- a/osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineArea.cs +++ b/osu.Game/Screens/Edit/Compose/Components/Timeline/TimelineArea.cs @@ -91,7 +91,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline RelativeSizeAxes = Axes.Y, Height = 0.5f, Icon = FontAwesome.fa_search_plus, - Action = () => timeline.Zoom++ + Action = () => changeZoom(1) }, new TimelineButton { @@ -100,7 +100,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline RelativeSizeAxes = Axes.Y, Height = 0.5f, Icon = FontAwesome.fa_search_minus, - Action = () => timeline.Zoom-- + Action = () => changeZoom(-1) }, } } @@ -124,5 +124,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline timeline.WaveformVisible.BindTo(waveformCheckbox.Current); } + + private void changeZoom(float change) => timeline.Zoom += change; } } From b7126b3efb2824da40ef53673ec262a01f348f18 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 2 Mar 2019 14:48:05 +0900 Subject: [PATCH 35/35] Fix mod select overlay dimming itself --- .../Graphics/Containers/OsuFocusedOverlayContainer.cs | 8 +++++++- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs index 8e47bf2e99..c6ee91f961 100644 --- a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs +++ b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs @@ -24,6 +24,12 @@ namespace osu.Game.Graphics.Containers protected override bool BlockNonPositionalInput => true; + /// + /// Temporary to allow for overlays in the main screen content to not dim theirselves. + /// Should be eventually replaced by dimming which is aware of the target dim container (traverse parent for certain interface type?). + /// + protected virtual bool DimMainContent => true; + [Resolved(CanBeNull = true)] private OsuGame osuGame { get; set; } @@ -95,7 +101,7 @@ namespace osu.Game.Graphics.Containers if (OverlayActivationMode.Value != OverlayActivation.Disabled) { if (PlaySamplesOnStateChange) samplePopIn?.Play(); - if (BlockScreenWideMouse) osuGame?.AddBlockingOverlay(this); + if (BlockScreenWideMouse && DimMainContent) osuGame?.AddBlockingOverlay(this); } else State = Visibility.Hidden; diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 24faf36ef8..aa41723ca6 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -38,6 +38,8 @@ namespace osu.Game.Overlays.Mods protected override bool BlockNonPositionalInput => false; + protected override bool DimMainContent => false; + protected readonly FillFlowContainer ModSectionsContainer; protected readonly Bindable> SelectedMods = new Bindable>(new Mod[] { });