From 6d864cb47e2e5efb0b283d078526b833362d252e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 24 Jun 2019 12:42:21 +0900 Subject: [PATCH 01/57] Load beatmap content asynchronously in the background --- osu.Game/Beatmaps/WorkingBeatmap.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 328763fc9f..3ef7b4feca 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -11,6 +11,7 @@ using osu.Framework.IO.File; using System.IO; using System.Linq; using System.Threading; +using System.Threading.Tasks; using osu.Framework.Audio; using osu.Game.IO.Serialization; using osu.Game.Rulesets; @@ -38,7 +39,7 @@ namespace osu.Game.Beatmaps BeatmapSetInfo = beatmapInfo.BeatmapSet; Metadata = beatmapInfo.Metadata ?? BeatmapSetInfo?.Metadata ?? new BeatmapMetadata(); - beatmap = new RecyclableLazy(() => + beatmapLoadTask = Task.Factory.StartNew(() => { var b = GetBeatmap() ?? new Beatmap(); @@ -49,7 +50,7 @@ namespace osu.Game.Beatmaps b.BeatmapInfo = BeatmapInfo; return b; - }); + }, beatmapCancellation.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default); track = new RecyclableLazy(() => GetTrack() ?? GetVirtualTrack()); background = new RecyclableLazy(GetBackground, BackgroundStillValid); @@ -153,10 +154,11 @@ namespace osu.Game.Beatmaps public override string ToString() => BeatmapInfo.ToString(); - public bool BeatmapLoaded => beatmap.IsResultAvailable; - public IBeatmap Beatmap => beatmap.Value; + public bool BeatmapLoaded => beatmapLoadTask.IsCompleted; + public IBeatmap Beatmap => beatmapLoadTask.Result; + private readonly CancellationTokenSource beatmapCancellation = new CancellationTokenSource(); protected abstract IBeatmap GetBeatmap(); - private readonly RecyclableLazy beatmap; + private readonly Task beatmapLoadTask; public bool BackgroundLoaded => background.IsResultAvailable; public Texture Background => background.Value; @@ -201,6 +203,8 @@ namespace osu.Game.Beatmaps waveform.Recycle(); storyboard.Recycle(); skin.Recycle(); + + beatmapCancellation.Cancel(); } /// From 18303623371ab1544d6e26d8458813fa05afff3e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 24 Jun 2019 17:10:50 +0900 Subject: [PATCH 02/57] Move task out of ctor to avoid initialisation ordering issues --- osu.Game/Beatmaps/WorkingBeatmap.cs | 34 +++++++++++++++-------------- osu.Game/OsuGame.cs | 2 ++ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 3ef7b4feca..a1864526d1 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -39,19 +39,6 @@ namespace osu.Game.Beatmaps BeatmapSetInfo = beatmapInfo.BeatmapSet; Metadata = beatmapInfo.Metadata ?? BeatmapSetInfo?.Metadata ?? new BeatmapMetadata(); - beatmapLoadTask = Task.Factory.StartNew(() => - { - var b = GetBeatmap() ?? new Beatmap(); - - // The original beatmap version needs to be preserved as the database doesn't contain it - BeatmapInfo.BeatmapVersion = b.BeatmapInfo.BeatmapVersion; - - // Use the database-backed info for more up-to-date values (beatmap id, ranked status, etc) - b.BeatmapInfo = BeatmapInfo; - - return b; - }, beatmapCancellation.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default); - track = new RecyclableLazy(() => GetTrack() ?? GetVirtualTrack()); background = new RecyclableLazy(GetBackground, BackgroundStillValid); waveform = new RecyclableLazy(GetWaveform); @@ -154,11 +141,26 @@ namespace osu.Game.Beatmaps public override string ToString() => BeatmapInfo.ToString(); - public bool BeatmapLoaded => beatmapLoadTask.IsCompleted; - public IBeatmap Beatmap => beatmapLoadTask.Result; + public bool BeatmapLoaded => beatmapLoadTask?.IsCompleted ?? false; + + public Task LoadBeatmapAsync() => (beatmapLoadTask ?? (beatmapLoadTask = Task.Factory.StartNew(() => + { + var b = GetBeatmap() ?? new Beatmap(); + + // The original beatmap version needs to be preserved as the database doesn't contain it + BeatmapInfo.BeatmapVersion = b.BeatmapInfo.BeatmapVersion; + + // Use the database-backed info for more up-to-date values (beatmap id, ranked status, etc) + b.BeatmapInfo = BeatmapInfo; + + return b; + }, beatmapCancellation.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default))); + + public IBeatmap Beatmap => LoadBeatmapAsync().Result; + private readonly CancellationTokenSource beatmapCancellation = new CancellationTokenSource(); protected abstract IBeatmap GetBeatmap(); - private readonly Task beatmapLoadTask; + private Task beatmapLoadTask; public bool BackgroundLoaded => background.IsResultAvailable; public Texture Background => background.Value; diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 35684849a3..b018c2b64a 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -293,6 +293,8 @@ namespace osu.Game var nextBeatmap = beatmap.NewValue; if (nextBeatmap?.Track != null) nextBeatmap.Track.Completed += currentTrackCompleted; + + nextBeatmap?.LoadBeatmapAsync(); } private void currentTrackCompleted() From 8b0aaccfe618dd9fd92e43718458e7315594ee40 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 27 Jun 2019 13:56:36 +0900 Subject: [PATCH 03/57] Add finaliser to WorkingBeatmap --- osu.Game.Tests/WaveformTestBeatmap.cs | 2 +- osu.Game/Beatmaps/WorkingBeatmap.cs | 36 +++++++++++++++++++-------- osu.Game/Tests/Visual/OsuTestScene.cs | 2 +- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/osu.Game.Tests/WaveformTestBeatmap.cs b/osu.Game.Tests/WaveformTestBeatmap.cs index fdb91b7c5b..c5a2f5be51 100644 --- a/osu.Game.Tests/WaveformTestBeatmap.cs +++ b/osu.Game.Tests/WaveformTestBeatmap.cs @@ -30,7 +30,7 @@ namespace osu.Game.Tests trackStore = audioManager.GetTrackStore(reader); } - public override void Dispose() + protected override void Dispose(bool isDisposing) { base.Dispose(); stream?.Dispose(); diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index a1864526d1..61390fe51b 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -46,6 +46,11 @@ namespace osu.Game.Beatmaps skin = new RecyclableLazy(GetSkin); } + ~WorkingBeatmap() + { + Dispose(false); + } + protected virtual Track GetVirtualTrack() { const double excess_length = 1000; @@ -199,22 +204,33 @@ namespace osu.Game.Beatmaps other.track = track; } - public virtual void Dispose() - { - background.Recycle(); - waveform.Recycle(); - storyboard.Recycle(); - skin.Recycle(); - - beatmapCancellation.Cancel(); - } - /// /// Eagerly dispose of the audio track associated with this (if any). /// Accessing track again will load a fresh instance. /// public virtual void RecycleTrack() => track.Recycle(); + #region Disposal + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool isDisposing) + { + // recycling logic is not here for the time being, as components which use + // retrieved objects from WorkingBeatmap may not hold a reference to the WorkingBeatmap itself. + // this should be fine as each retrieved comopnent do have their own finalizers. + + // cancelling the beatmap load is safe for now since the retrieval is a synchronous + // operation. if we add an async retrieval method this may need to be reconsidered. + beatmapCancellation.Cancel(); + } + + #endregion + public class RecyclableLazy { private Lazy lazy; diff --git a/osu.Game/Tests/Visual/OsuTestScene.cs b/osu.Game/Tests/Visual/OsuTestScene.cs index c8798448ae..9f4532513f 100644 --- a/osu.Game/Tests/Visual/OsuTestScene.cs +++ b/osu.Game/Tests/Visual/OsuTestScene.cs @@ -137,7 +137,7 @@ namespace osu.Game.Tests.Visual track = audio?.Tracks.GetVirtual(length); } - public override void Dispose() + protected override void Dispose(bool isDisposing) { base.Dispose(); store?.Dispose(); From 1072431fbbc17373f367eb06c8b6de0156f16cb7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 27 Jun 2019 14:08:58 +0900 Subject: [PATCH 04/57] Fix test StackOverflows --- osu.Game.Tests/WaveformTestBeatmap.cs | 2 +- osu.Game/Tests/Visual/OsuTestScene.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/WaveformTestBeatmap.cs b/osu.Game.Tests/WaveformTestBeatmap.cs index c5a2f5be51..3e0df8d45e 100644 --- a/osu.Game.Tests/WaveformTestBeatmap.cs +++ b/osu.Game.Tests/WaveformTestBeatmap.cs @@ -32,7 +32,7 @@ namespace osu.Game.Tests protected override void Dispose(bool isDisposing) { - base.Dispose(); + base.Dispose(isDisposing); stream?.Dispose(); reader?.Dispose(); trackStore?.Dispose(); diff --git a/osu.Game/Tests/Visual/OsuTestScene.cs b/osu.Game/Tests/Visual/OsuTestScene.cs index 9f4532513f..9b3c15aa91 100644 --- a/osu.Game/Tests/Visual/OsuTestScene.cs +++ b/osu.Game/Tests/Visual/OsuTestScene.cs @@ -139,7 +139,7 @@ namespace osu.Game.Tests.Visual protected override void Dispose(bool isDisposing) { - base.Dispose(); + base.Dispose(isDisposing); store?.Dispose(); } From ef384b86676510f045b70da9068e222136ed9eb2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 26 Jun 2019 14:08:19 +0900 Subject: [PATCH 05/57] Add simple (weak) WorkingBeatmap cache --- osu.Game/Beatmaps/BeatmapManager.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index d5b19485de..6c7929d193 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -13,6 +13,7 @@ using osu.Framework.Audio; using osu.Framework.Audio.Track; using osu.Framework.Extensions; using osu.Framework.Graphics.Textures; +using osu.Framework.Lists; using osu.Framework.Logging; using osu.Framework.Platform; using osu.Framework.Threading; @@ -157,6 +158,8 @@ namespace osu.Game.Beatmaps /// The beatmap difficulty to restore. public void Restore(BeatmapInfo beatmap) => beatmaps.Restore(beatmap); + private readonly WeakList workingCache = new WeakList(); + /// /// Retrieve a instance for the provided /// @@ -171,12 +174,18 @@ namespace osu.Game.Beatmaps if (beatmapInfo?.BeatmapSet == null || beatmapInfo == DefaultBeatmap?.BeatmapInfo) return DefaultBeatmap; + var cached = workingCache.FirstOrDefault(w => w.BeatmapInfo?.ID == beatmapInfo.ID); + + if (cached != null) + return cached; + if (beatmapInfo.Metadata == null) beatmapInfo.Metadata = beatmapInfo.BeatmapSet.Metadata; WorkingBeatmap working = new BeatmapManagerWorkingBeatmap(Files.Store, new LargeTextureStore(host?.CreateTextureLoaderStore(Files.Store)), beatmapInfo, audioManager); previous?.TransferTo(working); + workingCache.Add(working); return working; } From ab0bb8b678c0d0a34845a40bf7b19cb53009eeeb Mon Sep 17 00:00:00 2001 From: naoey Date: Wed, 12 Jun 2019 01:31:57 +0530 Subject: [PATCH 06/57] Implement replay downloading with ArchiveDownloadModelManager --- .../API/Requests/DownloadReplayRequest.cs | 13 +++++ .../Requests/Responses/APILegacyScoreInfo.cs | 5 +- osu.Game/OsuGameBase.cs | 2 +- osu.Game/Scoring/ScoreInfo.cs | 4 +- osu.Game/Scoring/ScoreManager.cs | 10 ++-- osu.Game/Screens/Play/ReplayDownloadButton.cs | 53 +++++++++++++++++++ osu.Game/Screens/Play/SoloResults.cs | 22 ++++++++ 7 files changed, 103 insertions(+), 6 deletions(-) create mode 100644 osu.Game/Online/API/Requests/DownloadReplayRequest.cs create mode 100644 osu.Game/Screens/Play/ReplayDownloadButton.cs diff --git a/osu.Game/Online/API/Requests/DownloadReplayRequest.cs b/osu.Game/Online/API/Requests/DownloadReplayRequest.cs new file mode 100644 index 0000000000..11747f4f5f --- /dev/null +++ b/osu.Game/Online/API/Requests/DownloadReplayRequest.cs @@ -0,0 +1,13 @@ +using osu.Game.Scoring; +namespace osu.Game.Online.API.Requests +{ + public class DownloadReplayRequest : ArchiveDownloadModelRequest + { + public DownloadReplayRequest(ScoreInfo score) + : base(score) + { + } + + protected override string Target => $@"scores/{Info.Ruleset.ShortName}/{Info.OnlineScoreID}/download"; + } +} diff --git a/osu.Game/Online/API/Requests/Responses/APILegacyScoreInfo.cs b/osu.Game/Online/API/Requests/Responses/APILegacyScoreInfo.cs index 3060300077..5a18cf63f9 100644 --- a/osu.Game/Online/API/Requests/Responses/APILegacyScoreInfo.cs +++ b/osu.Game/Online/API/Requests/Responses/APILegacyScoreInfo.cs @@ -32,12 +32,15 @@ namespace osu.Game.Online.API.Requests.Responses set => User = value; } - [JsonProperty(@"score_id")] + [JsonProperty(@"id")] private long onlineScoreID { set => OnlineScoreID = value; } + [JsonProperty(@"replay")] + public bool Replay { get; set; } + [JsonProperty(@"created_at")] private DateTimeOffset date { diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 3bdf37d769..f589ba8a5a 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -170,7 +170,7 @@ namespace osu.Game dependencies.Cache(FileStore = new FileStore(contextFactory, Host.Storage)); // ordering is important here to ensure foreign keys rules are not broken in ModelStore.Cleanup() - dependencies.Cache(ScoreManager = new ScoreManager(RulesetStore, () => BeatmapManager, Host.Storage, contextFactory, Host)); + dependencies.Cache(ScoreManager = new ScoreManager(RulesetStore, () => BeatmapManager, Host.Storage, API, contextFactory, Host)); dependencies.Cache(BeatmapManager = new BeatmapManager(Host.Storage, contextFactory, RulesetStore, API, Audio, Host, defaultBeatmap)); // this should likely be moved to ArchiveModelManager when another case appers where it is necessary diff --git a/osu.Game/Scoring/ScoreInfo.cs b/osu.Game/Scoring/ScoreInfo.cs index 8bdc30ac94..266725a739 100644 --- a/osu.Game/Scoring/ScoreInfo.cs +++ b/osu.Game/Scoring/ScoreInfo.cs @@ -16,7 +16,7 @@ using osu.Game.Rulesets.Scoring; namespace osu.Game.Scoring { - public class ScoreInfo : IHasFiles, IHasPrimaryKey, ISoftDelete + public class ScoreInfo : IHasFiles, IHasPrimaryKey, ISoftDelete, IEquatable { public int ID { get; set; } @@ -182,5 +182,7 @@ namespace osu.Game.Scoring } public override string ToString() => $"{User} playing {Beatmap}"; + + public bool Equals(ScoreInfo other) => other?.OnlineScoreID == OnlineScoreID; } } diff --git a/osu.Game/Scoring/ScoreManager.cs b/osu.Game/Scoring/ScoreManager.cs index 6b737dc734..6d2ade5ecd 100644 --- a/osu.Game/Scoring/ScoreManager.cs +++ b/osu.Game/Scoring/ScoreManager.cs @@ -11,12 +11,14 @@ using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Database; using osu.Game.IO.Archives; +using osu.Game.Online.API; +using osu.Game.Online.API.Requests; using osu.Game.Rulesets; using osu.Game.Scoring.Legacy; namespace osu.Game.Scoring { - public class ScoreManager : ArchiveModelManager + public class ScoreManager : ArchiveDownloadModelManager { public override string[] HandledExtensions => new[] { ".osr" }; @@ -27,8 +29,8 @@ namespace osu.Game.Scoring private readonly RulesetStore rulesets; private readonly Func beatmaps; - public ScoreManager(RulesetStore rulesets, Func beatmaps, Storage storage, IDatabaseContextFactory contextFactory, IIpcHost importHost = null) - : base(storage, contextFactory, new ScoreStore(contextFactory, storage), importHost) + public ScoreManager(RulesetStore rulesets, Func beatmaps, Storage storage, IAPIProvider api, IDatabaseContextFactory contextFactory, IIpcHost importHost = null) + : base(storage, contextFactory, api, new ScoreStore(contextFactory, storage), importHost) { this.rulesets = rulesets; this.beatmaps = beatmaps; @@ -60,5 +62,7 @@ namespace osu.Game.Scoring public IEnumerable QueryScores(Expression> query) => ModelStore.ConsumableItems.AsNoTracking().Where(query); public ScoreInfo Query(Expression> query) => ModelStore.ConsumableItems.AsNoTracking().FirstOrDefault(query); + + protected override ArchiveDownloadModelRequest CreateDownloadRequest(ScoreInfo score, object[] options) => new DownloadReplayRequest(score); } } diff --git a/osu.Game/Screens/Play/ReplayDownloadButton.cs b/osu.Game/Screens/Play/ReplayDownloadButton.cs new file mode 100644 index 0000000000..14a6f942eb --- /dev/null +++ b/osu.Game/Screens/Play/ReplayDownloadButton.cs @@ -0,0 +1,53 @@ +using osu.Framework.Allocation; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics; +using osu.Game.Graphics.UserInterface; +using osu.Game.Online; +using osu.Game.Scoring; + +namespace osu.Game.Screens.Play +{ + public class ReplayDownloadButton : DownloadTrackingComposite + { + [Resolved] + private OsuGame game { get; set; } + + [Resolved] + private ScoreManager scores { get; set; } + + public ReplayDownloadButton(ScoreInfo score) + : base(score) + { + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + AddInternal(new TwoLayerButton + { + BackgroundColour = colours.Yellow, + Icon = FontAwesome.Solid.PlayCircle, + Text = @"Replay", + HoverColour = colours.YellowDark, + Action = onReplay, + }); + } + + private void onReplay() + { + if (scores.IsAvailableLocally(ModelInfo.Value)) + { + game.PresentScore(ModelInfo.Value); + return; + } + + scores.Download(ModelInfo.Value); + + scores.ItemAdded += (score, _) => + { + if (score.Equals(ModelInfo.Value)) + game.PresentScore(ModelInfo.Value); + }; + } + } +} diff --git a/osu.Game/Screens/Play/SoloResults.cs b/osu.Game/Screens/Play/SoloResults.cs index 2b9aec257c..5c747d2d31 100644 --- a/osu.Game/Screens/Play/SoloResults.cs +++ b/osu.Game/Screens/Play/SoloResults.cs @@ -2,6 +2,8 @@ // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; +using osu.Framework.Allocation; +using osu.Game.Online.API.Requests.Responses; using osu.Game.Scoring; using osu.Game.Screens.Ranking; using osu.Game.Screens.Ranking.Types; @@ -10,11 +12,31 @@ namespace osu.Game.Screens.Play { public class SoloResults : Results { + [Resolved] + ScoreManager scores { get; set; } + public SoloResults(ScoreInfo score) : base(score) { } + [BackgroundDependencyLoader] + private void load() + { + if (scores.IsAvailableLocally(Score) || hasOnlineReplay) + { + AddInternal(new ReplayDownloadButton(Score) + { + Anchor = Framework.Graphics.Anchor.BottomRight, + Origin = Framework.Graphics.Anchor.BottomRight, + Height = 80, + Width = 100, + }); + } + } + + private bool hasOnlineReplay => Score is APILegacyScoreInfo apiScore && apiScore.OnlineScoreID != null && apiScore.Replay; + protected override IEnumerable CreateResultPages() => new IResultPageInfo[] { new ScoreOverviewPageInfo(Score, Beatmap.Value), From 53d6d74537c67512d7afc57746306fcdf6716243 Mon Sep 17 00:00:00 2001 From: naoey Date: Wed, 26 Jun 2019 21:10:21 +0530 Subject: [PATCH 07/57] Update to match upstream changes --- .../Online/API/Requests/DownloadReplayRequest.cs | 6 ++++-- osu.Game/Scoring/ScoreManager.cs | 4 ++-- osu.Game/Screens/Play/ReplayDownloadButton.cs | 14 ++++++++------ 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/osu.Game/Online/API/Requests/DownloadReplayRequest.cs b/osu.Game/Online/API/Requests/DownloadReplayRequest.cs index 11747f4f5f..0eacb4ed7b 100644 --- a/osu.Game/Online/API/Requests/DownloadReplayRequest.cs +++ b/osu.Game/Online/API/Requests/DownloadReplayRequest.cs @@ -1,13 +1,15 @@ using osu.Game.Scoring; namespace osu.Game.Online.API.Requests { - public class DownloadReplayRequest : ArchiveDownloadModelRequest + public class DownloadReplayRequest : ArchiveDownloadRequest { public DownloadReplayRequest(ScoreInfo score) : base(score) { } - protected override string Target => $@"scores/{Info.Ruleset.ShortName}/{Info.OnlineScoreID}/download"; + protected override string FileExtension => ".osr"; + + protected override string Target => $@"scores/{Model.Ruleset.ShortName}/{Model.OnlineScoreID}/download"; } } diff --git a/osu.Game/Scoring/ScoreManager.cs b/osu.Game/Scoring/ScoreManager.cs index 6d2ade5ecd..33be8c41ef 100644 --- a/osu.Game/Scoring/ScoreManager.cs +++ b/osu.Game/Scoring/ScoreManager.cs @@ -18,7 +18,7 @@ using osu.Game.Scoring.Legacy; namespace osu.Game.Scoring { - public class ScoreManager : ArchiveDownloadModelManager + public class ScoreManager : DownloadableArchiveModelManager { public override string[] HandledExtensions => new[] { ".osr" }; @@ -63,6 +63,6 @@ namespace osu.Game.Scoring public ScoreInfo Query(Expression> query) => ModelStore.ConsumableItems.AsNoTracking().FirstOrDefault(query); - protected override ArchiveDownloadModelRequest CreateDownloadRequest(ScoreInfo score, object[] options) => new DownloadReplayRequest(score); + protected override ArchiveDownloadRequest CreateDownloadRequest(ScoreInfo score, bool minimiseDownload) => new DownloadReplayRequest(score); } } diff --git a/osu.Game/Screens/Play/ReplayDownloadButton.cs b/osu.Game/Screens/Play/ReplayDownloadButton.cs index 14a6f942eb..51061e0660 100644 --- a/osu.Game/Screens/Play/ReplayDownloadButton.cs +++ b/osu.Game/Screens/Play/ReplayDownloadButton.cs @@ -35,18 +35,20 @@ namespace osu.Game.Screens.Play private void onReplay() { - if (scores.IsAvailableLocally(ModelInfo.Value)) + if (scores.IsAvailableLocally(Model.Value)) { - game.PresentScore(ModelInfo.Value); + game.PresentScore(Model.Value); return; } - scores.Download(ModelInfo.Value); + scores.Download(Model.Value); - scores.ItemAdded += (score, _) => + scores.ItemAdded += score => { - if (score.Equals(ModelInfo.Value)) - game.PresentScore(ModelInfo.Value); + if (score.Equals(Model.Value)) + // use the newly added score instead of ModelInfo.Score because that won't have the Files property populated + game.PresentScore(score); + //ReplayLoaded?.Invoke(scores.GetScore(score)); }; } } From 01508e68134c45a6380d6a892694957afbc11b73 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 28 Jun 2019 10:34:04 +0200 Subject: [PATCH 08/57] implement HD for CtB --- .../TestSceneDrawableHitObjects.cs | 160 ++++++++++++++++++ .../TestSceneDrawableHitObjectsHidden.cs | 20 +++ .../Mods/CatchModHidden.cs | 35 ++++ .../Objects/CatchHitObject.cs | 4 + .../Drawable/DrawableCatchHitObject.cs | 4 +- 5 files changed, 220 insertions(+), 3 deletions(-) create mode 100644 osu.Game.Rulesets.Catch.Tests/TestSceneDrawableHitObjects.cs create mode 100644 osu.Game.Rulesets.Catch.Tests/TestSceneDrawableHitObjectsHidden.cs diff --git a/osu.Game.Rulesets.Catch.Tests/TestSceneDrawableHitObjects.cs b/osu.Game.Rulesets.Catch.Tests/TestSceneDrawableHitObjects.cs new file mode 100644 index 0000000000..7a9b61c60c --- /dev/null +++ b/osu.Game.Rulesets.Catch.Tests/TestSceneDrawableHitObjects.cs @@ -0,0 +1,160 @@ +// 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 System.Collections.Generic; +using System.Linq; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Beatmaps; +using osu.Game.Beatmaps.ControlPoints; +using osu.Game.Rulesets.Catch.Objects; +using osu.Game.Rulesets.Catch.Objects.Drawable; +using osu.Game.Rulesets.Catch.UI; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Objects.Types; +using osu.Game.Tests.Visual; +using osuTK; + +namespace osu.Game.Rulesets.Catch.Tests +{ + public class TestSceneDrawableHitObjects : OsuTestScene + { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(CatcherArea.Catcher), + typeof(DrawableCatchRuleset), + typeof(DrawableFruit), + typeof(DrawableJuiceStream), + typeof(DrawableBanana) + }; + + private DrawableCatchRuleset drawableRuleset; + private double playfieldTime => drawableRuleset.Playfield.Time.Current; + + [BackgroundDependencyLoader] + private void load() + { + var controlPointInfo = new ControlPointInfo(); + controlPointInfo.TimingPoints.Add(new TimingControlPoint()); + + WorkingBeatmap beatmap = CreateWorkingBeatmap(new Beatmap + { + HitObjects = new List { new Fruit() }, + BeatmapInfo = new BeatmapInfo + { + BaseDifficulty = new BeatmapDifficulty(), + Metadata = new BeatmapMetadata + { + Artist = @"Unknown", + Title = @"You're breathtaking", + AuthorString = @"Everyone", + }, + Ruleset = new CatchRuleset().RulesetInfo + }, + ControlPointInfo = controlPointInfo + }); + + Add(new Container + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Children = new[] + { + drawableRuleset = new DrawableCatchRuleset(new CatchRuleset(), beatmap, Array.Empty()) + } + }); + + AddStep("miss fruits", () => spawnFruits()); + AddStep("hit fruits", () => spawnFruits(true)); + AddStep("miss juicestream", () => spawnJuiceStream()); + AddStep("hit juicestream", () => spawnJuiceStream(true)); + AddStep("miss bananas", () => spawnBananas()); + AddStep("hit bananas", () => spawnBananas(true)); + } + + private void spawnFruits(bool hit = false) + { + for (int i = 1; i <= 4; i++) + { + var fruit = new Fruit + { + X = getXCoords(hit), + LastInCombo = i % 4 == 0, + StartTime = playfieldTime + 800 + (200 * i) + }; + + fruit.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); + + addToPlayfield(new DrawableFruit(fruit)); + } + } + + private void spawnJuiceStream(bool hit = false) + { + var xCoords = getXCoords(hit); + + var juice = new JuiceStream + { + X = xCoords, + StartTime = playfieldTime + 1000, + Path = new SliderPath(PathType.Linear, new[] + { + Vector2.Zero, + new Vector2(0, 200) + }) + }; + + juice.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); + + if (juice.NestedHitObjects.Last() is CatchHitObject tail) + tail.LastInCombo = true; // usually the (Catch)BeatmapProcessor would do this for us when necessary + + addToPlayfield(new DrawableJuiceStream(juice, drawableRuleset.CreateDrawableRepresentation)); + } + + private void spawnBananas(bool hit = false) + { + for (int i = 1; i <= 4; i++) + { + var banana = new Banana + { + X = getXCoords(hit), + LastInCombo = i % 4 == 0, + StartTime = playfieldTime + 800 + (200 * i) + }; + + banana.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); + + addToPlayfield(new DrawableBanana(banana)); + } + } + + private float getXCoords(bool hit) + { + const float x_offset = 0.2f; + float xCoords = drawableRuleset.Playfield.Width / 2; + + if (drawableRuleset.Playfield is CatchPlayfield catchPlayfield) + catchPlayfield.CatcherArea.MovableCatcher.X = xCoords - x_offset; + + if (hit) + xCoords -= x_offset; + else + xCoords += x_offset; + + return xCoords; + } + + private void addToPlayfield(DrawableCatchHitObject drawable) + { + foreach (var mod in Mods.Value.OfType()) + mod.ApplyToDrawableHitObjects(new[] { drawable }); + + drawableRuleset.Playfield.Add(drawable); + } + } +} diff --git a/osu.Game.Rulesets.Catch.Tests/TestSceneDrawableHitObjectsHidden.cs b/osu.Game.Rulesets.Catch.Tests/TestSceneDrawableHitObjectsHidden.cs new file mode 100644 index 0000000000..f6d26addaa --- /dev/null +++ b/osu.Game.Rulesets.Catch.Tests/TestSceneDrawableHitObjectsHidden.cs @@ -0,0 +1,20 @@ +// 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 System.Collections.Generic; +using System.Linq; +using osu.Game.Rulesets.Catch.Mods; + +namespace osu.Game.Rulesets.Catch.Tests +{ + public class TestSceneDrawableHitObjectsHidden : TestSceneDrawableHitObjects + { + public override IReadOnlyList RequiredTypes => base.RequiredTypes.Concat(new[] { typeof(CatchModHidden) }).ToList(); + + public TestSceneDrawableHitObjectsHidden() + { + Mods.Value = new[] { new CatchModHidden() }; + } + } +} diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModHidden.cs b/osu.Game.Rulesets.Catch/Mods/CatchModHidden.cs index 9990b01427..606a935229 100644 --- a/osu.Game.Rulesets.Catch/Mods/CatchModHidden.cs +++ b/osu.Game.Rulesets.Catch/Mods/CatchModHidden.cs @@ -1,7 +1,11 @@ // 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 osu.Framework.Graphics; +using osu.Game.Rulesets.Catch.Objects.Drawable; using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Objects.Drawables; namespace osu.Game.Rulesets.Catch.Mods { @@ -9,5 +13,36 @@ namespace osu.Game.Rulesets.Catch.Mods { public override string Description => @"Play with fading fruits."; public override double ScoreMultiplier => 1.06; + + private const double fade_out_offset_multiplier = 0.6; + private const double fade_out_duration_multiplier = 0.44; + + protected override void ApplyHiddenState(DrawableHitObject drawable, ArmedState state) + { + if (!(drawable is DrawableCatchHitObject catchDrawable)) + return; + + if (catchDrawable.NestedHitObjects.Any()) + { + foreach (var nestedDrawable in catchDrawable.NestedHitObjects) + { + if (nestedDrawable is DrawableCatchHitObject nestedCatchDrawable) + fadeOutHitObject(nestedCatchDrawable); + } + } + else + fadeOutHitObject(catchDrawable); + } + + private void fadeOutHitObject(DrawableCatchHitObject drawable) + { + var hitObject = drawable.HitObject; + + var offset = hitObject.TimePreempt * fade_out_offset_multiplier; + var duration = offset - hitObject.TimePreempt * fade_out_duration_multiplier; + + using (drawable.BeginAbsoluteSequence(hitObject.StartTime - offset, true)) + drawable.FadeOut(duration); + } } } diff --git a/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs index 2153b8dc85..be76edc01b 100644 --- a/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs @@ -14,6 +14,8 @@ namespace osu.Game.Rulesets.Catch.Objects public float X { get; set; } + public double TimePreempt = 1000; + public int IndexInBeatmap { get; set; } public virtual FruitVisualRepresentation VisualRepresentation => (FruitVisualRepresentation)(ComboIndex % 4); @@ -54,6 +56,8 @@ namespace osu.Game.Rulesets.Catch.Objects { base.ApplyDefaultsToSelf(controlPointInfo, difficulty); + TimePreempt = (float)BeatmapDifficulty.DifficultyRange(difficulty.ApproachRate, 1800, 1200, 450); + Scale = 1.0f - 0.7f * (difficulty.CircleSize - 5) / 5; } diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs index 2f8ccec48b..5785d9a9ca 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs @@ -68,11 +68,9 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable AccentColour = skin.GetValue(s => s.ComboColours.Count > 0 ? s.ComboColours[combo.ComboIndex % s.ComboColours.Count] : (Color4?)null) ?? Color4.White; } - private const float preempt = 1000; - protected override void UpdateState(ArmedState state) { - using (BeginAbsoluteSequence(HitObject.StartTime - preempt)) + using (BeginAbsoluteSequence(HitObject.StartTime - HitObject.TimePreempt)) this.FadeIn(200); var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime; From bc52f765567a4954d116c140368a09f25b7cd149 Mon Sep 17 00:00:00 2001 From: naoey Date: Sat, 29 Jun 2019 10:55:30 +0530 Subject: [PATCH 09/57] Move replay button to score card --- .../Gameplay/TestSceneReplayDownloadButton.cs | 49 ++++++ osu.Game/Online/DownloadTrackingComposite.cs | 9 + osu.Game/Scoring/ScoreManager.cs | 2 + osu.Game/Screens/Play/ReplayDownloadButton.cs | 154 ++++++++++++++---- osu.Game/Screens/Play/SoloResults.cs | 17 -- .../Screens/Ranking/Pages/ScoreResultsPage.cs | 15 +- 6 files changed, 195 insertions(+), 51 deletions(-) create mode 100644 osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs new file mode 100644 index 0000000000..205d869efe --- /dev/null +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs @@ -0,0 +1,49 @@ +using NUnit.Framework; +using osu.Framework.Graphics; +using osu.Game.Online.API.Requests.Responses; +using osu.Game.Rulesets.Osu; +using osu.Game.Scoring; +using osu.Game.Screens.Play; +using osu.Game.Users; +using osuTK; +using System; +using System.Collections.Generic; + +namespace osu.Game.Tests.Visual.Gameplay +{ + [TestFixture] + public class TestSceneReplayDownloadButton : OsuTestScene + { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(ReplayDownloadButton) + }; + + private ReplayDownloadButton downloadButton; + + public TestSceneReplayDownloadButton() + { + Add(new ReplayDownloadButton(getScoreInfo()) + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }); + } + + private ScoreInfo getScoreInfo() + { + return new APILegacyScoreInfo + { + ID = 1, + OnlineScoreID = 2553163309, + Ruleset = new OsuRuleset().RulesetInfo, + Replay = true, + User = new User + { + Id = 39828, + Username = @"WubWoofWolf", + } + }; + } + } +} diff --git a/osu.Game/Online/DownloadTrackingComposite.cs b/osu.Game/Online/DownloadTrackingComposite.cs index 5eb2bb74bb..f0375335da 100644 --- a/osu.Game/Online/DownloadTrackingComposite.cs +++ b/osu.Game/Online/DownloadTrackingComposite.cs @@ -54,6 +54,12 @@ namespace osu.Game.Online attachDownload(download); }; + manager.DownloadFailed += download => + { + if (download.Model.Equals(Model.Value)) + attachDownload(null); + }; + manager.ItemAdded += itemAdded; manager.ItemRemoved += itemRemoved; } @@ -109,6 +115,9 @@ namespace osu.Game.Online if (!s.Equals(Model.Value)) return; + // when model states are being updated from manager, update the model being held by us also so that it will + // be up do date when being consumed for reading files etc. + Model.Value = s; State.Value = state; }); diff --git a/osu.Game/Scoring/ScoreManager.cs b/osu.Game/Scoring/ScoreManager.cs index 33be8c41ef..2d82987da0 100644 --- a/osu.Game/Scoring/ScoreManager.cs +++ b/osu.Game/Scoring/ScoreManager.cs @@ -64,5 +64,7 @@ namespace osu.Game.Scoring public ScoreInfo Query(Expression> query) => ModelStore.ConsumableItems.AsNoTracking().FirstOrDefault(query); protected override ArchiveDownloadRequest CreateDownloadRequest(ScoreInfo score, bool minimiseDownload) => new DownloadReplayRequest(score); + + protected override bool CheckLocalAvailability(ScoreInfo model, IQueryable items) => items.Any(s => s.OnlineScoreID == model.OnlineScoreID); } } diff --git a/osu.Game/Screens/Play/ReplayDownloadButton.cs b/osu.Game/Screens/Play/ReplayDownloadButton.cs index 51061e0660..f56246e615 100644 --- a/osu.Game/Screens/Play/ReplayDownloadButton.cs +++ b/osu.Game/Screens/Play/ReplayDownloadButton.cs @@ -1,55 +1,147 @@ using osu.Framework.Allocation; -using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Cursor; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics; using osu.Game.Graphics; -using osu.Game.Graphics.UserInterface; +using osu.Game.Graphics.Containers; using osu.Game.Online; using osu.Game.Scoring; +using osuTK; +using osu.Framework.Graphics.Sprites; +using osu.Game.Online.API.Requests.Responses; +using osu.Framework.Graphics.Effects; +using osuTK.Graphics; +using osu.Framework.Extensions.Color4Extensions; namespace osu.Game.Screens.Play { - public class ReplayDownloadButton : DownloadTrackingComposite + public class ReplayDownloadButton : DownloadTrackingComposite, IHasTooltip { - [Resolved] + private const int size = 40; + + [Resolved(canBeNull: true)] private OsuGame game { get; set; } [Resolved] private ScoreManager scores { get; set; } + [Resolved] + private OsuColour colours { get; set; } + + private OsuClickableContainer button; + private SpriteIcon downloadIcon; + private SpriteIcon playIcon; + private ShakeContainer shakeContainer; + + public string TooltipText + { + get + { + if (scores.IsAvailableLocally(Model.Value)) + return @"Watch replay"; + + if (Model.Value is APILegacyScoreInfo apiScore && apiScore.Replay) + return @"Download replay"; + + return @"Replay unavailable"; + } + } + public ReplayDownloadButton(ScoreInfo score) : base(score) { + Size = new Vector2(size); + CornerRadius = size / 2; + Masking = true; } - [BackgroundDependencyLoader] - private void load(OsuColour colours) + private bool hasReplay => (Model.Value is APILegacyScoreInfo apiScore && apiScore.Replay) || scores.IsAvailableLocally(Model.Value); + + [BackgroundDependencyLoader(true)] + private void load() { - AddInternal(new TwoLayerButton + EdgeEffect = new EdgeEffectParameters { - BackgroundColour = colours.Yellow, - Icon = FontAwesome.Solid.PlayCircle, - Text = @"Replay", - HoverColour = colours.YellowDark, - Action = onReplay, - }); - } - - private void onReplay() - { - if (scores.IsAvailableLocally(Model.Value)) - { - game.PresentScore(Model.Value); - return; - } - - scores.Download(Model.Value); - - scores.ItemAdded += score => - { - if (score.Equals(Model.Value)) - // use the newly added score instead of ModelInfo.Score because that won't have the Files property populated - game.PresentScore(score); - //ReplayLoaded?.Invoke(scores.GetScore(score)); + Colour = Color4.Black.Opacity(0.4f), + Type = EdgeEffectType.Shadow, + Radius = 5, }; + + InternalChild = shakeContainer = new ShakeContainer + { + RelativeSizeAxes = Axes.Both, + Child = button = new OsuClickableContainer + { + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = colours.GrayF, + }, + playIcon = new SpriteIcon + { + Icon = FontAwesome.Solid.Play, + Size = Vector2.Zero, + Colour = colours.Gray3, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }, + downloadIcon = new SpriteIcon + { + Icon = FontAwesome.Solid.FileDownload, + Size = Vector2.Zero, + Colour = colours.Gray3, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }, + }, + } + }; + + button.Action = () => + { + switch (State.Value) + { + case DownloadState.LocallyAvailable: + game.PresentScore(Model.Value); + break; + + case DownloadState.NotDownloaded: + scores.Download(Model.Value); + break; + + case DownloadState.Downloading: + shakeContainer.Shake(); + break; + } + }; + + State.BindValueChanged(state => + { + switch (state.NewValue) + { + case DownloadState.Downloading: + FadeEdgeEffectTo(colours.Yellow, 400, Easing.OutQuint); + button.Enabled.Value = false; + break; + + case DownloadState.LocallyAvailable: + playIcon.ResizeTo(13, 300, Easing.OutQuint); + downloadIcon.ResizeTo(Vector2.Zero, 300, Easing.OutExpo); + FadeEdgeEffectTo(Color4.Black.Opacity(0.4f), 400, Easing.OutQuint); + button.Enabled.Value = true; + break; + + case DownloadState.NotDownloaded: + playIcon.ResizeTo(Vector2.Zero, 300, Easing.OutQuint); + downloadIcon.ResizeTo(13, 300, Easing.OutExpo); + FadeEdgeEffectTo(Color4.Black.Opacity(0.4f), 400, Easing.OutQuint); + button.Enabled.Value = true; + break; + } + }, true); } } } diff --git a/osu.Game/Screens/Play/SoloResults.cs b/osu.Game/Screens/Play/SoloResults.cs index 5c747d2d31..e8f4a7e182 100644 --- a/osu.Game/Screens/Play/SoloResults.cs +++ b/osu.Game/Screens/Play/SoloResults.cs @@ -20,23 +20,6 @@ namespace osu.Game.Screens.Play { } - [BackgroundDependencyLoader] - private void load() - { - if (scores.IsAvailableLocally(Score) || hasOnlineReplay) - { - AddInternal(new ReplayDownloadButton(Score) - { - Anchor = Framework.Graphics.Anchor.BottomRight, - Origin = Framework.Graphics.Anchor.BottomRight, - Height = 80, - Width = 100, - }); - } - } - - private bool hasOnlineReplay => Score is APILegacyScoreInfo apiScore && apiScore.OnlineScoreID != null && apiScore.Replay; - protected override IEnumerable CreateResultPages() => new IResultPageInfo[] { new ScoreOverviewPageInfo(Score, Beatmap.Value), diff --git a/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs b/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs index a82156e34e..3068fd77e8 100644 --- a/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs +++ b/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs @@ -33,9 +33,12 @@ namespace osu.Game.Screens.Ranking.Pages private Container scoreContainer; private ScoreCounter scoreCounter; + private readonly ScoreInfo score; + public ScoreResultsPage(ScoreInfo score, WorkingBeatmap beatmap) : base(score, beatmap) { + this.score = score; } private FillFlowContainer statisticsContainer; @@ -163,9 +166,15 @@ namespace osu.Game.Screens.Ranking.Pages Direction = FillDirection.Horizontal, LayoutDuration = 200, LayoutEasing = Easing.OutQuint - } - } - } + }, + }, + }, + new ReplayDownloadButton(score) + { + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + Margin = new MarginPadding { Bottom = 10 }, + }, }; statisticsContainer.ChildrenEnumerable = Score.Statistics.OrderByDescending(p => p.Key).Select(s => new DrawableScoreStatistic(s)); From f9316bc038f8e68d030cc3bf0af7654a945bc407 Mon Sep 17 00:00:00 2001 From: naoey Date: Sat, 29 Jun 2019 11:09:39 +0530 Subject: [PATCH 10/57] Hack fix for models not updating correctly when added in DB --- osu.Game/Online/DownloadTrackingComposite.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Online/DownloadTrackingComposite.cs b/osu.Game/Online/DownloadTrackingComposite.cs index f0375335da..3d230c5475 100644 --- a/osu.Game/Online/DownloadTrackingComposite.cs +++ b/osu.Game/Online/DownloadTrackingComposite.cs @@ -117,6 +117,8 @@ namespace osu.Game.Online // when model states are being updated from manager, update the model being held by us also so that it will // be up do date when being consumed for reading files etc. + // the value -> null -> value change is to force the bindable to update the value instance + Model.Value = null; Model.Value = s; State.Value = state; }); From 424711d24be8ef4d0fa7175e659079178bc51847 Mon Sep 17 00:00:00 2001 From: naoey Date: Sat, 29 Jun 2019 12:26:37 +0530 Subject: [PATCH 11/57] Fix replay button shake container - Add license headers - Slightly reduce bottom margin of button in score screen --- .../Gameplay/TestSceneReplayDownloadButton.cs | 27 +++++- osu.Game/Screens/Play/ReplayDownloadButton.cs | 92 ++++++++++--------- .../Screens/Ranking/Pages/ScoreResultsPage.cs | 2 +- 3 files changed, 73 insertions(+), 48 deletions(-) diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs index 205d869efe..9c87d4cd79 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs @@ -1,5 +1,9 @@ -using NUnit.Framework; +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using NUnit.Framework; using osu.Framework.Graphics; +using osu.Game.Online; using osu.Game.Online.API.Requests.Responses; using osu.Game.Rulesets.Osu; using osu.Game.Scoring; @@ -19,11 +23,19 @@ namespace osu.Game.Tests.Visual.Gameplay typeof(ReplayDownloadButton) }; - private ReplayDownloadButton downloadButton; + private TestReplayDownloadButton downloadButton; public TestSceneReplayDownloadButton() { - Add(new ReplayDownloadButton(getScoreInfo()) + createButton(); + AddStep(@"downloading state", () => downloadButton.SetDownloadState(DownloadState.Downloading)); + AddStep(@"locally available state", () => downloadButton.SetDownloadState(DownloadState.LocallyAvailable)); + AddStep(@"not downloaded state", () => downloadButton.SetDownloadState(DownloadState.NotDownloaded)); + } + + private void createButton() + { + AddStep(@"create button", () => Child = downloadButton = new TestReplayDownloadButton(getScoreInfo()) { Anchor = Anchor.Centre, Origin = Anchor.Centre, @@ -45,5 +57,14 @@ namespace osu.Game.Tests.Visual.Gameplay } }; } + + private class TestReplayDownloadButton : ReplayDownloadButton + { + public void SetDownloadState(DownloadState state) => State.Value = state; + + public TestReplayDownloadButton(ScoreInfo score) : base(score) + { + } + } } } diff --git a/osu.Game/Screens/Play/ReplayDownloadButton.cs b/osu.Game/Screens/Play/ReplayDownloadButton.cs index f56246e615..0d6a159523 100644 --- a/osu.Game/Screens/Play/ReplayDownloadButton.cs +++ b/osu.Game/Screens/Play/ReplayDownloadButton.cs @@ -1,4 +1,7 @@ -using osu.Framework.Allocation; +// 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.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics; @@ -12,6 +15,7 @@ using osu.Game.Online.API.Requests.Responses; using osu.Framework.Graphics.Effects; using osuTK.Graphics; using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics.Containers; namespace osu.Game.Screens.Play { @@ -32,6 +36,7 @@ namespace osu.Game.Screens.Play private SpriteIcon downloadIcon; private SpriteIcon playIcon; private ShakeContainer shakeContainer; + private CircularContainer circle; public string TooltipText { @@ -50,9 +55,7 @@ namespace osu.Game.Screens.Play public ReplayDownloadButton(ScoreInfo score) : base(score) { - Size = new Vector2(size); - CornerRadius = size / 2; - Masking = true; + AutoSizeAxes = Axes.Both; } private bool hasReplay => (Model.Value is APILegacyScoreInfo apiScore && apiScore.Replay) || scores.IsAvailableLocally(Model.Value); @@ -60,44 +63,48 @@ namespace osu.Game.Screens.Play [BackgroundDependencyLoader(true)] private void load() { - EdgeEffect = new EdgeEffectParameters - { - Colour = Color4.Black.Opacity(0.4f), - Type = EdgeEffectType.Shadow, - Radius = 5, - }; - InternalChild = shakeContainer = new ShakeContainer { - RelativeSizeAxes = Axes.Both, - Child = button = new OsuClickableContainer + AutoSizeAxes = Axes.Both, + Child = circle = new CircularContainer { - RelativeSizeAxes = Axes.Both, - Children = new Drawable[] + Masking = true, + Size = new Vector2(size), + EdgeEffect = new EdgeEffectParameters { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = colours.GrayF, - }, - playIcon = new SpriteIcon - { - Icon = FontAwesome.Solid.Play, - Size = Vector2.Zero, - Colour = colours.Gray3, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - }, - downloadIcon = new SpriteIcon - { - Icon = FontAwesome.Solid.FileDownload, - Size = Vector2.Zero, - Colour = colours.Gray3, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - }, + Colour = Color4.Black.Opacity(0.4f), + Type = EdgeEffectType.Shadow, + Radius = 5, }, - } + Child = button = new OsuClickableContainer + { + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = colours.GrayF, + }, + playIcon = new SpriteIcon + { + Icon = FontAwesome.Solid.Play, + Size = Vector2.Zero, + Colour = colours.Gray3, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }, + downloadIcon = new SpriteIcon + { + Icon = FontAwesome.Solid.FileDownload, + Size = Vector2.Zero, + Colour = colours.Gray3, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }, + }, + } + }, }; button.Action = () => @@ -105,7 +112,7 @@ namespace osu.Game.Screens.Play switch (State.Value) { case DownloadState.LocallyAvailable: - game.PresentScore(Model.Value); + game?.PresentScore(Model.Value); break; case DownloadState.NotDownloaded: @@ -123,22 +130,19 @@ namespace osu.Game.Screens.Play switch (state.NewValue) { case DownloadState.Downloading: - FadeEdgeEffectTo(colours.Yellow, 400, Easing.OutQuint); - button.Enabled.Value = false; + circle.FadeEdgeEffectTo(colours.Yellow, 400, Easing.OutQuint); break; case DownloadState.LocallyAvailable: playIcon.ResizeTo(13, 300, Easing.OutQuint); downloadIcon.ResizeTo(Vector2.Zero, 300, Easing.OutExpo); - FadeEdgeEffectTo(Color4.Black.Opacity(0.4f), 400, Easing.OutQuint); - button.Enabled.Value = true; + circle.FadeEdgeEffectTo(Color4.Black.Opacity(0.4f), 400, Easing.OutQuint); break; case DownloadState.NotDownloaded: playIcon.ResizeTo(Vector2.Zero, 300, Easing.OutQuint); downloadIcon.ResizeTo(13, 300, Easing.OutExpo); - FadeEdgeEffectTo(Color4.Black.Opacity(0.4f), 400, Easing.OutQuint); - button.Enabled.Value = true; + circle.FadeEdgeEffectTo(Color4.Black.Opacity(0.4f), 400, Easing.OutQuint); break; } }, true); diff --git a/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs b/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs index 3068fd77e8..676c1e3adf 100644 --- a/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs +++ b/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs @@ -173,7 +173,7 @@ namespace osu.Game.Screens.Ranking.Pages { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, - Margin = new MarginPadding { Bottom = 10 }, + Margin = new MarginPadding { Bottom = 5 }, }, }; From 7d9e21574477ab4fb4818fa66a82841dbe6a6563 Mon Sep 17 00:00:00 2001 From: naoey Date: Sat, 29 Jun 2019 12:29:12 +0530 Subject: [PATCH 12/57] Code quality fixes --- .../Visual/Gameplay/TestSceneReplayDownloadButton.cs | 4 ++-- osu.Game/Online/API/Requests/DownloadReplayRequest.cs | 6 +++++- osu.Game/Screens/Play/SoloResults.cs | 5 ----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs index 9c87d4cd79..0be848f1d5 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs @@ -9,7 +9,6 @@ using osu.Game.Rulesets.Osu; using osu.Game.Scoring; using osu.Game.Screens.Play; using osu.Game.Users; -using osuTK; using System; using System.Collections.Generic; @@ -62,7 +61,8 @@ namespace osu.Game.Tests.Visual.Gameplay { public void SetDownloadState(DownloadState state) => State.Value = state; - public TestReplayDownloadButton(ScoreInfo score) : base(score) + public TestReplayDownloadButton(ScoreInfo score) + : base(score) { } } diff --git a/osu.Game/Online/API/Requests/DownloadReplayRequest.cs b/osu.Game/Online/API/Requests/DownloadReplayRequest.cs index 0eacb4ed7b..6fd052653d 100644 --- a/osu.Game/Online/API/Requests/DownloadReplayRequest.cs +++ b/osu.Game/Online/API/Requests/DownloadReplayRequest.cs @@ -1,4 +1,8 @@ -using osu.Game.Scoring; +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Game.Scoring; + namespace osu.Game.Online.API.Requests { public class DownloadReplayRequest : ArchiveDownloadRequest diff --git a/osu.Game/Screens/Play/SoloResults.cs b/osu.Game/Screens/Play/SoloResults.cs index e8f4a7e182..2b9aec257c 100644 --- a/osu.Game/Screens/Play/SoloResults.cs +++ b/osu.Game/Screens/Play/SoloResults.cs @@ -2,8 +2,6 @@ // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; -using osu.Framework.Allocation; -using osu.Game.Online.API.Requests.Responses; using osu.Game.Scoring; using osu.Game.Screens.Ranking; using osu.Game.Screens.Ranking.Types; @@ -12,9 +10,6 @@ namespace osu.Game.Screens.Play { public class SoloResults : Results { - [Resolved] - ScoreManager scores { get; set; } - public SoloResults(ScoreInfo score) : base(score) { From d8f6bbc90e2648f6059b8cb9790d16390ff993e4 Mon Sep 17 00:00:00 2001 From: naoey Date: Sat, 29 Jun 2019 12:49:03 +0530 Subject: [PATCH 13/57] Disable replay button when replay is unavailable --- .../Gameplay/TestSceneReplayDownloadButton.cs | 18 +++++---- osu.Game/Screens/Play/ReplayDownloadButton.cs | 40 +++++++++++++++---- 2 files changed, 44 insertions(+), 14 deletions(-) diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs index 0be848f1d5..e71b2d596e 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs @@ -26,29 +26,33 @@ namespace osu.Game.Tests.Visual.Gameplay public TestSceneReplayDownloadButton() { - createButton(); + createButton(true); AddStep(@"downloading state", () => downloadButton.SetDownloadState(DownloadState.Downloading)); AddStep(@"locally available state", () => downloadButton.SetDownloadState(DownloadState.LocallyAvailable)); AddStep(@"not downloaded state", () => downloadButton.SetDownloadState(DownloadState.NotDownloaded)); + createButton(false); } - private void createButton() + private void createButton(bool withReplay) { - AddStep(@"create button", () => Child = downloadButton = new TestReplayDownloadButton(getScoreInfo()) + AddStep(withReplay ? @"create button with replay" : "create button without replay", () => { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, + Child = downloadButton = new TestReplayDownloadButton(getScoreInfo(withReplay)) + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }; }); } - private ScoreInfo getScoreInfo() + private ScoreInfo getScoreInfo(bool replayAvailable) { return new APILegacyScoreInfo { ID = 1, OnlineScoreID = 2553163309, Ruleset = new OsuRuleset().RulesetInfo, - Replay = true, + Replay = replayAvailable, User = new User { Id = 39828, diff --git a/osu.Game/Screens/Play/ReplayDownloadButton.cs b/osu.Game/Screens/Play/ReplayDownloadButton.cs index 0d6a159523..d6ded27cdf 100644 --- a/osu.Game/Screens/Play/ReplayDownloadButton.cs +++ b/osu.Game/Screens/Play/ReplayDownloadButton.cs @@ -42,13 +42,17 @@ namespace osu.Game.Screens.Play { get { - if (scores.IsAvailableLocally(Model.Value)) - return @"Watch replay"; + switch (getReplayAvailability()) + { + case ReplayAvailability.Local: + return @"Watch replay"; - if (Model.Value is APILegacyScoreInfo apiScore && apiScore.Replay) - return @"Download replay"; + case ReplayAvailability.Online: + return @"Download replay"; - return @"Replay unavailable"; + default: + return @"Replay unavailable"; + } } } @@ -58,8 +62,6 @@ namespace osu.Game.Screens.Play AutoSizeAxes = Axes.Both; } - private bool hasReplay => (Model.Value is APILegacyScoreInfo apiScore && apiScore.Replay) || scores.IsAvailableLocally(Model.Value); - [BackgroundDependencyLoader(true)] private void load() { @@ -146,6 +148,30 @@ namespace osu.Game.Screens.Play break; } }, true); + + if (getReplayAvailability() == ReplayAvailability.NotAvailable) + { + button.Enabled.Value = false; + button.Alpha = 0.6f; + } + } + + private ReplayAvailability getReplayAvailability() + { + if (scores.IsAvailableLocally(Model.Value)) + return ReplayAvailability.Local; + + if (Model.Value is APILegacyScoreInfo apiScore && apiScore.Replay) + return ReplayAvailability.Online; + + return ReplayAvailability.NotAvailable; + } + + private enum ReplayAvailability + { + Local, + Online, + NotAvailable, } } } From 6c81d5717849b41fa1f50dcb6c793659246378c6 Mon Sep 17 00:00:00 2001 From: naoey Date: Sat, 29 Jun 2019 16:08:48 +0530 Subject: [PATCH 14/57] Remove hacks for updating model info - Re-retrieve score from database when presenting scores --- osu.Game/Online/DownloadTrackingComposite.cs | 5 ----- osu.Game/OsuGame.cs | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/osu.Game/Online/DownloadTrackingComposite.cs b/osu.Game/Online/DownloadTrackingComposite.cs index 3d230c5475..786afdf450 100644 --- a/osu.Game/Online/DownloadTrackingComposite.cs +++ b/osu.Game/Online/DownloadTrackingComposite.cs @@ -115,11 +115,6 @@ namespace osu.Game.Online if (!s.Equals(Model.Value)) return; - // when model states are being updated from manager, update the model being held by us also so that it will - // be up do date when being consumed for reading files etc. - // the value -> null -> value change is to force the bindable to update the value instance - Model.Value = null; - Model.Value = s; State.Value = state; }); diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index f7f2e1b451..0d1fc704f1 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -261,8 +261,8 @@ namespace osu.Game /// public void PresentScore(ScoreInfo score) { - var databasedScore = ScoreManager.GetScore(score); - var databasedScoreInfo = databasedScore.ScoreInfo; + var databasedScoreInfo = ScoreManager.Query(s => s.OnlineScoreID == score.OnlineScoreID); + var databasedScore = ScoreManager.GetScore(databasedScoreInfo); if (databasedScore.Replay == null) { From 04c467fd812153d9733fcb2a4ca0c63e60af3daa Mon Sep 17 00:00:00 2001 From: naoey Date: Sat, 29 Jun 2019 16:10:16 +0530 Subject: [PATCH 15/57] Add comment --- osu.Game/OsuGame.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 0d1fc704f1..12291c430e 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -261,6 +261,8 @@ namespace osu.Game /// public void PresentScore(ScoreInfo score) { + // The given ScoreInfo may have missing properties if it was retrieved from online data. Re-retrieve it from the database + // to ensure all the required data for presenting a replay are present. var databasedScoreInfo = ScoreManager.Query(s => s.OnlineScoreID == score.OnlineScoreID); var databasedScore = ScoreManager.GetScore(databasedScoreInfo); From 8c5397709b242150f3fc7a2d020420bc86e81902 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Sun, 30 Jun 2019 04:20:42 +0300 Subject: [PATCH 16/57] Use drawables instead of textures --- osu.Game/Online/Leaderboards/DrawableRank.cs | 113 ++++++++++++++++--- 1 file changed, 99 insertions(+), 14 deletions(-) diff --git a/osu.Game/Online/Leaderboards/DrawableRank.cs b/osu.Game/Online/Leaderboards/DrawableRank.cs index 9bbaa28e2a..a944356681 100644 --- a/osu.Game/Online/Leaderboards/DrawableRank.cs +++ b/osu.Game/Online/Leaderboards/DrawableRank.cs @@ -3,43 +3,128 @@ using osu.Framework.Allocation; using osu.Framework.Extensions; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.Textures; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Colour; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics; +using osu.Game.Graphics.Backgrounds; +using osu.Game.Graphics.Sprites; using osu.Game.Scoring; -using System; +using osuTK; +using osuTK.Graphics; namespace osu.Game.Online.Leaderboards { - public class DrawableRank : Sprite + public class DrawableRank : CompositeDrawable { private readonly ScoreRank rank; + private readonly Box background; + private readonly Triangles triangles; + private readonly OsuSpriteText name; + public DrawableRank(ScoreRank rank) { this.rank = rank; + + RelativeSizeAxes = Axes.Both; + FillMode = FillMode.Fit; + FillAspectRatio = 2; + + InternalChild = new DrawSizePreservingFillContainer + { + TargetDrawSize = new Vector2(64, 32), + Strategy = DrawSizePreservationStrategy.Minimum, + Child = new CircularContainer + { + Masking = true, + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + background = new Box + { + RelativeSizeAxes = Axes.Both, + }, + triangles = new Triangles + { + RelativeSizeAxes = Axes.Both, + TriangleScale = 1.25f, + Velocity = 0.5f, + }, + name = new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Padding = new MarginPadding { Top = 5 }, + Font = OsuFont.GetFont(Typeface.Venera, 25), + Text = getRankName(), + }, + } + } + }; } - [BackgroundDependencyLoader(true)] - private void load(TextureStore ts) + [BackgroundDependencyLoader] + private void load(OsuColour colours) { - if (ts == null) - throw new ArgumentNullException(nameof(ts)); + var rankColour = getRankColour(colours); + background.Colour = rankColour; + triangles.ColourDark = rankColour.Darken(0.3f); + triangles.ColourLight = rankColour.Lighten(0.1f); - Texture = ts.Get($@"Grades/{getTextureName()}"); + name.Colour = getRankNameColour(colours); } - private string getTextureName() + private string getRankName() => rank.GetDescription().TrimEnd('+'); + + /// + /// Retrieves the grade background colour. + /// + private Color4 getRankColour(OsuColour colours) { switch (rank) { - default: - return rank.GetDescription(); + case ScoreRank.XH: + case ScoreRank.X: + return colours.PinkDarker; case ScoreRank.SH: - return "SPlus"; + case ScoreRank.S: + return Color4.DarkCyan; + case ScoreRank.A: + return colours.Green; + + case ScoreRank.B: + return Color4.Orange; + + case ScoreRank.C: + return Color4.OrangeRed; + + default: + return colours.Red; + } + } + + /// + /// Retrieves the grade text colour. + /// + private ColourInfo getRankNameColour(OsuColour colours) + { + switch (rank) + { case ScoreRank.XH: - return "SSPlus"; + case ScoreRank.SH: + return ColourInfo.GradientVertical(Color4.White, Color4.LightGray); + + case ScoreRank.X: + case ScoreRank.S: + return ColourInfo.GradientVertical(Color4.Yellow, Color4.Orange); + + default: + return getRankColour(colours).Darken(2); } } } From 372d90de6ad53cb2e7319531f72d4fcc5abe29ce Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Sun, 30 Jun 2019 04:25:47 +0300 Subject: [PATCH 17/57] Remove unnecessary assigns --- osu.Game/Online/Leaderboards/UpdateableRank.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Online/Leaderboards/UpdateableRank.cs b/osu.Game/Online/Leaderboards/UpdateableRank.cs index 64230a92db..d9e8957281 100644 --- a/osu.Game/Online/Leaderboards/UpdateableRank.cs +++ b/osu.Game/Online/Leaderboards/UpdateableRank.cs @@ -22,10 +22,8 @@ namespace osu.Game.Online.Leaderboards protected override Drawable CreateDrawable(ScoreRank rank) => new DrawableRank(rank) { - RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, - FillMode = FillMode.Fit, }; } } From 20ad486d538ee16c940d7b929365c6e31ed210e7 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Sun, 30 Jun 2019 04:59:33 +0300 Subject: [PATCH 18/57] Scale adjustments --- osu.Game/Online/Leaderboards/DrawableRank.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Online/Leaderboards/DrawableRank.cs b/osu.Game/Online/Leaderboards/DrawableRank.cs index a944356681..f9e5d689d0 100644 --- a/osu.Game/Online/Leaderboards/DrawableRank.cs +++ b/osu.Game/Online/Leaderboards/DrawableRank.cs @@ -50,7 +50,7 @@ namespace osu.Game.Online.Leaderboards triangles = new Triangles { RelativeSizeAxes = Axes.Both, - TriangleScale = 1.25f, + TriangleScale = 1, Velocity = 0.5f, }, name = new OsuSpriteText From 9498fc2426aaaf3599783303a40bfbad548e4799 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Sun, 30 Jun 2019 05:47:52 +0300 Subject: [PATCH 19/57] Use proper colours for rank background and text --- osu.Game/Online/Leaderboards/DrawableRank.cs | 60 ++++++++++---------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/osu.Game/Online/Leaderboards/DrawableRank.cs b/osu.Game/Online/Leaderboards/DrawableRank.cs index f9e5d689d0..68dca97ff9 100644 --- a/osu.Game/Online/Leaderboards/DrawableRank.cs +++ b/osu.Game/Online/Leaderboards/DrawableRank.cs @@ -1,7 +1,6 @@ // 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.Framework.Extensions; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; @@ -21,10 +20,6 @@ namespace osu.Game.Online.Leaderboards { private readonly ScoreRank rank; - private readonly Box background; - private readonly Triangles triangles; - private readonly OsuSpriteText name; - public DrawableRank(ScoreRank rank) { this.rank = rank; @@ -33,6 +28,7 @@ namespace osu.Game.Online.Leaderboards FillMode = FillMode.Fit; FillAspectRatio = 2; + var rankColour = getRankColour(); InternalChild = new DrawSizePreservingFillContainer { TargetDrawSize = new Vector2(64, 32), @@ -43,21 +39,25 @@ namespace osu.Game.Online.Leaderboards RelativeSizeAxes = Axes.Both, Children = new Drawable[] { - background = new Box + new Box { RelativeSizeAxes = Axes.Both, + Colour = rankColour, }, - triangles = new Triangles + new Triangles { RelativeSizeAxes = Axes.Both, + ColourDark = rankColour.Darken(0.1f), + ColourLight = rankColour.Lighten(0.1f), TriangleScale = 1, - Velocity = 0.5f, + Velocity = 0.25f, }, - name = new OsuSpriteText + new OsuSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Padding = new MarginPadding { Top = 5 }, + Colour = getRankNameColour(), Font = OsuFont.GetFont(Typeface.Venera, 25), Text = getRankName(), }, @@ -66,65 +66,63 @@ namespace osu.Game.Online.Leaderboards }; } - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - var rankColour = getRankColour(colours); - background.Colour = rankColour; - triangles.ColourDark = rankColour.Darken(0.3f); - triangles.ColourLight = rankColour.Lighten(0.1f); - - name.Colour = getRankNameColour(colours); - } - private string getRankName() => rank.GetDescription().TrimEnd('+'); /// /// Retrieves the grade background colour. /// - private Color4 getRankColour(OsuColour colours) + private Color4 getRankColour() { switch (rank) { case ScoreRank.XH: case ScoreRank.X: - return colours.PinkDarker; + return OsuColour.FromHex(@"ce1c9d"); case ScoreRank.SH: case ScoreRank.S: - return Color4.DarkCyan; + return OsuColour.FromHex(@"00a8b5"); case ScoreRank.A: - return colours.Green; + return OsuColour.FromHex(@"7cce14"); case ScoreRank.B: - return Color4.Orange; + return OsuColour.FromHex(@"e3b130"); case ScoreRank.C: - return Color4.OrangeRed; + return OsuColour.FromHex(@"f18252"); default: - return colours.Red; + return OsuColour.FromHex(@"e95353"); } } /// /// Retrieves the grade text colour. /// - private ColourInfo getRankNameColour(OsuColour colours) + private ColourInfo getRankNameColour() { switch (rank) { case ScoreRank.XH: case ScoreRank.SH: - return ColourInfo.GradientVertical(Color4.White, Color4.LightGray); + return ColourInfo.GradientVertical(Color4.White, OsuColour.FromHex("afdff0")); case ScoreRank.X: case ScoreRank.S: - return ColourInfo.GradientVertical(Color4.Yellow, Color4.Orange); + return ColourInfo.GradientVertical(OsuColour.FromHex(@"ffe7a8"), OsuColour.FromHex(@"ffb800")); + + case ScoreRank.A: + return OsuColour.FromHex(@"275227"); + + case ScoreRank.B: + return OsuColour.FromHex(@"553a2b"); + + case ScoreRank.C: + return OsuColour.FromHex(@"473625"); default: - return getRankColour(colours).Darken(2); + return OsuColour.FromHex(@"512525"); } } } From c5b3572c285073186c2483c6e7bf69b7d27b3dd0 Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Sun, 30 Jun 2019 08:05:45 +0300 Subject: [PATCH 20/57] Add missing details --- osu.Game/Online/Leaderboards/DrawableRank.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Online/Leaderboards/DrawableRank.cs b/osu.Game/Online/Leaderboards/DrawableRank.cs index 68dca97ff9..4d81ead494 100644 --- a/osu.Game/Online/Leaderboards/DrawableRank.cs +++ b/osu.Game/Online/Leaderboards/DrawableRank.cs @@ -56,10 +56,14 @@ namespace osu.Game.Online.Leaderboards { Anchor = Anchor.Centre, Origin = Anchor.Centre, + Spacing = new Vector2(-3, 0), Padding = new MarginPadding { Top = 5 }, Colour = getRankNameColour(), Font = OsuFont.GetFont(Typeface.Venera, 25), Text = getRankName(), + ShadowColour = Color4.Black.Opacity(0.3f), + ShadowOffset = new Vector2(0, 0.08f), + Shadow = true, }, } } From bfcbb47b77daef12d4cb703c50954f600d9f20d4 Mon Sep 17 00:00:00 2001 From: naoey Date: Sun, 30 Jun 2019 10:56:20 +0530 Subject: [PATCH 21/57] Clean up some more leftover code --- osu.Game/Screens/Play/ReplayDownloadButton.cs | 51 +++++++++---------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/osu.Game/Screens/Play/ReplayDownloadButton.cs b/osu.Game/Screens/Play/ReplayDownloadButton.cs index d6ded27cdf..d715f17109 100644 --- a/osu.Game/Screens/Play/ReplayDownloadButton.cs +++ b/osu.Game/Screens/Play/ReplayDownloadButton.cs @@ -21,17 +21,9 @@ namespace osu.Game.Screens.Play { public class ReplayDownloadButton : DownloadTrackingComposite, IHasTooltip { - private const int size = 40; - - [Resolved(canBeNull: true)] - private OsuGame game { get; set; } - [Resolved] private ScoreManager scores { get; set; } - [Resolved] - private OsuColour colours { get; set; } - private OsuClickableContainer button; private SpriteIcon downloadIcon; private SpriteIcon playIcon; @@ -42,7 +34,7 @@ namespace osu.Game.Screens.Play { get { - switch (getReplayAvailability()) + switch (replayAvailability) { case ReplayAvailability.Local: return @"Watch replay"; @@ -56,6 +48,20 @@ namespace osu.Game.Screens.Play } } + private ReplayAvailability replayAvailability + { + get + { + if (scores.IsAvailableLocally(Model.Value)) + return ReplayAvailability.Local; + + if (Model.Value is APILegacyScoreInfo apiScore && apiScore.Replay) + return ReplayAvailability.Online; + + return ReplayAvailability.NotAvailable; + } + } + public ReplayDownloadButton(ScoreInfo score) : base(score) { @@ -63,7 +69,7 @@ namespace osu.Game.Screens.Play } [BackgroundDependencyLoader(true)] - private void load() + private void load(OsuGame game, OsuColour colours) { InternalChild = shakeContainer = new ShakeContainer { @@ -71,7 +77,7 @@ namespace osu.Game.Screens.Play Child = circle = new CircularContainer { Masking = true, - Size = new Vector2(size), + Size = new Vector2(40), EdgeEffect = new EdgeEffectParameters { Colour = Color4.Black.Opacity(0.4f), @@ -132,41 +138,32 @@ namespace osu.Game.Screens.Play switch (state.NewValue) { case DownloadState.Downloading: + playIcon.ResizeTo(Vector2.Zero, 400, Easing.OutQuint); + downloadIcon.ResizeTo(13, 400, Easing.OutQuint); circle.FadeEdgeEffectTo(colours.Yellow, 400, Easing.OutQuint); break; case DownloadState.LocallyAvailable: - playIcon.ResizeTo(13, 300, Easing.OutQuint); - downloadIcon.ResizeTo(Vector2.Zero, 300, Easing.OutExpo); + playIcon.ResizeTo(13, 400, Easing.OutQuint); + downloadIcon.ResizeTo(Vector2.Zero, 400, Easing.OutQuint); circle.FadeEdgeEffectTo(Color4.Black.Opacity(0.4f), 400, Easing.OutQuint); break; case DownloadState.NotDownloaded: - playIcon.ResizeTo(Vector2.Zero, 300, Easing.OutQuint); - downloadIcon.ResizeTo(13, 300, Easing.OutExpo); + playIcon.ResizeTo(Vector2.Zero, 400, Easing.OutQuint); + downloadIcon.ResizeTo(13, 400, Easing.OutQuint); circle.FadeEdgeEffectTo(Color4.Black.Opacity(0.4f), 400, Easing.OutQuint); break; } }, true); - if (getReplayAvailability() == ReplayAvailability.NotAvailable) + if (replayAvailability == ReplayAvailability.NotAvailable) { button.Enabled.Value = false; button.Alpha = 0.6f; } } - private ReplayAvailability getReplayAvailability() - { - if (scores.IsAvailableLocally(Model.Value)) - return ReplayAvailability.Local; - - if (Model.Value is APILegacyScoreInfo apiScore && apiScore.Replay) - return ReplayAvailability.Online; - - return ReplayAvailability.NotAvailable; - } - private enum ReplayAvailability { Local, From 9de4bb342311e0573163dba38c41be8878667567 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 1 Jul 2019 16:12:20 +0900 Subject: [PATCH 22/57] Remove all non-transform LogoVisualisation per-frame allocations --- osu.Game/Screens/Menu/LogoVisualisation.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Menu/LogoVisualisation.cs b/osu.Game/Screens/Menu/LogoVisualisation.cs index c6de5857c2..2ba82b5d9b 100644 --- a/osu.Game/Screens/Menu/LogoVisualisation.cs +++ b/osu.Game/Screens/Menu/LogoVisualisation.cs @@ -96,13 +96,13 @@ namespace osu.Game.Screens.Menu var track = beatmap.Value.TrackLoaded ? beatmap.Value.Track : null; var effect = beatmap.Value.BeatmapLoaded ? beatmap.Value.Beatmap.ControlPointInfo.EffectPointAt(track?.CurrentTime ?? Time.Current) : null; - float[] temporalAmplitudes = track?.CurrentAmplitudes.FrequencyAmplitudes ?? new float[256]; + float[] temporalAmplitudes = track?.CurrentAmplitudes.FrequencyAmplitudes; for (int i = 0; i < bars_per_visualiser; i++) { if (track?.IsRunning ?? false) { - float targetAmplitude = temporalAmplitudes[(i + indexOffset) % bars_per_visualiser] * (effect?.KiaiMode == true ? 1 : 0.5f); + float targetAmplitude = (temporalAmplitudes?[(i + indexOffset) % bars_per_visualiser] ?? 0) * (effect?.KiaiMode == true ? 1 : 0.5f); if (targetAmplitude > frequencyAmplitudes[i]) frequencyAmplitudes[i] = targetAmplitude; } @@ -115,7 +115,6 @@ namespace osu.Game.Screens.Menu } indexOffset = (indexOffset + index_change) % bars_per_visualiser; - Scheduler.AddDelayed(updateAmplitudes, time_between_updates); } private void updateColour() @@ -131,7 +130,8 @@ namespace osu.Game.Screens.Menu protected override void LoadComplete() { base.LoadComplete(); - updateAmplitudes(); + + Scheduler.AddDelayed(updateAmplitudes, time_between_updates, true); } protected override void Update() From 8e54990f62a72dbd3789549fce975ff02e62a884 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 2 Jul 2019 13:40:40 +0900 Subject: [PATCH 23/57] Add database statistics to GlobalStatistics --- osu.Game/Database/DatabaseContextFactory.cs | 19 ++++++++++++++++++- osu.Game/Database/OsuDbContext.cs | 19 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/osu.Game/Database/DatabaseContextFactory.cs b/osu.Game/Database/DatabaseContextFactory.cs index 554337c477..bb6bef1c50 100644 --- a/osu.Game/Database/DatabaseContextFactory.cs +++ b/osu.Game/Database/DatabaseContextFactory.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Threading; using Microsoft.EntityFrameworkCore.Storage; using osu.Framework.Platform; +using osu.Framework.Statistics; namespace osu.Game.Database { @@ -31,11 +32,20 @@ namespace osu.Game.Database recycleThreadContexts(); } + private static readonly GlobalStatistic reads = GlobalStatistics.Get("Database", "Get (Read)"); + private static readonly GlobalStatistic writes = GlobalStatistics.Get("Database", "Get (Write)"); + private static readonly GlobalStatistic commits = GlobalStatistics.Get("Database", "Commits"); + private static readonly GlobalStatistic rollbacks = GlobalStatistics.Get("Database", "Rollbacks"); + /// /// Get a context for the current thread for read-only usage. /// If a is in progress, the existing write-safe context will be returned. /// - public OsuDbContext Get() => threadContexts.Value; + public OsuDbContext Get() + { + reads.Value++; + return threadContexts.Value; + } /// /// Request a context for write usage. Can be consumed in a nested fashion (and will return the same underlying context). @@ -45,6 +55,7 @@ namespace osu.Game.Database /// A usage containing a usable context. public DatabaseWriteUsage GetForWrite(bool withTransaction = true) { + writes.Value++; Monitor.Enter(writeLock); OsuDbContext context; @@ -90,9 +101,15 @@ namespace osu.Game.Database if (usages == 0) { if (currentWriteDidError) + { + rollbacks.Value++; currentWriteTransaction?.Rollback(); + } else + { + commits.Value++; currentWriteTransaction?.Commit(); + } if (currentWriteDidWrite || currentWriteDidError) { diff --git a/osu.Game/Database/OsuDbContext.cs b/osu.Game/Database/OsuDbContext.cs index d31d7cbff7..538ec41b3d 100644 --- a/osu.Game/Database/OsuDbContext.cs +++ b/osu.Game/Database/OsuDbContext.cs @@ -6,6 +6,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.Extensions.Logging; using osu.Framework.Logging; +using osu.Framework.Statistics; using osu.Game.Beatmaps; using osu.Game.Configuration; using osu.Game.IO; @@ -34,6 +35,8 @@ namespace osu.Game.Database private static readonly Lazy logger = new Lazy(() => new OsuDbLoggerFactory()); + private static readonly GlobalStatistic contexts = GlobalStatistics.Get("Database", "Contexts"); + static OsuDbContext() { // required to initialise native SQLite libraries on some platforms. @@ -76,6 +79,8 @@ namespace osu.Game.Database connection.Close(); throw; } + + contexts.Value++; } ~OsuDbContext() @@ -85,6 +90,20 @@ namespace osu.Game.Database Dispose(); } + private bool isDisposed; + + public override void Dispose() + { + if (isDisposed) return; + + isDisposed = true; + + base.Dispose(); + + contexts.Value--; + GC.SuppressFinalize(this); + } + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { base.OnConfiguring(optionsBuilder); From 451765784a9f5324c1f011e6c9593e714ffe749b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 2 Jul 2019 15:17:15 +0900 Subject: [PATCH 24/57] Centralise SocialOverlay's scheduling logic Just some clean-ups to make it easier to confirm correct logic --- osu.Game/Overlays/SocialOverlay.cs | 91 +++++++++++++++--------------- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index 780a80b4fc..4def249200 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -66,24 +66,64 @@ namespace osu.Game.Overlays } }; - Header.Tabs.Current.ValueChanged += _ => Scheduler.AddOnce(updateSearch); + Header.Tabs.Current.ValueChanged += _ => queueUpdate(); - Filter.Tabs.Current.ValueChanged += _ => Scheduler.AddOnce(updateSearch); + Filter.Tabs.Current.ValueChanged += _ => queueUpdate(); Filter.DisplayStyleControl.DisplayStyle.ValueChanged += style => recreatePanels(style.NewValue); - Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += _ => Scheduler.AddOnce(updateSearch); + Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += _ => queueUpdate(); + currentQuery.BindTo(Filter.Search.Current); currentQuery.ValueChanged += query => { queryChangedDebounce?.Cancel(); if (string.IsNullOrEmpty(query.NewValue)) - Scheduler.AddOnce(updateSearch); + queueUpdate(); else queryChangedDebounce = Scheduler.AddDelayed(updateSearch, 500); }; + } - currentQuery.BindTo(Filter.Search.Current); + private APIRequest getUsersRequest; + + private readonly Bindable currentQuery = new Bindable(); + + private ScheduledDelegate queryChangedDebounce; + + private void queueUpdate() => Scheduler.AddOnce(updateSearch); + + private void updateSearch() + { + queryChangedDebounce?.Cancel(); + + if (!IsLoaded) + return; + + Users = null; + clearPanels(); + loading.Hide(); + getUsersRequest?.Cancel(); + + if (API?.IsLoggedIn != true) + return; + + switch (Header.Tabs.Current.Value) + { + case SocialTab.Friends: + var friendRequest = new GetFriendsRequest(); // TODO filter arguments? + friendRequest.Success += updateUsers; + API.Queue(getUsersRequest = friendRequest); + break; + + default: + var userRequest = new GetUsersRequest(); // TODO filter arguments! + userRequest.Success += response => updateUsers(response.Select(r => r.User)); + API.Queue(getUsersRequest = userRequest); + break; + } + + loading.Show(); } private void recreatePanels(PanelDisplayStyle displayStyle) @@ -133,45 +173,6 @@ namespace osu.Game.Overlays }); } - private APIRequest getUsersRequest; - - private readonly Bindable currentQuery = new Bindable(); - - private ScheduledDelegate queryChangedDebounce; - - private void updateSearch() - { - queryChangedDebounce?.Cancel(); - - if (!IsLoaded) - return; - - Users = null; - clearPanels(); - loading.Hide(); - getUsersRequest?.Cancel(); - - if (API?.IsLoggedIn != true) - return; - - switch (Header.Tabs.Current.Value) - { - case SocialTab.Friends: - var friendRequest = new GetFriendsRequest(); // TODO filter arguments? - friendRequest.Success += updateUsers; - API.Queue(getUsersRequest = friendRequest); - break; - - default: - var userRequest = new GetUsersRequest(); // TODO filter arguments! - userRequest.Success += response => updateUsers(response.Select(r => r.User)); - API.Queue(getUsersRequest = userRequest); - break; - } - - loading.Show(); - } - private void updateUsers(IEnumerable newUsers) { Users = newUsers; @@ -193,7 +194,7 @@ namespace osu.Game.Overlays switch (state) { case APIState.Online: - Scheduler.AddOnce(updateSearch); + queueUpdate(); break; default: From 29bb227de28fc264a77ded4cc1180e0a28244b55 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 2 Jul 2019 16:28:06 +0900 Subject: [PATCH 25/57] Avoid Intro screen holding references to the intro beatmap --- osu.Game/Screens/Menu/Intro.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index c52e8541c5..dab5066c52 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -86,6 +86,7 @@ namespace osu.Game.Screens.Menu if (!resuming) { Beatmap.Value = introBeatmap; + introBeatmap = null; if (menuVoice.Value) welcome.Play(); @@ -94,7 +95,10 @@ namespace osu.Game.Screens.Menu { // Only start the current track if it is the menu music. A beatmap's track is started when entering the Main Manu. if (menuMusic.Value) + { track.Start(); + track = null; + } LoadComponentAsync(mainMenu = new MainMenu()); From 6c7b97931e2642090c7d28c8779498d4a46959f3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 2 Jul 2019 17:45:46 +0900 Subject: [PATCH 26/57] Avoid using a BufferedContainer for backgrounds unless required --- osu.Game/Graphics/Backgrounds/Background.cs | 36 ++++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/osu.Game/Graphics/Backgrounds/Background.cs b/osu.Game/Graphics/Backgrounds/Background.cs index db055d15e5..8fdb8ebcdd 100644 --- a/osu.Game/Graphics/Backgrounds/Background.cs +++ b/osu.Game/Graphics/Backgrounds/Background.cs @@ -6,23 +6,28 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; +using osu.Framework.Graphics.Transforms; +using osuTK; namespace osu.Game.Graphics.Backgrounds { - public class Background : BufferedContainer + /// + /// A background which offer blurring on demand. + /// + public class Background : CompositeDrawable { public Sprite Sprite; private readonly string textureName; + private BufferedContainer bufferedContainer; + public Background(string textureName = @"") { - CacheDrawnFrameBuffer = true; - this.textureName = textureName; RelativeSizeAxes = Axes.Both; - Add(Sprite = new Sprite + AddInternal(Sprite = new Sprite { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, @@ -37,5 +42,28 @@ namespace osu.Game.Graphics.Backgrounds if (!string.IsNullOrEmpty(textureName)) Sprite.Texture = textures.Get(textureName); } + + public Vector2 BlurSigma => bufferedContainer?.BlurSigma ?? Vector2.Zero; + + /// + /// Smoothly adjusts over time. + /// + /// A to which further transforms can be added. + public void BlurTo(Vector2 newBlurSigma, double duration = 0, Easing easing = Easing.None) + { + if (bufferedContainer == null) + { + RemoveInternal(Sprite); + + AddInternal(bufferedContainer = new BufferedContainer + { + CacheDrawnFrameBuffer = true, + RelativeSizeAxes = Axes.Both, + Child = Sprite + }); + } + + bufferedContainer.BlurTo(newBlurSigma, duration, easing); + } } } From 7b2227c5053f78fb3bda55854259fa7a6422e768 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 2 Jul 2019 17:47:19 +0900 Subject: [PATCH 27/57] Fix xmldoc --- osu.Game/Graphics/Backgrounds/Background.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Backgrounds/Background.cs b/osu.Game/Graphics/Backgrounds/Background.cs index 8fdb8ebcdd..526b3da8a6 100644 --- a/osu.Game/Graphics/Backgrounds/Background.cs +++ b/osu.Game/Graphics/Backgrounds/Background.cs @@ -12,7 +12,7 @@ using osuTK; namespace osu.Game.Graphics.Backgrounds { /// - /// A background which offer blurring on demand. + /// A background which offers blurring via a on demand. /// public class Background : CompositeDrawable { From 587be955c3e20d667067660be5b8aa9d1f72aa31 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 2 Jul 2019 17:57:23 +0900 Subject: [PATCH 28/57] Increase number of backgrounds in line with resources --- osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs index 7092ac0c4a..55338ea01a 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs @@ -18,7 +18,7 @@ namespace osu.Game.Screens.Backgrounds private Background background; private int currentDisplay; - private const int background_count = 5; + private const int background_count = 7; private string backgroundName => $@"Menu/menu-background-{currentDisplay % background_count + 1}"; From 79b0deb353c0d13bcf0a86ad46059ef2b82dc05a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 2 Jul 2019 17:59:25 +0900 Subject: [PATCH 29/57] Update resources reference --- osu.Game/osu.Game.csproj | 2 +- osu.iOS.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index d6a998bf55..8c4f5dcb7d 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -14,7 +14,7 @@ - + diff --git a/osu.iOS.props b/osu.iOS.props index de4a14f01f..113874f6f6 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -104,7 +104,7 @@ - + From ee516d2515c47a3b7728805b6b7f3c8332afb528 Mon Sep 17 00:00:00 2001 From: naoey Date: Tue, 2 Jul 2019 15:55:30 +0530 Subject: [PATCH 30/57] Make direct panel download and replay buttons share UI --- .../Gameplay/TestSceneReplayDownloadButton.cs | 2 + .../UserInterface/OsuDownloadButton.cs | 87 ++++++++++++++ osu.Game/Overlays/Direct/DownloadButton.cs | 61 ++-------- osu.Game/Screens/Play/ReplayDownloadButton.cs | 108 ++++-------------- .../Screens/Ranking/Pages/ScoreResultsPage.cs | 3 +- 5 files changed, 119 insertions(+), 142 deletions(-) create mode 100644 osu.Game/Graphics/UserInterface/OsuDownloadButton.cs diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs index e71b2d596e..0dfcda122f 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneReplayDownloadButton.cs @@ -9,6 +9,7 @@ using osu.Game.Rulesets.Osu; using osu.Game.Scoring; using osu.Game.Screens.Play; using osu.Game.Users; +using osuTK; using System; using System.Collections.Generic; @@ -41,6 +42,7 @@ namespace osu.Game.Tests.Visual.Gameplay { Anchor = Anchor.Centre, Origin = Anchor.Centre, + Size = new Vector2(80, 40), }; }); } diff --git a/osu.Game/Graphics/UserInterface/OsuDownloadButton.cs b/osu.Game/Graphics/UserInterface/OsuDownloadButton.cs new file mode 100644 index 0000000000..6e95c7e291 --- /dev/null +++ b/osu.Game/Graphics/UserInterface/OsuDownloadButton.cs @@ -0,0 +1,87 @@ +// 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.Framework.Bindables; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Sprites; +using osu.Game.Online; +using osuTK; + +namespace osu.Game.Graphics.UserInterface +{ + public class OsuDownloadButton : OsuAnimatedButton + { + public readonly Bindable State = new Bindable(); + + private readonly SpriteIcon icon; + private readonly SpriteIcon checkmark; + private readonly Box background; + + private OsuColour colours; + + public OsuDownloadButton() + { + Children = new Drawable[] + { + background = new Box + { + RelativeSizeAxes = Axes.Both, + Depth = float.MaxValue + }, + icon = new SpriteIcon + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Size = new Vector2(13), + Icon = FontAwesome.Solid.Download, + }, + checkmark = new SpriteIcon + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + X = 8, + Size = Vector2.Zero, + Icon = FontAwesome.Solid.Check, + } + }; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + this.colours = colours; + + State.BindValueChanged(updateState, true); + } + + private void updateState(ValueChangedEvent state) + { + switch (state.NewValue) + { + case DownloadState.NotDownloaded: + background.FadeColour(colours.Gray4, 500, Easing.InOutExpo); + icon.MoveToX(0, 500, Easing.InOutExpo); + checkmark.ScaleTo(Vector2.Zero, 500, Easing.InOutExpo); + break; + + case DownloadState.Downloading: + background.FadeColour(colours.Blue, 500, Easing.InOutExpo); + icon.MoveToX(0, 500, Easing.InOutExpo); + checkmark.ScaleTo(Vector2.Zero, 500, Easing.InOutExpo); + break; + + case DownloadState.Downloaded: + background.FadeColour(colours.Yellow, 500, Easing.InOutExpo); + break; + + case DownloadState.LocallyAvailable: + background.FadeColour(colours.Green, 500, Easing.InOutExpo); + icon.MoveToX(-8, 500, Easing.InOutExpo); + checkmark.ScaleTo(new Vector2(13), 500, Easing.InOutExpo); + break; + } + } + } +} diff --git a/osu.Game/Overlays/Direct/DownloadButton.cs b/osu.Game/Overlays/Direct/DownloadButton.cs index 81709187e7..9aec7bcd0c 100644 --- a/osu.Game/Overlays/Direct/DownloadButton.cs +++ b/osu.Game/Overlays/Direct/DownloadButton.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 osu.Framework.Allocation; @@ -10,7 +10,6 @@ using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.UserInterface; using osu.Game.Online; -using osuTK; namespace osu.Game.Overlays.Direct { @@ -25,7 +24,7 @@ namespace osu.Game.Overlays.Direct private OsuColour colours; private readonly ShakeContainer shakeContainer; - private readonly OsuAnimatedButton button; + private readonly OsuDownloadButton button; public DownloadButton(BeatmapSetInfo beatmapSet, bool noVideo = false) : base(beatmapSet) @@ -35,33 +34,10 @@ namespace osu.Game.Overlays.Direct InternalChild = shakeContainer = new ShakeContainer { RelativeSizeAxes = Axes.Both, - Child = button = new OsuAnimatedButton + Child = button = new OsuDownloadButton { RelativeSizeAxes = Axes.Both, - Children = new Drawable[] - { - background = new Box - { - RelativeSizeAxes = Axes.Both, - Depth = float.MaxValue - }, - icon = new SpriteIcon - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Size = new Vector2(13), - Icon = FontAwesome.Solid.Download, - }, - checkmark = new SpriteIcon - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - X = 8, - Size = Vector2.Zero, - Icon = FontAwesome.Solid.Check, - } - } - } + }, }; } @@ -69,7 +45,7 @@ namespace osu.Game.Overlays.Direct { base.LoadComplete(); - State.BindValueChanged(state => updateState(state.NewValue), true); + button.State.BindTo(State); FinishTransforms(true); } @@ -105,32 +81,11 @@ namespace osu.Game.Overlays.Direct }; } - private void updateState(DownloadState state) + protected override void Dispose(bool isDisposing) { - switch (state) - { - case DownloadState.NotDownloaded: - background.FadeColour(colours.Gray4, 500, Easing.InOutExpo); - icon.MoveToX(0, 500, Easing.InOutExpo); - checkmark.ScaleTo(Vector2.Zero, 500, Easing.InOutExpo); - break; + base.Dispose(isDisposing); - case DownloadState.Downloading: - background.FadeColour(colours.Blue, 500, Easing.InOutExpo); - icon.MoveToX(0, 500, Easing.InOutExpo); - checkmark.ScaleTo(Vector2.Zero, 500, Easing.InOutExpo); - break; - - case DownloadState.Downloaded: - background.FadeColour(colours.Yellow, 500, Easing.InOutExpo); - break; - - case DownloadState.LocallyAvailable: - background.FadeColour(colours.Green, 500, Easing.InOutExpo); - icon.MoveToX(-8, 500, Easing.InOutExpo); - checkmark.ScaleTo(new Vector2(13), 500, Easing.InOutExpo); - break; - } + button?.State.UnbindAll(); } } } diff --git a/osu.Game/Screens/Play/ReplayDownloadButton.cs b/osu.Game/Screens/Play/ReplayDownloadButton.cs index d715f17109..9655bde36a 100644 --- a/osu.Game/Screens/Play/ReplayDownloadButton.cs +++ b/osu.Game/Screens/Play/ReplayDownloadButton.cs @@ -2,57 +2,28 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; -using osu.Framework.Graphics.Cursor; -using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics; -using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Online; using osu.Game.Scoring; -using osuTK; -using osu.Framework.Graphics.Sprites; using osu.Game.Online.API.Requests.Responses; -using osu.Framework.Graphics.Effects; -using osuTK.Graphics; -using osu.Framework.Extensions.Color4Extensions; -using osu.Framework.Graphics.Containers; +using osu.Game.Graphics.UserInterface; namespace osu.Game.Screens.Play { - public class ReplayDownloadButton : DownloadTrackingComposite, IHasTooltip + public class ReplayDownloadButton : DownloadTrackingComposite { [Resolved] private ScoreManager scores { get; set; } - private OsuClickableContainer button; - private SpriteIcon downloadIcon; - private SpriteIcon playIcon; + private OsuDownloadButton button; private ShakeContainer shakeContainer; - private CircularContainer circle; - - public string TooltipText - { - get - { - switch (replayAvailability) - { - case ReplayAvailability.Local: - return @"Watch replay"; - - case ReplayAvailability.Online: - return @"Download replay"; - - default: - return @"Replay unavailable"; - } - } - } private ReplayAvailability replayAvailability { get { - if (scores.IsAvailableLocally(Model.Value)) + if (State.Value == DownloadState.LocallyAvailable) return ReplayAvailability.Local; if (Model.Value is APILegacyScoreInfo apiScore && apiScore.Replay) @@ -65,54 +36,18 @@ namespace osu.Game.Screens.Play public ReplayDownloadButton(ScoreInfo score) : base(score) { - AutoSizeAxes = Axes.Both; } [BackgroundDependencyLoader(true)] - private void load(OsuGame game, OsuColour colours) + private void load(OsuGame game) { InternalChild = shakeContainer = new ShakeContainer { - AutoSizeAxes = Axes.Both, - Child = circle = new CircularContainer + RelativeSizeAxes = Axes.Both, + Child = button = new OsuDownloadButton { - Masking = true, - Size = new Vector2(40), - EdgeEffect = new EdgeEffectParameters - { - Colour = Color4.Black.Opacity(0.4f), - Type = EdgeEffectType.Shadow, - Radius = 5, - }, - Child = button = new OsuClickableContainer - { - RelativeSizeAxes = Axes.Both, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = colours.GrayF, - }, - playIcon = new SpriteIcon - { - Icon = FontAwesome.Solid.Play, - Size = Vector2.Zero, - Colour = colours.Gray3, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - }, - downloadIcon = new SpriteIcon - { - Icon = FontAwesome.Solid.FileDownload, - Size = Vector2.Zero, - Colour = colours.Gray3, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - }, - }, - } - }, + RelativeSizeAxes = Axes.Both, + } }; button.Action = () => @@ -127,32 +62,29 @@ namespace osu.Game.Screens.Play scores.Download(Model.Value); break; + case DownloadState.Downloaded: case DownloadState.Downloading: shakeContainer.Shake(); break; } }; - State.BindValueChanged(state => + State.BindValueChanged((state) => { - switch (state.NewValue) + button.State.Value = state.NewValue; + + switch (replayAvailability) { - case DownloadState.Downloading: - playIcon.ResizeTo(Vector2.Zero, 400, Easing.OutQuint); - downloadIcon.ResizeTo(13, 400, Easing.OutQuint); - circle.FadeEdgeEffectTo(colours.Yellow, 400, Easing.OutQuint); + case ReplayAvailability.Local: + button.TooltipText = @"Watch replay"; break; - case DownloadState.LocallyAvailable: - playIcon.ResizeTo(13, 400, Easing.OutQuint); - downloadIcon.ResizeTo(Vector2.Zero, 400, Easing.OutQuint); - circle.FadeEdgeEffectTo(Color4.Black.Opacity(0.4f), 400, Easing.OutQuint); + case ReplayAvailability.Online: + button.TooltipText = @"Download replay"; break; - case DownloadState.NotDownloaded: - playIcon.ResizeTo(Vector2.Zero, 400, Easing.OutQuint); - downloadIcon.ResizeTo(13, 400, Easing.OutQuint); - circle.FadeEdgeEffectTo(Color4.Black.Opacity(0.4f), 400, Easing.OutQuint); + default: + button.TooltipText = @"Replay unavailable"; break; } }, true); diff --git a/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs b/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs index 676c1e3adf..7c35742ff6 100644 --- a/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs +++ b/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs @@ -173,7 +173,8 @@ namespace osu.Game.Screens.Ranking.Pages { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, - Margin = new MarginPadding { Bottom = 5 }, + Margin = new MarginPadding { Bottom = 10 }, + Size = new Vector2(50, 30), }, }; From eaa19d5a49faf44645e824ca48c62651249621d2 Mon Sep 17 00:00:00 2001 From: naoey Date: Tue, 2 Jul 2019 16:13:47 +0530 Subject: [PATCH 31/57] Remove unused/unnecessary fields --- osu.Game/Overlays/Direct/DownloadButton.cs | 10 +--------- osu.Game/Screens/Play/ReplayDownloadButton.cs | 7 ++----- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/osu.Game/Overlays/Direct/DownloadButton.cs b/osu.Game/Overlays/Direct/DownloadButton.cs index 9aec7bcd0c..6bac07fc88 100644 --- a/osu.Game/Overlays/Direct/DownloadButton.cs +++ b/osu.Game/Overlays/Direct/DownloadButton.cs @@ -3,8 +3,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.Shapes; -using osu.Framework.Graphics.Sprites; using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Graphics.Containers; @@ -18,11 +16,7 @@ namespace osu.Game.Overlays.Direct protected bool DownloadEnabled => button.Enabled.Value; private readonly bool noVideo; - private readonly SpriteIcon icon; - private readonly SpriteIcon checkmark; - private readonly Box background; - private OsuColour colours; private readonly ShakeContainer shakeContainer; private readonly OsuDownloadButton button; @@ -50,10 +44,8 @@ namespace osu.Game.Overlays.Direct } [BackgroundDependencyLoader(true)] - private void load(OsuColour colours, OsuGame game, BeatmapManager beatmaps) + private void load(OsuGame game, BeatmapManager beatmaps) { - this.colours = colours; - if (BeatmapSet.Value.OnlineInfo.Availability?.DownloadDisabled ?? false) { button.Enabled.Value = false; diff --git a/osu.Game/Screens/Play/ReplayDownloadButton.cs b/osu.Game/Screens/Play/ReplayDownloadButton.cs index 9655bde36a..5acf4e83d9 100644 --- a/osu.Game/Screens/Play/ReplayDownloadButton.cs +++ b/osu.Game/Screens/Play/ReplayDownloadButton.cs @@ -13,9 +13,6 @@ namespace osu.Game.Screens.Play { public class ReplayDownloadButton : DownloadTrackingComposite { - [Resolved] - private ScoreManager scores { get; set; } - private OsuDownloadButton button; private ShakeContainer shakeContainer; @@ -39,7 +36,7 @@ namespace osu.Game.Screens.Play } [BackgroundDependencyLoader(true)] - private void load(OsuGame game) + private void load(OsuGame game, ScoreManager scores) { InternalChild = shakeContainer = new ShakeContainer { @@ -69,7 +66,7 @@ namespace osu.Game.Screens.Play } }; - State.BindValueChanged((state) => + State.BindValueChanged(state => { button.State.Value = state.NewValue; From 1ff6a9d085da89471a8d608cd4dd72251cef4a52 Mon Sep 17 00:00:00 2001 From: naoey Date: Tue, 2 Jul 2019 16:25:40 +0530 Subject: [PATCH 32/57] Remove unused using --- osu.Game/Overlays/Direct/DownloadButton.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Overlays/Direct/DownloadButton.cs b/osu.Game/Overlays/Direct/DownloadButton.cs index 6bac07fc88..dac1521bf3 100644 --- a/osu.Game/Overlays/Direct/DownloadButton.cs +++ b/osu.Game/Overlays/Direct/DownloadButton.cs @@ -4,7 +4,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Beatmaps; -using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.UserInterface; using osu.Game.Online; From a26b14a4f89a44ee8d9adb96774b75fa4989e46e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 2 Jul 2019 22:21:56 +0900 Subject: [PATCH 33/57] Move finaliser inside disposal region --- osu.Game/Beatmaps/WorkingBeatmap.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 61390fe51b..40b3d70262 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -46,11 +46,6 @@ namespace osu.Game.Beatmaps skin = new RecyclableLazy(GetSkin); } - ~WorkingBeatmap() - { - Dispose(false); - } - protected virtual Track GetVirtualTrack() { const double excess_length = 1000; @@ -229,6 +224,11 @@ namespace osu.Game.Beatmaps beatmapCancellation.Cancel(); } + ~WorkingBeatmap() + { + Dispose(false); + } + #endregion public class RecyclableLazy From 0b66f139020b9a13e3816814c76078db25c97a72 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 2 Jul 2019 22:22:33 +0900 Subject: [PATCH 34/57] Add todo about beatmap load cancellation --- osu.Game/Beatmaps/WorkingBeatmap.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 40b3d70262..2f611b8409 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -145,6 +145,7 @@ namespace osu.Game.Beatmaps public Task LoadBeatmapAsync() => (beatmapLoadTask ?? (beatmapLoadTask = Task.Factory.StartNew(() => { + // Todo: Handle cancellation during beatmap parsing var b = GetBeatmap() ?? new Beatmap(); // The original beatmap version needs to be preserved as the database doesn't contain it From a6acc1f99f25e9dfbd344679ba9cc147e5eb9e3b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 2 Jul 2019 22:25:51 +0900 Subject: [PATCH 35/57] Catch exception and return null for safety . --- osu.Game/Beatmaps/WorkingBeatmap.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 2f611b8409..a4324ecb0c 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -157,7 +157,20 @@ namespace osu.Game.Beatmaps return b; }, beatmapCancellation.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default))); - public IBeatmap Beatmap => LoadBeatmapAsync().Result; + public IBeatmap Beatmap + { + get + { + try + { + return LoadBeatmapAsync().Result; + } + catch (TaskCanceledException) + { + return null; + } + } + } private readonly CancellationTokenSource beatmapCancellation = new CancellationTokenSource(); protected abstract IBeatmap GetBeatmap(); From 9e33fb35e9241dda9fa34c33804bae5f7a9e9670 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 2 Jul 2019 22:24:08 +0900 Subject: [PATCH 36/57] Fix typo --- osu.Game/Beatmaps/WorkingBeatmap.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index a4324ecb0c..00ba8963cb 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -231,7 +231,7 @@ namespace osu.Game.Beatmaps { // recycling logic is not here for the time being, as components which use // retrieved objects from WorkingBeatmap may not hold a reference to the WorkingBeatmap itself. - // this should be fine as each retrieved comopnent do have their own finalizers. + // this should be fine as each retrieved component do have their own finalizers. // cancelling the beatmap load is safe for now since the retrieval is a synchronous // operation. if we add an async retrieval method this may need to be reconsidered. From f31d840c13eecb92af95e69aceb26fad15a69a0f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 2 Jul 2019 22:25:03 +0900 Subject: [PATCH 37/57] Dispose previous WorkingBeatmap on change --- osu.Game/OsuGame.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index bfa4aeadef..49c543537a 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -296,6 +296,8 @@ namespace osu.Game if (nextBeatmap?.Track != null) nextBeatmap.Track.Completed += currentTrackCompleted; + beatmap.OldValue?.Dispose(); + nextBeatmap?.LoadBeatmapAsync(); } From e7a7f2f660c0eed21b1d7696f3236038f59c2edf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 2 Jul 2019 22:39:42 +0900 Subject: [PATCH 38/57] Add statistic for count of alive WorkingBeatmaps --- osu.Game/Beatmaps/WorkingBeatmap.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 00ba8963cb..138d911556 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -13,6 +13,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using osu.Framework.Audio; +using osu.Framework.Statistics; using osu.Game.IO.Serialization; using osu.Game.Rulesets; using osu.Game.Rulesets.Objects; @@ -32,6 +33,8 @@ namespace osu.Game.Beatmaps protected AudioManager AudioManager { get; } + private static readonly GlobalStatistic total_count = GlobalStatistics.Get(nameof(Beatmaps), $"Total {nameof(WorkingBeatmap)}s"); + protected WorkingBeatmap(BeatmapInfo beatmapInfo, AudioManager audioManager) { AudioManager = audioManager; @@ -44,6 +47,8 @@ namespace osu.Game.Beatmaps waveform = new RecyclableLazy(GetWaveform); storyboard = new RecyclableLazy(GetStoryboard); skin = new RecyclableLazy(GetSkin); + + total_count.Value++; } protected virtual Track GetVirtualTrack() @@ -227,8 +232,15 @@ namespace osu.Game.Beatmaps GC.SuppressFinalize(this); } + private bool isDisposed; + protected virtual void Dispose(bool isDisposing) { + if (isDisposed) + return; + + isDisposed = true; + // recycling logic is not here for the time being, as components which use // retrieved objects from WorkingBeatmap may not hold a reference to the WorkingBeatmap itself. // this should be fine as each retrieved component do have their own finalizers. @@ -236,6 +248,8 @@ namespace osu.Game.Beatmaps // cancelling the beatmap load is safe for now since the retrieval is a synchronous // operation. if we add an async retrieval method this may need to be reconsidered. beatmapCancellation.Cancel(); + + total_count.Value--; } ~WorkingBeatmap() From 8e0b5f16225f00266c52c61818636b798502770d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 2 Jul 2019 23:21:13 +0900 Subject: [PATCH 39/57] Fix weird merge conflict --- osu.Game/Beatmaps/WorkingBeatmap.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index c6f26423dd..37aa0024da 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -51,11 +51,6 @@ namespace osu.Game.Beatmaps total_count.Value++; } - ~WorkingBeatmap() - { - Dispose(false); - } - protected virtual Track GetVirtualTrack() { const double excess_length = 1000; From 778c36c7d7a243696380f14fb0942ad08153cc9d Mon Sep 17 00:00:00 2001 From: miterosan Date: Tue, 2 Jul 2019 17:05:04 +0200 Subject: [PATCH 40/57] Allow discover of rulesets that are already loaded. --- osu.Game/Rulesets/RulesetStore.cs | 42 +++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/RulesetStore.cs b/osu.Game/Rulesets/RulesetStore.cs index 0ebadd73d2..919b5dde22 100644 --- a/osu.Game/Rulesets/RulesetStore.cs +++ b/osu.Game/Rulesets/RulesetStore.cs @@ -22,8 +22,20 @@ namespace osu.Game.Rulesets { AppDomain.CurrentDomain.AssemblyResolve += currentDomain_AssemblyResolve; - foreach (string file in Directory.GetFiles(Environment.CurrentDirectory, $"{ruleset_library_prefix}.*.dll") - .Where(f => !Path.GetFileName(f).Contains("Tests"))) + addLoadedRulesets(); + + IEnumerable files = new string[0]; + + try + { + files = Directory.GetFiles(Environment.CurrentDirectory, $"{ruleset_library_prefix}.*.dll"); + } + catch (Exception e) + { + Logger.Error(e, $"Could not load rulesets from directory {Environment.CurrentDirectory}"); + } + + foreach (string file in files.Where(f => !Path.GetFileName(f).Contains("Tests"))) loadRulesetFromFile(file); } @@ -111,6 +123,17 @@ namespace osu.Game.Rulesets } } + private static void addLoadedRulesets() + { + // on android the rulesets are already loaded + var loadedRulesets = AppDomain.CurrentDomain.GetAssemblies() + .Where(assembly => assembly.GetName().Name.StartsWith(ruleset_library_prefix, StringComparison.InvariantCultureIgnoreCase)) + .Where(assembly => !assembly.GetName().Name.Contains("Tests")); + + foreach (var ruleset in loadedRulesets) + addRuleset(ruleset); + } + private static void loadRulesetFromFile(string file) { var filename = Path.GetFileNameWithoutExtension(file); @@ -128,5 +151,20 @@ namespace osu.Game.Rulesets Logger.Error(e, $"Failed to load ruleset {filename}"); } } + + private static void addRuleset(Assembly assembly) + { + if (loaded_assemblies.ContainsKey(assembly)) + return; + + try + { + loaded_assemblies[assembly] = assembly.GetTypes().First(t => t.IsPublic && t.IsSubclassOf(typeof(Ruleset))); + } + catch (Exception e) + { + Logger.Error(e, $"Failed to add ruleset {assembly}"); + } + } } } From f1ceea8361e18ce23e9e5f4dc031f5bd40a393c5 Mon Sep 17 00:00:00 2001 From: miterosan Date: Tue, 2 Jul 2019 17:25:12 +0200 Subject: [PATCH 41/57] style fixes --- osu.Game/Rulesets/RulesetStore.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/osu.Game/Rulesets/RulesetStore.cs b/osu.Game/Rulesets/RulesetStore.cs index 919b5dde22..17834f8545 100644 --- a/osu.Game/Rulesets/RulesetStore.cs +++ b/osu.Game/Rulesets/RulesetStore.cs @@ -24,19 +24,17 @@ namespace osu.Game.Rulesets addLoadedRulesets(); - IEnumerable files = new string[0]; - try { - files = Directory.GetFiles(Environment.CurrentDirectory, $"{ruleset_library_prefix}.*.dll"); + string[] files = Directory.GetFiles(Environment.CurrentDirectory, $"{ruleset_library_prefix}.*.dll"); + + foreach (string file in files.Where(f => !Path.GetFileName(f).Contains("Tests"))) + loadRulesetFromFile(file); } catch (Exception e) { Logger.Error(e, $"Could not load rulesets from directory {Environment.CurrentDirectory}"); } - - foreach (string file in files.Where(f => !Path.GetFileName(f).Contains("Tests"))) - loadRulesetFromFile(file); } public RulesetStore(IDatabaseContextFactory factory) @@ -125,13 +123,15 @@ namespace osu.Game.Rulesets private static void addLoadedRulesets() { - // on android the rulesets are already loaded - var loadedRulesets = AppDomain.CurrentDomain.GetAssemblies() - .Where(assembly => assembly.GetName().Name.StartsWith(ruleset_library_prefix, StringComparison.InvariantCultureIgnoreCase)) - .Where(assembly => !assembly.GetName().Name.Contains("Tests")); + foreach (var ruleset in AppDomain.CurrentDomain.GetAssemblies()) + { + string rulesetName = ruleset.GetName().Name; + + if (!rulesetName.StartsWith(ruleset_library_prefix, StringComparison.InvariantCultureIgnoreCase) || ruleset.GetName().Name.Contains("Tests")) + continue; - foreach (var ruleset in loadedRulesets) addRuleset(ruleset); + } } private static void loadRulesetFromFile(string file) From f9c24f2281dc82ffd14ec3f47b7fc155112d9a66 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jul 2019 00:35:55 +0900 Subject: [PATCH 42/57] 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 8c4f5dcb7d..b59828a52e 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -15,7 +15,7 @@ - + diff --git a/osu.iOS.props b/osu.iOS.props index 113874f6f6..ddbdaf3d18 100644 --- a/osu.iOS.props +++ b/osu.iOS.props @@ -105,8 +105,8 @@ - - + + From d387629e5348aaa8ac3322a169401415e5ba6747 Mon Sep 17 00:00:00 2001 From: Joehu Date: Tue, 2 Jul 2019 10:52:24 -0700 Subject: [PATCH 43/57] Fix layout of profile top header to match web --- .../Profile/Header/TopHeaderContainer.cs | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs b/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs index dc6c3f56f8..bdf047478d 100644 --- a/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs +++ b/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs @@ -72,18 +72,30 @@ namespace osu.Game.Overlays.Profile.Header new FillFlowContainer { AutoSizeAxes = Axes.Both, - Direction = FillDirection.Horizontal, + Direction = FillDirection.Vertical, Children = new Drawable[] { - usernameText = new OsuSpriteText + new FillFlowContainer { - Font = OsuFont.GetFont(size: 24, weight: FontWeight.Regular) + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, + Children = new Drawable[] + { + usernameText = new OsuSpriteText + { + Font = OsuFont.GetFont(size: 24, weight: FontWeight.Regular) + }, + openUserExternally = new ExternalLinkButton + { + Margin = new MarginPadding { Left = 5 }, + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + }, + } }, - openUserExternally = new ExternalLinkButton + titleText = new OsuSpriteText { - Margin = new MarginPadding { Left = 5 }, - Anchor = Anchor.CentreLeft, - Origin = Anchor.CentreLeft, + Font = OsuFont.GetFont(size: 18, weight: FontWeight.Regular) }, } }, @@ -95,10 +107,6 @@ namespace osu.Game.Overlays.Profile.Header AutoSizeAxes = Axes.Both, Children = new Drawable[] { - titleText = new OsuSpriteText - { - Font = OsuFont.GetFont(size: 18, weight: FontWeight.Regular) - }, supporterTag = new SupporterIcon { Height = 20, From a1fb41ea66c7489d1036f7e17ca0f9eb5d9f9ba5 Mon Sep 17 00:00:00 2001 From: Joehu Date: Tue, 2 Jul 2019 10:53:52 -0700 Subject: [PATCH 44/57] Use FillFlowContainer on flag and country --- osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs b/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs index bdf047478d..b0d7070994 100644 --- a/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs +++ b/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs @@ -119,10 +119,11 @@ namespace osu.Game.Overlays.Profile.Header Margin = new MarginPadding { Top = 10 }, Colour = colours.GreySeafoamLighter, }, - new Container + new FillFlowContainer { AutoSizeAxes = Axes.Both, Margin = new MarginPadding { Top = 5 }, + Direction = FillDirection.Horizontal, Children = new Drawable[] { userFlag = new UpdateableFlag @@ -133,7 +134,7 @@ namespace osu.Game.Overlays.Profile.Header userCountryText = new OsuSpriteText { Font = OsuFont.GetFont(size: 17.5f, weight: FontWeight.Regular), - Margin = new MarginPadding { Left = 40 }, + Margin = new MarginPadding { Left = 10 }, Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, Colour = colours.GreySeafoamLighter, From 23acddcb562fcdfd6d66e2182177901d1db55595 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jul 2019 12:02:35 +0900 Subject: [PATCH 45/57] Rename download buttons to avoid ambiguity --- .../Visual/Online/TestSceneBeatmapSetOverlay.cs | 2 +- .../Visual/Online/TestSceneDirectDownloadButton.cs | 4 ++-- .../{OsuDownloadButton.cs => DownloadButton.cs} | 4 ++-- .../{DownloadButton.cs => HeaderDownloadButton.cs} | 4 ++-- osu.Game/Overlays/BeatmapSet/Header.cs | 9 ++++----- osu.Game/Overlays/Direct/DirectGridPanel.cs | 2 +- osu.Game/Overlays/Direct/DirectListPanel.cs | 4 ++-- .../{DownloadButton.cs => PanelDownloadButton.cs} | 10 +++++----- osu.Game/Screens/Play/ReplayDownloadButton.cs | 4 ++-- 9 files changed, 21 insertions(+), 22 deletions(-) rename osu.Game/Graphics/UserInterface/{OsuDownloadButton.cs => DownloadButton.cs} (96%) rename osu.Game/Overlays/BeatmapSet/Buttons/{DownloadButton.cs => HeaderDownloadButton.cs} (97%) rename osu.Game/Overlays/Direct/{DownloadButton.cs => PanelDownloadButton.cs} (86%) diff --git a/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlay.cs b/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlay.cs index c494f5ef33..a9c44c9020 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlay.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlay.cs @@ -32,7 +32,7 @@ namespace osu.Game.Tests.Visual.Online typeof(BasicStats), typeof(BeatmapPicker), typeof(Details), - typeof(DownloadButton), + typeof(HeaderDownloadButton), typeof(FavouriteButton), typeof(Header), typeof(HeaderButton), diff --git a/osu.Game.Tests/Visual/Online/TestSceneDirectDownloadButton.cs b/osu.Game.Tests/Visual/Online/TestSceneDirectDownloadButton.cs index 5a5833feb6..5b0c2d3c67 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneDirectDownloadButton.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneDirectDownloadButton.cs @@ -20,7 +20,7 @@ namespace osu.Game.Tests.Visual.Online { public override IReadOnlyList RequiredTypes => new[] { - typeof(DownloadButton) + typeof(PanelDownloadButton) }; private TestDownloadButton downloadButton; @@ -143,7 +143,7 @@ namespace osu.Game.Tests.Visual.Online return beatmap; } - private class TestDownloadButton : DownloadButton + private class TestDownloadButton : PanelDownloadButton { public new bool DownloadEnabled => base.DownloadEnabled; diff --git a/osu.Game/Graphics/UserInterface/OsuDownloadButton.cs b/osu.Game/Graphics/UserInterface/DownloadButton.cs similarity index 96% rename from osu.Game/Graphics/UserInterface/OsuDownloadButton.cs rename to osu.Game/Graphics/UserInterface/DownloadButton.cs index 6e95c7e291..41b90d3802 100644 --- a/osu.Game/Graphics/UserInterface/OsuDownloadButton.cs +++ b/osu.Game/Graphics/UserInterface/DownloadButton.cs @@ -11,7 +11,7 @@ using osuTK; namespace osu.Game.Graphics.UserInterface { - public class OsuDownloadButton : OsuAnimatedButton + public class DownloadButton : OsuAnimatedButton { public readonly Bindable State = new Bindable(); @@ -21,7 +21,7 @@ namespace osu.Game.Graphics.UserInterface private OsuColour colours; - public OsuDownloadButton() + public DownloadButton() { Children = new Drawable[] { diff --git a/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs b/osu.Game/Overlays/BeatmapSet/Buttons/HeaderDownloadButton.cs similarity index 97% rename from osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs rename to osu.Game/Overlays/BeatmapSet/Buttons/HeaderDownloadButton.cs index 3e8a5a8324..fe10287491 100644 --- a/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs +++ b/osu.Game/Overlays/BeatmapSet/Buttons/HeaderDownloadButton.cs @@ -20,7 +20,7 @@ using osuTK.Graphics; namespace osu.Game.Overlays.BeatmapSet.Buttons { - public class DownloadButton : BeatmapDownloadTrackingComposite, IHasTooltip + public class HeaderDownloadButton : BeatmapDownloadTrackingComposite, IHasTooltip { private readonly bool noVideo; @@ -31,7 +31,7 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons private ShakeContainer shakeContainer; private HeaderButton button; - public DownloadButton(BeatmapSetInfo beatmapSet, bool noVideo = false) + public HeaderDownloadButton(BeatmapSetInfo beatmapSet, bool noVideo = false) : base(beatmapSet) { this.noVideo = noVideo; diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 1c1167d08e..b50eac2c1a 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -18,7 +18,6 @@ using osu.Game.Overlays.BeatmapSet.Buttons; using osu.Game.Overlays.Direct; using osuTK; using osuTK.Graphics; -using DownloadButton = osu.Game.Overlays.BeatmapSet.Buttons.DownloadButton; namespace osu.Game.Overlays.BeatmapSet { @@ -268,7 +267,7 @@ namespace osu.Game.Overlays.BeatmapSet { case DownloadState.LocallyAvailable: // temporary for UX until new design is implemented. - downloadButtonsContainer.Child = new Direct.DownloadButton(BeatmapSet.Value) + downloadButtonsContainer.Child = new PanelDownloadButton(BeatmapSet.Value) { Width = 50, RelativeSizeAxes = Axes.Y @@ -278,13 +277,13 @@ namespace osu.Game.Overlays.BeatmapSet case DownloadState.Downloading: case DownloadState.Downloaded: // temporary to avoid showing two buttons for maps with novideo. will be fixed in new beatmap overlay design. - downloadButtonsContainer.Child = new DownloadButton(BeatmapSet.Value); + downloadButtonsContainer.Child = new HeaderDownloadButton(BeatmapSet.Value); break; default: - downloadButtonsContainer.Child = new DownloadButton(BeatmapSet.Value); + downloadButtonsContainer.Child = new HeaderDownloadButton(BeatmapSet.Value); if (BeatmapSet.Value.OnlineInfo.HasVideo) - downloadButtonsContainer.Add(new DownloadButton(BeatmapSet.Value, true)); + downloadButtonsContainer.Add(new HeaderDownloadButton(BeatmapSet.Value, true)); break; } } diff --git a/osu.Game/Overlays/Direct/DirectGridPanel.cs b/osu.Game/Overlays/Direct/DirectGridPanel.cs index 5756a4593d..243e79eb9b 100644 --- a/osu.Game/Overlays/Direct/DirectGridPanel.cs +++ b/osu.Game/Overlays/Direct/DirectGridPanel.cs @@ -155,7 +155,7 @@ namespace osu.Game.Overlays.Direct }, }, }, - new DownloadButton(SetInfo) + new PanelDownloadButton(SetInfo) { Size = new Vector2(50, 30), Margin = new MarginPadding(horizontal_padding), diff --git a/osu.Game/Overlays/Direct/DirectListPanel.cs b/osu.Game/Overlays/Direct/DirectListPanel.cs index 6f3b5bc5f1..5757e1445b 100644 --- a/osu.Game/Overlays/Direct/DirectListPanel.cs +++ b/osu.Game/Overlays/Direct/DirectListPanel.cs @@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Direct private const float height = 70; private FillFlowContainer statusContainer; - protected DownloadButton DownloadButton; + protected PanelDownloadButton DownloadButton; private PlayButton playButton; private Box progressBar; @@ -150,7 +150,7 @@ namespace osu.Game.Overlays.Direct Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, AutoSizeAxes = Axes.Both, - Child = DownloadButton = new DownloadButton(SetInfo) + Child = DownloadButton = new PanelDownloadButton(SetInfo) { Size = new Vector2(height - vertical_padding * 3), Margin = new MarginPadding { Left = vertical_padding * 2, Right = vertical_padding }, diff --git a/osu.Game/Overlays/Direct/DownloadButton.cs b/osu.Game/Overlays/Direct/PanelDownloadButton.cs similarity index 86% rename from osu.Game/Overlays/Direct/DownloadButton.cs rename to osu.Game/Overlays/Direct/PanelDownloadButton.cs index dac1521bf3..017f92abaa 100644 --- a/osu.Game/Overlays/Direct/DownloadButton.cs +++ b/osu.Game/Overlays/Direct/PanelDownloadButton.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 osu.Framework.Allocation; @@ -10,16 +10,16 @@ using osu.Game.Online; namespace osu.Game.Overlays.Direct { - public class DownloadButton : BeatmapDownloadTrackingComposite + public class PanelDownloadButton : BeatmapDownloadTrackingComposite { protected bool DownloadEnabled => button.Enabled.Value; private readonly bool noVideo; private readonly ShakeContainer shakeContainer; - private readonly OsuDownloadButton button; + private readonly DownloadButton button; - public DownloadButton(BeatmapSetInfo beatmapSet, bool noVideo = false) + public PanelDownloadButton(BeatmapSetInfo beatmapSet, bool noVideo = false) : base(beatmapSet) { this.noVideo = noVideo; @@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Direct InternalChild = shakeContainer = new ShakeContainer { RelativeSizeAxes = Axes.Both, - Child = button = new OsuDownloadButton + Child = button = new DownloadButton { RelativeSizeAxes = Axes.Both, }, diff --git a/osu.Game/Screens/Play/ReplayDownloadButton.cs b/osu.Game/Screens/Play/ReplayDownloadButton.cs index 5acf4e83d9..748fe8cc90 100644 --- a/osu.Game/Screens/Play/ReplayDownloadButton.cs +++ b/osu.Game/Screens/Play/ReplayDownloadButton.cs @@ -13,7 +13,7 @@ namespace osu.Game.Screens.Play { public class ReplayDownloadButton : DownloadTrackingComposite { - private OsuDownloadButton button; + private DownloadButton button; private ShakeContainer shakeContainer; private ReplayAvailability replayAvailability @@ -41,7 +41,7 @@ namespace osu.Game.Screens.Play InternalChild = shakeContainer = new ShakeContainer { RelativeSizeAxes = Axes.Both, - Child = button = new OsuDownloadButton + Child = button = new DownloadButton { RelativeSizeAxes = Axes.Both, } From d22a1229cbba13668b9f2abd5b33a220041d9658 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jul 2019 12:06:20 +0900 Subject: [PATCH 46/57] Remove unnecessary disposal --- osu.Game/Overlays/Direct/PanelDownloadButton.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/osu.Game/Overlays/Direct/PanelDownloadButton.cs b/osu.Game/Overlays/Direct/PanelDownloadButton.cs index 017f92abaa..4037cd46f3 100644 --- a/osu.Game/Overlays/Direct/PanelDownloadButton.cs +++ b/osu.Game/Overlays/Direct/PanelDownloadButton.cs @@ -71,12 +71,5 @@ namespace osu.Game.Overlays.Direct } }; } - - protected override void Dispose(bool isDisposing) - { - base.Dispose(isDisposing); - - button?.State.UnbindAll(); - } } } From 1189092e2033daa69f9fc224604de88fdbce546a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jul 2019 12:49:16 +0900 Subject: [PATCH 47/57] Remove redundant scale specification --- osu.Game/Online/Leaderboards/DrawableRank.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Online/Leaderboards/DrawableRank.cs b/osu.Game/Online/Leaderboards/DrawableRank.cs index 4d81ead494..50cb58c6ab 100644 --- a/osu.Game/Online/Leaderboards/DrawableRank.cs +++ b/osu.Game/Online/Leaderboards/DrawableRank.cs @@ -49,7 +49,6 @@ namespace osu.Game.Online.Leaderboards RelativeSizeAxes = Axes.Both, ColourDark = rankColour.Darken(0.1f), ColourLight = rankColour.Lighten(0.1f), - TriangleScale = 1, Velocity = 0.25f, }, new OsuSpriteText From 9eef8243c0906efb59013c66da45a7044a18fc1b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jul 2019 14:22:14 +0900 Subject: [PATCH 48/57] Update bounty/contribution information --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 55f2eebec9..6ef56149ab 100644 --- a/README.md +++ b/README.md @@ -92,11 +92,13 @@ Code analysis can be run with `powershell ./build.ps1` or `build.sh`. This is cu 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. -Please make sure you are familiar with the [development and testing](https://github.com/ppy/osu-framework/wiki/Development-and-Testing) procedure we have set up. New component development, and where possible, bug fixing and debugging existing components **should always be done under VisualTests**. +If you're unsure of what you can help with, check out the [list of open issues](https://github.com/ppy/osu/issues) (especially those with the ["good first issue"](https://github.com/ppy/osu/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22good+first+issue%22) label). -Contributions can be made via pull requests to this repository. We hope to credit and reward larger contributions via a [bounty system](https://www.bountysource.com/teams/ppy). If you're unsure of what you can help with, check out the [list of open issues](https://github.com/ppy/osu/issues). +Before starting, please make sure you are familiar with the [development and testing](https://github.com/ppy/osu-framework/wiki/Development-and-Testing) procedure we have set up. New component development, and where possible, bug fixing and debugging existing components **should always be done under VisualTests**. -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. +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. We welcome all feedback so we can make contributing to this project as pain-free as possible. + +For those interested, we love to reward quality contributions via [awarding bounties](https://docs.google.com/forms/d/e/1FAIpQLSet_8iFAgPMG526pBZ2Kic6HSh7XPM3fE8xPcnWNkMzINDdYg/viewform). Don't hesitate to request a bounty for your work on this project. ## Licence From 6c46643c26c6d5ad5539e2bbb812d4b30377cc2e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jul 2019 14:26:19 +0900 Subject: [PATCH 49/57] Update icon --- README.md | 6 ++++-- assets/lazer.png | Bin 0 -> 39498 bytes 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 assets/lazer.png diff --git a/README.md b/README.md index 6ef56149ab..18663353b4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +

