From 16e48ed187073b9f77799016005356a3a166e38d Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 5 Nov 2017 16:33:58 +0530 Subject: [PATCH 01/27] Hook up download logic with BeatmapSetOverlay download buttons. - Add noVideo option to DownloadBeatmapSetRequest - Make Download fire an event with new download instead of returning it --- osu.Game/Beatmaps/BeatmapManager.cs | 27 +++++++++---- .../API/Requests/DownloadBeatmapSetRequest.cs | 7 +++- osu.Game/Overlays/BeatmapSet/Header.cs | 40 ++++++++++++++++--- osu.Game/Overlays/BeatmapSetOverlay.cs | 14 ++++++- osu.Game/Overlays/Direct/DirectPanel.cs | 20 +++------- 5 files changed, 78 insertions(+), 30 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index f02a9a176c..e610073300 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -18,6 +18,7 @@ using osu.Framework.Platform; using osu.Game.Beatmaps.Formats; using osu.Game.Beatmaps.IO; using osu.Game.Database; +using osu.Game.Graphics; using osu.Game.IO; using osu.Game.IPC; using osu.Game.Online.API; @@ -52,6 +53,11 @@ namespace osu.Game.Beatmaps /// public event Action BeatmapRestored; + /// + /// Fired when a beatmap download begins. + /// + public event Action BeatmapDownloadBegan; + /// /// A default representation of a WorkingBeatmap to use when no beatmap is available. /// @@ -221,21 +227,29 @@ namespace osu.Game.Beatmaps /// Downloads a beatmap. /// /// The to be downloaded. - /// A new , or an existing one if a download is already in progress. - public DownloadBeatmapSetRequest Download(BeatmapSetInfo beatmapSetInfo) + /// Whether the beatmap should be downloaded without video. Defaults to false. + public void Download(BeatmapSetInfo beatmapSetInfo, bool noVideo = false) { var existing = GetExistingDownload(beatmapSetInfo); - if (existing != null) return existing; + if (existing != null || api == null) return; - if (api == null) return null; + if (!api.LocalUser.Value.IsSupporter) + { + PostNotification?.Invoke(new SimpleNotification + { + Icon = FontAwesome.fa_superpowers, + Text = "You gotta be a supporter to download for now 'yo" + }); + return; + } ProgressNotification downloadNotification = new ProgressNotification { Text = $"Downloading {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}", }; - var request = new DownloadBeatmapSetRequest(beatmapSetInfo); + var request = new DownloadBeatmapSetRequest(beatmapSetInfo, noVideo); request.DownloadProgressed += progress => { @@ -280,8 +294,7 @@ namespace osu.Game.Beatmaps // don't run in the main api queue as this is a long-running task. Task.Factory.StartNew(() => request.Perform(api), TaskCreationOptions.LongRunning); - - return request; + BeatmapDownloadBegan?.Invoke(request); } /// diff --git a/osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs b/osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs index 5a9f609bca..cdcc06a65c 100644 --- a/osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs +++ b/osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs @@ -12,13 +12,16 @@ namespace osu.Game.Online.API.Requests public Action DownloadProgressed; - public DownloadBeatmapSetRequest(BeatmapSetInfo set) + private readonly bool noVideo; + + public DownloadBeatmapSetRequest(BeatmapSetInfo set, bool noVideo) { + this.noVideo = noVideo; BeatmapSet = set; Progress += (current, total) => DownloadProgressed?.Invoke((float) current / total); } - protected override string Target => $@"beatmapsets/{BeatmapSet.OnlineBeatmapSetID}/download"; + protected override string Target => $@"beatmapsets/{BeatmapSet.OnlineBeatmapSetID}/download{(noVideo ? "?noVideo=1" : "")}"; } } diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index d4514cbaed..a9802c8155 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -27,12 +27,17 @@ namespace osu.Game.Overlays.BeatmapSet private readonly Container coverContainer; private readonly OsuSpriteText title, artist; private readonly AuthorInfo author; + private readonly Container downloadButtonsContainer; public Details Details; + private BeatmapManager beatmaps; + private DelayedLoadWrapper cover; public readonly BeatmapPicker Picker; + private bool isDownloading => beatmaps.GetExistingDownload(BeatmapSet) != null; + private BeatmapSetInfo beatmapSet; public BeatmapSetInfo BeatmapSet { @@ -162,7 +167,7 @@ namespace osu.Game.Overlays.BeatmapSet Children = new Drawable[] { new FavouriteButton(), - new Container + downloadButtonsContainer = new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = buttons_height + buttons_spacing }, @@ -172,7 +177,10 @@ namespace osu.Game.Overlays.BeatmapSet { RelativeSizeAxes = Axes.Both, Alpha = 0f, - Child = new DownloadButton("Download", @""), + Child = new DownloadButton("Download", @"") + { + Action = () => download(false), + }, }, videoButtons = new FillFlowContainer { @@ -181,8 +189,14 @@ namespace osu.Game.Overlays.BeatmapSet Alpha = 0f, Children = new[] { - new DownloadButton("Download", "with Video"), - new DownloadButton("Download", "without Video"), + new DownloadButton("Download", "with Video") + { + Action = () => download(false), + }, + new DownloadButton("Download", "without Video") + { + Action = () => download(true), + }, }, }, }, @@ -220,9 +234,25 @@ namespace osu.Game.Overlays.BeatmapSet } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OsuColour colours, BeatmapManager beatmaps) { tabsBg.Colour = colours.Gray3; + this.beatmaps = beatmaps; + } + + private void download(bool video) + { + if (beatmaps.GetExistingDownload(BeatmapSet) != null) + { + downloadButtonsContainer.MoveToX(-5, 50, Easing.OutSine).Then() + .MoveToX(5, 100, Easing.InOutSine).Then() + .MoveToX(-5, 100, Easing.InOutSine).Then() + .MoveToX(0, 50, Easing.InSine).Then(); + + return; + } + + beatmaps.Download(BeatmapSet); } } } diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index ddd146bcb6..7e80f427de 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -24,11 +24,14 @@ namespace osu.Game.Overlays public const float X_PADDING = 40; public const float RIGHT_WIDTH = 275; + private BeatmapSetInfo currentBeatmap; + private readonly Header header; private readonly Info info; private APIAccess api; private RulesetStore rulesets; + private BeatmapManager manager; // receive input outside our bounds so we can trigger a close event on ourselves. public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; @@ -83,10 +86,17 @@ namespace osu.Game.Overlays } [BackgroundDependencyLoader] - private void load(APIAccess api, RulesetStore rulesets) + private void load(APIAccess api, RulesetStore rulesets, BeatmapManager manager) { this.api = api; this.rulesets = rulesets; + this.manager = manager; + + manager.BeatmapSetAdded += beatmap => + { + if (beatmap.OnlineBeatmapSetID == currentBeatmap.OnlineBeatmapSetID) + Hide(); + }; } protected override void PopIn() @@ -118,7 +128,7 @@ namespace osu.Game.Overlays public void ShowBeatmapSet(BeatmapSetInfo set) { - header.BeatmapSet = info.BeatmapSet = set; + currentBeatmap = header.BeatmapSet = info.BeatmapSet = set; Show(); } } diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index ef89c0022b..702aef7417 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -18,7 +18,6 @@ using osu.Framework.Input; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API; using osu.Framework.Logging; -using osu.Game.Overlays.Notifications; using osu.Game.Online.API.Requests; using osu.Framework.Configuration; using osu.Framework.Audio.Track; @@ -109,6 +108,8 @@ namespace osu.Game.Overlays.Direct if (downloadRequest != null) attachDownload(downloadRequest); + + beatmaps.BeatmapDownloadBegan += attachDownload; } protected override void Update() @@ -151,16 +152,6 @@ namespace osu.Game.Overlays.Direct protected void StartDownload() { - if (!api.LocalUser.Value.IsSupporter) - { - notifications.Post(new SimpleNotification - { - Icon = FontAwesome.fa_superpowers, - Text = "You gotta be a supporter to download for now 'yo" - }); - return; - } - if (beatmaps.GetExistingDownload(SetInfo) != null) { // we already have an active download running. @@ -172,13 +163,14 @@ namespace osu.Game.Overlays.Direct return; } - var request = beatmaps.Download(SetInfo); - - attachDownload(request); + beatmaps.Download(SetInfo); } private void attachDownload(DownloadBeatmapSetRequest request) { + if (request.BeatmapSet.OnlineBeatmapSetID != SetInfo.OnlineBeatmapSetID) + return; + progressBar.FadeIn(400, Easing.OutQuint); progressBar.ResizeHeightTo(4, 400, Easing.OutQuint); From bbe555dc3cd2a19ede0a58a80e171ed4cca22fd8 Mon Sep 17 00:00:00 2001 From: naoey Date: Wed, 15 Nov 2017 17:49:41 +0530 Subject: [PATCH 02/27] Pass noVideo flag on... --- osu.Game/Overlays/BeatmapSet/Header.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 0cfa7be81a..f9998dcca2 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -228,7 +228,7 @@ namespace osu.Game.Overlays.BeatmapSet this.beatmaps = beatmaps; } - private void download(bool video) + private void download(bool noVideo) { if (beatmaps.GetExistingDownload(BeatmapSet) != null) { @@ -240,7 +240,7 @@ namespace osu.Game.Overlays.BeatmapSet return; } - beatmaps.Download(BeatmapSet); + beatmaps.Download(BeatmapSet, noVideo); } } } From df53b884eabe7025b8e46b879ce76274a6f28b43 Mon Sep 17 00:00:00 2001 From: naoey Date: Wed, 15 Nov 2017 17:58:02 +0530 Subject: [PATCH 03/27] Removed unused stuff. --- osu.Game/Overlays/BeatmapSet/Header.cs | 2 -- osu.Game/Overlays/BeatmapSetOverlay.cs | 2 -- osu.Game/Overlays/Direct/DirectPanel.cs | 7 +------ 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index f9998dcca2..ed72cf0cc9 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -38,8 +38,6 @@ namespace osu.Game.Overlays.BeatmapSet public readonly BeatmapPicker Picker; - private bool isDownloading => beatmaps.GetExistingDownload(BeatmapSet) != null; - private BeatmapSetInfo beatmapSet; public BeatmapSetInfo BeatmapSet { diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index 1173390d57..7ae2d323b8 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -31,7 +31,6 @@ namespace osu.Game.Overlays private APIAccess api; private RulesetStore rulesets; - private BeatmapManager manager; private readonly ScrollContainer scroll; @@ -92,7 +91,6 @@ namespace osu.Game.Overlays { this.api = api; this.rulesets = rulesets; - this.manager = manager; manager.BeatmapSetAdded += beatmap => { diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index 702aef7417..d4f4067fca 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -16,7 +16,6 @@ using osu.Game.Graphics.Sprites; using OpenTK.Graphics; using osu.Framework.Input; using osu.Game.Graphics.UserInterface; -using osu.Game.Online.API; using osu.Framework.Logging; using osu.Game.Online.API.Requests; using osu.Framework.Configuration; @@ -34,10 +33,8 @@ namespace osu.Game.Overlays.Direct private Container content; - private APIAccess api; private ProgressBar progressBar; private BeatmapManager beatmaps; - private NotificationOverlay notifications; private BeatmapSetOverlay beatmapSetOverlay; public Track Preview => PlayButton.Preview; @@ -70,11 +67,9 @@ namespace osu.Game.Overlays.Direct [BackgroundDependencyLoader(permitNulls: true)] - private void load(APIAccess api, BeatmapManager beatmaps, OsuColour colours, NotificationOverlay notifications, BeatmapSetOverlay beatmapSetOverlay) + private void load(BeatmapManager beatmaps, OsuColour colours, BeatmapSetOverlay beatmapSetOverlay) { - this.api = api; this.beatmaps = beatmaps; - this.notifications = notifications; this.beatmapSetOverlay = beatmapSetOverlay; AddInternal(content = new Container From 97c5956083779edfcb8d5c8ac9b5b6e4b5b2bdee Mon Sep 17 00:00:00 2001 From: naoey Date: Thu, 16 Nov 2017 15:36:22 +0530 Subject: [PATCH 04/27] Make download buttons disappear instead of closing overlay. - Also unbind event handlers - Remove unused field --- osu.Game/Overlays/BeatmapSet/Header.cs | 15 +++++++++++++++ osu.Game/Overlays/BeatmapSetOverlay.cs | 12 ++---------- osu.Game/Overlays/Direct/DirectPanel.cs | 6 ++++++ 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index ed72cf0cc9..27ef6208be 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -51,6 +51,7 @@ namespace osu.Game.Overlays.BeatmapSet title.Text = BeatmapSet.Metadata.Title; artist.Text = BeatmapSet.Metadata.Artist; + downloadButtonsContainer.FadeIn(); noVideoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 0 : 1, transition_duration); videoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 1 : 0, transition_duration); @@ -224,6 +225,20 @@ namespace osu.Game.Overlays.BeatmapSet { tabsBg.Colour = colours.Gray3; this.beatmaps = beatmaps; + + beatmaps.BeatmapSetAdded += handleBeatmapAdd; + } + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + beatmaps.BeatmapSetAdded -= handleBeatmapAdd; + } + + private void handleBeatmapAdd(BeatmapSetInfo beatmap) + { + if (beatmap.OnlineBeatmapSetID == BeatmapSet.OnlineBeatmapSetID) + downloadButtonsContainer.FadeOut(transition_duration); } private void download(bool noVideo) diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index 7ae2d323b8..940ac433fc 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -24,8 +24,6 @@ namespace osu.Game.Overlays public const float X_PADDING = 40; public const float RIGHT_WIDTH = 275; - private BeatmapSetInfo currentBeatmap; - private readonly Header header; private readonly Info info; @@ -87,16 +85,10 @@ namespace osu.Game.Overlays } [BackgroundDependencyLoader] - private void load(APIAccess api, RulesetStore rulesets, BeatmapManager manager) + private void load(APIAccess api, RulesetStore rulesets) { this.api = api; this.rulesets = rulesets; - - manager.BeatmapSetAdded += beatmap => - { - if (beatmap.OnlineBeatmapSetID == currentBeatmap.OnlineBeatmapSetID) - Hide(); - }; } protected override void PopIn() @@ -128,7 +120,7 @@ namespace osu.Game.Overlays public void ShowBeatmapSet(BeatmapSetInfo set) { - currentBeatmap = header.BeatmapSet = info.BeatmapSet = set; + header.BeatmapSet = info.BeatmapSet = set; Show(); scroll.ScrollTo(0); } diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index d4f4067fca..b8a8528962 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -107,6 +107,12 @@ namespace osu.Game.Overlays.Direct beatmaps.BeatmapDownloadBegan += attachDownload; } + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + beatmaps.BeatmapDownloadBegan -= attachDownload; + } + protected override void Update() { base.Update(); From 87f13688692bce3d25ff9f52e8778b56546103a6 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 18 Nov 2017 18:19:35 +0300 Subject: [PATCH 05/27] Add KudosuInfo container in the kudosu section --- .../Profile/Sections/Kudosu/KudosuInfo.cs | 146 ++++++++++++++++++ .../Profile/Sections/KudosuSection.cs | 10 ++ osu.Game/Overlays/UserProfileOverlay.cs | 2 +- osu.Game/osu.Game.csproj | 1 + 4 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs new file mode 100644 index 0000000000..14d2ef39f8 --- /dev/null +++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs @@ -0,0 +1,146 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; +using OpenTK.Graphics; +using osu.Framework.Configuration; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Input; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Users; + +namespace osu.Game.Overlays.Profile.Sections.Kudosu +{ + public class KudosuInfo : Container + { + private const int content_text_size = 19; + + protected readonly Bindable User = new Bindable(); + + public KudosuInfo(Bindable user) + { + User.BindTo(user); + + SubSection total; + SubSection avaliable; + + RelativeSizeAxes = Axes.X; + Height = 130; + Masking = true; + CornerRadius = 3; + EdgeEffect = new EdgeEffectParameters + { + Type = EdgeEffectType.Shadow, + Offset = new Vector2(0f, 1f), + Radius = 2.5f, + Colour = Color4.Black.Opacity(0.2f), + }; + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = OsuColour.Gray(0.2f) + }, + new GridContainer + { + RelativeSizeAxes = Axes.Both, + Content = new[] + { + new Drawable[] + { + total = new SubSection("Total Kudosu Earned"), + avaliable = new SubSection("Kudosu Avaliable"), + } + } + } + }; + + total.TextFlow.Text = "Based on how much of a contribution the user has made to " + + "beatmap moderation. See this link for more information."; + + avaliable.TextFlow.Text = "Kudosu can be traded for kudosu stars, which will help your beatmap get " + + "more attention. This is the number of kudosu you haven't traded in yet."; + + User.ValueChanged += newUser => + { + total.KudosuValue = newUser == null ? 0 : newUser.Kudosu.Total; + avaliable.KudosuValue = newUser == null ? 0 : newUser.Kudosu.Available; + }; + } + + protected override bool OnClick(InputState state) => true; + + private class SubSection : Container + { + public readonly TextFlowContainer TextFlow; + + private readonly OsuSpriteText valueText; + + private int kudosuValue; + public int KudosuValue + { + get { return kudosuValue; } + set + { + if (kudosuValue == value) + return; + kudosuValue = value; + + valueText.Text = kudosuValue.ToString(); + } + } + + public SubSection(string header) + { + RelativeSizeAxes = Axes.Both; + Padding = new MarginPadding { Horizontal = 10, Top = 10 }; + Child = new FillFlowContainer + { + AutoSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.X, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 5), + Children = new Drawable[] + { + new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, + Spacing = new Vector2(5, 0), + Children = new Drawable[] + { + new OsuSpriteText + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + Text = header + ":", + TextSize = 20, + Font = @"Exo2.0-RegularItalic", + }, + valueText = new OsuSpriteText + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + Text = "0", + TextSize = 40, + UseFullGlyphHeight = false, + Font = @"Exo2.0-RegularItalic" + } + } + }, + TextFlow = new TextFlowContainer(t => { t.TextSize = 19; }) + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + } + } + }; + } + } + } +} diff --git a/osu.Game/Overlays/Profile/Sections/KudosuSection.cs b/osu.Game/Overlays/Profile/Sections/KudosuSection.cs index 3c36368fd7..907c26e5e8 100644 --- a/osu.Game/Overlays/Profile/Sections/KudosuSection.cs +++ b/osu.Game/Overlays/Profile/Sections/KudosuSection.cs @@ -1,6 +1,8 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Overlays.Profile.Sections.Kudosu; + namespace osu.Game.Overlays.Profile.Sections { public class KudosuSection : ProfileSection @@ -8,5 +10,13 @@ namespace osu.Game.Overlays.Profile.Sections public override string Title => "Kudosu!"; public override string Identifier => "kudosu"; + + public KudosuSection() + { + Children = new[] + { + new KudosuInfo(User), + }; + } } } diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index dd31a43290..7374a9aa44 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -97,7 +97,7 @@ namespace osu.Game.Overlays //new MedalsSection(), new HistoricalSection(), new BeatmapsSection(), - //new KudosuSection() + new KudosuSection() }; tabs = new ProfileTabControl { diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 7b479bdba2..b9d8e36ff3 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -288,6 +288,7 @@ + From 915ccf3c84b8229b73d2068eecaf39324f348ba6 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 18 Nov 2017 18:41:00 +0300 Subject: [PATCH 06/27] Fix some layout issues --- .../Profile/Sections/Kudosu/KudosuInfo.cs | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs index 14d2ef39f8..3fe0bfd9e2 100644 --- a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs +++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs @@ -17,26 +17,24 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu { public class KudosuInfo : Container { - private const int content_text_size = 19; - - protected readonly Bindable User = new Bindable(); + private readonly Bindable user = new Bindable(); public KudosuInfo(Bindable user) { - User.BindTo(user); + this.user.BindTo(user); SubSection total; SubSection avaliable; RelativeSizeAxes = Axes.X; - Height = 130; + AutoSizeAxes = Axes.Y; Masking = true; CornerRadius = 3; EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Offset = new Vector2(0f, 1f), - Radius = 2.5f, + Radius = 3f, Colour = Color4.Black.Opacity(0.2f), }; Children = new Drawable[] @@ -46,18 +44,12 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(0.2f) }, - new GridContainer + total = new SubSection("Total Kudosu Earned"), + avaliable = new SubSection("Kudosu Avaliable") { - RelativeSizeAxes = Axes.Both, - Content = new[] - { - new Drawable[] - { - total = new SubSection("Total Kudosu Earned"), - avaliable = new SubSection("Kudosu Avaliable"), - } - } - } + RelativePositionAxes = Axes.X, + X = 0.5f, + }, }; total.TextFlow.Text = "Based on how much of a contribution the user has made to " + @@ -66,7 +58,7 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu avaliable.TextFlow.Text = "Kudosu can be traded for kudosu stars, which will help your beatmap get " + "more attention. This is the number of kudosu you haven't traded in yet."; - User.ValueChanged += newUser => + this.user.ValueChanged += newUser => { total.KudosuValue = newUser == null ? 0 : newUser.Kudosu.Total; avaliable.KudosuValue = newUser == null ? 0 : newUser.Kudosu.Available; @@ -97,8 +89,10 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu public SubSection(string header) { - RelativeSizeAxes = Axes.Both; - Padding = new MarginPadding { Horizontal = 10, Top = 10 }; + RelativeSizeAxes = Axes.X; + Width = 0.5f; + AutoSizeAxes = Axes.Y; + Padding = new MarginPadding { Horizontal = 10, Top = 10, Bottom = 20 }; Child = new FillFlowContainer { AutoSizeAxes = Axes.Y, From 2ff88c86eafc4509b7b0c1d430a34e1f52fd3c09 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sat, 18 Nov 2017 18:53:21 +0300 Subject: [PATCH 07/27] CI fixes --- osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs index 3fe0bfd9e2..1982059065 100644 --- a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs +++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs @@ -57,11 +57,11 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu avaliable.TextFlow.Text = "Kudosu can be traded for kudosu stars, which will help your beatmap get " + "more attention. This is the number of kudosu you haven't traded in yet."; - + this.user.ValueChanged += newUser => { - total.KudosuValue = newUser == null ? 0 : newUser.Kudosu.Total; - avaliable.KudosuValue = newUser == null ? 0 : newUser.Kudosu.Available; + total.KudosuValue = newUser?.Kudosu.Total ?? 0; + avaliable.KudosuValue = newUser?.Kudosu.Available ?? 0; }; } From a033eb46d3361e321aaccf24e7569adfdaa988c5 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Tue, 21 Nov 2017 16:12:23 +0100 Subject: [PATCH 08/27] Changed to LoadComponentAsync call instead of adding an AsyncLoadWrapper instance. --- osu.Game/Overlays/Direct/PlayButton.cs | 11 ++++----- osu.Game/Overlays/Profile/ProfileHeader.cs | 10 ++++---- osu.Game/Screens/Multiplayer/DrawableRoom.cs | 21 +++++++++-------- osu.Game/Screens/Multiplayer/RoomInspector.cs | 23 +++++++++++-------- osu.Game/Screens/Play/Player.cs | 3 ++- 5 files changed, 37 insertions(+), 31 deletions(-) diff --git a/osu.Game/Overlays/Direct/PlayButton.cs b/osu.Game/Overlays/Direct/PlayButton.cs index 9317bc06cf..7fff2821e3 100644 --- a/osu.Game/Overlays/Direct/PlayButton.cs +++ b/osu.Game/Overlays/Direct/PlayButton.cs @@ -146,18 +146,17 @@ namespace osu.Game.Overlays.Direct loading = true; - Add(new AsyncLoadWrapper(trackLoader = new TrackLoader($"https://b.ppy.sh/preview/{BeatmapSet.OnlineBeatmapSetID}.mp3") - { - OnLoadComplete = d => + LoadComponentAsync(trackLoader = new TrackLoader($"https://b.ppy.sh/preview/{BeatmapSet.OnlineBeatmapSetID}.mp3"), + d => { - // we may have been replaced by another loader + // We may have been replaced by another loader if (trackLoader != d) return; Preview = (d as TrackLoader)?.Preview; Playing.TriggerChange(); loading = false; - }, - })); + Add(trackLoader); + }); } private class TrackLoader : Drawable diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index 22e34be34c..6a9247e73b 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -316,18 +316,18 @@ namespace osu.Game.Overlays.Profile private void loadUser() { - coverContainer.Add(new AsyncLoadWrapper(new UserCoverBackground(user) + LoadComponentAsync(new UserCoverBackground(user) { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, FillMode = FillMode.Fill, OnLoadComplete = d => d.FadeInFromZero(200) - }) + }, + ucb => { - Masking = true, - RelativeSizeAxes = Axes.Both, - Depth = float.MaxValue + ucb.Depth = float.MaxValue; + coverContainer.Add(ucb); }); if (user.IsSupporter) supporterTag.Show(); diff --git a/osu.Game/Screens/Multiplayer/DrawableRoom.cs b/osu.Game/Screens/Multiplayer/DrawableRoom.cs index d2f88224c2..dd69ec9db1 100644 --- a/osu.Game/Screens/Multiplayer/DrawableRoom.cs +++ b/osu.Game/Screens/Multiplayer/DrawableRoom.cs @@ -228,16 +228,19 @@ namespace osu.Game.Screens.Multiplayer if (value != null) { coverContainer.FadeIn(transition_duration); - coverContainer.Children = new[] + + LoadComponentAsync(new BeatmapSetCover(value.BeatmapSet) { - new AsyncLoadWrapper(new BeatmapSetCover(value.BeatmapSet) - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - FillMode = FillMode.Fill, - OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), - }) { RelativeSizeAxes = Axes.Both }, - }; + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + FillMode = FillMode.Fill, + OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), + }, + bsc => + { + bsc.RelativeSizeAxes = Axes.Both; + coverContainer.Add(bsc); + }); beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title); beatmapDash.Text = @" - "; diff --git a/osu.Game/Screens/Multiplayer/RoomInspector.cs b/osu.Game/Screens/Multiplayer/RoomInspector.cs index 66ce51b428..fec35d3d7e 100644 --- a/osu.Game/Screens/Multiplayer/RoomInspector.cs +++ b/osu.Game/Screens/Multiplayer/RoomInspector.cs @@ -329,17 +329,20 @@ namespace osu.Game.Screens.Multiplayer if (value != null) { coverContainer.FadeIn(transition_duration); - coverContainer.Children = new[] + + LoadComponentAsync(new BeatmapSetCover(value.BeatmapSet) { - new AsyncLoadWrapper(new BeatmapSetCover(value.BeatmapSet) - { - RelativeSizeAxes = Axes.Both, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - FillMode = FillMode.Fill, - OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), - }) { RelativeSizeAxes = Axes.Both }, - }; + RelativeSizeAxes = Axes.Both, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + FillMode = FillMode.Fill, + OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), + }, + bsc => + { + bsc.RelativeSizeAxes = Axes.Both; + coverContainer.Add(bsc); + }); beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title); beatmapDash.Text = @" - "; diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index cd2818398d..5f7ef03218 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -248,7 +248,8 @@ namespace osu.Game.Screens.Play storyboard = beatmap.Storyboard.CreateDrawable(Beatmap.Value); storyboard.Masking = true; - storyboardContainer.Add(asyncLoad ? new AsyncLoadWrapper(storyboard) { RelativeSizeAxes = Axes.Both } : (Drawable)storyboard); + if (asyncLoad) LoadComponentAsync(storyboard, s => storyboardContainer.Add(s)); + else storyboardContainer.Add((Drawable)storyboard); } public void Restart() From 870807c26588b0e967d94174bbc54104a1be58b0 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Tue, 21 Nov 2017 16:17:33 +0100 Subject: [PATCH 09/27] Switched over to the new LoadWrapper class for all delayed loading. --- osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs | 4 ++-- osu.Game/Overlays/BeatmapSet/Header.cs | 4 ++-- osu.Game/Overlays/Direct/DirectPanel.cs | 2 +- osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs | 2 +- osu.Game/Users/UpdateableAvatar.cs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs index 8a589ccd30..3644c1b26f 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -43,7 +43,7 @@ namespace osu.Game.Beatmaps.Drawables Children = new Drawable[] { - new DelayedLoadWrapper( + new LoadWrapper( new PanelBackground(beatmap) { RelativeSizeAxes = Axes.Both, @@ -185,4 +185,4 @@ namespace osu.Game.Beatmaps.Drawables } } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 96bb613f9f..3c7266bb57 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -31,7 +31,7 @@ namespace osu.Game.Overlays.BeatmapSet private readonly AuthorInfo author; public Details Details; - private DelayedLoadWrapper cover; + private LoadWrapper cover; public readonly BeatmapPicker Picker; @@ -52,7 +52,7 @@ namespace osu.Game.Overlays.BeatmapSet videoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 1 : 0, transition_duration); cover?.FadeOut(400, Easing.Out); - coverContainer.Add(cover = new DelayedLoadWrapper(new BeatmapSetCover(BeatmapSet) + coverContainer.Add(cover = new LoadWrapper(new BeatmapSetCover(BeatmapSet) { Anchor = Anchor.Centre, Origin = Anchor.Centre, diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index ef89c0022b..692e561435 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -219,7 +219,7 @@ namespace osu.Game.Overlays.Direct return icons; } - protected Drawable CreateBackground() => new DelayedLoadWrapper(new BeatmapSetCover(SetInfo) + protected Drawable CreateBackground() => new LoadWrapper(new BeatmapSetCover(SetInfo) { Anchor = Anchor.Centre, Origin = Anchor.Centre, diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 7b50d36b44..92fc6aef2b 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -99,7 +99,7 @@ namespace osu.Game.Screens.Select.Leaderboards Padding = new MarginPadding(edge_margin), Children = new Drawable[] { - avatar = new DelayedLoadWrapper( + avatar = new LoadWrapper( new Avatar(Score.User) { RelativeSizeAxes = Axes.Both, diff --git a/osu.Game/Users/UpdateableAvatar.cs b/osu.Game/Users/UpdateableAvatar.cs index 7c020fce91..12a189f18f 100644 --- a/osu.Game/Users/UpdateableAvatar.cs +++ b/osu.Game/Users/UpdateableAvatar.cs @@ -40,7 +40,7 @@ namespace osu.Game.Users { displayedAvatar?.FadeOut(300); displayedAvatar?.Expire(); - Add(displayedAvatar = new DelayedLoadWrapper(new Avatar(user) + Add(displayedAvatar = new LoadWrapper(new Avatar(user) { RelativeSizeAxes = Axes.Both, OnLoadComplete = d => d.FadeInFromZero(200), From fd7ac9b6fcdb1a476499d5f89714565f62dfa132 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Tue, 21 Nov 2017 16:18:32 +0100 Subject: [PATCH 10/27] Switched to the new LoadWrapper class for asynchronous loading (LoadComponentAsync not used here since it's not possible to call that method on a component that has not finished loading, and we're in the constructor where it would be called) --- osu.Game/Users/UserPanel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index ab4d55027d..e4fdcb4c1b 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -58,7 +58,7 @@ namespace osu.Game.Users Children = new Drawable[] { - new AsyncLoadWrapper(new UserCoverBackground(user) + new LoadWrapper(new UserCoverBackground(user) { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, From 2203a8430000b00d539bbfc29000556a789d0a54 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Tue, 21 Nov 2017 19:16:44 +0100 Subject: [PATCH 11/27] Small fixes and style corrections --- osu.Game/Overlays/BeatmapSet/Header.cs | 21 +++++++++-------- osu.Game/Overlays/Direct/DirectPanel.cs | 23 ++++++++++--------- osu.Game/Screens/Multiplayer/DrawableRoom.cs | 7 ++---- osu.Game/Screens/Multiplayer/RoomInspector.cs | 6 +---- osu.Game/Users/UpdateableAvatar.cs | 12 ++++++---- 5 files changed, 33 insertions(+), 36 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 3c7266bb57..5fed0c096a 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -52,17 +52,18 @@ namespace osu.Game.Overlays.BeatmapSet videoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 1 : 0, transition_duration); cover?.FadeOut(400, Easing.Out); - coverContainer.Add(cover = new LoadWrapper(new BeatmapSetCover(BeatmapSet) - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - FillMode = FillMode.Fill, - OnLoadComplete = d => + coverContainer.Add(cover = new LoadWrapper( + new BeatmapSetCover(BeatmapSet) { - d.FadeInFromZero(400, Easing.Out); - }, - }) + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + FillMode = FillMode.Fill, + OnLoadComplete = d => + { + d.FadeInFromZero(400, Easing.Out); + }, + }) { RelativeSizeAxes = Axes.Both, TimeBeforeLoad = 300 diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index 692e561435..98aa5ef0cb 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -219,18 +219,19 @@ namespace osu.Game.Overlays.Direct return icons; } - protected Drawable CreateBackground() => new LoadWrapper(new BeatmapSetCover(SetInfo) - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - FillMode = FillMode.Fill, - OnLoadComplete = d => + protected Drawable CreateBackground() => new LoadWrapper( + new BeatmapSetCover(SetInfo) { - d.FadeInFromZero(400, Easing.Out); - BlackBackground.Delay(400).FadeOut(); - }, - }) + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + FillMode = FillMode.Fill, + OnLoadComplete = d => + { + d.FadeInFromZero(400, Easing.Out); + BlackBackground.Delay(400).FadeOut(); + }, + }) { RelativeSizeAxes = Axes.Both, TimeBeforeLoad = 300 diff --git a/osu.Game/Screens/Multiplayer/DrawableRoom.cs b/osu.Game/Screens/Multiplayer/DrawableRoom.cs index dd69ec9db1..77e32752e4 100644 --- a/osu.Game/Screens/Multiplayer/DrawableRoom.cs +++ b/osu.Game/Screens/Multiplayer/DrawableRoom.cs @@ -229,6 +229,7 @@ namespace osu.Game.Screens.Multiplayer { coverContainer.FadeIn(transition_duration); + LoadComponentAsync(new BeatmapSetCover(value.BeatmapSet) { Anchor = Anchor.Centre, @@ -236,11 +237,7 @@ namespace osu.Game.Screens.Multiplayer FillMode = FillMode.Fill, OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), }, - bsc => - { - bsc.RelativeSizeAxes = Axes.Both; - coverContainer.Add(bsc); - }); + bsc => coverContainer.Add(bsc)); beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title); beatmapDash.Text = @" - "; diff --git a/osu.Game/Screens/Multiplayer/RoomInspector.cs b/osu.Game/Screens/Multiplayer/RoomInspector.cs index fec35d3d7e..30c2aa8505 100644 --- a/osu.Game/Screens/Multiplayer/RoomInspector.cs +++ b/osu.Game/Screens/Multiplayer/RoomInspector.cs @@ -338,11 +338,7 @@ namespace osu.Game.Screens.Multiplayer FillMode = FillMode.Fill, OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), }, - bsc => - { - bsc.RelativeSizeAxes = Axes.Both; - coverContainer.Add(bsc); - }); + bsc => coverContainer.Add(bsc)); beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title); beatmapDash.Text = @" - "; diff --git a/osu.Game/Users/UpdateableAvatar.cs b/osu.Game/Users/UpdateableAvatar.cs index 12a189f18f..02018ee1f4 100644 --- a/osu.Game/Users/UpdateableAvatar.cs +++ b/osu.Game/Users/UpdateableAvatar.cs @@ -40,11 +40,13 @@ namespace osu.Game.Users { displayedAvatar?.FadeOut(300); displayedAvatar?.Expire(); - Add(displayedAvatar = new LoadWrapper(new Avatar(user) - { - RelativeSizeAxes = Axes.Both, - OnLoadComplete = d => d.FadeInFromZero(200), - })); + Add(displayedAvatar = new LoadWrapper( + new Avatar(user) + { + RelativeSizeAxes = Axes.Both, + OnLoadComplete = d => d.FadeInFromZero(200), + }) + ); } } } From bf0184c06dc1cbef794c3e617bdb97caa7145bf1 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Tue, 21 Nov 2017 19:34:01 +0100 Subject: [PATCH 12/27] One more small style fix --- osu.Game/Overlays/BeatmapSet/Header.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 5fed0c096a..b9d04e7b55 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -59,10 +59,7 @@ namespace osu.Game.Overlays.BeatmapSet Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fill, - OnLoadComplete = d => - { - d.FadeInFromZero(400, Easing.Out); - }, + OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), }) { RelativeSizeAxes = Axes.Both, From 1d41e7cc8a8ea5a750004bbfe8ad1cd4936521da Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Tue, 21 Nov 2017 20:15:42 +0100 Subject: [PATCH 13/27] Removed newline at end --- osu.Game/Screens/Multiplayer/DrawableRoom.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Multiplayer/DrawableRoom.cs b/osu.Game/Screens/Multiplayer/DrawableRoom.cs index 77e32752e4..60a0bd7a82 100644 --- a/osu.Game/Screens/Multiplayer/DrawableRoom.cs +++ b/osu.Game/Screens/Multiplayer/DrawableRoom.cs @@ -229,7 +229,7 @@ namespace osu.Game.Screens.Multiplayer { coverContainer.FadeIn(transition_duration); - + LoadComponentAsync(new BeatmapSetCover(value.BeatmapSet) { Anchor = Anchor.Centre, @@ -260,4 +260,4 @@ namespace osu.Game.Screens.Multiplayer participantInfo.Participants = value; } } -} +} \ No newline at end of file From 7d428875b8c0a4537ef3bde6531393ca3edc0459 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Wed, 22 Nov 2017 15:46:04 +0100 Subject: [PATCH 14/27] Changed LoadWrapper back to DelayedLoadWrapper and fixed the implementation (dependent on framework change, delay now in ctor) --- osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs | 10 ++++------ osu.Game/Overlays/BeatmapSet/Header.cs | 8 ++++---- osu.Game/Overlays/Direct/DirectPanel.cs | 6 +++--- .../Screens/Select/Leaderboards/LeaderboardScore.cs | 6 +++--- osu.Game/Users/UpdateableAvatar.cs | 5 +++-- osu.Game/Users/UserPanel.cs | 2 +- 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs index 3644c1b26f..ec39f86c5c 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -43,16 +43,14 @@ namespace osu.Game.Beatmaps.Drawables Children = new Drawable[] { - new LoadWrapper( + new DelayedLoadWrapper( new PanelBackground(beatmap) { RelativeSizeAxes = Axes.Both, OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), - } - ) - { - TimeBeforeLoad = 300, - }, + }, + 300 + ), new FillFlowContainer { Direction = FillDirection.Vertical, diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index b9d04e7b55..9bf14e1f90 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -31,7 +31,7 @@ namespace osu.Game.Overlays.BeatmapSet private readonly AuthorInfo author; public Details Details; - private LoadWrapper cover; + private DelayedLoadWrapper cover; public readonly BeatmapPicker Picker; @@ -52,7 +52,7 @@ namespace osu.Game.Overlays.BeatmapSet videoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 1 : 0, transition_duration); cover?.FadeOut(400, Easing.Out); - coverContainer.Add(cover = new LoadWrapper( + coverContainer.Add(cover = new DelayedLoadWrapper( new BeatmapSetCover(BeatmapSet) { Anchor = Anchor.Centre, @@ -60,10 +60,10 @@ namespace osu.Game.Overlays.BeatmapSet RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fill, OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), - }) + }, + 300) { RelativeSizeAxes = Axes.Both, - TimeBeforeLoad = 300 }); } } diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index 98aa5ef0cb..bef8697552 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -219,7 +219,7 @@ namespace osu.Game.Overlays.Direct return icons; } - protected Drawable CreateBackground() => new LoadWrapper( + protected Drawable CreateBackground() => new DelayedLoadWrapper( new BeatmapSetCover(SetInfo) { Anchor = Anchor.Centre, @@ -231,10 +231,10 @@ namespace osu.Game.Overlays.Direct d.FadeInFromZero(400, Easing.Out); BlackBackground.Delay(400).FadeOut(); }, - }) + }, + 300) { RelativeSizeAxes = Axes.Both, - TimeBeforeLoad = 300 }; public class Statistic : FillFlowContainer diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 92fc6aef2b..14cd7e6f07 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -99,7 +99,7 @@ namespace osu.Game.Screens.Select.Leaderboards Padding = new MarginPadding(edge_margin), Children = new Drawable[] { - avatar = new LoadWrapper( + avatar = new DelayedLoadWrapper( new Avatar(Score.User) { RelativeSizeAxes = Axes.Both, @@ -112,9 +112,9 @@ namespace osu.Game.Screens.Select.Leaderboards Radius = 1, Colour = Color4.Black.Opacity(0.2f), }, - }) + }, + 500) { - TimeBeforeLoad = 500, RelativeSizeAxes = Axes.None, Size = new Vector2(HEIGHT - edge_margin * 2, HEIGHT - edge_margin * 2), }, diff --git a/osu.Game/Users/UpdateableAvatar.cs b/osu.Game/Users/UpdateableAvatar.cs index 02018ee1f4..1700046653 100644 --- a/osu.Game/Users/UpdateableAvatar.cs +++ b/osu.Game/Users/UpdateableAvatar.cs @@ -40,12 +40,13 @@ namespace osu.Game.Users { displayedAvatar?.FadeOut(300); displayedAvatar?.Expire(); - Add(displayedAvatar = new LoadWrapper( + Add(displayedAvatar = new DelayedLoadWrapper( new Avatar(user) { RelativeSizeAxes = Axes.Both, OnLoadComplete = d => d.FadeInFromZero(200), - }) + }, + 500) ); } } diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index e4fdcb4c1b..923c62f8ef 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -58,7 +58,7 @@ namespace osu.Game.Users Children = new Drawable[] { - new LoadWrapper(new UserCoverBackground(user) + new DelayedLoadWrapper(new UserCoverBackground(user) { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, From 18b0b77f0ae27c1dddd976a6ae7e7405463e1656 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Wed, 22 Nov 2017 21:41:50 +0100 Subject: [PATCH 15/27] Added requested changes. Mainly changing lambdas to direct function references. --- osu.Game/Overlays/Profile/ProfileHeader.cs | 9 +++------ osu.Game/Screens/Multiplayer/DrawableRoom.cs | 4 ++-- osu.Game/Screens/Multiplayer/RoomInspector.cs | 2 +- osu.Game/Screens/Play/Player.cs | 6 ++++-- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index 6a9247e73b..c7bc5c1d93 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -322,13 +322,10 @@ namespace osu.Game.Overlays.Profile Anchor = Anchor.Centre, Origin = Anchor.Centre, FillMode = FillMode.Fill, - OnLoadComplete = d => d.FadeInFromZero(200) + OnLoadComplete = d => d.FadeInFromZero(200), + Depth = float.MaxValue, }, - ucb => - { - ucb.Depth = float.MaxValue; - coverContainer.Add(ucb); - }); + coverContainer.Add); if (user.IsSupporter) supporterTag.Show(); diff --git a/osu.Game/Screens/Multiplayer/DrawableRoom.cs b/osu.Game/Screens/Multiplayer/DrawableRoom.cs index 60a0bd7a82..0ba4aaa364 100644 --- a/osu.Game/Screens/Multiplayer/DrawableRoom.cs +++ b/osu.Game/Screens/Multiplayer/DrawableRoom.cs @@ -237,7 +237,7 @@ namespace osu.Game.Screens.Multiplayer FillMode = FillMode.Fill, OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), }, - bsc => coverContainer.Add(bsc)); + coverContainer.Add); beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title); beatmapDash.Text = @" - "; @@ -260,4 +260,4 @@ namespace osu.Game.Screens.Multiplayer participantInfo.Participants = value; } } -} \ No newline at end of file +} diff --git a/osu.Game/Screens/Multiplayer/RoomInspector.cs b/osu.Game/Screens/Multiplayer/RoomInspector.cs index 30c2aa8505..8d7401500f 100644 --- a/osu.Game/Screens/Multiplayer/RoomInspector.cs +++ b/osu.Game/Screens/Multiplayer/RoomInspector.cs @@ -338,7 +338,7 @@ namespace osu.Game.Screens.Multiplayer FillMode = FillMode.Fill, OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), }, - bsc => coverContainer.Add(bsc)); + coverContainer.Add); beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title); beatmapDash.Text = @" - "; diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 5f7ef03218..1e1b7bac93 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -248,8 +248,10 @@ namespace osu.Game.Screens.Play storyboard = beatmap.Storyboard.CreateDrawable(Beatmap.Value); storyboard.Masking = true; - if (asyncLoad) LoadComponentAsync(storyboard, s => storyboardContainer.Add(s)); - else storyboardContainer.Add((Drawable)storyboard); + if (asyncLoad) + LoadComponentAsync(storyboard, storyboardContainer.Add); + else + storyboardContainer.Add(storyboard); } public void Restart() From 288c21dfece72710df16f641119f59e6b661f881 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 16:00:33 +0900 Subject: [PATCH 16/27] Move TestCase descriptions to attributes Depends on https://github.com/ppy/osu-framework/pull/1186. --- osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs | 2 -- osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs | 2 -- osu.Game.Tests/Visual/TestCaseAllPlayers.cs | 1 - osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs | 2 -- osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs | 5 ++--- osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs | 5 ++--- osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs | 2 -- osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs | 2 -- osu.Game.Tests/Visual/TestCaseBreakOverlay.cs | 4 +--- osu.Game.Tests/Visual/TestCaseChatDisplay.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseContextMenu.cs | 2 -- osu.Game.Tests/Visual/TestCaseDialogOverlay.cs | 2 -- osu.Game.Tests/Visual/TestCaseDirect.cs | 2 -- osu.Game.Tests/Visual/TestCaseDrawableRoom.cs | 2 -- osu.Game.Tests/Visual/TestCaseDrawings.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseGamefield.cs | 2 -- osu.Game.Tests/Visual/TestCaseGraph.cs | 4 +--- osu.Game.Tests/Visual/TestCaseIconButton.cs | 2 -- osu.Game.Tests/Visual/TestCaseKeyConfiguration.cs | 2 -- osu.Game.Tests/Visual/TestCaseKeyCounter.cs | 2 -- osu.Game.Tests/Visual/TestCaseLeaderboard.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseMedalOverlay.cs | 2 -- osu.Game.Tests/Visual/TestCaseMenuButtonSystem.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseMenuOverlays.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseMods.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseMusicController.cs | 2 -- osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs | 2 -- osu.Game.Tests/Visual/TestCaseOnScreenDisplay.cs | 2 -- osu.Game.Tests/Visual/TestCasePlaySongSelect.cs | 2 -- osu.Game.Tests/Visual/TestCaseReplay.cs | 2 -- osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs | 2 -- osu.Game.Tests/Visual/TestCaseResults.cs | 2 -- osu.Game.Tests/Visual/TestCaseRoomInspector.cs | 2 -- osu.Game.Tests/Visual/TestCaseScoreCounter.cs | 2 -- osu.Game.Tests/Visual/TestCaseSettings.cs | 2 -- osu.Game.Tests/Visual/TestCaseSkipButton.cs | 2 -- osu.Game.Tests/Visual/TestCaseSocial.cs | 2 -- osu.Game.Tests/Visual/TestCaseSongProgress.cs | 2 -- osu.Game.Tests/Visual/TestCaseStoryboard.cs | 2 -- osu.Game.Tests/Visual/TestCaseTabControl.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseTextAwesome.cs | 2 -- osu.Game.Tests/Visual/TestCaseTwoLayerButton.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseUserPanel.cs | 2 -- osu.Game.Tests/Visual/TestCaseUserProfile.cs | 2 -- osu.Game.Tests/Visual/TestCaseUserRanks.cs | 2 -- osu.Game/Tests/Visual/TestCasePlayer.cs | 2 -- 48 files changed, 26 insertions(+), 99 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs index 802d4cc99d..aab784f177 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs @@ -26,8 +26,6 @@ namespace osu.Game.Rulesets.Mania.Tests private const double start_time = 500; private const double duration = 500; - public override string Description => @"Mania playfield"; - protected override double TimePerAction => 200; private RulesetInfo maniaRuleset; diff --git a/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs index 059d297401..555f9bb0da 100644 --- a/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs @@ -30,8 +30,6 @@ namespace osu.Game.Rulesets.Taiko.Tests private const double default_duration = 1000; private const float scroll_time = 1000; - public override string Description => "Taiko playfield"; - protected override double TimePerAction => default_duration * 2; private readonly Random rng = new Random(1337); diff --git a/osu.Game.Tests/Visual/TestCaseAllPlayers.cs b/osu.Game.Tests/Visual/TestCaseAllPlayers.cs index 8c63e1a274..62b99487a9 100644 --- a/osu.Game.Tests/Visual/TestCaseAllPlayers.cs +++ b/osu.Game.Tests/Visual/TestCaseAllPlayers.cs @@ -5,6 +5,5 @@ namespace osu.Game.Tests.Visual { public class TestCaseAllPlayers : TestCasePlayer { - public override string Description => @"Showing everything to play the game."; } } diff --git a/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs b/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs index a5156c155b..18555574ba 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs @@ -19,8 +19,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseBeatSyncedContainer : OsuTestCase { - public override string Description => @"Tests beat synced containers."; - private readonly MusicController mc; public TestCaseBeatSyncedContainer() diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs b/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs index 7dffa6d590..215d1ee5b1 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs @@ -9,10 +9,9 @@ using OpenTK; namespace osu.Game.Tests.Visual { [TestFixture] + [Description("PlaySongSelect leaderboard/details area")] internal class TestCaseBeatmapDetailArea : OsuTestCase { - public override string Description => @"Beatmap details in song select"; - public TestCaseBeatmapDetailArea() { Add(new BeatmapDetailArea @@ -23,4 +22,4 @@ namespace osu.Game.Tests.Visual }); } } -} \ No newline at end of file +} diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs b/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs index b31eded9a0..248ec6d43d 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.ComponentModel; using System.Linq; using osu.Framework.Graphics; using osu.Game.Beatmaps; @@ -8,10 +9,9 @@ using osu.Game.Screens.Select; namespace osu.Game.Tests.Visual { + [Description("PlaySongSelect beatmap details")] internal class TestCaseBeatmapDetails : OsuTestCase { - public override string Description => "BeatmapDetails tab of BeatmapDetailArea"; - public TestCaseBeatmapDetails() { BeatmapDetails details; diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs b/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs index bdc2e0e105..e114fac96e 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.ComponentModel; using osu.Game.Graphics; using osu.Game.Screens.Select.Options; using OpenTK.Graphics; @@ -8,10 +9,9 @@ using OpenTK.Input; namespace osu.Game.Tests.Visual { + [Description("bottom beatmap details")] internal class TestCaseBeatmapOptionsOverlay : OsuTestCase { - public override string Description => @"Beatmap options in song select"; - public TestCaseBeatmapOptionsOverlay() { var overlay = new BeatmapOptionsOverlay(); diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs index 8cae3feae2..cef8797f20 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs @@ -3,7 +3,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.MathUtils; using osu.Game.Graphics; @@ -14,13 +13,13 @@ using osu.Game.Rulesets.Osu.Mods; using osu.Game.Rulesets.Scoring; using osu.Game.Users; using System.Collections.Generic; +using osu.Framework.Graphics.Containers; namespace osu.Game.Tests.Visual { + [System.ComponentModel.Description("in BeatmapOverlay")] public class TestCaseBeatmapScoresContainer : OsuTestCase { - public override string Description => "BeatmapOverlay scores container"; - private readonly IEnumerable scores; private readonly IEnumerable anotherScores; private readonly OnlineScore topScore; diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs b/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs index c2de4ec05d..c24e13b7fb 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs @@ -14,8 +14,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseBeatmapSetOverlay : OsuTestCase { - public override string Description => @"view online beatmap sets"; - private readonly BeatmapSetOverlay overlay; public TestCaseBeatmapSetOverlay() diff --git a/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs b/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs index 97c343f8ac..50abd11e79 100644 --- a/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs +++ b/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs @@ -8,8 +8,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseBreadcrumbs : OsuTestCase { - public override string Description => @"breadcrumb > control"; - public TestCaseBreadcrumbs() { BreadcrumbControl c; diff --git a/osu.Game.Tests/Visual/TestCaseBreakOverlay.cs b/osu.Game.Tests/Visual/TestCaseBreakOverlay.cs index 206ca308cf..dcb3b74654 100644 --- a/osu.Game.Tests/Visual/TestCaseBreakOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseBreakOverlay.cs @@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseBreakOverlay : OsuTestCase { - public override string Description => @"Tests breaks behavior"; - private readonly BreakOverlay breakOverlay; public TestCaseBreakOverlay() @@ -88,4 +86,4 @@ namespace osu.Game.Tests.Visual }; } } -} \ No newline at end of file +} diff --git a/osu.Game.Tests/Visual/TestCaseChatDisplay.cs b/osu.Game.Tests/Visual/TestCaseChatDisplay.cs index 847593fcec..85ee224a5e 100644 --- a/osu.Game.Tests/Visual/TestCaseChatDisplay.cs +++ b/osu.Game.Tests/Visual/TestCaseChatDisplay.cs @@ -1,15 +1,15 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.ComponentModel; using osu.Framework.Graphics.Containers; using osu.Game.Overlays; namespace osu.Game.Tests.Visual { + [Description("Testing chat api and overlay")] internal class TestCaseChatDisplay : OsuTestCase { - public override string Description => @"Testing chat api and overlay"; - public TestCaseChatDisplay() { Add(new ChatOverlay diff --git a/osu.Game.Tests/Visual/TestCaseContextMenu.cs b/osu.Game.Tests/Visual/TestCaseContextMenu.cs index 91a766f8c7..6f5cb398d7 100644 --- a/osu.Game.Tests/Visual/TestCaseContextMenu.cs +++ b/osu.Game.Tests/Visual/TestCaseContextMenu.cs @@ -15,8 +15,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseContextMenu : OsuTestCase { - public override string Description => @"Menu visible on right click"; - private const int start_time = 0; private const int duration = 1000; diff --git a/osu.Game.Tests/Visual/TestCaseDialogOverlay.cs b/osu.Game.Tests/Visual/TestCaseDialogOverlay.cs index a031125b3a..f1aba908f0 100644 --- a/osu.Game.Tests/Visual/TestCaseDialogOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseDialogOverlay.cs @@ -9,8 +9,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseDialogOverlay : OsuTestCase { - public override string Description => @"Display dialogs"; - public TestCaseDialogOverlay() { DialogOverlay overlay; diff --git a/osu.Game.Tests/Visual/TestCaseDirect.cs b/osu.Game.Tests/Visual/TestCaseDirect.cs index 2d8677c391..ede17fa775 100644 --- a/osu.Game.Tests/Visual/TestCaseDirect.cs +++ b/osu.Game.Tests/Visual/TestCaseDirect.cs @@ -11,8 +11,6 @@ namespace osu.Game.Tests.Visual { public class TestCaseDirect : OsuTestCase { - public override string Description => @"osu!direct overlay"; - private DirectOverlay direct; private RulesetStore rulesets; diff --git a/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs b/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs index 7113bcbff5..a51cf8ca95 100644 --- a/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs +++ b/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs @@ -14,8 +14,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseDrawableRoom : OsuTestCase { - public override string Description => @"Select your favourite room"; - private RulesetStore rulesets; protected override void LoadComplete() diff --git a/osu.Game.Tests/Visual/TestCaseDrawings.cs b/osu.Game.Tests/Visual/TestCaseDrawings.cs index c805d88cb4..e5692b29de 100644 --- a/osu.Game.Tests/Visual/TestCaseDrawings.cs +++ b/osu.Game.Tests/Visual/TestCaseDrawings.cs @@ -2,15 +2,15 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using System.ComponentModel; using osu.Game.Screens.Tournament; using osu.Game.Screens.Tournament.Teams; namespace osu.Game.Tests.Visual { + [Description("for tournament use")] internal class TestCaseDrawings : OsuTestCase { - public override string Description => "Tournament drawings"; - public TestCaseDrawings() { Add(new Drawings diff --git a/osu.Game.Tests/Visual/TestCaseGamefield.cs b/osu.Game.Tests/Visual/TestCaseGamefield.cs index af86b6ec06..0d8f4cb5f7 100644 --- a/osu.Game.Tests/Visual/TestCaseGamefield.cs +++ b/osu.Game.Tests/Visual/TestCaseGamefield.cs @@ -7,8 +7,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseGamefield : OsuTestCase { - public override string Description => @"Showing hitobjects and what not."; - protected override void LoadComplete() { base.LoadComplete(); diff --git a/osu.Game.Tests/Visual/TestCaseGraph.cs b/osu.Game.Tests/Visual/TestCaseGraph.cs index 714f284879..fb1a3ef3f6 100644 --- a/osu.Game.Tests/Visual/TestCaseGraph.cs +++ b/osu.Game.Tests/Visual/TestCaseGraph.cs @@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseGraph : OsuTestCase { - public override string Description => "graph"; - public TestCaseGraph() { BarGraph graph; @@ -36,4 +34,4 @@ namespace osu.Game.Tests.Visual AddStep("Right to left", () => graph.Direction = BarDirection.RightToLeft); } } -} \ No newline at end of file +} diff --git a/osu.Game.Tests/Visual/TestCaseIconButton.cs b/osu.Game.Tests/Visual/TestCaseIconButton.cs index acde9df4a9..345316708e 100644 --- a/osu.Game.Tests/Visual/TestCaseIconButton.cs +++ b/osu.Game.Tests/Visual/TestCaseIconButton.cs @@ -14,8 +14,6 @@ namespace osu.Game.Tests.Visual { public class TestCaseIconButton : OsuTestCase { - public override string Description => "Various display modes of icon buttons"; - public TestCaseIconButton() { Child = new FillFlowContainer diff --git a/osu.Game.Tests/Visual/TestCaseKeyConfiguration.cs b/osu.Game.Tests/Visual/TestCaseKeyConfiguration.cs index e473ce8778..d39ac12a60 100644 --- a/osu.Game.Tests/Visual/TestCaseKeyConfiguration.cs +++ b/osu.Game.Tests/Visual/TestCaseKeyConfiguration.cs @@ -9,8 +9,6 @@ namespace osu.Game.Tests.Visual { private readonly KeyBindingOverlay overlay; - public override string Description => @"Key configuration"; - public TestCaseKeyConfiguration() { Child = overlay = new KeyBindingOverlay(); diff --git a/osu.Game.Tests/Visual/TestCaseKeyCounter.cs b/osu.Game.Tests/Visual/TestCaseKeyCounter.cs index 622fb15f4f..df122b7132 100644 --- a/osu.Game.Tests/Visual/TestCaseKeyCounter.cs +++ b/osu.Game.Tests/Visual/TestCaseKeyCounter.cs @@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseKeyCounter : OsuTestCase { - public override string Description => @"Tests key counter"; - public TestCaseKeyCounter() { KeyCounterCollection kc = new KeyCounterCollection diff --git a/osu.Game.Tests/Visual/TestCaseLeaderboard.cs b/osu.Game.Tests/Visual/TestCaseLeaderboard.cs index 832003e6ab..9d6fb3a4ec 100644 --- a/osu.Game.Tests/Visual/TestCaseLeaderboard.cs +++ b/osu.Game.Tests/Visual/TestCaseLeaderboard.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.ComponentModel; using osu.Framework.Graphics; using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Select.Leaderboards; @@ -9,10 +10,9 @@ using OpenTK; namespace osu.Game.Tests.Visual { + [Description("PlaySongSelect leaderboard")] internal class TestCaseLeaderboard : OsuTestCase { - public override string Description => @"From song select"; - private readonly Leaderboard leaderboard; private void newScores() diff --git a/osu.Game.Tests/Visual/TestCaseMedalOverlay.cs b/osu.Game.Tests/Visual/TestCaseMedalOverlay.cs index 9a26eefd63..fbee27668c 100644 --- a/osu.Game.Tests/Visual/TestCaseMedalOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseMedalOverlay.cs @@ -11,8 +11,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseMedalOverlay : OsuTestCase { - public override string Description => @"medal get!"; - public override IReadOnlyList RequiredTypes => new[] { typeof(MedalOverlay), diff --git a/osu.Game.Tests/Visual/TestCaseMenuButtonSystem.cs b/osu.Game.Tests/Visual/TestCaseMenuButtonSystem.cs index 0b50c9cf47..b5310f0fb0 100644 --- a/osu.Game.Tests/Visual/TestCaseMenuButtonSystem.cs +++ b/osu.Game.Tests/Visual/TestCaseMenuButtonSystem.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.ComponentModel; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Shapes; using osu.Game.Screens.Menu; @@ -8,10 +9,9 @@ using OpenTK.Graphics; namespace osu.Game.Tests.Visual { + [Description("main menu")] internal class TestCaseMenuButtonSystem : OsuTestCase { - public override string Description => @"Main menu button system"; - public TestCaseMenuButtonSystem() { Add(new Box diff --git a/osu.Game.Tests/Visual/TestCaseMenuOverlays.cs b/osu.Game.Tests/Visual/TestCaseMenuOverlays.cs index e27de96bee..94a69f0029 100644 --- a/osu.Game.Tests/Visual/TestCaseMenuOverlays.cs +++ b/osu.Game.Tests/Visual/TestCaseMenuOverlays.cs @@ -1,16 +1,16 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.ComponentModel; using osu.Framework.Graphics.Containers; using osu.Framework.Logging; using osu.Game.Screens.Play; namespace osu.Game.Tests.Visual { + [Description("player pause/fail screens")] internal class TestCaseMenuOverlays : OsuTestCase { - public override string Description => @"Tests pause and fail overlays"; - public TestCaseMenuOverlays() { FailOverlay failOverlay; diff --git a/osu.Game.Tests/Visual/TestCaseMods.cs b/osu.Game.Tests/Visual/TestCaseMods.cs index 0447d6582d..5270ac0dc9 100644 --- a/osu.Game.Tests/Visual/TestCaseMods.cs +++ b/osu.Game.Tests/Visual/TestCaseMods.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.ComponentModel; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Overlays.Mods; @@ -10,10 +11,9 @@ using OpenTK; namespace osu.Game.Tests.Visual { + [Description("mod select and icon display")] internal class TestCaseMods : OsuTestCase { - public override string Description => @"Mod select overlay and in-game display"; - private ModSelectOverlay modSelect; private ModDisplay modDisplay; diff --git a/osu.Game.Tests/Visual/TestCaseMusicController.cs b/osu.Game.Tests/Visual/TestCaseMusicController.cs index 323c32bf10..3c544bb968 100644 --- a/osu.Game.Tests/Visual/TestCaseMusicController.cs +++ b/osu.Game.Tests/Visual/TestCaseMusicController.cs @@ -13,8 +13,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseMusicController : OsuTestCase { - public override string Description => @"Tests music controller ui."; - private readonly Bindable beatmapBacking = new Bindable(); public TestCaseMusicController() diff --git a/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs b/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs index ed331076b2..3dca860909 100644 --- a/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs @@ -15,8 +15,6 @@ namespace osu.Game.Tests.Visual [TestFixture] internal class TestCaseNotificationOverlay : OsuTestCase { - public override string Description => @"I handle notifications"; - private readonly NotificationOverlay manager; public TestCaseNotificationOverlay() diff --git a/osu.Game.Tests/Visual/TestCaseOnScreenDisplay.cs b/osu.Game.Tests/Visual/TestCaseOnScreenDisplay.cs index 8749d240f8..c3a755f3ca 100644 --- a/osu.Game.Tests/Visual/TestCaseOnScreenDisplay.cs +++ b/osu.Game.Tests/Visual/TestCaseOnScreenDisplay.cs @@ -12,8 +12,6 @@ namespace osu.Game.Tests.Visual private FrameworkConfigManager config; private Bindable frameSyncMode; - public override string Description => @"Make it easier to see setting changes"; - protected override void LoadComplete() { base.LoadComplete(); diff --git a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs index 37dd60a25c..7c070fd3df 100644 --- a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs @@ -22,8 +22,6 @@ namespace osu.Game.Tests.Visual { private BeatmapManager manager; - public override string Description => @"with fake data"; - private RulesetStore rulesets; private DependencyContainer dependencies; diff --git a/osu.Game.Tests/Visual/TestCaseReplay.cs b/osu.Game.Tests/Visual/TestCaseReplay.cs index 2e56daccfc..62c8a64916 100644 --- a/osu.Game.Tests/Visual/TestCaseReplay.cs +++ b/osu.Game.Tests/Visual/TestCaseReplay.cs @@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseReplay : TestCasePlayer { - public override string Description => @"Testing replay playback."; - protected override Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset) { beatmap.Mods.Value = beatmap.Mods.Value.Concat(new[] { ruleset.GetAutoplayMod() }); diff --git a/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs b/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs index 3105a7d588..22a2d717e4 100644 --- a/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs @@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseReplaySettingsOverlay : OsuTestCase { - public override string Description => @"Settings visible in replay/auto"; - public TestCaseReplaySettingsOverlay() { ExampleContainer container; diff --git a/osu.Game.Tests/Visual/TestCaseResults.cs b/osu.Game.Tests/Visual/TestCaseResults.cs index 62154a535a..f1bbb8fed6 100644 --- a/osu.Game.Tests/Visual/TestCaseResults.cs +++ b/osu.Game.Tests/Visual/TestCaseResults.cs @@ -15,8 +15,6 @@ namespace osu.Game.Tests.Visual { private BeatmapManager beatmaps; - public override string Description => @"Results after playing."; - [BackgroundDependencyLoader] private void load(BeatmapManager beatmaps) { diff --git a/osu.Game.Tests/Visual/TestCaseRoomInspector.cs b/osu.Game.Tests/Visual/TestCaseRoomInspector.cs index e6b57c970b..51b6ae8e50 100644 --- a/osu.Game.Tests/Visual/TestCaseRoomInspector.cs +++ b/osu.Game.Tests/Visual/TestCaseRoomInspector.cs @@ -13,8 +13,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseRoomInspector : OsuTestCase { - public override string Description => @"from the multiplayer lobby"; - private RulesetStore rulesets; protected override void LoadComplete() diff --git a/osu.Game.Tests/Visual/TestCaseScoreCounter.cs b/osu.Game.Tests/Visual/TestCaseScoreCounter.cs index 543ff12fcb..5a04000900 100644 --- a/osu.Game.Tests/Visual/TestCaseScoreCounter.cs +++ b/osu.Game.Tests/Visual/TestCaseScoreCounter.cs @@ -12,8 +12,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseScoreCounter : OsuTestCase { - public override string Description => @"Tests multiple counters"; - public TestCaseScoreCounter() { int numerator = 0, denominator = 0; diff --git a/osu.Game.Tests/Visual/TestCaseSettings.cs b/osu.Game.Tests/Visual/TestCaseSettings.cs index dfc0b66e21..63d798cd53 100644 --- a/osu.Game.Tests/Visual/TestCaseSettings.cs +++ b/osu.Game.Tests/Visual/TestCaseSettings.cs @@ -7,8 +7,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseSettings : OsuTestCase { - public override string Description => @"Tests the settings overlay"; - private readonly SettingsOverlay settings; public TestCaseSettings() diff --git a/osu.Game.Tests/Visual/TestCaseSkipButton.cs b/osu.Game.Tests/Visual/TestCaseSkipButton.cs index 49be015adf..40c8baaac8 100644 --- a/osu.Game.Tests/Visual/TestCaseSkipButton.cs +++ b/osu.Game.Tests/Visual/TestCaseSkipButton.cs @@ -7,8 +7,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseSkipButton : OsuTestCase { - public override string Description => @"Skip skip skippediskip"; - protected override void LoadComplete() { base.LoadComplete(); diff --git a/osu.Game.Tests/Visual/TestCaseSocial.cs b/osu.Game.Tests/Visual/TestCaseSocial.cs index 4f90e4ceff..ff0707c8ab 100644 --- a/osu.Game.Tests/Visual/TestCaseSocial.cs +++ b/osu.Game.Tests/Visual/TestCaseSocial.cs @@ -8,8 +8,6 @@ namespace osu.Game.Tests.Visual { public class TestCaseSocial : OsuTestCase { - public override string Description => @"social browser overlay"; - public TestCaseSocial() { SocialOverlay s = new SocialOverlay diff --git a/osu.Game.Tests/Visual/TestCaseSongProgress.cs b/osu.Game.Tests/Visual/TestCaseSongProgress.cs index 96ff76e9c6..1e6886cda9 100644 --- a/osu.Game.Tests/Visual/TestCaseSongProgress.cs +++ b/osu.Game.Tests/Visual/TestCaseSongProgress.cs @@ -12,8 +12,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseSongProgress : OsuTestCase { - public override string Description => @"With fake data"; - private readonly SongProgress progress; private readonly SongProgressGraph graph; diff --git a/osu.Game.Tests/Visual/TestCaseStoryboard.cs b/osu.Game.Tests/Visual/TestCaseStoryboard.cs index c6ef3f4ecf..1dad106cbe 100644 --- a/osu.Game.Tests/Visual/TestCaseStoryboard.cs +++ b/osu.Game.Tests/Visual/TestCaseStoryboard.cs @@ -16,8 +16,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseStoryboard : OsuTestCase { - public override string Description => @"Tests storyboards."; - private readonly Bindable beatmapBacking = new Bindable(); private readonly Container storyboardContainer; diff --git a/osu.Game.Tests/Visual/TestCaseTabControl.cs b/osu.Game.Tests/Visual/TestCaseTabControl.cs index 6db74f2cfb..44a1732e16 100644 --- a/osu.Game.Tests/Visual/TestCaseTabControl.cs +++ b/osu.Game.Tests/Visual/TestCaseTabControl.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.ComponentModel; using osu.Framework.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; @@ -9,10 +10,9 @@ using OpenTK; namespace osu.Game.Tests.Visual { + [Description("SongSelect filter control")] public class TestCaseTabControl : OsuTestCase { - public override string Description => @"Filter for song select"; - public TestCaseTabControl() { OsuSpriteText text; diff --git a/osu.Game.Tests/Visual/TestCaseTextAwesome.cs b/osu.Game.Tests/Visual/TestCaseTextAwesome.cs index beec5ab271..37905a1883 100644 --- a/osu.Game.Tests/Visual/TestCaseTextAwesome.cs +++ b/osu.Game.Tests/Visual/TestCaseTextAwesome.cs @@ -12,8 +12,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseTextAwesome : OsuTestCase { - public override string Description => @"Tests display of icons"; - public TestCaseTextAwesome() { FillFlowContainer flow; diff --git a/osu.Game.Tests/Visual/TestCaseTwoLayerButton.cs b/osu.Game.Tests/Visual/TestCaseTwoLayerButton.cs index 83e0e4b442..bd5c10d147 100644 --- a/osu.Game.Tests/Visual/TestCaseTwoLayerButton.cs +++ b/osu.Game.Tests/Visual/TestCaseTwoLayerButton.cs @@ -1,14 +1,14 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.ComponentModel; using osu.Game.Graphics.UserInterface; namespace osu.Game.Tests.Visual { + [Description("mostly back button")] internal class TestCaseTwoLayerButton : OsuTestCase { - public override string Description => @"Mostly back button"; - public TestCaseTwoLayerButton() { Add(new BackButton()); diff --git a/osu.Game.Tests/Visual/TestCaseUserPanel.cs b/osu.Game.Tests/Visual/TestCaseUserPanel.cs index 8523a754f8..8d94a0c90f 100644 --- a/osu.Game.Tests/Visual/TestCaseUserPanel.cs +++ b/osu.Game.Tests/Visual/TestCaseUserPanel.cs @@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseUserPanel : OsuTestCase { - public override string Description => @"Panels for displaying a user's status"; - public TestCaseUserPanel() { UserPanel flyte; diff --git a/osu.Game.Tests/Visual/TestCaseUserProfile.cs b/osu.Game.Tests/Visual/TestCaseUserProfile.cs index f5fced2915..90daf1e996 100644 --- a/osu.Game.Tests/Visual/TestCaseUserProfile.cs +++ b/osu.Game.Tests/Visual/TestCaseUserProfile.cs @@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseUserProfile : OsuTestCase { - public override string Description => "Tests user's profile page."; - public TestCaseUserProfile() { var profile = new UserProfileOverlay(); diff --git a/osu.Game.Tests/Visual/TestCaseUserRanks.cs b/osu.Game.Tests/Visual/TestCaseUserRanks.cs index e17f0e1a46..eb0678203c 100644 --- a/osu.Game.Tests/Visual/TestCaseUserRanks.cs +++ b/osu.Game.Tests/Visual/TestCaseUserRanks.cs @@ -15,8 +15,6 @@ namespace osu.Game.Tests.Visual { internal class TestCaseUserRanks : OsuTestCase { - public override string Description => "showing your latest achievements"; - public override IReadOnlyList RequiredTypes => new[] { typeof(DrawableScore), typeof(RanksSection) }; public TestCaseUserRanks() diff --git a/osu.Game/Tests/Visual/TestCasePlayer.cs b/osu.Game/Tests/Visual/TestCasePlayer.cs index 5965be9717..cef85b65f1 100644 --- a/osu.Game/Tests/Visual/TestCasePlayer.cs +++ b/osu.Game/Tests/Visual/TestCasePlayer.cs @@ -23,8 +23,6 @@ namespace osu.Game.Tests.Visual protected Player Player; - public override string Description => @"Showing everything to play the game."; - /// /// Create a TestCase which runs through the Player screen. /// From f3a84a01dac463f17e287fdcd43a715f3eba1948 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 16:20:50 +0900 Subject: [PATCH 17/27] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index c6fd291492..eea84aaefc 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit c6fd2914926f2a6df23eda536c0310f072581b1b +Subproject commit eea84aaefcc7a1a6732d105ba319272dd9744901 From d6f532171b83a9c58c19ef99843643233430e05b Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 23 Nov 2017 09:11:52 +0100 Subject: [PATCH 18/27] Implementation fix (since the default delay is now 500 and not 0 this is necessary to ensure the same functionality) --- osu.Game/Users/UserPanel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index 923c62f8ef..1f235e3893 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -65,7 +65,7 @@ namespace osu.Game.Users Origin = Anchor.Centre, FillMode = FillMode.Fill, OnLoadComplete = d => d.FadeInFromZero(200), - }) { RelativeSizeAxes = Axes.Both }, + }, 0) { RelativeSizeAxes = Axes.Both }, new Box { RelativeSizeAxes = Axes.Both, From 2cc2323791b59fa615db3371b89cc3f5dd64ff9a Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 23 Nov 2017 09:12:23 +0100 Subject: [PATCH 19/27] Style changes (removing newline from before second constructor parameter) --- osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs | 4 +--- osu.Game/Overlays/BeatmapSet/Header.cs | 3 +-- osu.Game/Overlays/Direct/DirectPanel.cs | 3 +-- osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs | 3 +-- osu.Game/Users/UpdateableAvatar.cs | 3 +-- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs index ec39f86c5c..5b84fa7c6e 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -48,9 +48,7 @@ namespace osu.Game.Beatmaps.Drawables { RelativeSizeAxes = Axes.Both, OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), - }, - 300 - ), + }, 300), new FillFlowContainer { Direction = FillDirection.Vertical, diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 9bf14e1f90..195ff63ca5 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -60,8 +60,7 @@ namespace osu.Game.Overlays.BeatmapSet RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fill, OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), - }, - 300) + }, 300) { RelativeSizeAxes = Axes.Both, }); diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index bef8697552..2e842af614 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -231,8 +231,7 @@ namespace osu.Game.Overlays.Direct d.FadeInFromZero(400, Easing.Out); BlackBackground.Delay(400).FadeOut(); }, - }, - 300) + }, 300) { RelativeSizeAxes = Axes.Both, }; diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 14cd7e6f07..0d898ad7d2 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -112,8 +112,7 @@ namespace osu.Game.Screens.Select.Leaderboards Radius = 1, Colour = Color4.Black.Opacity(0.2f), }, - }, - 500) + }, 500) { RelativeSizeAxes = Axes.None, Size = new Vector2(HEIGHT - edge_margin * 2, HEIGHT - edge_margin * 2), diff --git a/osu.Game/Users/UpdateableAvatar.cs b/osu.Game/Users/UpdateableAvatar.cs index 1700046653..895407064c 100644 --- a/osu.Game/Users/UpdateableAvatar.cs +++ b/osu.Game/Users/UpdateableAvatar.cs @@ -45,8 +45,7 @@ namespace osu.Game.Users { RelativeSizeAxes = Axes.Both, OnLoadComplete = d => d.FadeInFromZero(200), - }, - 500) + }, 500) ); } } From 2ff21bbc6c1caabf2e0e6ad95375d2586fc5ed05 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 17:29:20 +0900 Subject: [PATCH 20/27] Move descriptions to constructor --- .../Profile/Sections/Kudosu/KudosuInfo.cs | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs index 1982059065..975a09fe18 100644 --- a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs +++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs @@ -23,8 +23,8 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu { this.user.BindTo(user); - SubSection total; - SubSection avaliable; + CountSection total; + CountSection avaliable; RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; @@ -44,20 +44,20 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(0.2f) }, - total = new SubSection("Total Kudosu Earned"), - avaliable = new SubSection("Kudosu Avaliable") + total = new CountSection( + "Total Kudosu Earned", + "Based on how much of a contribution the user has made to beatmap moderation. See this link for more information." + ), + avaliable = new CountSection( + "Kudosu Avaliable", + "Kudosu can be traded for kudosu stars, which will help your beatmap get more attention. This is the number of kudosu you haven't traded in yet." + ) { RelativePositionAxes = Axes.X, X = 0.5f, }, }; - total.TextFlow.Text = "Based on how much of a contribution the user has made to " + - "beatmap moderation. See this link for more information."; - - avaliable.TextFlow.Text = "Kudosu can be traded for kudosu stars, which will help your beatmap get " + - "more attention. This is the number of kudosu you haven't traded in yet."; - this.user.ValueChanged += newUser => { total.KudosuValue = newUser?.Kudosu.Total ?? 0; @@ -67,7 +67,7 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu protected override bool OnClick(InputState state) => true; - private class SubSection : Container + private class CountSection : Container { public readonly TextFlowContainer TextFlow; @@ -87,7 +87,7 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu } } - public SubSection(string header) + public CountSection(string header, string description) { RelativeSizeAxes = Axes.X; Width = 0.5f; @@ -131,6 +131,7 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, + Text = description } } }; From 6d9951d9afdc664dab13bc348296d62aa271b740 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 17:31:43 +0900 Subject: [PATCH 21/27] Use FillFlow rather than manually specifying positions --- .../Profile/Sections/Kudosu/KudosuInfo.cs | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs index 975a09fe18..2639bd7686 100644 --- a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs +++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs @@ -44,18 +44,22 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(0.2f) }, - total = new CountSection( - "Total Kudosu Earned", - "Based on how much of a contribution the user has made to beatmap moderation. See this link for more information." - ), - avaliable = new CountSection( - "Kudosu Avaliable", - "Kudosu can be traded for kudosu stars, which will help your beatmap get more attention. This is the number of kudosu you haven't traded in yet." - ) + new FillFlowContainer { - RelativePositionAxes = Axes.X, - X = 0.5f, - }, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Children = new[] + { + total = new CountSection( + "Total Kudosu Earned", + "Based on how much of a contribution the user has made to beatmap moderation. See this link for more information." + ), + avaliable = new CountSection( + "Kudosu Avaliable", + "Kudosu can be traded for kudosu stars, which will help your beatmap get more attention. This is the number of kudosu you haven't traded in yet." + ), + } + } }; this.user.ValueChanged += newUser => From cf4fc05be3567c9233a78735986b02ad6be3aa86 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 17:33:46 +0900 Subject: [PATCH 22/27] Fix nullref on disposing BeatmapSetOverlay before load Only affects VisualTests --- osu.Game/Overlays/BeatmapSet/Header.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 27ef6208be..b02df76996 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -232,7 +232,7 @@ namespace osu.Game.Overlays.BeatmapSet protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); - beatmaps.BeatmapSetAdded -= handleBeatmapAdd; + if (beatmaps != null) beatmaps.BeatmapSetAdded -= handleBeatmapAdd; } private void handleBeatmapAdd(BeatmapSetInfo beatmap) From 30db2ce18a1f96a728d1591eaf5ef980ae9477e8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 17:37:02 +0900 Subject: [PATCH 23/27] Rename KudosuValue to count and remove pointless local storage --- .../Profile/Sections/Kudosu/KudosuInfo.cs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs index 2639bd7686..4520abdd6d 100644 --- a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs +++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs @@ -64,8 +64,8 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu this.user.ValueChanged += newUser => { - total.KudosuValue = newUser?.Kudosu.Total ?? 0; - avaliable.KudosuValue = newUser?.Kudosu.Available ?? 0; + total.Count = newUser?.Kudosu.Total ?? 0; + avaliable.Count = newUser?.Kudosu.Available ?? 0; }; } @@ -77,18 +77,9 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu private readonly OsuSpriteText valueText; - private int kudosuValue; - public int KudosuValue + public int Count { - get { return kudosuValue; } - set - { - if (kudosuValue == value) - return; - kudosuValue = value; - - valueText.Text = kudosuValue.ToString(); - } + set { valueText.Text = value.ToString(); } } public CountSection(string header, string description) From 38f5c55f80d18239ba80dca2dd558b78dcb00d61 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 18:11:35 +0900 Subject: [PATCH 24/27] Remove not-accessed field --- osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs index 4520abdd6d..8a835634b8 100644 --- a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs +++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs @@ -73,8 +73,6 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu private class CountSection : Container { - public readonly TextFlowContainer TextFlow; - private readonly OsuSpriteText valueText; public int Count @@ -122,7 +120,7 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu } } }, - TextFlow = new TextFlowContainer(t => { t.TextSize = 19; }) + new TextFlowContainer(t => { t.TextSize = 19; }) { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, From 52c971cd75abacac52ef2b153b948ece5bc336f0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 18:58:25 +0900 Subject: [PATCH 25/27] Fix using incorrect Description attribute --- osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs b/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs index 215d1ee5b1..1a64994d0e 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs @@ -9,7 +9,7 @@ using OpenTK; namespace osu.Game.Tests.Visual { [TestFixture] - [Description("PlaySongSelect leaderboard/details area")] + [System.ComponentModel.Description("PlaySongSelect leaderboard/details area")] internal class TestCaseBeatmapDetailArea : OsuTestCase { public TestCaseBeatmapDetailArea() From 6d88396139f3f88695f1aa877f2b844954a89917 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 20:22:15 +0900 Subject: [PATCH 26/27] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index eea84aaefc..d87dab204b 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit eea84aaefcc7a1a6732d105ba319272dd9744901 +Subproject commit d87dab204b3df50f62e6070b1970c135ea647d78 From 9db6ef6657c70d8f49809c6f04a1fba23b3988df Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Nov 2017 20:23:47 +0900 Subject: [PATCH 27/27] Fix unfixed regressions --- osu.Game/Overlays/Direct/PlayButton.cs | 2 +- osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs | 8 ++++---- osu.Game/Users/UpdateableAvatar.cs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game/Overlays/Direct/PlayButton.cs b/osu.Game/Overlays/Direct/PlayButton.cs index 7fff2821e3..75a3358d51 100644 --- a/osu.Game/Overlays/Direct/PlayButton.cs +++ b/osu.Game/Overlays/Direct/PlayButton.cs @@ -152,7 +152,7 @@ namespace osu.Game.Overlays.Direct // We may have been replaced by another loader if (trackLoader != d) return; - Preview = (d as TrackLoader)?.Preview; + Preview = d?.Preview; Playing.TriggerChange(); loading = false; Add(trackLoader); diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 0d898ad7d2..03466439ad 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -33,7 +33,7 @@ namespace osu.Game.Screens.Select.Leaderboards private Box background; private Container content; - private Container avatar; + private Drawable avatar; private DrawableRank scoreRank; private OsuSpriteText nameLabel; private GlowingSpriteText scoreLabel; @@ -97,7 +97,7 @@ namespace osu.Game.Screens.Select.Leaderboards { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(edge_margin), - Children = new Drawable[] + Children = new[] { avatar = new DelayedLoadWrapper( new Avatar(Score.User) @@ -112,7 +112,7 @@ namespace osu.Game.Screens.Select.Leaderboards Radius = 1, Colour = Color4.Black.Opacity(0.2f), }, - }, 500) + }) { RelativeSizeAxes = Axes.None, Size = new Vector2(HEIGHT - edge_margin * 2, HEIGHT - edge_margin * 2), @@ -210,7 +210,7 @@ namespace osu.Game.Screens.Select.Leaderboards public override void Show() { - foreach (var d in new Drawable[] { avatar, nameLabel, scoreLabel, scoreRank, flagBadgeContainer, maxCombo, accuracy, modsContainer }) + foreach (var d in new[] { avatar, nameLabel, scoreLabel, scoreRank, flagBadgeContainer, maxCombo, accuracy, modsContainer }) d.FadeOut(); Alpha = 0; diff --git a/osu.Game/Users/UpdateableAvatar.cs b/osu.Game/Users/UpdateableAvatar.cs index 895407064c..d55c0caad7 100644 --- a/osu.Game/Users/UpdateableAvatar.cs +++ b/osu.Game/Users/UpdateableAvatar.cs @@ -11,7 +11,7 @@ namespace osu.Game.Users /// public class UpdateableAvatar : Container { - private Container displayedAvatar; + private Drawable displayedAvatar; private User user; @@ -45,7 +45,7 @@ namespace osu.Game.Users { RelativeSizeAxes = Axes.Both, OnLoadComplete = d => d.FadeInFromZero(200), - }, 500) + }) ); } }