From e920b8d5774beb09455e462ac09347e768e81a7e Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Mon, 28 May 2018 19:11:26 -0300 Subject: [PATCH 01/39] Add UpdateableBeatmapSetCover. --- .../Drawables/UpdateableBeatmapSetCover.cs | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 osu.Game/Beatmaps/Drawables/UpdateableBeatmapSetCover.cs diff --git a/osu.Game/Beatmaps/Drawables/UpdateableBeatmapSetCover.cs b/osu.Game/Beatmaps/Drawables/UpdateableBeatmapSetCover.cs new file mode 100644 index 0000000000..e25f5a9431 --- /dev/null +++ b/osu.Game/Beatmaps/Drawables/UpdateableBeatmapSetCover.cs @@ -0,0 +1,78 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using OpenTK.Graphics; + +namespace osu.Game.Beatmaps.Drawables +{ + public class UpdateableBeatmapSetCover : Container + { + private Drawable displayedCover; + + private BeatmapSetInfo beatmapSet; + public BeatmapSetInfo BeatmapSet + { + get { return beatmapSet; } + set + { + if (value == beatmapSet) return; + beatmapSet = value; + + if (IsLoaded) + updateCover(); + } + } + + private BeatmapSetCoverType coverType = BeatmapSetCoverType.Cover; + public BeatmapSetCoverType CoverType + { + get { return coverType; } + set + { + if (value == coverType) return; + coverType = value; + + if (IsLoaded) + updateCover(); + } + } + + public UpdateableBeatmapSetCover() + { + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + }; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + updateCover(); + } + + private void updateCover() + { + displayedCover?.FadeOut(400); + displayedCover?.Expire(); + + if (beatmapSet != null) + { + Add(displayedCover = new DelayedLoadWrapper( + new BeatmapSetCover(beatmapSet, coverType) + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + FillMode = FillMode.Fill, + OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), + }) + ); + } + } + } +} From bdfb5752cd46eda4f5f0e908e3aa721eb5222e54 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Mon, 28 May 2018 19:31:20 -0300 Subject: [PATCH 02/39] Update existing drawables to use UpdateableBeatmapSetCover. --- osu.Game/Overlays/BeatmapSet/Header.cs | 25 +++------------ osu.Game/Overlays/Direct/DirectPanel.cs | 23 ++----------- .../Historical/DrawableMostPlayedRow.cs | 14 +++----- .../Screens/Multi/Components/DrawableRoom.cs | 29 +++-------------- .../Screens/Multi/Components/RoomInspector.cs | 32 +++---------------- 5 files changed, 19 insertions(+), 104 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 8833a89479..033f0b22d0 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -26,7 +26,7 @@ namespace osu.Game.Overlays.BeatmapSet private const float buttons_spacing = 5; private readonly Box tabsBg; - private readonly Container coverContainer; + private readonly UpdateableBeatmapSetCover cover; private readonly OsuSpriteText title, artist; private readonly Container noVideoButtons; private readonly FillFlowContainer videoButtons; @@ -36,7 +36,6 @@ namespace osu.Game.Overlays.BeatmapSet public Details Details; private BeatmapManager beatmaps; - private DelayedLoadWrapper cover; public readonly BeatmapPicker Picker; @@ -63,7 +62,7 @@ namespace osu.Game.Overlays.BeatmapSet artist.Text = BeatmapSet?.Metadata.Artist ?? string.Empty; onlineStatusPill.Status = BeatmapSet?.OnlineInfo.Status ?? BeatmapSetOnlineStatus.None; - cover?.FadeOut(400, Easing.Out); + cover.BeatmapSet = null; if (BeatmapSet != null) { downloadButtonsContainer.FadeIn(transition_duration); @@ -72,18 +71,7 @@ namespace osu.Game.Overlays.BeatmapSet noVideoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 0 : 1, transition_duration); videoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 1 : 0, transition_duration); - coverContainer.Add(cover = new DelayedLoadWrapper( - new BeatmapSetCover(BeatmapSet) - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - FillMode = FillMode.Fill, - OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), - }, 300) - { - RelativeSizeAxes = Axes.Both, - }); + cover.BeatmapSet = BeatmapSet; } else { @@ -130,12 +118,7 @@ namespace osu.Game.Overlays.BeatmapSet RelativeSizeAxes = Axes.Both, Children = new Drawable[] { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, - }, - coverContainer = new Container + cover = new UpdateableBeatmapSetCover { RelativeSizeAxes = Axes.Both, }, diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index cc0123dabc..df784252ce 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -27,8 +27,6 @@ namespace osu.Game.Overlays.Direct { public readonly BeatmapSetInfo SetInfo; - protected Box BlackBackground; - private const double hover_transition_time = 400; private Container content; @@ -81,12 +79,6 @@ namespace osu.Game.Overlays.Direct EdgeEffect = edgeEffectNormal, Children = new[] { - // temporary blackness until the actual background loads. - BlackBackground = new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, - }, CreateBackground(), progressBar = new ProgressBar { @@ -215,21 +207,10 @@ namespace osu.Game.Overlays.Direct return icons; } - protected Drawable CreateBackground() => new DelayedLoadWrapper( - new BeatmapSetCover(SetInfo) - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - FillMode = FillMode.Fill, - OnLoadComplete = d => - { - d.FadeInFromZero(400, Easing.Out); - BlackBackground.Delay(400).FadeOut(); - }, - }, 300) + protected Drawable CreateBackground() => new UpdateableBeatmapSetCover { RelativeSizeAxes = Axes.Both, + BeatmapSet = SetInfo, }; public class Statistic : FillFlowContainer diff --git a/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedRow.cs b/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedRow.cs index be8e09105b..0a2b2fe121 100644 --- a/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedRow.cs +++ b/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedRow.cs @@ -24,19 +24,13 @@ namespace osu.Game.Overlays.Profile.Sections.Historical this.playCount = playCount; } - protected override Drawable CreateLeftVisual() => new DelayedLoadWrapper(new BeatmapSetCover(beatmap.BeatmapSet, BeatmapSetCoverType.List) + protected override Drawable CreateLeftVisual() => new UpdateableBeatmapSetCover { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - FillMode = FillMode.Fit, - RelativeSizeAxes = Axes.Both, - OnLoadComplete = d => d.FadeInFromZero(500, Easing.OutQuint) - }) - { - Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, - RelativeSizeAxes = Axes.None, + Origin = Anchor.CentreLeft, Size = new Vector2(80, 50), + BeatmapSet = beatmap.BeatmapSet, + CoverType = BeatmapSetCoverType.List, }; [BackgroundDependencyLoader(true)] diff --git a/osu.Game/Screens/Multi/Components/DrawableRoom.cs b/osu.Game/Screens/Multi/Components/DrawableRoom.cs index 1851f4618e..83d86d8159 100644 --- a/osu.Game/Screens/Multi/Components/DrawableRoom.cs +++ b/osu.Game/Screens/Multi/Components/DrawableRoom.cs @@ -111,7 +111,7 @@ namespace osu.Game.Screens.Multi.Components private void load(OsuColour colours, LocalisationEngine localisation) { Box sideStrip; - Container coverContainer; + UpdateableBeatmapSetCover cover; OsuSpriteText name, status, beatmapTitle, beatmapDash, beatmapArtist; ParticipantInfo participantInfo; ModeTypeInfo modeTypeInfo; @@ -146,24 +146,12 @@ namespace osu.Game.Screens.Multi.Components RelativeSizeAxes = Axes.Y, Width = side_strip_width, }, - new Container + cover = new UpdateableBeatmapSetCover { Width = cover_width, RelativeSizeAxes = Axes.Y, Masking = true, Margin = new MarginPadding { Left = side_strip_width }, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, - }, - coverContainer = new Container - { - RelativeSizeAxes = Axes.Both, - }, - }, }, new Container { @@ -263,23 +251,14 @@ namespace osu.Game.Screens.Multi.Components if (b != null) { - coverContainer.FadeIn(transition_duration); - - LoadComponentAsync(new BeatmapSetCover(b.BeatmapSet) - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - FillMode = FillMode.Fill, - OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), - }, coverContainer.Add); - + cover.BeatmapSet = b.BeatmapSet; beatmapTitle.Current = localisation.GetUnicodePreference(b.Metadata.TitleUnicode, b.Metadata.Title); beatmapDash.Text = @" - "; beatmapArtist.Current = localisation.GetUnicodePreference(b.Metadata.ArtistUnicode, b.Metadata.Artist); } else { - coverContainer.FadeOut(transition_duration); + cover.BeatmapSet = null; beatmapTitle.Current = null; beatmapArtist.Current = null; diff --git a/osu.Game/Screens/Multi/Components/RoomInspector.cs b/osu.Game/Screens/Multi/Components/RoomInspector.cs index 3bd054b042..a282e56d22 100644 --- a/osu.Game/Screens/Multi/Components/RoomInspector.cs +++ b/osu.Game/Screens/Multi/Components/RoomInspector.cs @@ -38,7 +38,7 @@ namespace osu.Game.Screens.Multi.Components private OsuColour colours; private Box statusStrip; - private Container coverContainer; + private UpdateableBeatmapSetCover cover; private FillFlowContainer topFlow, participantsFlow, participantNumbersFlow, infoPanelFlow; private OsuSpriteText name, status; private ScrollContainer participantsScroll; @@ -105,21 +105,9 @@ namespace osu.Game.Screens.Multi.Components Masking = true, Children = new Drawable[] { - new Container + cover = new UpdateableBeatmapSetCover { RelativeSizeAxes = Axes.Both, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, - }, - coverContainer = new Container - { - RelativeSizeAxes = Axes.Both, - }, - }, }, new Box { @@ -294,17 +282,7 @@ namespace osu.Game.Screens.Multi.Components if (b != null) { - coverContainer.FadeIn(transition_duration); - - LoadComponentAsync(new BeatmapSetCover(b.BeatmapSet) - { - RelativeSizeAxes = Axes.Both, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - FillMode = FillMode.Fill, - OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), - }, coverContainer.Add); - + cover.BeatmapSet = b.BeatmapSet; beatmapTitle.Current = localisation.GetUnicodePreference(b.Metadata.TitleUnicode, b.Metadata.Title); beatmapDash.Text = @" - "; beatmapArtist.Current = localisation.GetUnicodePreference(b.Metadata.ArtistUnicode, b.Metadata.Artist); @@ -312,7 +290,7 @@ namespace osu.Game.Screens.Multi.Components } else { - coverContainer.FadeOut(transition_duration); + cover.BeatmapSet = null; beatmapTitle.Current = null; beatmapArtist.Current = null; @@ -367,7 +345,7 @@ namespace osu.Game.Screens.Multi.Components { if (Room == null) { - coverContainer.FadeOut(transition_duration); + cover.BeatmapSet = null; participantsFlow.FadeOut(transition_duration); participantNumbersFlow.FadeOut(transition_duration); infoPanelFlow.FadeOut(transition_duration); From 8b36e1dad088095b0e9aa4b8e7cc74f8fae1390d Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Mon, 28 May 2018 23:13:56 -0300 Subject: [PATCH 03/39] Add BeatmapTitle to encapsulate multiplayer beatmap title display logic. (cherry picked from commit 58e65afb45fbc675186e470cc4a268d9eaa2a539) --- .../Screens/Multi/Components/BeatmapTitle.cs | 90 +++++++++++++++++++ .../Screens/Multi/Components/DrawableRoom.cs | 40 ++------- .../Screens/Multi/Components/RoomInspector.cs | 37 ++------ 3 files changed, 104 insertions(+), 63 deletions(-) create mode 100644 osu.Game/Screens/Multi/Components/BeatmapTitle.cs diff --git a/osu.Game/Screens/Multi/Components/BeatmapTitle.cs b/osu.Game/Screens/Multi/Components/BeatmapTitle.cs new file mode 100644 index 0000000000..a6cc472335 --- /dev/null +++ b/osu.Game/Screens/Multi/Components/BeatmapTitle.cs @@ -0,0 +1,90 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Localisation; +using osu.Game.Beatmaps; +using osu.Game.Graphics.Sprites; + +namespace osu.Game.Screens.Multi.Components +{ + public class BeatmapTitle : FillFlowContainer + { + private readonly OsuSpriteText beatmapTitle, beatmapDash, beatmapArtist; + + private LocalisationEngine localisation; + + public float TextSize + { + set { beatmapTitle.TextSize = beatmapDash.TextSize = beatmapArtist.TextSize = value; } + } + + private BeatmapInfo beatmap; + public BeatmapInfo Beatmap + { + get { return beatmap; } + set + { + if (value == beatmap) return; + beatmap = value; + + if (IsLoaded) + updateText(); + } + } + + public BeatmapTitle() + { + AutoSizeAxes = Axes.Both; + Direction = FillDirection.Horizontal; + + Children = new[] + { + beatmapTitle = new OsuSpriteText + { + Font = @"Exo2.0-BoldItalic", + }, + beatmapDash = new OsuSpriteText + { + Font = @"Exo2.0-BoldItalic", + }, + beatmapArtist = new OsuSpriteText + { + Font = @"Exo2.0-RegularItalic", + }, + }; + } + + [BackgroundDependencyLoader] + private void load(LocalisationEngine localisation) + { + this.localisation = localisation; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + + updateText(); + } + + private void updateText() + { + if (beatmap == null) + { + beatmapTitle.Current = beatmapArtist.Current = null; + + beatmapTitle.Text = "Changing map"; + beatmapDash.Text = beatmapArtist.Text = string.Empty; + } + else + { + beatmapTitle.Current = localisation.GetUnicodePreference(beatmap.Metadata.TitleUnicode, beatmap.Metadata.Title); + beatmapDash.Text = @" - "; + beatmapArtist.Current = localisation.GetUnicodePreference(beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist); + } + } + } +} diff --git a/osu.Game/Screens/Multi/Components/DrawableRoom.cs b/osu.Game/Screens/Multi/Components/DrawableRoom.cs index 83d86d8159..f48846f707 100644 --- a/osu.Game/Screens/Multi/Components/DrawableRoom.cs +++ b/osu.Game/Screens/Multi/Components/DrawableRoom.cs @@ -112,8 +112,9 @@ namespace osu.Game.Screens.Multi.Components { Box sideStrip; UpdateableBeatmapSetCover cover; - OsuSpriteText name, status, beatmapTitle, beatmapDash, beatmapArtist; + OsuSpriteText name, status; ParticipantInfo participantInfo; + BeatmapTitle beatmapTitle; ModeTypeInfo modeTypeInfo; Children = new Drawable[] @@ -193,30 +194,10 @@ namespace osu.Game.Screens.Multi.Components TextSize = 14, Font = @"Exo2.0-Bold", }, - new FillFlowContainer + beatmapTitle = new BeatmapTitle { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Colour = colours.Gray9, - Direction = FillDirection.Horizontal, - Children = new[] - { - beatmapTitle = new OsuSpriteText - { - TextSize = 14, - Font = @"Exo2.0-BoldItalic", - }, - beatmapDash = new OsuSpriteText - { - TextSize = 14, - Font = @"Exo2.0-BoldItalic", - }, - beatmapArtist = new OsuSpriteText - { - TextSize = 14, - Font = @"Exo2.0-RegularItalic", - }, - }, + TextSize = 14, + Colour = colours.Gray9 }, }, }, @@ -252,19 +233,12 @@ namespace osu.Game.Screens.Multi.Components if (b != null) { cover.BeatmapSet = b.BeatmapSet; - beatmapTitle.Current = localisation.GetUnicodePreference(b.Metadata.TitleUnicode, b.Metadata.Title); - beatmapDash.Text = @" - "; - beatmapArtist.Current = localisation.GetUnicodePreference(b.Metadata.ArtistUnicode, b.Metadata.Artist); + beatmapTitle.Beatmap = b; } else { cover.BeatmapSet = null; - - beatmapTitle.Current = null; - beatmapArtist.Current = null; - - beatmapTitle.Text = "Changing map"; - beatmapDash.Text = beatmapArtist.Text = string.Empty; + beatmapTitle.Beatmap = null; } }; diff --git a/osu.Game/Screens/Multi/Components/RoomInspector.cs b/osu.Game/Screens/Multi/Components/RoomInspector.cs index a282e56d22..ee3dea7c0d 100644 --- a/osu.Game/Screens/Multi/Components/RoomInspector.cs +++ b/osu.Game/Screens/Multi/Components/RoomInspector.cs @@ -82,7 +82,8 @@ namespace osu.Game.Screens.Multi.Components this.colours = colours; ModeTypeInfo modeTypeInfo; - OsuSpriteText participants, participantsSlash, maxParticipants, beatmapTitle, beatmapDash, beatmapArtist, beatmapAuthor; + OsuSpriteText participants, participantsSlash, maxParticipants, beatmapAuthor; + BeatmapTitle beatmapTitle; Children = new Drawable[] { @@ -203,28 +204,9 @@ namespace osu.Game.Screens.Multi.Components AutoSizeAxes = Axes.X, RelativeSizeAxes = Axes.Y, Margin = new MarginPadding { Left = 5 }, - Children = new[] + Children = new Drawable[] { - new FillFlowContainer - { - AutoSizeAxes = Axes.Both, - Direction = FillDirection.Horizontal, - Children = new[] - { - beatmapTitle = new OsuSpriteText - { - Font = @"Exo2.0-BoldItalic", - }, - beatmapDash = new OsuSpriteText - { - Font = @"Exo2.0-BoldItalic", - }, - beatmapArtist = new OsuSpriteText - { - Font = @"Exo2.0-RegularItalic", - }, - }, - }, + beatmapTitle = new BeatmapTitle(), beatmapAuthor = new OsuSpriteText { Anchor = Anchor.BottomLeft, @@ -283,20 +265,15 @@ namespace osu.Game.Screens.Multi.Components if (b != null) { cover.BeatmapSet = b.BeatmapSet; - beatmapTitle.Current = localisation.GetUnicodePreference(b.Metadata.TitleUnicode, b.Metadata.Title); - beatmapDash.Text = @" - "; - beatmapArtist.Current = localisation.GetUnicodePreference(b.Metadata.ArtistUnicode, b.Metadata.Artist); + beatmapTitle.Beatmap = b; beatmapAuthor.Text = $"mapped by {b.Metadata.Author}"; } else { cover.BeatmapSet = null; + beatmapTitle.Beatmap = null; - beatmapTitle.Current = null; - beatmapArtist.Current = null; - - beatmapTitle.Text = "Changing map"; - beatmapDash.Text = beatmapArtist.Text = beatmapAuthor.Text = string.Empty; + beatmapAuthor.Text = string.Empty; } }; From 8b8d10349e67f6f3987efaeb32e7c616fb578e71 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Mon, 28 May 2018 23:33:13 -0300 Subject: [PATCH 04/39] Move RoomInspector info panel content to BeatmapModeInfo to share with Match. (cherry picked from commit 257d9d13ac81d85583314f8b5dfabf05661b1572) --- .../Multi/Components/BeatmapModeInfo.cs | 74 +++++++++++++++++++ .../Screens/Multi/Components/DrawableRoom.cs | 3 +- .../Screens/Multi/Components/ModeTypeInfo.cs | 3 +- .../Screens/Multi/Components/RoomInspector.cs | 60 +++------------ 4 files changed, 86 insertions(+), 54 deletions(-) create mode 100644 osu.Game/Screens/Multi/Components/BeatmapModeInfo.cs diff --git a/osu.Game/Screens/Multi/Components/BeatmapModeInfo.cs b/osu.Game/Screens/Multi/Components/BeatmapModeInfo.cs new file mode 100644 index 0000000000..8bd7d7ea06 --- /dev/null +++ b/osu.Game/Screens/Multi/Components/BeatmapModeInfo.cs @@ -0,0 +1,74 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Beatmaps; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Online.Multiplayer; +using OpenTK; + +namespace osu.Game.Screens.Multi.Components +{ + public class BeatmapModeInfo : FillFlowContainer + { + private readonly ModeTypeInfo modeTypeInfo; + private readonly BeatmapTitle beatmapTitle; + private readonly OsuSpriteText beatmapAuthor; + + public BeatmapInfo Beatmap + { + set + { + modeTypeInfo.Beatmap = beatmapTitle.Beatmap = value; + + if (value == null) + beatmapAuthor.Text = string.Empty; + else + beatmapAuthor.Text = $"mapped by {value.Metadata.Author}"; + } + } + + public GameType Type + { + set { modeTypeInfo.Type = value; } + } + + public BeatmapModeInfo() + { + AutoSizeAxes = Axes.Both; + Direction = FillDirection.Horizontal; + LayoutDuration = 100; + Spacing = new Vector2(5f, 0f); + + Children = new Drawable[] + { + modeTypeInfo = new ModeTypeInfo(), + new Container + { + AutoSizeAxes = Axes.X, + Height = 30, + Margin = new MarginPadding { Left = 5 }, + Children = new Drawable[] + { + beatmapTitle = new BeatmapTitle(), + beatmapAuthor = new OsuSpriteText + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + TextSize = 14, + }, + }, + }, + }; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + beatmapAuthor.Colour = colours.Gray9; + } + } +} diff --git a/osu.Game/Screens/Multi/Components/DrawableRoom.cs b/osu.Game/Screens/Multi/Components/DrawableRoom.cs index f48846f707..70adf8c7db 100644 --- a/osu.Game/Screens/Multi/Components/DrawableRoom.cs +++ b/osu.Game/Screens/Multi/Components/DrawableRoom.cs @@ -11,7 +11,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Input; -using osu.Framework.Localisation; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics; @@ -108,7 +107,7 @@ namespace osu.Game.Screens.Multi.Components } [BackgroundDependencyLoader] - private void load(OsuColour colours, LocalisationEngine localisation) + private void load(OsuColour colours) { Box sideStrip; UpdateableBeatmapSetCover cover; diff --git a/osu.Game/Screens/Multi/Components/ModeTypeInfo.cs b/osu.Game/Screens/Multi/Components/ModeTypeInfo.cs index e3aba685a7..26c391586a 100644 --- a/osu.Game/Screens/Multi/Components/ModeTypeInfo.cs +++ b/osu.Game/Screens/Multi/Components/ModeTypeInfo.cs @@ -55,7 +55,8 @@ namespace osu.Game.Screens.Multi.Components public ModeTypeInfo() { - AutoSizeAxes = Axes.Both; + AutoSizeAxes = Axes.X; + Height = height; Children = new[] { diff --git a/osu.Game/Screens/Multi/Components/RoomInspector.cs b/osu.Game/Screens/Multi/Components/RoomInspector.cs index ee3dea7c0d..c3b7d3a7ad 100644 --- a/osu.Game/Screens/Multi/Components/RoomInspector.cs +++ b/osu.Game/Screens/Multi/Components/RoomInspector.cs @@ -10,7 +10,6 @@ using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; -using osu.Framework.Localisation; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics; @@ -39,8 +38,9 @@ namespace osu.Game.Screens.Multi.Components private OsuColour colours; private Box statusStrip; private UpdateableBeatmapSetCover cover; - private FillFlowContainer topFlow, participantsFlow, participantNumbersFlow, infoPanelFlow; + private FillFlowContainer topFlow, participantsFlow, participantNumbersFlow; private OsuSpriteText name, status; + private BeatmapModeInfo beatmapModeInfo; private ScrollContainer participantsScroll; private ParticipantInfo participantInfo; @@ -77,13 +77,12 @@ namespace osu.Game.Screens.Multi.Components } [BackgroundDependencyLoader] - private void load(OsuColour colours, LocalisationEngine localisation) + private void load(OsuColour colours) { this.colours = colours; ModeTypeInfo modeTypeInfo; OsuSpriteText participants, participantsSlash, maxParticipants, beatmapAuthor; - BeatmapTitle beatmapTitle; Children = new Drawable[] { @@ -189,35 +188,7 @@ namespace osu.Game.Screens.Multi.Components TextSize = 14, Font = @"Exo2.0-Bold", }, - infoPanelFlow = new FillFlowContainer - { - AutoSizeAxes = Axes.X, - Height = 30, - Direction = FillDirection.Horizontal, - LayoutDuration = transition_duration, - Spacing = new Vector2(5f, 0f), - Children = new Drawable[] - { - modeTypeInfo = new ModeTypeInfo(), - new Container - { - AutoSizeAxes = Axes.X, - RelativeSizeAxes = Axes.Y, - Margin = new MarginPadding { Left = 5 }, - Children = new Drawable[] - { - beatmapTitle = new BeatmapTitle(), - beatmapAuthor = new OsuSpriteText - { - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft, - TextSize = 14, - Colour = colours.Gray9, - }, - }, - }, - }, - }, + beatmapModeInfo = new BeatmapModeInfo(), }, }, }, @@ -255,26 +226,13 @@ namespace osu.Game.Screens.Multi.Components nameBind.ValueChanged += n => name.Text = n; hostBind.ValueChanged += h => participantInfo.Host = h; - typeBind.ValueChanged += t => modeTypeInfo.Type = t; + typeBind.ValueChanged += t => beatmapModeInfo.Type = t; statusBind.ValueChanged += displayStatus; beatmapBind.ValueChanged += b => { - modeTypeInfo.Beatmap = b; - - if (b != null) - { - cover.BeatmapSet = b.BeatmapSet; - beatmapTitle.Beatmap = b; - beatmapAuthor.Text = $"mapped by {b.Metadata.Author}"; - } - else - { - cover.BeatmapSet = null; - beatmapTitle.Beatmap = null; - - beatmapAuthor.Text = string.Empty; - } + cover.BeatmapSet = b?.BeatmapSet; + beatmapModeInfo.Beatmap = b; }; maxParticipantsBind.ValueChanged += m => @@ -325,7 +283,7 @@ namespace osu.Game.Screens.Multi.Components cover.BeatmapSet = null; participantsFlow.FadeOut(transition_duration); participantNumbersFlow.FadeOut(transition_duration); - infoPanelFlow.FadeOut(transition_duration); + beatmapModeInfo.FadeOut(transition_duration); name.FadeOut(transition_duration); participantInfo.FadeOut(transition_duration); @@ -335,7 +293,7 @@ namespace osu.Game.Screens.Multi.Components { participantsFlow.FadeIn(transition_duration); participantNumbersFlow.FadeIn(transition_duration); - infoPanelFlow.FadeIn(transition_duration); + beatmapModeInfo.FadeIn(transition_duration); name.FadeIn(transition_duration); participantInfo.FadeIn(transition_duration); From bd9af745dd898b770d7a8b7f1bc13b8641867dc5 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Mon, 28 May 2018 23:36:35 -0300 Subject: [PATCH 05/39] Cleanup. (cherry picked from commit fffa6a004cf074caf0cf5c8ae1408a80500859fa) --- osu.Game/Screens/Multi/Components/ModeTypeInfo.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Screens/Multi/Components/ModeTypeInfo.cs b/osu.Game/Screens/Multi/Components/ModeTypeInfo.cs index 26c391586a..e3aba685a7 100644 --- a/osu.Game/Screens/Multi/Components/ModeTypeInfo.cs +++ b/osu.Game/Screens/Multi/Components/ModeTypeInfo.cs @@ -55,8 +55,7 @@ namespace osu.Game.Screens.Multi.Components public ModeTypeInfo() { - AutoSizeAxes = Axes.X; - Height = height; + AutoSizeAxes = Axes.Both; Children = new[] { From dcc39d96e2801d29fa671d1963546855a6b53fbe Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Mon, 28 May 2018 23:45:59 -0300 Subject: [PATCH 06/39] BeatmapModeInfo -> BeatmapTypeInfo. --- .../{BeatmapModeInfo.cs => BeatmapTypeInfo.cs} | 4 ++-- osu.Game/Screens/Multi/Components/ModeTypeInfo.cs | 1 + osu.Game/Screens/Multi/Components/RoomInspector.cs | 12 ++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) rename osu.Game/Screens/Multi/Components/{BeatmapModeInfo.cs => BeatmapTypeInfo.cs} (96%) diff --git a/osu.Game/Screens/Multi/Components/BeatmapModeInfo.cs b/osu.Game/Screens/Multi/Components/BeatmapTypeInfo.cs similarity index 96% rename from osu.Game/Screens/Multi/Components/BeatmapModeInfo.cs rename to osu.Game/Screens/Multi/Components/BeatmapTypeInfo.cs index 8bd7d7ea06..753006c62d 100644 --- a/osu.Game/Screens/Multi/Components/BeatmapModeInfo.cs +++ b/osu.Game/Screens/Multi/Components/BeatmapTypeInfo.cs @@ -12,7 +12,7 @@ using OpenTK; namespace osu.Game.Screens.Multi.Components { - public class BeatmapModeInfo : FillFlowContainer + public class BeatmapTypeInfo : FillFlowContainer { private readonly ModeTypeInfo modeTypeInfo; private readonly BeatmapTitle beatmapTitle; @@ -36,7 +36,7 @@ namespace osu.Game.Screens.Multi.Components set { modeTypeInfo.Type = value; } } - public BeatmapModeInfo() + public BeatmapTypeInfo() { AutoSizeAxes = Axes.Both; Direction = FillDirection.Horizontal; diff --git a/osu.Game/Screens/Multi/Components/ModeTypeInfo.cs b/osu.Game/Screens/Multi/Components/ModeTypeInfo.cs index e3aba685a7..e2d0268090 100644 --- a/osu.Game/Screens/Multi/Components/ModeTypeInfo.cs +++ b/osu.Game/Screens/Multi/Components/ModeTypeInfo.cs @@ -64,6 +64,7 @@ namespace osu.Game.Screens.Multi.Components AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(5f, 0f), + LayoutDuration = 100, Children = new[] { rulesetContainer = new Container diff --git a/osu.Game/Screens/Multi/Components/RoomInspector.cs b/osu.Game/Screens/Multi/Components/RoomInspector.cs index c3b7d3a7ad..d9a35808a8 100644 --- a/osu.Game/Screens/Multi/Components/RoomInspector.cs +++ b/osu.Game/Screens/Multi/Components/RoomInspector.cs @@ -40,7 +40,7 @@ namespace osu.Game.Screens.Multi.Components private UpdateableBeatmapSetCover cover; private FillFlowContainer topFlow, participantsFlow, participantNumbersFlow; private OsuSpriteText name, status; - private BeatmapModeInfo beatmapModeInfo; + private BeatmapTypeInfo beatmapTypeInfo; private ScrollContainer participantsScroll; private ParticipantInfo participantInfo; @@ -188,7 +188,7 @@ namespace osu.Game.Screens.Multi.Components TextSize = 14, Font = @"Exo2.0-Bold", }, - beatmapModeInfo = new BeatmapModeInfo(), + beatmapTypeInfo = new BeatmapTypeInfo(), }, }, }, @@ -226,13 +226,13 @@ namespace osu.Game.Screens.Multi.Components nameBind.ValueChanged += n => name.Text = n; hostBind.ValueChanged += h => participantInfo.Host = h; - typeBind.ValueChanged += t => beatmapModeInfo.Type = t; + typeBind.ValueChanged += t => beatmapTypeInfo.Type = t; statusBind.ValueChanged += displayStatus; beatmapBind.ValueChanged += b => { cover.BeatmapSet = b?.BeatmapSet; - beatmapModeInfo.Beatmap = b; + beatmapTypeInfo.Beatmap = b; }; maxParticipantsBind.ValueChanged += m => @@ -283,7 +283,7 @@ namespace osu.Game.Screens.Multi.Components cover.BeatmapSet = null; participantsFlow.FadeOut(transition_duration); participantNumbersFlow.FadeOut(transition_duration); - beatmapModeInfo.FadeOut(transition_duration); + beatmapTypeInfo.FadeOut(transition_duration); name.FadeOut(transition_duration); participantInfo.FadeOut(transition_duration); @@ -293,7 +293,7 @@ namespace osu.Game.Screens.Multi.Components { participantsFlow.FadeIn(transition_duration); participantNumbersFlow.FadeIn(transition_duration); - beatmapModeInfo.FadeIn(transition_duration); + beatmapTypeInfo.FadeIn(transition_duration); name.FadeIn(transition_duration); participantInfo.FadeIn(transition_duration); From 7beac3a712138ec393b3cf84466f1742327d44b1 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Mon, 28 May 2018 23:56:00 -0300 Subject: [PATCH 07/39] Cleanup DrawableRoom. --- osu.Game/Screens/Multi/Components/DrawableRoom.cs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/osu.Game/Screens/Multi/Components/DrawableRoom.cs b/osu.Game/Screens/Multi/Components/DrawableRoom.cs index 70adf8c7db..d31019a259 100644 --- a/osu.Game/Screens/Multi/Components/DrawableRoom.cs +++ b/osu.Game/Screens/Multi/Components/DrawableRoom.cs @@ -227,18 +227,9 @@ namespace osu.Game.Screens.Multi.Components beatmapBind.ValueChanged += b => { + cover.BeatmapSet = b?.BeatmapSet; + beatmapTitle.Beatmap = b; modeTypeInfo.Beatmap = b; - - if (b != null) - { - cover.BeatmapSet = b.BeatmapSet; - beatmapTitle.Beatmap = b; - } - else - { - cover.BeatmapSet = null; - beatmapTitle.Beatmap = null; - } }; nameBind.BindTo(Room.Name); From 852d7ef48de64996af8fa109c8b4e8aedc0c5ec5 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Tue, 29 May 2018 00:07:33 -0300 Subject: [PATCH 08/39] Use ?: expression instead of if/else. --- osu.Game/Screens/Multi/Components/BeatmapTitle.cs | 1 - osu.Game/Screens/Multi/Components/BeatmapTypeInfo.cs | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/osu.Game/Screens/Multi/Components/BeatmapTitle.cs b/osu.Game/Screens/Multi/Components/BeatmapTitle.cs index a6cc472335..daa362409a 100644 --- a/osu.Game/Screens/Multi/Components/BeatmapTitle.cs +++ b/osu.Game/Screens/Multi/Components/BeatmapTitle.cs @@ -24,7 +24,6 @@ namespace osu.Game.Screens.Multi.Components private BeatmapInfo beatmap; public BeatmapInfo Beatmap { - get { return beatmap; } set { if (value == beatmap) return; diff --git a/osu.Game/Screens/Multi/Components/BeatmapTypeInfo.cs b/osu.Game/Screens/Multi/Components/BeatmapTypeInfo.cs index 753006c62d..78ffe01ef0 100644 --- a/osu.Game/Screens/Multi/Components/BeatmapTypeInfo.cs +++ b/osu.Game/Screens/Multi/Components/BeatmapTypeInfo.cs @@ -23,11 +23,7 @@ namespace osu.Game.Screens.Multi.Components set { modeTypeInfo.Beatmap = beatmapTitle.Beatmap = value; - - if (value == null) - beatmapAuthor.Text = string.Empty; - else - beatmapAuthor.Text = $"mapped by {value.Metadata.Author}"; + beatmapAuthor.Text = value == null ? string.Empty : $"mapped by {value.Metadata.Author}"; } } From d090323c0039c1a39a58bb4f5a8aead177be9a99 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Tue, 29 May 2018 00:51:56 -0300 Subject: [PATCH 09/39] Add ParticipantCount to share with the Match screen. --- .../Multi/Components/ParticipantCount.cs | 67 +++++++++++++++++++ .../Screens/Multi/Components/RoomInspector.cs | 52 ++------------ 2 files changed, 74 insertions(+), 45 deletions(-) create mode 100644 osu.Game/Screens/Multi/Components/ParticipantCount.cs diff --git a/osu.Game/Screens/Multi/Components/ParticipantCount.cs b/osu.Game/Screens/Multi/Components/ParticipantCount.cs new file mode 100644 index 0000000000..96e2bd7bee --- /dev/null +++ b/osu.Game/Screens/Multi/Components/ParticipantCount.cs @@ -0,0 +1,67 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Graphics.Sprites; + +namespace osu.Game.Screens.Multi.Components +{ + public class ParticipantCount : FillFlowContainer + { + private const float text_size = 30; + private const float transition_duration = 100; + + private readonly OsuSpriteText count, slash, max; + + public int Count + { + set { count.Text = value.ToString(); } + } + + public int? Max + { + set + { + if (value == null) + { + slash.FadeOut(transition_duration); + max.FadeOut(transition_duration); + } + else + { + slash.FadeIn(transition_duration); + max.FadeIn(transition_duration); + max.Text = value.ToString(); + } + } + } + + public ParticipantCount() + { + AutoSizeAxes = Axes.Both; + Direction = FillDirection.Horizontal; + LayoutDuration = transition_duration; + + Children = new[] + { + count = new OsuSpriteText + { + TextSize = text_size, + Font = @"Exo2.0-Bold" + }, + slash = new OsuSpriteText + { + Text = @"/", + TextSize = text_size, + Font = @"Exo2.0-Light" + }, + max = new OsuSpriteText + { + TextSize = text_size, + Font = @"Exo2.0-Light" + }, + }; + } + } +} diff --git a/osu.Game/Screens/Multi/Components/RoomInspector.cs b/osu.Game/Screens/Multi/Components/RoomInspector.cs index d9a35808a8..14f4feab05 100644 --- a/osu.Game/Screens/Multi/Components/RoomInspector.cs +++ b/osu.Game/Screens/Multi/Components/RoomInspector.cs @@ -38,7 +38,8 @@ namespace osu.Game.Screens.Multi.Components private OsuColour colours; private Box statusStrip; private UpdateableBeatmapSetCover cover; - private FillFlowContainer topFlow, participantsFlow, participantNumbersFlow; + private ParticipantCount participantCount; + private FillFlowContainer topFlow, participantsFlow; private OsuSpriteText name, status; private BeatmapTypeInfo beatmapTypeInfo; private ScrollContainer participantsScroll; @@ -81,9 +82,6 @@ namespace osu.Game.Screens.Multi.Components { this.colours = colours; - ModeTypeInfo modeTypeInfo; - OsuSpriteText participants, participantsSlash, maxParticipants, beatmapAuthor; - Children = new Drawable[] { new Box @@ -120,32 +118,10 @@ namespace osu.Game.Screens.Multi.Components Padding = new MarginPadding(20), Children = new Drawable[] { - participantNumbersFlow = new FillFlowContainer + participantCount = new ParticipantCount { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, - AutoSizeAxes = Axes.Both, - Direction = FillDirection.Horizontal, - LayoutDuration = transition_duration, - Children = new[] - { - participants = new OsuSpriteText - { - TextSize = 30, - Font = @"Exo2.0-Bold" - }, - participantsSlash = new OsuSpriteText - { - Text = @"/", - TextSize = 30, - Font = @"Exo2.0-Light" - }, - maxParticipants = new OsuSpriteText - { - TextSize = 30, - Font = @"Exo2.0-Light" - }, - }, }, name = new OsuSpriteText { @@ -227,6 +203,7 @@ namespace osu.Game.Screens.Multi.Components nameBind.ValueChanged += n => name.Text = n; hostBind.ValueChanged += h => participantInfo.Host = h; typeBind.ValueChanged += t => beatmapTypeInfo.Type = t; + maxParticipantsBind.ValueChanged += m => participantCount.Max = m; statusBind.ValueChanged += displayStatus; beatmapBind.ValueChanged += b => @@ -235,24 +212,9 @@ namespace osu.Game.Screens.Multi.Components beatmapTypeInfo.Beatmap = b; }; - maxParticipantsBind.ValueChanged += m => - { - if (m == null) - { - participantsSlash.FadeOut(transition_duration); - maxParticipants.FadeOut(transition_duration); - } - else - { - participantsSlash.FadeIn(transition_duration); - maxParticipants.FadeIn(transition_duration); - maxParticipants.Text = m.ToString(); - } - }; - participantsBind.ValueChanged += p => { - participants.Text = p.Length.ToString(); + participantCount.Count = p.Length; participantInfo.Participants = p; participantsFlow.ChildrenEnumerable = p.Select(u => new UserTile(u)); }; @@ -282,7 +244,7 @@ namespace osu.Game.Screens.Multi.Components { cover.BeatmapSet = null; participantsFlow.FadeOut(transition_duration); - participantNumbersFlow.FadeOut(transition_duration); + participantCount.FadeOut(transition_duration); beatmapTypeInfo.FadeOut(transition_duration); name.FadeOut(transition_duration); participantInfo.FadeOut(transition_duration); @@ -292,7 +254,7 @@ namespace osu.Game.Screens.Multi.Components else { participantsFlow.FadeIn(transition_duration); - participantNumbersFlow.FadeIn(transition_duration); + participantCount.FadeIn(transition_duration); beatmapTypeInfo.FadeIn(transition_duration); name.FadeIn(transition_duration); participantInfo.FadeIn(transition_duration); From 9497db0b0bb38e35c73f6ab6db54d9d09cfc22c0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 30 May 2018 20:21:25 +0900 Subject: [PATCH 10/39] Add a delay before the loading logo is displayed --- osu.Game/Screens/Loader.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index fb5c5ca84b..28b139c9f9 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -36,7 +36,13 @@ namespace osu.Game.Screens logo.Position = new Vector2(-40); logo.Scale = new Vector2(0.2f); - logo.FadeInFromZero(5000, Easing.OutQuint); + logo.Delay(500).FadeInFromZero(1000, Easing.OutQuint); + } + + protected override void LogoSuspending(OsuLogo logo) + { + base.LogoSuspending(logo); + logo.FadeOut(logo.Alpha * 1000); } private OsuScreen loadScreen; @@ -63,12 +69,6 @@ namespace osu.Game.Screens Push(loadScreen); } - protected override void LogoSuspending(OsuLogo logo) - { - base.LogoSuspending(logo); - logo.FadeOut(100); - } - [BackgroundDependencyLoader] private void load(OsuGameBase game) { From 9ea6ab28ea45ce90de2471f22a1b20de8ce44b5b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 30 May 2018 20:21:53 +0900 Subject: [PATCH 11/39] Fix intro potentially starting out-of-sync due to logo's outward animation --- osu.Game/Screens/Menu/Intro.cs | 48 ++++++++++++++++------------------ 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index c174e2d470..5aca184d24 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -79,31 +79,6 @@ namespace osu.Game.Screens.Menu seeya = audio.Sample.Get(@"seeya"); } - protected override void OnEntering(Screen last) - { - base.OnEntering(last); - - Game.Beatmap.Value = beatmap; - - if (menuVoice) - welcome.Play(); - - Scheduler.AddDelayed(delegate - { - // Only start the current track if it is the menu music. A beatmap's track is started when entering the Main Manu. - if (menuMusic) - track.Start(); - - LoadComponentAsync(mainMenu = new MainMenu()); - - Scheduler.AddDelayed(delegate - { - DidLoadMenu = true; - Push(mainMenu); - }, delay_step_one); - }, delay_step_two); - } - private const double delay_step_one = 2300; private const double delay_step_two = 600; @@ -113,6 +88,29 @@ namespace osu.Game.Screens.Menu { base.LogoArriving(logo, resuming); + if (!resuming) + { + Game.Beatmap.Value = beatmap; + + if (menuVoice) + welcome.Play(); + + Scheduler.AddDelayed(delegate + { + // Only start the current track if it is the menu music. A beatmap's track is started when entering the Main Manu. + if (menuMusic) + track.Start(); + + LoadComponentAsync(mainMenu = new MainMenu()); + + Scheduler.AddDelayed(delegate + { + DidLoadMenu = true; + Push(mainMenu); + }, delay_step_one); + }, delay_step_two); + } + logo.RelativePositionAxes = Axes.Both; logo.Colour = Color4.White; logo.Ripple = false; From c161d8247479f401b0719b029459a9107ef3705f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 31 May 2018 17:14:04 +0900 Subject: [PATCH 12/39] Reduce the length of the fadeout animation --- osu.Game/Screens/Loader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index 28b139c9f9..c8a80d470b 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -42,7 +42,7 @@ namespace osu.Game.Screens protected override void LogoSuspending(OsuLogo logo) { base.LogoSuspending(logo); - logo.FadeOut(logo.Alpha * 1000); + logo.FadeOut(logo.Alpha * 400); } private OsuScreen loadScreen; From 7487c82ec151b2b3a9fffc7adc260f87794ce182 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 31 May 2018 17:14:47 +0900 Subject: [PATCH 13/39] Stop the logo from beating --- osu.Game/Screens/Loader.cs | 1 + osu.Game/Screens/Menu/OsuLogo.cs | 4 ++++ osu.Game/Screens/OsuScreen.cs | 1 + 3 files changed, 6 insertions(+) diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index c8a80d470b..b8c1c31b8c 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -30,6 +30,7 @@ namespace osu.Game.Screens { base.LogoArriving(logo, resuming); + logo.BeatMatching = false; logo.Triangles = false; logo.Origin = Anchor.BottomRight; logo.Anchor = Anchor.BottomRight; diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index 42a8dbd5da..16482b0e48 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -64,6 +64,8 @@ namespace osu.Game.Screens.Menu set { colourAndTriangles.FadeTo(value ? 1 : 0, transition_length, Easing.OutQuint); } } + public bool BeatMatching = true; + public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => logoContainer.ReceiveMouseInputAt(screenSpacePos); public bool Ripple @@ -264,6 +266,8 @@ namespace osu.Game.Screens.Menu { base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes); + if (!BeatMatching) return; + lastBeatIndex = beatIndex; var beatLength = timingPoint.BeatLength; diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index db9807b9ab..7f68e5144b 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -225,6 +225,7 @@ namespace osu.Game.Screens logo.Anchor = Anchor.TopLeft; logo.Origin = Anchor.Centre; logo.RelativePositionAxes = Axes.None; + logo.BeatMatching = true; logo.Triangles = true; logo.Ripple = true; } From dfbcf4d7b7df2cde7194ea952a2eec221b81cd87 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 31 May 2018 17:29:59 +0900 Subject: [PATCH 14/39] Add tests --- .../Visual/TestCaseLoaderAnimation.cs | 101 ++++++++++++++++++ osu.Game/Screens/Loader.cs | 4 +- 2 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 osu.Game.Tests/Visual/TestCaseLoaderAnimation.cs diff --git a/osu.Game.Tests/Visual/TestCaseLoaderAnimation.cs b/osu.Game.Tests/Visual/TestCaseLoaderAnimation.cs new file mode 100644 index 0000000000..066efb5116 --- /dev/null +++ b/osu.Game.Tests/Visual/TestCaseLoaderAnimation.cs @@ -0,0 +1,101 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Threading; +using NUnit.Framework; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Shapes; +using osu.Game.Screens; +using osu.Game.Screens.Menu; +using OpenTK.Graphics; + +namespace osu.Game.Tests.Visual +{ + [TestFixture] + public class TestCaseLoaderAnimation : OsuTestCase + { + private TestLoader loader; + + public TestCaseLoaderAnimation() + { + bool logoVisible = false; + + AddStep("almost instant display", () => Child = loader = new TestLoader(0.25f)); + AddUntilStep(() => + { + logoVisible = loader.Logo.Alpha > 0; + return !loader.IsCurrentScreen; + }, "loaded"); + AddAssert("logo not visible", () => !logoVisible); + + AddStep("short load", () => Child = loader = new TestLoader(0.8f)); + AddUntilStep(() => + { + logoVisible = loader.Logo.Alpha > 0; + return !loader.IsCurrentScreen; + }, "loaded"); + AddAssert("logo visible", () => logoVisible); + AddUntilStep(() => loader.Logo.Alpha == 0, "logo gone"); + + AddStep("longer load", () => Child = loader = new TestLoader(1.4f)); + AddUntilStep(() => + { + logoVisible = loader.Logo.Alpha > 0; + return !loader.IsCurrentScreen; + }, "loaded"); + AddAssert("logo visible", () => logoVisible); + AddUntilStep(() => loader.Logo.Alpha == 0, "logo gone"); + } + + private class TestLoader : Loader + { + private readonly float secondsDelay; + + public OsuLogo Logo; + + public TestLoader(float secondsDelay) + { + this.secondsDelay = secondsDelay; + } + + protected override void LogoArriving(OsuLogo logo, bool resuming) + { + Logo = logo; + base.LogoArriving(logo, resuming); + } + + protected override OsuScreen CreateLoadableScreen() => new TestScreen(secondsDelay); + + private class TestScreen : OsuScreen + { + private readonly float secondsDelay; + + public TestScreen(float secondsDelay) + { + this.secondsDelay = secondsDelay; + + Child = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.DarkSlateGray, + Alpha = 0, + }; + } + + [BackgroundDependencyLoader] + private void load() + { + Thread.Sleep((int)(secondsDelay * 1000)); + } + + protected override void LogoArriving(OsuLogo logo, bool resuming) + { + base.LogoArriving(logo, resuming); + + Child.FadeInFromZero(200); + } + } + } + } +} diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index b8c1c31b8c..6335700a8f 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -49,12 +49,14 @@ namespace osu.Game.Screens private OsuScreen loadScreen; private ShaderPrecompiler precompiler; + protected virtual OsuScreen CreateLoadableScreen() => showDisclaimer ? (OsuScreen)new Disclaimer() : new Intro(); + protected override void OnEntering(Screen last) { base.OnEntering(last); LoadComponentAsync(precompiler = new ShaderPrecompiler(loadIfReady), Add); - LoadComponentAsync(loadScreen = showDisclaimer ? (OsuScreen)new Disclaimer() : new Intro(), s => loadIfReady()); + LoadComponentAsync(loadScreen = CreateLoadableScreen(), s => loadIfReady()); } private void loadIfReady() From 6781b81336ba61b053d91028ba9a7ec1d06108c6 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Thu, 31 May 2018 05:48:42 -0300 Subject: [PATCH 15/39] Cleanup. --- osu.Game/Beatmaps/Drawables/UpdateableBeatmapSetCover.cs | 1 + osu.Game/Overlays/BeatmapSet/Header.cs | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/UpdateableBeatmapSetCover.cs b/osu.Game/Beatmaps/Drawables/UpdateableBeatmapSetCover.cs index e25f5a9431..1976db907c 100644 --- a/osu.Game/Beatmaps/Drawables/UpdateableBeatmapSetCover.cs +++ b/osu.Game/Beatmaps/Drawables/UpdateableBeatmapSetCover.cs @@ -59,6 +59,7 @@ namespace osu.Game.Beatmaps.Drawables { displayedCover?.FadeOut(400); displayedCover?.Expire(); + displayedCover = null; if (beatmapSet != null) { diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 033f0b22d0..89c141ef17 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -61,8 +61,8 @@ namespace osu.Game.Overlays.BeatmapSet title.Text = BeatmapSet?.Metadata.Title ?? string.Empty; artist.Text = BeatmapSet?.Metadata.Artist ?? string.Empty; onlineStatusPill.Status = BeatmapSet?.OnlineInfo.Status ?? BeatmapSetOnlineStatus.None; + cover.BeatmapSet = BeatmapSet; - cover.BeatmapSet = null; if (BeatmapSet != null) { downloadButtonsContainer.FadeIn(transition_duration); @@ -70,8 +70,6 @@ namespace osu.Game.Overlays.BeatmapSet noVideoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 0 : 1, transition_duration); videoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 1 : 0, transition_duration); - - cover.BeatmapSet = BeatmapSet; } else { From b68a5f5eabb589b787a844d96d0606915f44d55d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 31 May 2018 20:07:44 +0900 Subject: [PATCH 16/39] Tidy up Loader logic --- osu.Game/Screens/Loader.cs | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index 6335700a8f..c3b3e747fd 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; @@ -46,30 +45,32 @@ namespace osu.Game.Screens logo.FadeOut(logo.Alpha * 400); } - private OsuScreen loadScreen; + private OsuScreen loadableScreen; private ShaderPrecompiler precompiler; protected virtual OsuScreen CreateLoadableScreen() => showDisclaimer ? (OsuScreen)new Disclaimer() : new Intro(); + protected virtual ShaderPrecompiler CreateShaderPrecompiler() => new ShaderPrecompiler(); + protected override void OnEntering(Screen last) { base.OnEntering(last); - LoadComponentAsync(precompiler = new ShaderPrecompiler(loadIfReady), Add); - LoadComponentAsync(loadScreen = CreateLoadableScreen(), s => loadIfReady()); + LoadComponentAsync(precompiler = CreateShaderPrecompiler(), Add); + LoadComponentAsync(loadableScreen = CreateLoadableScreen()); + + checkIfLoaded(); } - private void loadIfReady() + private void checkIfLoaded() { - if (ChildScreen == loadScreen) return; - - if (loadScreen.LoadState != LoadState.Ready) + if (loadableScreen.LoadState != LoadState.Ready || !precompiler.FinishedCompiling) + { + Schedule(checkIfLoaded); return; + } - if (!precompiler.FinishedCompiling) - return; - - Push(loadScreen); + Push(loadableScreen); } [BackgroundDependencyLoader] @@ -83,16 +84,10 @@ namespace osu.Game.Screens /// public class ShaderPrecompiler : Drawable { - private readonly Action onLoaded; private readonly List loadTargets = new List(); public bool FinishedCompiling { get; private set; } - public ShaderPrecompiler(Action onLoaded) - { - this.onLoaded = onLoaded; - } - [BackgroundDependencyLoader] private void load(ShaderManager manager) { @@ -106,16 +101,17 @@ namespace osu.Game.Screens loadTargets.Add(manager.Load(VertexShaderDescriptor.TEXTURE_3, FragmentShaderDescriptor.TEXTURE)); } + protected virtual bool AllLoaded => loadTargets.All(s => s.Loaded); + protected override void Update() { base.Update(); // if our target is null we are done. - if (loadTargets.All(s => s.Loaded)) + if (AllLoaded) { FinishedCompiling = true; Expire(); - onLoaded?.Invoke(); } } } From a6f2561be83855dd1075495cc8a44cf5bb173c70 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 31 May 2018 20:07:55 +0900 Subject: [PATCH 17/39] Fix automated testing --- .../Visual/TestCaseLoaderAnimation.cs | 76 +++++++++++-------- 1 file changed, 45 insertions(+), 31 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseLoaderAnimation.cs b/osu.Game.Tests/Visual/TestCaseLoaderAnimation.cs index 066efb5116..600784f8db 100644 --- a/osu.Game.Tests/Visual/TestCaseLoaderAnimation.cs +++ b/osu.Game.Tests/Visual/TestCaseLoaderAnimation.cs @@ -1,9 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Threading; using NUnit.Framework; -using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Shapes; using osu.Game.Screens; @@ -17,46 +15,53 @@ namespace osu.Game.Tests.Visual { private TestLoader loader; - public TestCaseLoaderAnimation() + protected override void LoadComplete() { - bool logoVisible = false; + base.LoadComplete(); - AddStep("almost instant display", () => Child = loader = new TestLoader(0.25f)); + // required to preload the logo in a headless run (so it doesn't delay the loading itself). + Add(new OsuLogo()); + + bool logoVisible = false; + AddStep("almost instant display", () => Child = loader = new TestLoader(250)); AddUntilStep(() => { - logoVisible = loader.Logo.Alpha > 0; - return !loader.IsCurrentScreen; + logoVisible = loader.Logo?.Alpha > 0; + return loader.Logo != null && loader.ScreenLoaded; }, "loaded"); AddAssert("logo not visible", () => !logoVisible); - AddStep("short load", () => Child = loader = new TestLoader(0.8f)); + AddStep("short load", () => Child = loader = new TestLoader(800)); AddUntilStep(() => { - logoVisible = loader.Logo.Alpha > 0; - return !loader.IsCurrentScreen; + logoVisible = loader.Logo?.Alpha > 0; + return loader.Logo != null && loader.ScreenLoaded; }, "loaded"); AddAssert("logo visible", () => logoVisible); - AddUntilStep(() => loader.Logo.Alpha == 0, "logo gone"); + AddUntilStep(() => loader.Logo?.Alpha == 0, "logo gone"); - AddStep("longer load", () => Child = loader = new TestLoader(1.4f)); + AddStep("longer load", () => Child = loader = new TestLoader(1400)); AddUntilStep(() => { - logoVisible = loader.Logo.Alpha > 0; - return !loader.IsCurrentScreen; + logoVisible = loader.Logo?.Alpha > 0; + return loader.Logo != null && loader.ScreenLoaded; }, "loaded"); AddAssert("logo visible", () => logoVisible); - AddUntilStep(() => loader.Logo.Alpha == 0, "logo gone"); + AddUntilStep(() => loader.Logo?.Alpha == 0, "logo gone"); } private class TestLoader : Loader { - private readonly float secondsDelay; + private readonly double delay; public OsuLogo Logo; + private TestScreen screen; - public TestLoader(float secondsDelay) + public bool ScreenLoaded => screen.IsCurrentScreen; + + public TestLoader(double delay) { - this.secondsDelay = secondsDelay; + this.delay = delay; } protected override void LogoArriving(OsuLogo logo, bool resuming) @@ -65,16 +70,32 @@ namespace osu.Game.Tests.Visual base.LogoArriving(logo, resuming); } - protected override OsuScreen CreateLoadableScreen() => new TestScreen(secondsDelay); + protected override OsuScreen CreateLoadableScreen() => screen = new TestScreen(); + protected override ShaderPrecompiler CreateShaderPrecompiler() => new TestShaderPrecompiler(delay); + + private class TestShaderPrecompiler : ShaderPrecompiler + { + private readonly double delay; + private double startTime; + + public TestShaderPrecompiler(double delay) + { + this.delay = delay; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + startTime = Time.Current; + } + + protected override bool AllLoaded => Time.Current > startTime + delay; + } private class TestScreen : OsuScreen { - private readonly float secondsDelay; - - public TestScreen(float secondsDelay) + public TestScreen() { - this.secondsDelay = secondsDelay; - Child = new Box { RelativeSizeAxes = Axes.Both, @@ -83,16 +104,9 @@ namespace osu.Game.Tests.Visual }; } - [BackgroundDependencyLoader] - private void load() - { - Thread.Sleep((int)(secondsDelay * 1000)); - } - protected override void LogoArriving(OsuLogo logo, bool resuming) { base.LogoArriving(logo, resuming); - Child.FadeInFromZero(200); } } From 1095669a5583a6ca81e8e27e65fdc8d45655a704 Mon Sep 17 00:00:00 2001 From: Joehu Date: Thu, 31 May 2018 08:09:19 -0700 Subject: [PATCH 18/39] Match panel with web --- osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs | 5 +++ .../API/Requests/APIResponseBeatmapSet.cs | 4 +++ osu.Game/Overlays/Direct/DirectGridPanel.cs | 33 +++++++++++++++---- osu.Game/Overlays/Direct/PlayButton.cs | 2 +- 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs b/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs index a70caf0207..8f985306e3 100644 --- a/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs +++ b/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs @@ -36,6 +36,11 @@ namespace osu.Game.Beatmaps /// public bool HasVideo { get; set; } + /// + /// Whether or not this beatmap set has a storyboard. + /// + public bool HasStoryboard { get; set; } + /// /// The different sizes of cover art for this beatmap set. /// diff --git a/osu.Game/Online/API/Requests/APIResponseBeatmapSet.cs b/osu.Game/Online/API/Requests/APIResponseBeatmapSet.cs index 2661303652..44c1216959 100644 --- a/osu.Game/Online/API/Requests/APIResponseBeatmapSet.cs +++ b/osu.Game/Online/API/Requests/APIResponseBeatmapSet.cs @@ -30,6 +30,9 @@ namespace osu.Game.Online.API.Requests [JsonProperty(@"video")] private bool hasVideo { get; set; } + [JsonProperty(@"storyboard")] + private bool hasStoryboard { get; set; } + [JsonProperty(@"status")] private BeatmapSetOnlineStatus status { get; set; } @@ -65,6 +68,7 @@ namespace osu.Game.Online.API.Requests BPM = bpm, Status = status, HasVideo = hasVideo, + HasStoryboard = hasStoryboard, Submitted = submitted, Ranked = ranked, LastUpdated = lastUpdated, diff --git a/osu.Game/Overlays/Direct/DirectGridPanel.cs b/osu.Game/Overlays/Direct/DirectGridPanel.cs index 9715615d14..1f0c097811 100644 --- a/osu.Game/Overlays/Direct/DirectGridPanel.cs +++ b/osu.Game/Overlays/Direct/DirectGridPanel.cs @@ -149,7 +149,7 @@ namespace osu.Game.Overlays.Direct { new OsuSpriteText { - Text = $"from {SetInfo.Metadata.Source}", + Text = $"{SetInfo.Metadata.Source}", TextSize = 14, Shadow = false, Colour = colours.Gray5, @@ -195,18 +195,18 @@ namespace osu.Game.Overlays.Direct new Statistic(FontAwesome.fa_heart, SetInfo.OnlineInfo?.FavouriteCount ?? 0), }, }, - playButton = new PlayButton(SetInfo) - { - Margin = new MarginPadding { Top = 5, Left = 10 }, - Size = new Vector2(30), - Alpha = 0, - }, statusContainer = new FillFlowContainer { AutoSizeAxes = Axes.Both, Margin = new MarginPadding { Top = 5, Left = 5 }, Spacing = new Vector2(5), }, + playButton = new PlayButton(SetInfo) + { + Margin = new MarginPadding { Top = 5, Left = 10 }, + Size = new Vector2(30), + Alpha = 0, + }, }); if (SetInfo.OnlineInfo?.HasVideo ?? false) @@ -214,6 +214,11 @@ namespace osu.Game.Overlays.Direct statusContainer.Add(new IconPill(FontAwesome.fa_film)); } + if (SetInfo.OnlineInfo?.HasStoryboard ?? false) + { + statusContainer.Add(new IconPill(FontAwesome.fa_image)); + } + statusContainer.Add(new BeatmapSetOnlineStatusPill(12, new MarginPadding { Horizontal = 10, Vertical = 5 }) { Status = SetInfo.OnlineInfo?.Status ?? BeatmapSetOnlineStatus.None, @@ -233,5 +238,19 @@ namespace osu.Game.Overlays.Direct statusContainer.FadeIn(120, Easing.InOutQuint); } + + protected override void Update() + { + base.Update(); + + if (PreviewPlaying) + { + statusContainer.Hide(); + } + else if (!IsHovered) + { + statusContainer.Show(); + } + } } } diff --git a/osu.Game/Overlays/Direct/PlayButton.cs b/osu.Game/Overlays/Direct/PlayButton.cs index 4913b11ae1..131083c6ff 100644 --- a/osu.Game/Overlays/Direct/PlayButton.cs +++ b/osu.Game/Overlays/Direct/PlayButton.cs @@ -126,7 +126,7 @@ namespace osu.Game.Overlays.Direct return; } - icon.Icon = playing ? FontAwesome.fa_pause : FontAwesome.fa_play; + icon.Icon = playing ? FontAwesome.fa_stop : FontAwesome.fa_play; icon.FadeColour(playing || IsHovered ? hoverColour : Color4.White, 120, Easing.InOutQuint); if (playing) From 729f2ec7251cc981b009412858d294adfc4477f3 Mon Sep 17 00:00:00 2001 From: Joehu Date: Thu, 31 May 2018 14:34:47 -0700 Subject: [PATCH 19/39] Match authorinfo with web --- osu.Game/Overlays/BeatmapSet/AuthorInfo.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs b/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs index 66e3148065..398518ef2b 100644 --- a/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs +++ b/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs @@ -49,8 +49,8 @@ namespace osu.Game.Overlays.BeatmapSet fields.Children = new Drawable[] { - new Field("made by", BeatmapSet.Metadata.Author.Username, @"Exo2.0-RegularItalic"), - new Field("submitted on", online.Submitted.ToString(@"MMM d, yyyy"), @"Exo2.0-Bold") + new Field("mapped by", BeatmapSet.Metadata.Author.Username, @"Exo2.0-RegularItalic"), + new Field("submitted on", online.Submitted.ToString(@"MMMM d, yyyy"), @"Exo2.0-Bold") { Margin = new MarginPadding { Top = 5 }, }, @@ -58,11 +58,11 @@ namespace osu.Game.Overlays.BeatmapSet if (online.Ranked.HasValue) { - fields.Add(new Field("ranked on ", online.Ranked.Value.ToString(@"MMM d, yyyy"), @"Exo2.0-Bold")); + fields.Add(new Field("ranked on", online.Ranked.Value.ToString(@"MMMM d, yyyy"), @"Exo2.0-Bold")); } else if (online.LastUpdated.HasValue) { - fields.Add(new Field("last updated on ", online.LastUpdated.Value.ToString(@"MMM d, yyyy"), @"Exo2.0-Bold")); + fields.Add(new Field("last updated on", online.LastUpdated.Value.ToString(@"MMMM d, yyyy"), @"Exo2.0-Bold")); } } From b9c601074d6659150b237d0f7c712d30d50ee3b6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Jun 2018 15:45:09 +0900 Subject: [PATCH 20/39] Formatting fixes --- .../Screens/Multi/Components/BeatmapTitle.cs | 18 ++++-------------- .../Multi/Components/ParticipantCount.cs | 4 ++-- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/osu.Game/Screens/Multi/Components/BeatmapTitle.cs b/osu.Game/Screens/Multi/Components/BeatmapTitle.cs index daa362409a..42863754c5 100644 --- a/osu.Game/Screens/Multi/Components/BeatmapTitle.cs +++ b/osu.Game/Screens/Multi/Components/BeatmapTitle.cs @@ -22,6 +22,7 @@ namespace osu.Game.Screens.Multi.Components } private BeatmapInfo beatmap; + public BeatmapInfo Beatmap { set @@ -41,18 +42,9 @@ namespace osu.Game.Screens.Multi.Components Children = new[] { - beatmapTitle = new OsuSpriteText - { - Font = @"Exo2.0-BoldItalic", - }, - beatmapDash = new OsuSpriteText - { - Font = @"Exo2.0-BoldItalic", - }, - beatmapArtist = new OsuSpriteText - { - Font = @"Exo2.0-RegularItalic", - }, + beatmapTitle = new OsuSpriteText { Font = @"Exo2.0-BoldItalic", }, + beatmapDash = new OsuSpriteText { Font = @"Exo2.0-BoldItalic", }, + beatmapArtist = new OsuSpriteText { Font = @"Exo2.0-RegularItalic", }, }; } @@ -65,7 +57,6 @@ namespace osu.Game.Screens.Multi.Components protected override void LoadComplete() { base.LoadComplete(); - updateText(); } @@ -74,7 +65,6 @@ namespace osu.Game.Screens.Multi.Components if (beatmap == null) { beatmapTitle.Current = beatmapArtist.Current = null; - beatmapTitle.Text = "Changing map"; beatmapDash.Text = beatmapArtist.Text = string.Empty; } diff --git a/osu.Game/Screens/Multi/Components/ParticipantCount.cs b/osu.Game/Screens/Multi/Components/ParticipantCount.cs index 96e2bd7bee..e47a529ff8 100644 --- a/osu.Game/Screens/Multi/Components/ParticipantCount.cs +++ b/osu.Game/Screens/Multi/Components/ParticipantCount.cs @@ -16,7 +16,7 @@ namespace osu.Game.Screens.Multi.Components public int Count { - set { count.Text = value.ToString(); } + set => count.Text = value.ToString(); } public int? Max @@ -31,8 +31,8 @@ namespace osu.Game.Screens.Multi.Components else { slash.FadeIn(transition_duration); - max.FadeIn(transition_duration); max.Text = value.ToString(); + max.FadeIn(transition_duration); } } } From 8dd36ee1a98a54ccf4ede99a4f829b1fc6b2ed19 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Fri, 1 Jun 2018 06:08:57 -0300 Subject: [PATCH 21/39] Default Max to null in ParticipantCount. --- osu.Game/Screens/Multi/Components/ParticipantCount.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/Multi/Components/ParticipantCount.cs b/osu.Game/Screens/Multi/Components/ParticipantCount.cs index e47a529ff8..2e9183d047 100644 --- a/osu.Game/Screens/Multi/Components/ParticipantCount.cs +++ b/osu.Game/Screens/Multi/Components/ParticipantCount.cs @@ -62,6 +62,8 @@ namespace osu.Game.Screens.Multi.Components Font = @"Exo2.0-Light" }, }; + + Max = null; } } } From 59762c0393a01b14ba92467076dc19cd54fcef0a Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Fri, 1 Jun 2018 06:15:23 -0300 Subject: [PATCH 22/39] Change Room.Participants to an IEnumerable. --- osu.Game/Online/Multiplayer/Room.cs | 3 ++- osu.Game/Screens/Multi/Components/DrawableRoom.cs | 2 +- osu.Game/Screens/Multi/Components/RoomInspector.cs | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/osu.Game/Online/Multiplayer/Room.cs b/osu.Game/Online/Multiplayer/Room.cs index ae3fb5ec6e..b076afbcdb 100644 --- a/osu.Game/Online/Multiplayer/Room.cs +++ b/osu.Game/Online/Multiplayer/Room.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.Generic; using osu.Framework.Configuration; using osu.Game.Beatmaps; using osu.Game.Users; @@ -16,6 +17,6 @@ namespace osu.Game.Online.Multiplayer public Bindable Type = new Bindable(); public Bindable Beatmap = new Bindable(); public Bindable MaxParticipants = new Bindable(); - public Bindable Participants = new Bindable(); + public Bindable> Participants = new Bindable>(); } } diff --git a/osu.Game/Screens/Multi/Components/DrawableRoom.cs b/osu.Game/Screens/Multi/Components/DrawableRoom.cs index d31019a259..54bd0ae7cc 100644 --- a/osu.Game/Screens/Multi/Components/DrawableRoom.cs +++ b/osu.Game/Screens/Multi/Components/DrawableRoom.cs @@ -41,7 +41,7 @@ namespace osu.Game.Screens.Multi.Components private readonly Bindable statusBind = new Bindable(); private readonly Bindable typeBind = new Bindable(); private readonly Bindable beatmapBind = new Bindable(); - private readonly Bindable participantsBind = new Bindable(); + private readonly Bindable> participantsBind = new Bindable>(); public readonly Room Room; diff --git a/osu.Game/Screens/Multi/Components/RoomInspector.cs b/osu.Game/Screens/Multi/Components/RoomInspector.cs index 14f4feab05..22bca1efc7 100644 --- a/osu.Game/Screens/Multi/Components/RoomInspector.cs +++ b/osu.Game/Screens/Multi/Components/RoomInspector.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Configuration; @@ -33,7 +34,7 @@ namespace osu.Game.Screens.Multi.Components private readonly Bindable typeBind = new Bindable(); private readonly Bindable beatmapBind = new Bindable(); private readonly Bindable maxParticipantsBind = new Bindable(); - private readonly Bindable participantsBind = new Bindable(); + private readonly Bindable> participantsBind = new Bindable>(); private OsuColour colours; private Box statusStrip; @@ -214,7 +215,7 @@ namespace osu.Game.Screens.Multi.Components participantsBind.ValueChanged += p => { - participantCount.Count = p.Length; + participantCount.Count = p.Count(); participantInfo.Participants = p; participantsFlow.ChildrenEnumerable = p.Select(u => new UserTile(u)); }; From 5c2a2e394e2bff3b8a2a014c75c26218822423e2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Jun 2018 18:03:16 +0900 Subject: [PATCH 23/39] Fix incorrect async logic in BeatmapInfoWedge Closes #2653. Alternative to #2657. --- .../Visual/TestCaseBeatmapInfoWedge.cs | 6 +- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 66 +++++++++++-------- osu.Game/Screens/Select/SongSelect.cs | 2 +- 3 files changed, 42 insertions(+), 32 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs b/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs index 0d3e08154f..996c3b8695 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs @@ -53,7 +53,7 @@ namespace osu.Game.Tests.Visual AddStep("show", () => { infoWedge.State = Visibility.Visible; - infoWedge.UpdateBeatmap(beatmap); + infoWedge.Beatmap = beatmap; }); // select part is redundant, but wait for load isn't @@ -133,7 +133,7 @@ namespace osu.Game.Tests.Visual AddStep($"select {b.Metadata.Title} beatmap", () => { infoBefore = infoWedge.Info; - infoWedge.UpdateBeatmap(beatmap.Value = new TestWorkingBeatmap(b)); + infoWedge.Beatmap = beatmap.Value = new TestWorkingBeatmap(b); }); AddUntilStep(() => infoWedge.Info != infoBefore, "wait for async load"); @@ -144,7 +144,7 @@ namespace osu.Game.Tests.Visual AddStep("select null beatmap", () => { beatmap.Value = beatmap.Default; - infoWedge.UpdateBeatmap(beatmap); + infoWedge.Beatmap = beatmap; }); } diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 97f6371cb2..7950018554 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -57,7 +57,7 @@ namespace osu.Game.Screens.Select { if (osuGame != null) ruleset.BindTo(osuGame.Ruleset); - ruleset.ValueChanged += updateRuleset; + ruleset.ValueChanged += _ => updateDisplay(); } protected override bool BlockPassThroughMouse => false; @@ -78,66 +78,76 @@ namespace osu.Game.Screens.Select private WorkingBeatmap beatmap; - public void UpdateBeatmap(WorkingBeatmap beatmap) + public WorkingBeatmap Beatmap { - this.beatmap = beatmap; - loadBeatmap(); + get => beatmap; + set + { + if (beatmap == value) return; + + beatmap = value; + updateDisplay(); + } } - private void updateRuleset(RulesetInfo ruleset) => loadBeatmap(); + private BufferedWedgeInfo loadingInfo; - private void loadBeatmap() + private void updateDisplay() { - void updateState() + void removeOldInfo() { State = beatmap == null ? Visibility.Hidden : Visibility.Visible; Info?.FadeOut(250); Info?.Expire(); + Info = null; } if (beatmap == null) { - updateState(); + removeOldInfo(); return; } - LoadComponentAsync(new BufferedWedgeInfo(beatmap, ruleset.Value) + LoadComponentAsync(loadingInfo = new BufferedWedgeInfo(beatmap, ruleset.Value) { Shear = -Shear, - Depth = Info?.Depth + 1 ?? 0, - }, newInfo => + Depth = Info?.Depth + 1 ?? 0 + }, loaded => { - updateState(); - Add(Info = newInfo); + // ensure we are the most recent loaded wedge. + if (loaded != loadingInfo) return; + + removeOldInfo(); + Add(Info = loaded); }); } public class BufferedWedgeInfo : BufferedContainer { - private readonly WorkingBeatmap working; public OsuSpriteText VersionLabel { get; private set; } public OsuSpriteText TitleLabel { get; private set; } public OsuSpriteText ArtistLabel { get; private set; } public FillFlowContainer MapperContainer { get; private set; } public FillFlowContainer InfoLabelContainer { get; private set; } + private UnicodeBindableString titleBinding; private UnicodeBindableString artistBinding; + private readonly WorkingBeatmap beatmap; private readonly RulesetInfo ruleset; - public BufferedWedgeInfo(WorkingBeatmap working, RulesetInfo userRuleset) + public BufferedWedgeInfo(WorkingBeatmap beatmap, RulesetInfo userRuleset) { - this.working = working; - - ruleset = userRuleset ?? working.BeatmapInfo.Ruleset; + this.beatmap = beatmap; + ruleset = userRuleset ?? beatmap.BeatmapInfo.Ruleset; } [BackgroundDependencyLoader] private void load(LocalisationEngine localisation) { - var beatmapInfo = working.BeatmapInfo; - var metadata = beatmapInfo.Metadata ?? working.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata(); + var beatmapInfo = beatmap.BeatmapInfo; + var metadata = beatmapInfo.Metadata ?? beatmap.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata(); PixelSnapping = true; CacheDrawnFrameBuffer = true; @@ -165,7 +175,7 @@ namespace osu.Game.Screens.Select Children = new[] { // Zoomed-in and cropped beatmap background - new BeatmapBackgroundSprite(working) + new BeatmapBackgroundSprite(beatmap) { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, @@ -248,27 +258,27 @@ namespace osu.Game.Screens.Select private InfoLabel[] getInfoLabels() { - var beatmap = working.Beatmap; + var b = beatmap.Beatmap; List labels = new List(); - if (beatmap?.HitObjects?.Any() == true) + if (b?.HitObjects?.Any() == true) { - HitObject lastObject = beatmap.HitObjects.LastOrDefault(); + HitObject lastObject = b.HitObjects.LastOrDefault(); double endTime = (lastObject as IHasEndTime)?.EndTime ?? lastObject?.StartTime ?? 0; labels.Add(new InfoLabel(new BeatmapStatistic { Name = "Length", Icon = FontAwesome.fa_clock_o, - Content = TimeSpan.FromMilliseconds(endTime - beatmap.HitObjects.First().StartTime).ToString(@"m\:ss"), + Content = TimeSpan.FromMilliseconds(endTime - b.HitObjects.First().StartTime).ToString(@"m\:ss"), })); labels.Add(new InfoLabel(new BeatmapStatistic { Name = "BPM", Icon = FontAwesome.fa_circle, - Content = getBPMRange(beatmap), + Content = getBPMRange(b), })); IBeatmap playableBeatmap; @@ -276,12 +286,12 @@ namespace osu.Game.Screens.Select try { // Try to get the beatmap with the user's ruleset - playableBeatmap = working.GetPlayableBeatmap(ruleset); + playableBeatmap = beatmap.GetPlayableBeatmap(ruleset); } catch (BeatmapInvalidForRulesetException) { // Can't be converted to the user's ruleset, so use the beatmap's own ruleset - playableBeatmap = working.GetPlayableBeatmap(working.BeatmapInfo.Ruleset); + playableBeatmap = beatmap.GetPlayableBeatmap(beatmap.BeatmapInfo.Ruleset); } labels.AddRange(playableBeatmap.GetStatistics().Select(s => new InfoLabel(s))); diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index e1271aebc4..41ba38cb0f 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -430,7 +430,7 @@ namespace osu.Game.Screens.Select backgroundModeBeatmap.FadeTo(1, 250); } - beatmapInfoWedge.UpdateBeatmap(beatmap); + beatmapInfoWedge.Beatmap = beatmap; } private void ensurePlayingSelected(bool preview = false) From 9b7741b353a6d71d88c836b51724ab26013de90f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Jun 2018 22:19:11 +0900 Subject: [PATCH 24/39] Avoid using update for fading logic --- osu.Game/Overlays/Direct/DirectGridPanel.cs | 22 +++++---------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/osu.Game/Overlays/Direct/DirectGridPanel.cs b/osu.Game/Overlays/Direct/DirectGridPanel.cs index 1f0c097811..ed4630a8e7 100644 --- a/osu.Game/Overlays/Direct/DirectGridPanel.cs +++ b/osu.Game/Overlays/Direct/DirectGridPanel.cs @@ -223,34 +223,22 @@ namespace osu.Game.Overlays.Direct { Status = SetInfo.OnlineInfo?.Status ?? BeatmapSetOnlineStatus.None, }); + + PreviewPlaying.ValueChanged += _ => updateStatusContainer(); } protected override bool OnHover(InputState state) { - statusContainer.FadeOut(120, Easing.InOutQuint); - + updateStatusContainer(); return base.OnHover(state); } protected override void OnHoverLost(InputState state) { base.OnHoverLost(state); - - statusContainer.FadeIn(120, Easing.InOutQuint); + updateStatusContainer(); } - protected override void Update() - { - base.Update(); - - if (PreviewPlaying) - { - statusContainer.Hide(); - } - else if (!IsHovered) - { - statusContainer.Show(); - } - } + private void updateStatusContainer() => statusContainer.FadeTo(IsHovered || PreviewPlaying ? 0 : 1, 120, Easing.InOutQuint); } } From de64e4500ffcca65b31ccc36a77ff4fb31e553f3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 1 Jun 2018 22:20:28 +0900 Subject: [PATCH 25/39] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index aebfa5bc5c..804a4b81b8 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit aebfa5bc5c634c1fd0c103e0c17518e5111a67c7 +Subproject commit 804a4b81b89cb4569af5221e6fa2296d559c28fb From cc32adf51fb008e5e9573397c5c320cb8e3ea075 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Fri, 1 Jun 2018 14:28:24 -0300 Subject: [PATCH 26/39] Move max text updating into updateMax. --- .../Multi/Components/ParticipantCount.cs | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/osu.Game/Screens/Multi/Components/ParticipantCount.cs b/osu.Game/Screens/Multi/Components/ParticipantCount.cs index 2e9183d047..e7183cbd92 100644 --- a/osu.Game/Screens/Multi/Components/ParticipantCount.cs +++ b/osu.Game/Screens/Multi/Components/ParticipantCount.cs @@ -12,28 +12,23 @@ namespace osu.Game.Screens.Multi.Components private const float text_size = 30; private const float transition_duration = 100; - private readonly OsuSpriteText count, slash, max; + private readonly OsuSpriteText count, slash, maxText; public int Count { set => count.Text = value.ToString(); } + private int? max; public int? Max { + get => max; set { - if (value == null) - { - slash.FadeOut(transition_duration); - max.FadeOut(transition_duration); - } - else - { - slash.FadeIn(transition_duration); - max.Text = value.ToString(); - max.FadeIn(transition_duration); - } + if (value == max) return; + max = value; + + updateMax(); } } @@ -56,14 +51,29 @@ namespace osu.Game.Screens.Multi.Components TextSize = text_size, Font = @"Exo2.0-Light" }, - max = new OsuSpriteText + maxText = new OsuSpriteText { TextSize = text_size, Font = @"Exo2.0-Light" }, }; - Max = null; + updateMax(); + } + + private void updateMax() + { + if (Max == null) + { + slash.FadeOut(transition_duration); + maxText.FadeOut(transition_duration); + } + else + { + slash.FadeIn(transition_duration); + maxText.Text = Max.ToString(); + maxText.FadeIn(transition_duration); + } } } } From 5d1421c0e9b97a8d1bdbd4e422fddb6a6777dfc1 Mon Sep 17 00:00:00 2001 From: Joehu Date: Fri, 1 Jun 2018 15:31:25 -0700 Subject: [PATCH 27/39] Fix visual settings expand button colour --- .../Play/PlayerSettings/PlayerSettingsGroup.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs index 0ffcdf94a6..cdde11c5f8 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs @@ -50,11 +50,11 @@ namespace osu.Game.Screens.Play.PlayerSettings content.ResizeHeightTo(0, transition_duration, Easing.OutQuint); } - button.FadeColour(expanded ? buttonActiveColour : Color4.White, 200, Easing.OutQuint); + button.FadeColour(expanded ? expandedColour : Color4.White, 200, Easing.OutQuint); } } - private Color4 buttonActiveColour; + private Color4 expandedColour; protected PlayerSettingsGroup() { @@ -130,7 +130,16 @@ namespace osu.Game.Screens.Play.PlayerSettings [BackgroundDependencyLoader] private void load(OsuColour colours) { - button.Colour = buttonActiveColour = colours.Yellow; + if (expanded) + { + button.Colour = colours.Yellow; + } + else + { + button.Colour = Color4.White; + } + + expandedColour = colours.Yellow; } protected override Container Content => content; From 8d3de3affbba360fe7d8d755d8a71c07899dcd79 Mon Sep 17 00:00:00 2001 From: Joehu Date: Fri, 1 Jun 2018 15:58:05 -0700 Subject: [PATCH 28/39] Use '?:' expression instead --- .../Screens/Play/PlayerSettings/PlayerSettingsGroup.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs index cdde11c5f8..967cfd7fa0 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs @@ -130,14 +130,7 @@ namespace osu.Game.Screens.Play.PlayerSettings [BackgroundDependencyLoader] private void load(OsuColour colours) { - if (expanded) - { - button.Colour = colours.Yellow; - } - else - { - button.Colour = Color4.White; - } + button.FadeColour(expanded ? colours.Yellow : Color4.White); expandedColour = colours.Yellow; } From a0c643fae50982f78040a64c219fe5fdb44bfa47 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Sat, 2 Jun 2018 11:25:49 +0200 Subject: [PATCH 29/39] Fix SongProgressInfo timespan formatting --- osu.Game/Screens/Play/SongProgressInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index b79c212ade..3156a646db 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -92,6 +92,6 @@ namespace osu.Game.Screens.Play } } - private string formatTime(TimeSpan timeSpan) => $"{(timeSpan < TimeSpan.Zero ? "-" : "")}{timeSpan.Duration().TotalMinutes:N0}:{timeSpan.Duration().Seconds:D2}"; + private string formatTime(TimeSpan timeSpan) => $"{(timeSpan < TimeSpan.Zero ? "-" : "")}{Math.Floor(timeSpan.Duration().TotalMinutes)}:{timeSpan.Duration().Seconds:D2}"; } } From d287e32fafb32f4d29817a4810f55643a8d870c3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 2 Jun 2018 22:20:17 +0900 Subject: [PATCH 30/39] Update project build configurations to target netcoreapp2.1 --- ...p2_0_.xml => VisualTests__netcoreapp2_1_.xml} | 6 +++--- ...tcoreapp2_0_.xml => osu___netcoreapp2_1_.xml} | 6 +++--- .vscode/launch.json | 16 ++++++++-------- .vscode/tasks.json | 10 +++++----- osu-framework | 2 +- osu.Desktop/osu.Desktop.csproj | 2 +- .../.vscode/launch.json | 8 ++++---- osu.Game.Rulesets.Catch.Tests/.vscode/tasks.json | 6 +++--- .../osu.Game.Rulesets.Catch.Tests.csproj | 2 +- .../.vscode/launch.json | 8 ++++---- osu.Game.Rulesets.Mania.Tests/.vscode/tasks.json | 6 +++--- .../osu.Game.Rulesets.Mania.Tests.csproj | 2 +- osu.Game.Rulesets.Osu.Tests/.vscode/launch.json | 8 ++++---- osu.Game.Rulesets.Osu.Tests/.vscode/tasks.json | 6 +++--- .../osu.Game.Rulesets.Osu.Tests.csproj | 2 +- .../.vscode/launch.json | 8 ++++---- osu.Game.Rulesets.Taiko.Tests/.vscode/tasks.json | 6 +++--- .../osu.Game.Rulesets.Taiko.Tests.csproj | 2 +- osu.Game.Tests/osu.Game.Tests.csproj | 2 +- 19 files changed, 54 insertions(+), 54 deletions(-) rename .idea/.idea.osu/.idea/runConfigurations/{VisualTests__netcoreapp2_0_.xml => VisualTests__netcoreapp2_1_.xml} (82%) rename .idea/.idea.osu/.idea/runConfigurations/{osu___netcoreapp2_0_.xml => osu___netcoreapp2_1_.xml} (82%) diff --git a/.idea/.idea.osu/.idea/runConfigurations/VisualTests__netcoreapp2_0_.xml b/.idea/.idea.osu/.idea/runConfigurations/VisualTests__netcoreapp2_1_.xml similarity index 82% rename from .idea/.idea.osu/.idea/runConfigurations/VisualTests__netcoreapp2_0_.xml rename to .idea/.idea.osu/.idea/runConfigurations/VisualTests__netcoreapp2_1_.xml index 08b4e38667..2d3a848922 100644 --- a/.idea/.idea.osu/.idea/runConfigurations/VisualTests__netcoreapp2_0_.xml +++ b/.idea/.idea.osu/.idea/runConfigurations/VisualTests__netcoreapp2_1_.xml @@ -1,6 +1,6 @@ - - \ No newline at end of file diff --git a/.idea/.idea.osu/.idea/runConfigurations/osu___netcoreapp2_0_.xml b/.idea/.idea.osu/.idea/runConfigurations/osu___netcoreapp2_1_.xml similarity index 82% rename from .idea/.idea.osu/.idea/runConfigurations/osu___netcoreapp2_0_.xml rename to .idea/.idea.osu/.idea/runConfigurations/osu___netcoreapp2_1_.xml index 2f5c137631..36efe211c6 100644 --- a/.idea/.idea.osu/.idea/runConfigurations/osu___netcoreapp2_0_.xml +++ b/.idea/.idea.osu/.idea/runConfigurations/osu___netcoreapp2_1_.xml @@ -1,6 +1,6 @@ - - \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 32c82685c0..b9bb75d5bb 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -58,12 +58,12 @@ "console": "internalConsole" }, { - "name": "VisualTests (Debug, netcoreapp2.0)", + "name": "VisualTests (Debug, netcoreapp2.1)", "type": "coreclr", "request": "launch", "program": "dotnet", "args": [ - "${workspaceRoot}/osu.Game.Tests/bin/Debug/netcoreapp2.0/osu.Game.Tests.dll" + "${workspaceRoot}/osu.Game.Tests/bin/Debug/netcoreapp2.1/osu.Game.Tests.dll" ], "cwd": "${workspaceRoot}", "preLaunchTask": "Build tests (Debug, dotnet)", @@ -71,12 +71,12 @@ "console": "internalConsole" }, { - "name": "VisualTests (Release, netcoreapp2.0)", + "name": "VisualTests (Release, netcoreapp2.1)", "type": "coreclr", "request": "launch", "program": "dotnet", "args": [ - "${workspaceRoot}/osu.Game.Tests/bin/Release/netcoreapp2.0/osu.Game.Tests.dll" + "${workspaceRoot}/osu.Game.Tests/bin/Release/netcoreapp2.1/osu.Game.Tests.dll" ], "cwd": "${workspaceRoot}", "preLaunchTask": "Build tests (Release, dotnet)", @@ -84,12 +84,12 @@ "console": "internalConsole" }, { - "name": "osu! (Debug, netcoreapp2.0)", + "name": "osu! (Debug, netcoreapp2.1)", "type": "coreclr", "request": "launch", "program": "dotnet", "args": [ - "${workspaceRoot}/osu.Desktop/bin/Debug/netcoreapp2.0/osu!.dll", + "${workspaceRoot}/osu.Desktop/bin/Debug/netcoreapp2.1/osu!.dll", ], "cwd": "${workspaceRoot}", "preLaunchTask": "Build osu! (Debug, dotnet)", @@ -97,12 +97,12 @@ "console": "internalConsole" }, { - "name": "osu! (Release, netcoreapp2.0)", + "name": "osu! (Release, netcoreapp2.1)", "type": "coreclr", "request": "launch", "program": "dotnet", "args": [ - "${workspaceRoot}/osu.Desktop/bin/Release/netcoreapp2.0/osu!.dll", + "${workspaceRoot}/osu.Desktop/bin/Release/netcoreapp2.1/osu!.dll", ], "cwd": "${workspaceRoot}", "preLaunchTask": "Build osu! (Release, dotnet)", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 0908ff6108..bebad750ca 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -38,7 +38,7 @@ "build", "--no-restore", "osu.Desktop", - "/p:TargetFramework=netcoreapp2.0", + "/p:TargetFramework=netcoreapp2.1", "/p:GenerateFullPaths=true", "/m", "/verbosity:m" @@ -54,7 +54,7 @@ "build", "--no-restore", "osu.Desktop", - "/p:TargetFramework=netcoreapp2.0", + "/p:TargetFramework=netcoreapp2.1", "/p:Configuration=Release", "/p:GenerateFullPaths=true", "/m", @@ -71,7 +71,7 @@ "build", "--no-restore", "osu.Game.Tests", - "/p:TargetFramework=netcoreapp2.0", + "/p:TargetFramework=netcoreapp2.1", "/p:GenerateFullPaths=true", "/m", "/verbosity:m" @@ -87,7 +87,7 @@ "build", "--no-restore", "osu.Game.Tests", - "/p:TargetFramework=netcoreapp2.0", + "/p:TargetFramework=netcoreapp2.1", "/p:Configuration=Release", "/p:GenerateFullPaths=true", "/m", @@ -106,7 +106,7 @@ "problemMatcher": [] }, { - "label": "Restore (netcoreapp2.0)", + "label": "Restore (netcoreapp2.1)", "type": "shell", "command": "dotnet", "args": [ diff --git a/osu-framework b/osu-framework index 804a4b81b8..39aae99f5c 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 804a4b81b89cb4569af5221e6fa2296d559c28fb +Subproject commit 39aae99f5c21ac9c9f8003cb4dedea345c38c78c diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index af027da2fc..6b464ae4fe 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -1,7 +1,7 @@  - net471;netcoreapp2.0 + net471;netcoreapp2.1 WinExe AnyCPU true diff --git a/osu.Game.Rulesets.Catch.Tests/.vscode/launch.json b/osu.Game.Rulesets.Catch.Tests/.vscode/launch.json index eb80f4474c..c5005adfa5 100644 --- a/osu.Game.Rulesets.Catch.Tests/.vscode/launch.json +++ b/osu.Game.Rulesets.Catch.Tests/.vscode/launch.json @@ -30,12 +30,12 @@ "console": "internalConsole" }, { - "name": "VisualTests (Debug, netcoreapp2.0)", + "name": "VisualTests (Debug, netcoreapp2.1)", "type": "coreclr", "request": "launch", "program": "dotnet", "args": [ - "${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Catch.Tests.dll" + "${workspaceRoot}/bin/Debug/netcoreapp2.1/osu.Game.Rulesets.Catch.Tests.dll" ], "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Debug, dotnet)", @@ -43,12 +43,12 @@ "console": "internalConsole" }, { - "name": "VisualTests (Release, netcoreapp2.0)", + "name": "VisualTests (Release, netcoreapp2.1)", "type": "coreclr", "request": "launch", "program": "dotnet", "args": [ - "${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Catch.Tests.dll" + "${workspaceRoot}/bin/Debug/netcoreapp2.1/osu.Game.Rulesets.Catch.Tests.dll" ], "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Release, dotnet)", diff --git a/osu.Game.Rulesets.Catch.Tests/.vscode/tasks.json b/osu.Game.Rulesets.Catch.Tests/.vscode/tasks.json index 41ae88f425..6c6d562512 100644 --- a/osu.Game.Rulesets.Catch.Tests/.vscode/tasks.json +++ b/osu.Game.Rulesets.Catch.Tests/.vscode/tasks.json @@ -40,7 +40,7 @@ "build", "--no-restore", "osu.Game.Rulesets.Catch.Tests.csproj", - "/p:TargetFramework=netcoreapp2.0", + "/p:TargetFramework=netcoreapp2.1", "/p:GenerateFullPaths=true", "/m", "/verbosity:m" @@ -56,7 +56,7 @@ "build", "--no-restore", "osu.Game.Rulesets.Catch.Tests.csproj", - "/p:TargetFramework=netcoreapp2.0", + "/p:TargetFramework=netcoreapp2.1", "/p:Configuration=Release", "/p:GenerateFullPaths=true", "/m", @@ -75,7 +75,7 @@ "problemMatcher": [] }, { - "label": "Restore (netcoreapp2.0)", + "label": "Restore (netcoreapp2.1)", "type": "shell", "command": "dotnet", "args": [ diff --git a/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj b/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj index 3797edde61..93fa2c4d67 100644 --- a/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj +++ b/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj @@ -2,7 +2,7 @@ WinExe - netcoreapp2.0;net471 + netcoreapp2.1;net471 diff --git a/osu.Game.Rulesets.Mania.Tests/.vscode/launch.json b/osu.Game.Rulesets.Mania.Tests/.vscode/launch.json index fceb403f30..637a5de1b5 100644 --- a/osu.Game.Rulesets.Mania.Tests/.vscode/launch.json +++ b/osu.Game.Rulesets.Mania.Tests/.vscode/launch.json @@ -30,12 +30,12 @@ "console": "internalConsole" }, { - "name": "VisualTests (Debug, netcoreapp2.0)", + "name": "VisualTests (Debug, netcoreapp2.1)", "type": "coreclr", "request": "launch", "program": "dotnet", "args": [ - "${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Mania.Tests.dll" + "${workspaceRoot}/bin/Debug/netcoreapp2.1/osu.Game.Rulesets.Mania.Tests.dll" ], "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Debug, dotnet)", @@ -43,12 +43,12 @@ "console": "internalConsole" }, { - "name": "VisualTests (Release, netcoreapp2.0)", + "name": "VisualTests (Release, netcoreapp2.1)", "type": "coreclr", "request": "launch", "program": "dotnet", "args": [ - "${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Mania.Tests.dll" + "${workspaceRoot}/bin/Debug/netcoreapp2.1/osu.Game.Rulesets.Mania.Tests.dll" ], "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Release, dotnet)", diff --git a/osu.Game.Rulesets.Mania.Tests/.vscode/tasks.json b/osu.Game.Rulesets.Mania.Tests/.vscode/tasks.json index b04b068b0d..7fc2f7b2ef 100644 --- a/osu.Game.Rulesets.Mania.Tests/.vscode/tasks.json +++ b/osu.Game.Rulesets.Mania.Tests/.vscode/tasks.json @@ -40,7 +40,7 @@ "build", "--no-restore", "osu.Game.Rulesets.Mania.Tests.csproj", - "/p:TargetFramework=netcoreapp2.0", + "/p:TargetFramework=netcoreapp2.1", "/p:GenerateFullPaths=true", "/m", "/verbosity:m" @@ -56,7 +56,7 @@ "build", "--no-restore", "osu.Game.Rulesets.Mania.Tests.csproj", - "/p:TargetFramework=netcoreapp2.0", + "/p:TargetFramework=netcoreapp2.1", "/p:Configuration=Release", "/p:GenerateFullPaths=true", "/m", @@ -75,7 +75,7 @@ "problemMatcher": [] }, { - "label": "Restore (netcoreapp2.0)", + "label": "Restore (netcoreapp2.1)", "type": "shell", "command": "dotnet", "args": [ diff --git a/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj b/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj index e90155568e..77504fdc3c 100644 --- a/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj +++ b/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj @@ -2,7 +2,7 @@ WinExe - netcoreapp2.0;net471 + netcoreapp2.1;net471 diff --git a/osu.Game.Rulesets.Osu.Tests/.vscode/launch.json b/osu.Game.Rulesets.Osu.Tests/.vscode/launch.json index 714fb6db6f..65c801cef4 100644 --- a/osu.Game.Rulesets.Osu.Tests/.vscode/launch.json +++ b/osu.Game.Rulesets.Osu.Tests/.vscode/launch.json @@ -30,12 +30,12 @@ "console": "internalConsole" }, { - "name": "VisualTests (Debug, netcoreapp2.0)", + "name": "VisualTests (Debug, netcoreapp2.1)", "type": "coreclr", "request": "launch", "program": "dotnet", "args": [ - "${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Osu.Tests.dll" + "${workspaceRoot}/bin/Debug/netcoreapp2.1/osu.Game.Rulesets.Osu.Tests.dll" ], "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Debug, dotnet)", @@ -43,12 +43,12 @@ "console": "internalConsole" }, { - "name": "VisualTests (Release, netcoreapp2.0)", + "name": "VisualTests (Release, netcoreapp2.1)", "type": "coreclr", "request": "launch", "program": "dotnet", "args": [ - "${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Osu.Tests.dll" + "${workspaceRoot}/bin/Debug/netcoreapp2.1/osu.Game.Rulesets.Osu.Tests.dll" ], "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Release, dotnet)", diff --git a/osu.Game.Rulesets.Osu.Tests/.vscode/tasks.json b/osu.Game.Rulesets.Osu.Tests/.vscode/tasks.json index 657fe07e1a..62cf51382f 100644 --- a/osu.Game.Rulesets.Osu.Tests/.vscode/tasks.json +++ b/osu.Game.Rulesets.Osu.Tests/.vscode/tasks.json @@ -40,7 +40,7 @@ "build", "--no-restore", "osu.Game.Rulesets.Osu.Tests.csproj", - "/p:TargetFramework=netcoreapp2.0", + "/p:TargetFramework=netcoreapp2.1", "/p:GenerateFullPaths=true", "/m", "/verbosity:m" @@ -56,7 +56,7 @@ "build", "--no-restore", "osu.Game.Rulesets.Osu.Tests.csproj", - "/p:TargetFramework=netcoreapp2.0", + "/p:TargetFramework=netcoreapp2.1", "/p:Configuration=Release", "/p:GenerateFullPaths=true", "/m", @@ -75,7 +75,7 @@ "problemMatcher": [] }, { - "label": "Restore (netcoreapp2.0)", + "label": "Restore (netcoreapp2.1)", "type": "shell", "command": "dotnet", "args": [ diff --git a/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj b/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj index 1695ceacee..c5d9b26145 100644 --- a/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj +++ b/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj @@ -2,7 +2,7 @@ WinExe - netcoreapp2.0;net471 + netcoreapp2.1;net471 diff --git a/osu.Game.Rulesets.Taiko.Tests/.vscode/launch.json b/osu.Game.Rulesets.Taiko.Tests/.vscode/launch.json index e1df54e99b..dbb1ab28e2 100644 --- a/osu.Game.Rulesets.Taiko.Tests/.vscode/launch.json +++ b/osu.Game.Rulesets.Taiko.Tests/.vscode/launch.json @@ -30,12 +30,12 @@ "console": "internalConsole" }, { - "name": "VisualTests (Debug, netcoreapp2.0)", + "name": "VisualTests (Debug, netcoreapp2.1)", "type": "coreclr", "request": "launch", "program": "dotnet", "args": [ - "${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Taiko.Tests.dll" + "${workspaceRoot}/bin/Debug/netcoreapp2.1/osu.Game.Rulesets.Taiko.Tests.dll" ], "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Debug, dotnet)", @@ -43,12 +43,12 @@ "console": "internalConsole" }, { - "name": "VisualTests (Release, netcoreapp2.0)", + "name": "VisualTests (Release, netcoreapp2.1)", "type": "coreclr", "request": "launch", "program": "dotnet", "args": [ - "${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Taiko.Tests.dll" + "${workspaceRoot}/bin/Debug/netcoreapp2.1/osu.Game.Rulesets.Taiko.Tests.dll" ], "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Release, dotnet)", diff --git a/osu.Game.Rulesets.Taiko.Tests/.vscode/tasks.json b/osu.Game.Rulesets.Taiko.Tests/.vscode/tasks.json index 8bdbcd8e8e..7c8beed00f 100644 --- a/osu.Game.Rulesets.Taiko.Tests/.vscode/tasks.json +++ b/osu.Game.Rulesets.Taiko.Tests/.vscode/tasks.json @@ -40,7 +40,7 @@ "build", "--no-restore", "osu.Game.Rulesets.Taiko.Tests.csproj", - "/p:TargetFramework=netcoreapp2.0", + "/p:TargetFramework=netcoreapp2.1", "/p:GenerateFullPaths=true", "/m", "/verbosity:m" @@ -56,7 +56,7 @@ "build", "--no-restore", "osu.Game.Rulesets.Taiko.Tests.csproj", - "/p:TargetFramework=netcoreapp2.0", + "/p:TargetFramework=netcoreapp2.1", "/p:Configuration=Release", "/p:GenerateFullPaths=true", "/m", @@ -75,7 +75,7 @@ "problemMatcher": [] }, { - "label": "Restore (netcoreapp2.0)", + "label": "Restore (netcoreapp2.1)", "type": "shell", "command": "dotnet", "args": [ diff --git a/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj b/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj index 1221584a2b..dea34d25e7 100644 --- a/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj +++ b/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj @@ -2,7 +2,7 @@ WinExe - netcoreapp2.0;net471 + netcoreapp2.1;net471 diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 057c2c2de1..532915100b 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -2,7 +2,7 @@ WinExe - netcoreapp2.0;net471 + netcoreapp2.1;net471 From 6781807e23ab428d6b0e849048f597ae3fdb77e8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 3 Jun 2018 00:28:10 +0900 Subject: [PATCH 31/39] Remove unnecessary EF tools references --- osu.Desktop/osu.Desktop.csproj | 6 ------ 1 file changed, 6 deletions(-) diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 6b464ae4fe..b8efd76506 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -20,8 +20,6 @@ osu.Desktop.Program - - @@ -38,8 +36,4 @@ - - - - \ No newline at end of file From 88628812c64da355b1008282ba7375e96e795239 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 3 Jun 2018 00:28:29 +0900 Subject: [PATCH 32/39] Logexceptions when loading ruleset DLLs --- osu.Game/Rulesets/RulesetStore.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/RulesetStore.cs b/osu.Game/Rulesets/RulesetStore.cs index 1847b63658..8d267f48e9 100644 --- a/osu.Game/Rulesets/RulesetStore.cs +++ b/osu.Game/Rulesets/RulesetStore.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; +using osu.Framework.Logging; using osu.Game.Database; namespace osu.Game.Rulesets @@ -114,8 +115,9 @@ namespace osu.Game.Rulesets var assembly = Assembly.LoadFrom(file); loaded_assemblies[assembly] = assembly.GetTypes().First(t => t.IsPublic && t.IsSubclassOf(typeof(Ruleset))); } - catch (Exception) + catch (Exception e) { + Logger.Error(e, "Failed to load ruleset"); } } } From 64eda2754724e473597dc2b252fb9be2933a3fbe Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 3 Jun 2018 02:28:11 +0900 Subject: [PATCH 33/39] Update framework --- osu-framework | 2 +- osu.Game/Overlays/KeyBinding/KeyBindingRow.cs | 4 ++-- osu.Game/Screens/Edit/Editor.cs | 4 ++-- .../Screens/Compose/Timeline/ScrollingTimelineContainer.cs | 6 +++--- osu.Game/Screens/Play/Player.cs | 2 +- osu.Game/Tests/Visual/EditorClockTestCase.cs | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/osu-framework b/osu-framework index 39aae99f5c..b963ce8250 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 39aae99f5c21ac9c9f8003cb4dedea345c38c78c +Subproject commit b963ce82505bc953db0a0763679e1ec80a060811 diff --git a/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs b/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs index 7406a9ec4f..ffe1560627 100644 --- a/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs +++ b/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs @@ -180,7 +180,7 @@ namespace osu.Game.Overlays.KeyBinding return true; } - protected override bool OnWheel(InputState state) + protected override bool OnScroll(InputState state) { if (HasFocus) { @@ -192,7 +192,7 @@ namespace osu.Game.Overlays.KeyBinding } } - return base.OnWheel(state); + return base.OnScroll(state); } protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index be08fffc77..b71d3aee18 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -182,9 +182,9 @@ namespace osu.Game.Screens.Edit LoadComponentAsync(currentScreen, screenContainer.Add); } - protected override bool OnWheel(InputState state) + protected override bool OnScroll(InputState state) { - if (state.Mouse.WheelDelta > 0) + if (state.Mouse.ScrollDelta.X + state.Mouse.ScrollDelta.Y > 0) clock.SeekBackward(true); else clock.SeekForward(true); diff --git a/osu.Game/Screens/Edit/Screens/Compose/Timeline/ScrollingTimelineContainer.cs b/osu.Game/Screens/Edit/Screens/Compose/Timeline/ScrollingTimelineContainer.cs index 83aa86ba61..2902e74e00 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Timeline/ScrollingTimelineContainer.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Timeline/ScrollingTimelineContainer.cs @@ -123,15 +123,15 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline /// private float? localZoomTarget; - protected override bool OnWheel(InputState state) + protected override bool OnScroll(InputState state) { if (!state.Keyboard.ControlPressed) - return base.OnWheel(state); + return base.OnScroll(state); relativeContentZoomTarget = Content.ToLocalSpace(state.Mouse.NativeState.Position).X / Content.DrawSize.X; localZoomTarget = ToLocalSpace(state.Mouse.NativeState.Position).X; - Zoom += state.Mouse.WheelDelta; + Zoom += state.Mouse.ScrollDelta.Y; return true; } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 9985a24cab..c93e4b7b40 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -364,7 +364,7 @@ namespace osu.Game.Screens.Play Background?.FadeTo(1f, fade_out_duration); } - protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !pauseContainer.IsPaused; + protected override bool OnScroll(InputState state) => mouseWheelDisabled.Value && !pauseContainer.IsPaused; private void initializeStoryboard(bool asyncLoad) { diff --git a/osu.Game/Tests/Visual/EditorClockTestCase.cs b/osu.Game/Tests/Visual/EditorClockTestCase.cs index 85d3684530..1ce7023be0 100644 --- a/osu.Game/Tests/Visual/EditorClockTestCase.cs +++ b/osu.Game/Tests/Visual/EditorClockTestCase.cs @@ -59,9 +59,9 @@ namespace osu.Game.Tests.Visual Clock.ProcessFrame(); } - protected override bool OnWheel(InputState state) + protected override bool OnScroll(InputState state) { - if (state.Mouse.WheelDelta > 0) + if (state.Mouse.ScrollDelta.Y > 0) Clock.SeekBackward(true); else Clock.SeekForward(true); From ea3d97a757ae48791bdb0acd53382a188442b9b2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 3 Jun 2018 02:36:56 +0900 Subject: [PATCH 34/39] Update appveyor to support netcore2.1 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 69bc762f4c..314faa617a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ clone_depth: 1 version: '{branch}-{build}' -image: Visual Studio 2017 +image: Visual Studio 2017 preview configuration: Debug cache: - C:\ProgramData\chocolatey\bin -> appveyor.yml From 0f13acf67e4af21539a04e7a265b1e0d0bacdbcf Mon Sep 17 00:00:00 2001 From: Joehu Date: Sat, 2 Jun 2018 12:52:31 -0700 Subject: [PATCH 35/39] Use updateExpanded method --- .../Screens/Play/PlayerSettings/PlayerSettingsGroup.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs index 967cfd7fa0..cff3eca895 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs @@ -50,7 +50,7 @@ namespace osu.Game.Screens.Play.PlayerSettings content.ResizeHeightTo(0, transition_duration, Easing.OutQuint); } - button.FadeColour(expanded ? expandedColour : Color4.White, 200, Easing.OutQuint); + updateExpanded(); } } @@ -130,11 +130,13 @@ namespace osu.Game.Screens.Play.PlayerSettings [BackgroundDependencyLoader] private void load(OsuColour colours) { - button.FadeColour(expanded ? colours.Yellow : Color4.White); - expandedColour = colours.Yellow; + + updateExpanded(); } + private void updateExpanded() => button.FadeColour(expanded ? expandedColour : Color4.White, 200, Easing.InOutQuint); + protected override Container Content => content; protected override bool OnHover(InputState state) => true; From 645f6efce78edc8699f9d47443c86cdca3a3b1cf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 3 Jun 2018 13:01:52 +0900 Subject: [PATCH 36/39] Fix web request failures not being correctly handled at an APIRequest level --- osu.Game/Beatmaps/BeatmapManager.cs | 2 +- osu.Game/Online/API/APIRequest.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index efc0279aa0..806bcc4132 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -170,7 +170,7 @@ namespace osu.Game.Beatmaps { if (error is OperationCanceledException) return; - downloadNotification.State = ProgressNotificationState.Completed; + downloadNotification.State = ProgressNotificationState.Cancelled; Logger.Error(error, "Beatmap download failed!"); currentDownloads.Remove(request); }; diff --git a/osu.Game/Online/API/APIRequest.cs b/osu.Game/Online/API/APIRequest.cs index 9af142b9e8..dfd181b98a 100644 --- a/osu.Game/Online/API/APIRequest.cs +++ b/osu.Game/Online/API/APIRequest.cs @@ -73,6 +73,7 @@ namespace osu.Game.Online.API throw new TimeoutException(@"API request timeout hit"); WebRequest = CreateWebRequest(); + WebRequest.Failed += Fail; WebRequest.AllowRetryOnTimeout = false; WebRequest.AddHeader("Authorization", $"Bearer {api.AccessToken}"); From 3795a55808a2f4e591f9f0982efc2c53973b8ec1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 3 Jun 2018 03:26:59 +0900 Subject: [PATCH 37/39] Fix menu flashes not extending to the edge of screen during parallax --- osu.Game/Screens/Menu/MenuSideFlashes.cs | 55 +++++++++++++----------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/osu.Game/Screens/Menu/MenuSideFlashes.cs b/osu.Game/Screens/Menu/MenuSideFlashes.cs index fae3e72552..c321c98b24 100644 --- a/osu.Game/Screens/Menu/MenuSideFlashes.cs +++ b/osu.Game/Screens/Menu/MenuSideFlashes.cs @@ -24,8 +24,8 @@ namespace osu.Game.Screens.Menu private readonly Bindable beatmap = new Bindable(); - private readonly Box leftBox; - private readonly Box rightBox; + private Box leftBox; + private Box rightBox; private const float amplitude_dead_zone = 0.25f; private const float alpha_multiplier = (1 - amplitude_dead_zone) / 0.55f; @@ -42,27 +42,6 @@ namespace osu.Game.Screens.Menu RelativeSizeAxes = Axes.Both; Anchor = Anchor.Centre; Origin = Anchor.Centre; - Children = new Drawable[] - { - leftBox = new Box - { - Anchor = Anchor.CentreLeft, - Origin = Anchor.CentreLeft, - RelativeSizeAxes = Axes.Y, - Width = box_width, - Alpha = 0, - Blending = BlendingMode.Additive, - }, - rightBox = new Box - { - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreRight, - RelativeSizeAxes = Axes.Y, - Width = box_width, - Alpha = 0, - Blending = BlendingMode.Additive, - } - }; } [BackgroundDependencyLoader] @@ -72,10 +51,34 @@ namespace osu.Game.Screens.Menu // linear colour looks better in this case, so let's use it for now. Color4 gradientDark = colours.Blue.Opacity(0).ToLinear(); - Color4 gradientLight = colours.Blue.Opacity(0.3f).ToLinear(); + Color4 gradientLight = colours.Blue.Opacity(0.6f).ToLinear(); - leftBox.Colour = ColourInfo.GradientHorizontal(gradientLight, gradientDark); - rightBox.Colour = ColourInfo.GradientHorizontal(gradientDark, gradientLight); + Children = new Drawable[] + { + leftBox = new Box + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + RelativeSizeAxes = Axes.Y, + Width = box_width * 2, + // align off-screen to make sure our edges don't become visible during parallax. + X = -box_width, + Alpha = 0, + Blending = BlendingMode.Additive, + Colour = ColourInfo.GradientHorizontal(gradientLight, gradientDark) + }, + rightBox = new Box + { + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight, + RelativeSizeAxes = Axes.Y, + Width = box_width * 2, + X = box_width, + Alpha = 0, + Blending = BlendingMode.Additive, + Colour = ColourInfo.GradientHorizontal(gradientDark, gradientLight) + } + }; } protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes) From ed1918cd43984e68e23da1bfd03f7f7375d1ba7f Mon Sep 17 00:00:00 2001 From: ekrctb Date: Sun, 3 Jun 2018 23:10:44 +0900 Subject: [PATCH 38/39] Wait for loading beatmaps --- .../Visual/TestCaseBeatmapCarousel.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs b/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs index f819e882d9..4679fca855 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs @@ -65,11 +65,7 @@ namespace osu.Game.Tests.Visual carousel.SelectionChanged = s => currentSelection = s; - AddStep("Load Beatmaps", () => { carousel.BeatmapSets = beatmapSets; }); - - bool changed = false; - carousel.BeatmapSetsChanged = () => changed = true; - AddUntilStep(() => changed, "Wait for load"); + loadBeatmaps(beatmapSets); testTraversal(); testFiltering(); @@ -84,6 +80,17 @@ namespace osu.Game.Tests.Visual testCarouselRootIsRandom(); } + private void loadBeatmaps(List beatmapSets) + { + bool changed = false; + AddStep($"Load {beatmapSets.Count} Beatmaps", () => + { + carousel.BeatmapSetsChanged = () => changed = true; + carousel.BeatmapSets = beatmapSets; + }); + AddUntilStep(() => changed, "Wait for load"); + } + private void ensureRandomFetchSuccess() => AddAssert("ensure prev random fetch worked", () => selectedSets.Peek() == carousel.SelectedBeatmapSet); @@ -423,7 +430,7 @@ namespace osu.Game.Tests.Visual for (int i = 1; i <= 50; i++) beatmapSets.Add(createTestBeatmapSet(i)); - AddStep("Load 50 Beatmaps", () => { carousel.BeatmapSets = beatmapSets; }); + loadBeatmaps(beatmapSets); advanceSelection(direction: 1, diff: false); checkNonmatchingFilter(); checkNonmatchingFilter(); From 4b828b104817cfade7e3c24747ca6f769d0a98e0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 4 Jun 2018 10:37:24 +0900 Subject: [PATCH 39/39] Fix incorrect release build vscode configurations --- osu.Game.Rulesets.Catch.Tests/.vscode/launch.json | 4 ++-- osu.Game.Rulesets.Mania.Tests/.vscode/launch.json | 4 ++-- osu.Game.Rulesets.Osu.Tests/.vscode/launch.json | 4 ++-- osu.Game.Rulesets.Taiko.Tests/.vscode/launch.json | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Catch.Tests/.vscode/launch.json b/osu.Game.Rulesets.Catch.Tests/.vscode/launch.json index c5005adfa5..2a82d65014 100644 --- a/osu.Game.Rulesets.Catch.Tests/.vscode/launch.json +++ b/osu.Game.Rulesets.Catch.Tests/.vscode/launch.json @@ -22,7 +22,7 @@ }, "type": "mono", "request": "launch", - "program": "${workspaceRoot}/bin/Debug/net471/osu.Game.Rulesets.Catch.Tests.exe", + "program": "${workspaceRoot}/bin/Release/net471/osu.Game.Rulesets.Catch.Tests.exe", "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Release, msbuild)", "runtimeExecutable": null, @@ -48,7 +48,7 @@ "request": "launch", "program": "dotnet", "args": [ - "${workspaceRoot}/bin/Debug/netcoreapp2.1/osu.Game.Rulesets.Catch.Tests.dll" + "${workspaceRoot}/bin/Release/netcoreapp2.1/osu.Game.Rulesets.Catch.Tests.dll" ], "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Release, dotnet)", diff --git a/osu.Game.Rulesets.Mania.Tests/.vscode/launch.json b/osu.Game.Rulesets.Mania.Tests/.vscode/launch.json index 637a5de1b5..bc41d4ccf9 100644 --- a/osu.Game.Rulesets.Mania.Tests/.vscode/launch.json +++ b/osu.Game.Rulesets.Mania.Tests/.vscode/launch.json @@ -22,7 +22,7 @@ }, "type": "mono", "request": "launch", - "program": "${workspaceRoot}/bin/Debug/net471/osu.Game.Rulesets.Mania.Tests.exe", + "program": "${workspaceRoot}/bin/Release/net471/osu.Game.Rulesets.Mania.Tests.exe", "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Release, msbuild)", "runtimeExecutable": null, @@ -48,7 +48,7 @@ "request": "launch", "program": "dotnet", "args": [ - "${workspaceRoot}/bin/Debug/netcoreapp2.1/osu.Game.Rulesets.Mania.Tests.dll" + "${workspaceRoot}/bin/Release/netcoreapp2.1/osu.Game.Rulesets.Mania.Tests.dll" ], "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Release, dotnet)", diff --git a/osu.Game.Rulesets.Osu.Tests/.vscode/launch.json b/osu.Game.Rulesets.Osu.Tests/.vscode/launch.json index 65c801cef4..13aba025fd 100644 --- a/osu.Game.Rulesets.Osu.Tests/.vscode/launch.json +++ b/osu.Game.Rulesets.Osu.Tests/.vscode/launch.json @@ -22,7 +22,7 @@ }, "type": "mono", "request": "launch", - "program": "${workspaceRoot}/bin/Debug/net471/osu.Game.Rulesets.Osu.Tests.exe", + "program": "${workspaceRoot}/bin/Release/net471/osu.Game.Rulesets.Osu.Tests.exe", "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Release, msbuild)", "runtimeExecutable": null, @@ -48,7 +48,7 @@ "request": "launch", "program": "dotnet", "args": [ - "${workspaceRoot}/bin/Debug/netcoreapp2.1/osu.Game.Rulesets.Osu.Tests.dll" + "${workspaceRoot}/bin/Release/netcoreapp2.1/osu.Game.Rulesets.Osu.Tests.dll" ], "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Release, dotnet)", diff --git a/osu.Game.Rulesets.Taiko.Tests/.vscode/launch.json b/osu.Game.Rulesets.Taiko.Tests/.vscode/launch.json index dbb1ab28e2..df49e177dc 100644 --- a/osu.Game.Rulesets.Taiko.Tests/.vscode/launch.json +++ b/osu.Game.Rulesets.Taiko.Tests/.vscode/launch.json @@ -22,7 +22,7 @@ }, "type": "mono", "request": "launch", - "program": "${workspaceRoot}/bin/Debug/net471/osu.Game.Rulesets.Taiko.Tests.exe", + "program": "${workspaceRoot}/bin/Release/net471/osu.Game.Rulesets.Taiko.Tests.exe", "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Release, msbuild)", "runtimeExecutable": null, @@ -48,7 +48,7 @@ "request": "launch", "program": "dotnet", "args": [ - "${workspaceRoot}/bin/Debug/netcoreapp2.1/osu.Game.Rulesets.Taiko.Tests.dll" + "${workspaceRoot}/bin/Release/netcoreapp2.1/osu.Game.Rulesets.Taiko.Tests.dll" ], "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Release, dotnet)",