+ +

+ # 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) @@ -22,8 +26,6 @@ Detailed changelogs are published on the [official osu! site](https://osu.ppy.sh ### Releases -![](https://puu.sh/DCmvA/f6a74f5fbb.png) - If you are not interested in developing the game, you can still consume our [binary releases](https://github.com/ppy/osu/releases). **Latest build:** diff --git a/assets/lazer.png b/assets/lazer.png new file mode 100644 index 0000000000000000000000000000000000000000..075a8e7184ad508cedd8fe9ae549d8cea696b51a GIT binary patch literal 39498 zcmY&fby(By*B(7eMk76>8%d={m!#6&jFgfN>FyRJ6%eGm8|fO|NQd<3ci-QC@3!mu ztgb!J&biMy_lYM`?SmXH7C9CG0Kip{m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cw2Ot$CjR&O)ra}J$c_$^Y literal 0 HcmV?d00001 From 299e9c9c33c7d1c1423813c616eac6085c67b714 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jul 2019 14:34:51 +0900 Subject: [PATCH 50/57] Update bounty line --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 18663353b4..2c330e403c 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ Before starting, please make sure you are familiar with the [development and tes 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. We welcome all feedback so we can make contributing to this project as pain-free as possible. -For those interested, we love to reward quality contributions via [awarding bounties](https://docs.google.com/forms/d/e/1FAIpQLSet_8iFAgPMG526pBZ2Kic6HSh7XPM3fE8xPcnWNkMzINDdYg/viewform). Don't hesitate to request a bounty for your work on this project. +For those interested, we love to reward quality contributions via bounties, paid out via paypal or osu! supporter tags. Don't hesitate to [request a bounty](https://docs.google.com/forms/d/e/1FAIpQLSet_8iFAgPMG526pBZ2Kic6HSh7XPM3fE8xPcnWNkMzINDdYg/viewform) for your work on this project. ## Licence From d9e646d9ef75290af7cf6a79ef59c006e121928e Mon Sep 17 00:00:00 2001 From: miterosan Date: Wed, 3 Jul 2019 09:51:09 +0200 Subject: [PATCH 51/57] Use addRuleset inside loadRulesetFromFile --- osu.Game/Rulesets/RulesetStore.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/RulesetStore.cs b/osu.Game/Rulesets/RulesetStore.cs index 17834f8545..15adc258a1 100644 --- a/osu.Game/Rulesets/RulesetStore.cs +++ b/osu.Game/Rulesets/RulesetStore.cs @@ -143,8 +143,7 @@ namespace osu.Game.Rulesets try { - var assembly = Assembly.LoadFrom(file); - loaded_assemblies[assembly] = assembly.GetTypes().First(t => t.IsPublic && t.IsSubclassOf(typeof(Ruleset))); + addRuleset(Assembly.LoadFrom(file)); } catch (Exception e) { From ab244d1b7f7cb1ab4abf7c65aa043571cc8165b9 Mon Sep 17 00:00:00 2001 From: miterosan Date: Wed, 3 Jul 2019 10:21:18 +0200 Subject: [PATCH 52/57] Only log that the rulesets could not be loaded from a directory. --- osu.Game/Rulesets/RulesetStore.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/RulesetStore.cs b/osu.Game/Rulesets/RulesetStore.cs index 15adc258a1..31c8d03df4 100644 --- a/osu.Game/Rulesets/RulesetStore.cs +++ b/osu.Game/Rulesets/RulesetStore.cs @@ -31,9 +31,9 @@ namespace osu.Game.Rulesets foreach (string file in files.Where(f => !Path.GetFileName(f).Contains("Tests"))) loadRulesetFromFile(file); } - catch (Exception e) + catch { - Logger.Error(e, $"Could not load rulesets from directory {Environment.CurrentDirectory}"); + Logger.Log($"Could not load rulesets from directory {Environment.CurrentDirectory}"); } } From 43d7f66c5bb095bd63ba02de3d34eaefe4c34d79 Mon Sep 17 00:00:00 2001 From: miterosan Date: Wed, 3 Jul 2019 10:54:10 +0200 Subject: [PATCH 53/57] Add comment about the android ruleset situation. --- osu.Game/Rulesets/RulesetStore.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Rulesets/RulesetStore.cs b/osu.Game/Rulesets/RulesetStore.cs index 31c8d03df4..d0f6971e1c 100644 --- a/osu.Game/Rulesets/RulesetStore.cs +++ b/osu.Game/Rulesets/RulesetStore.cs @@ -22,6 +22,8 @@ namespace osu.Game.Rulesets { AppDomain.CurrentDomain.AssemblyResolve += currentDomain_AssemblyResolve; + // On android in release configuration the assemblies are loaded from the apk directly into memory. + // In this case there is no way to access the ruleset assemblies from the filesystem. addLoadedRulesets(); try From 5ecb764cdcf65ddd0f9a0bae68f30cda46072542 Mon Sep 17 00:00:00 2001 From: miterosan Date: Wed, 3 Jul 2019 10:57:09 +0200 Subject: [PATCH 54/57] Remove whitespaces and lowercase the comments --- osu.Game/Rulesets/RulesetStore.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/RulesetStore.cs b/osu.Game/Rulesets/RulesetStore.cs index d0f6971e1c..a7d62665db 100644 --- a/osu.Game/Rulesets/RulesetStore.cs +++ b/osu.Game/Rulesets/RulesetStore.cs @@ -22,8 +22,8 @@ namespace osu.Game.Rulesets { AppDomain.CurrentDomain.AssemblyResolve += currentDomain_AssemblyResolve; - // On android in release configuration the assemblies are loaded from the apk directly into memory. - // In this case there is no way to access the ruleset assemblies from the filesystem. + //on android in release configuration the assemblies are loaded from the apk directly into memory. + //in this case there is no way to access the rulesets assemblies from the filesystem. addLoadedRulesets(); try From 62dd89197c7fce70d38744a01beea5ad74056872 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jul 2019 18:36:04 +0900 Subject: [PATCH 55/57] Refactor comment slightly --- osu.Game/Rulesets/RulesetStore.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/RulesetStore.cs b/osu.Game/Rulesets/RulesetStore.cs index a7d62665db..4476f16e32 100644 --- a/osu.Game/Rulesets/RulesetStore.cs +++ b/osu.Game/Rulesets/RulesetStore.cs @@ -22,8 +22,8 @@ namespace osu.Game.Rulesets { AppDomain.CurrentDomain.AssemblyResolve += currentDomain_AssemblyResolve; - //on android in release configuration the assemblies are loaded from the apk directly into memory. - //in this case there is no way to access the rulesets assemblies from the filesystem. + // On android in release configuration assemblies are loaded from the apk directly into memory. + // We cannot read assemblies from cwd, so should check loaded assemblies isntead. addLoadedRulesets(); try From 06ef8f71e96e2af7242c558c2cd279afe3c72a6c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jul 2019 18:41:01 +0900 Subject: [PATCH 56/57] Fix typo --- osu.Game/Rulesets/RulesetStore.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/RulesetStore.cs b/osu.Game/Rulesets/RulesetStore.cs index 4476f16e32..69ce5f97b6 100644 --- a/osu.Game/Rulesets/RulesetStore.cs +++ b/osu.Game/Rulesets/RulesetStore.cs @@ -23,7 +23,7 @@ namespace osu.Game.Rulesets AppDomain.CurrentDomain.AssemblyResolve += currentDomain_AssemblyResolve; // On android in release configuration assemblies are loaded from the apk directly into memory. - // We cannot read assemblies from cwd, so should check loaded assemblies isntead. + // We cannot read assemblies from cwd, so should check loaded assemblies instead. addLoadedRulesets(); try From 8120bb36bc598acadb0d30952bd370fdeb639fae Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jul 2019 18:42:10 +0900 Subject: [PATCH 57/57] More methods --- osu.Game/Rulesets/RulesetStore.cs | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/osu.Game/Rulesets/RulesetStore.cs b/osu.Game/Rulesets/RulesetStore.cs index 69ce5f97b6..fd42f96c92 100644 --- a/osu.Game/Rulesets/RulesetStore.cs +++ b/osu.Game/Rulesets/RulesetStore.cs @@ -24,19 +24,9 @@ namespace osu.Game.Rulesets // On android in release configuration assemblies are loaded from the apk directly into memory. // We cannot read assemblies from cwd, so should check loaded assemblies instead. - addLoadedRulesets(); + loadFromAppDomain(); - try - { - string[] files = Directory.GetFiles(Environment.CurrentDirectory, $"{ruleset_library_prefix}.*.dll"); - - foreach (string file in files.Where(f => !Path.GetFileName(f).Contains("Tests"))) - loadRulesetFromFile(file); - } - catch - { - Logger.Log($"Could not load rulesets from directory {Environment.CurrentDirectory}"); - } + loadFromDisk(); } public RulesetStore(IDatabaseContextFactory factory) @@ -123,7 +113,7 @@ namespace osu.Game.Rulesets } } - private static void addLoadedRulesets() + private static void loadFromAppDomain() { foreach (var ruleset in AppDomain.CurrentDomain.GetAssemblies()) { @@ -136,6 +126,21 @@ namespace osu.Game.Rulesets } } + private static void loadFromDisk() + { + try + { + string[] files = Directory.GetFiles(Environment.CurrentDirectory, $"{ruleset_library_prefix}.*.dll"); + + foreach (string file in files.Where(f => !Path.GetFileName(f).Contains("Tests"))) + loadRulesetFromFile(file); + } + catch + { + Logger.Log($"Could not load rulesets from directory {Environment.CurrentDirectory}"); + } + } + private static void loadRulesetFromFile(string file) { var filename = Path.GetFileNameWithoutExtension(file);