diff --git a/Directory.Build.props b/Directory.Build.props
index 27a0bd0d48..21b8b402e0 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -40,7 +40,7 @@
https://github.com/ppy/osu
Automated release.
ppy Pty Ltd
- Copyright (c) 2019 ppy Pty Ltd
+ Copyright (c) 2020 ppy Pty Ltd
osu game
\ No newline at end of file
diff --git a/LICENCE b/LICENCE
index 21c6a7090f..2435c23545 100644
--- a/LICENCE
+++ b/LICENCE
@@ -1,4 +1,4 @@
-Copyright (c) 2019 ppy Pty Ltd .
+Copyright (c) 2020 ppy Pty Ltd .
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/osu.Desktop/osu.nuspec b/osu.Desktop/osu.nuspec
index a26b35fcd5..a919d54f38 100644
--- a/osu.Desktop/osu.nuspec
+++ b/osu.Desktop/osu.nuspec
@@ -12,7 +12,7 @@
click the circles. to the beat.
click the circles.
testing
- Copyright (c) 2019 ppy Pty Ltd
+ Copyright (c) 2020 ppy Pty Ltd
en-AU
diff --git a/osu.Game.Tournament/TournamentGameBase.cs b/osu.Game.Tournament/TournamentGameBase.cs
index bd91ad9704..17d7dc0245 100644
--- a/osu.Game.Tournament/TournamentGameBase.cs
+++ b/osu.Game.Tournament/TournamentGameBase.cs
@@ -223,9 +223,12 @@ namespace osu.Game.Tournament
foreach (var r in ladder.Rounds)
{
- foreach (var b in r.Beatmaps)
+ foreach (var b in r.Beatmaps.ToList())
{
- if (b.BeatmapInfo == null && b.ID > 0)
+ if (b.BeatmapInfo != null)
+ continue;
+
+ if (b.ID > 0)
{
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID });
API.Perform(req);
@@ -233,6 +236,10 @@ namespace osu.Game.Tournament
addedInfo = true;
}
+
+ if (b.BeatmapInfo == null)
+ // if online population couldn't be performed, ensure we don't leave a null value behind
+ r.Beatmaps.Remove(b);
}
}
diff --git a/osu.Game/Graphics/OsuColour.cs b/osu.Game/Graphics/OsuColour.cs
index 2dc12b3e67..6767104576 100644
--- a/osu.Game/Graphics/OsuColour.cs
+++ b/osu.Game/Graphics/OsuColour.cs
@@ -3,6 +3,7 @@
using System;
using osu.Game.Beatmaps;
+using osuTK;
using osuTK.Graphics;
namespace osu.Game.Graphics
@@ -63,6 +64,46 @@ namespace osu.Game.Graphics
}
}
+ public Color4 ForOverlayElement(OverlayColourScheme colourScheme, float saturation, float lightness, float opacity = 1) => Color4.FromHsl(new Vector4(getBaseHue(colourScheme), saturation, lightness, opacity));
+
+ // See https://github.com/ppy/osu-web/blob/4218c288292d7c810b619075471eaea8bbb8f9d8/app/helpers.php#L1463
+ private static float getBaseHue(OverlayColourScheme colourScheme)
+ {
+ float hue;
+
+ switch (colourScheme)
+ {
+ default:
+ throw new ArgumentException($@"{colourScheme} colour scheme does not provide a hue value in {nameof(getBaseHue)}.");
+
+ case OverlayColourScheme.Red:
+ hue = 0;
+ break;
+
+ case OverlayColourScheme.Pink:
+ hue = 333;
+ break;
+
+ case OverlayColourScheme.Orange:
+ hue = 46;
+ break;
+
+ case OverlayColourScheme.Green:
+ hue = 115;
+ break;
+
+ case OverlayColourScheme.Purple:
+ hue = 255;
+ break;
+
+ case OverlayColourScheme.Blue:
+ hue = 200;
+ break;
+ }
+
+ return hue / 360f;
+ }
+
// See https://github.com/ppy/osu-web/blob/master/resources/assets/less/colors.less
public readonly Color4 PurpleLighter = FromHex(@"eeeeff");
public readonly Color4 PurpleLight = FromHex(@"aa88ff");
@@ -165,4 +206,14 @@ namespace osu.Game.Graphics
public readonly Color4 ContextMenuGray = FromHex(@"223034");
}
+
+ public enum OverlayColourScheme
+ {
+ Red,
+ Pink,
+ Orange,
+ Green,
+ Purple,
+ Blue
+ }
}
diff --git a/osu.Game/Overlays/BreadcrumbControlOverlayHeader.cs b/osu.Game/Overlays/BreadcrumbControlOverlayHeader.cs
index 8a82b1f0c0..2e50c19729 100644
--- a/osu.Game/Overlays/BreadcrumbControlOverlayHeader.cs
+++ b/osu.Game/Overlays/BreadcrumbControlOverlayHeader.cs
@@ -1,8 +1,10 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
+using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
+using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays
@@ -13,6 +15,17 @@ namespace osu.Game.Overlays
protected override TabControl CreateTabControl() => BreadcrumbControl = new OverlayHeaderBreadcrumbControl();
+ protected BreadcrumbControlOverlayHeader(OverlayColourScheme colourScheme)
+ : base(colourScheme)
+ {
+ }
+
+ [BackgroundDependencyLoader]
+ private void load(OsuColour colours)
+ {
+ BreadcrumbControl.AccentColour = colours.ForOverlayElement(ColourScheme, 1, 0.75f);
+ }
+
public class OverlayHeaderBreadcrumbControl : BreadcrumbControl
{
public OverlayHeaderBreadcrumbControl()
diff --git a/osu.Game/Overlays/Changelog/ChangelogHeader.cs b/osu.Game/Overlays/Changelog/ChangelogHeader.cs
index 7e47a3e29f..d5e0890b4d 100644
--- a/osu.Game/Overlays/Changelog/ChangelogHeader.cs
+++ b/osu.Game/Overlays/Changelog/ChangelogHeader.cs
@@ -26,6 +26,7 @@ namespace osu.Game.Overlays.Changelog
private const string listing_string = "listing";
public ChangelogHeader()
+ : base(OverlayColourScheme.Purple)
{
BreadcrumbControl.AddItem(listing_string);
BreadcrumbControl.Current.ValueChanged += e =>
@@ -43,14 +44,6 @@ namespace osu.Game.Overlays.Changelog
};
}
- [BackgroundDependencyLoader]
- private void load(OsuColour colours)
- {
- BreadcrumbControl.AccentColour = colours.Violet;
- TitleBackgroundColour = colours.GreyVioletDarker;
- ControlBackgroundColour = colours.GreyVioletDark;
- }
-
private ChangelogHeaderTitle title;
private void showBuild(ValueChangedEvent e)
@@ -117,12 +110,6 @@ namespace osu.Game.Overlays.Changelog
Version = null;
}
- [BackgroundDependencyLoader]
- private void load(OsuColour colours)
- {
- AccentColour = colours.Violet;
- }
-
protected override Drawable CreateIcon() => new ScreenTitleTextureIcon(@"Icons/changelog");
}
}
diff --git a/osu.Game/Overlays/News/NewsHeader.cs b/osu.Game/Overlays/News/NewsHeader.cs
index fc88c86df2..03dc64b3bd 100644
--- a/osu.Game/Overlays/News/NewsHeader.cs
+++ b/osu.Game/Overlays/News/NewsHeader.cs
@@ -23,6 +23,7 @@ namespace osu.Game.Overlays.News
public Action ShowFrontPage;
public NewsHeader()
+ : base(OverlayColourScheme.Purple)
{
BreadcrumbControl.AddItem(front_page_string);
@@ -35,14 +36,6 @@ namespace osu.Game.Overlays.News
Current.ValueChanged += showPost;
}
- [BackgroundDependencyLoader]
- private void load(OsuColour colours)
- {
- BreadcrumbControl.AccentColour = colours.Violet;
- TitleBackgroundColour = colours.GreyVioletDarker;
- ControlBackgroundColour = colours.GreyVioletDark;
- }
-
private void showPost(ValueChangedEvent e)
{
if (e.OldValue != null)
@@ -97,12 +90,6 @@ namespace osu.Game.Overlays.News
}
protected override Drawable CreateIcon() => new ScreenTitleTextureIcon(@"Icons/news");
-
- [BackgroundDependencyLoader]
- private void load(OsuColour colours)
- {
- AccentColour = colours.Violet;
- }
}
}
}
diff --git a/osu.Game/Overlays/OverlayHeader.cs b/osu.Game/Overlays/OverlayHeader.cs
index 53da2da634..c9547bb5b8 100644
--- a/osu.Game/Overlays/OverlayHeader.cs
+++ b/osu.Game/Overlays/OverlayHeader.cs
@@ -2,10 +2,12 @@
// See the LICENCE file in the repository root for full licence text.
using JetBrains.Annotations;
+using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.UserInterface;
+using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using osuTK.Graphics;
@@ -16,24 +18,19 @@ namespace osu.Game.Overlays
private readonly Box titleBackground;
private readonly Box controlBackground;
private readonly Container background;
-
- protected Color4 TitleBackgroundColour
- {
- set => titleBackground.Colour = value;
- }
-
- protected Color4 ControlBackgroundColour
- {
- set => controlBackground.Colour = value;
- }
+ private readonly ScreenTitle title;
protected float BackgroundHeight
{
set => background.Height = value;
}
- protected OverlayHeader()
+ protected OverlayColourScheme ColourScheme { get; }
+
+ protected OverlayHeader(OverlayColourScheme colourScheme)
{
+ ColourScheme = colourScheme;
+
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
@@ -60,9 +57,8 @@ namespace osu.Game.Overlays
titleBackground = new Box
{
RelativeSizeAxes = Axes.Both,
- Colour = Color4.Gray,
},
- CreateTitle().With(title =>
+ title = CreateTitle().With(title =>
{
title.Margin = new MarginPadding
{
@@ -92,6 +88,14 @@ namespace osu.Game.Overlays
});
}
+ [BackgroundDependencyLoader]
+ private void load(OsuColour colours)
+ {
+ titleBackground.Colour = colours.ForOverlayElement(ColourScheme, 0.2f, 0.15f);
+ title.AccentColour = colours.ForOverlayElement(ColourScheme, 1, 0.7f);
+ controlBackground.Colour = colours.ForOverlayElement(ColourScheme, 0.2f, 0.2f);
+ }
+
protected abstract Drawable CreateBackground();
[NotNull]
diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs
index 59e64dfc26..b550d7d823 100644
--- a/osu.Game/Overlays/Profile/ProfileHeader.cs
+++ b/osu.Game/Overlays/Profile/ProfileHeader.cs
@@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
-using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
@@ -25,6 +24,7 @@ namespace osu.Game.Overlays.Profile
private DetailHeaderContainer detailHeaderContainer;
public ProfileHeader()
+ : base(OverlayColourScheme.Green)
{
BackgroundHeight = 150;
@@ -36,14 +36,6 @@ namespace osu.Game.Overlays.Profile
centreHeaderContainer.DetailsVisible.BindValueChanged(visible => detailHeaderContainer.Expanded = visible.NewValue, true);
}
- [BackgroundDependencyLoader]
- private void load(OsuColour colours)
- {
- TabControl.AccentColour = colours.Seafoam;
- TitleBackgroundColour = colours.GreySeafoamDarker;
- ControlBackgroundColour = colours.GreySeafoam;
- }
-
protected override Drawable CreateBackground() =>
new Container
{
@@ -109,12 +101,6 @@ namespace osu.Game.Overlays.Profile
Section = "info";
}
- [BackgroundDependencyLoader]
- private void load(OsuColour colours)
- {
- AccentColour = colours.Seafoam;
- }
-
protected override Drawable CreateIcon() => new ScreenTitleTextureIcon(@"Icons/profile");
}
}
diff --git a/osu.Game/Overlays/TabControlOverlayHeader.cs b/osu.Game/Overlays/TabControlOverlayHeader.cs
index f3521b66c8..8f3aa896ee 100644
--- a/osu.Game/Overlays/TabControlOverlayHeader.cs
+++ b/osu.Game/Overlays/TabControlOverlayHeader.cs
@@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
+using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface;
@@ -15,6 +16,17 @@ namespace osu.Game.Overlays
protected override TabControl CreateTabControl() => TabControl = new OverlayHeaderTabControl();
+ protected TabControlOverlayHeader(OverlayColourScheme colourScheme)
+ : base(colourScheme)
+ {
+ }
+
+ [BackgroundDependencyLoader]
+ private void load(OsuColour colours)
+ {
+ TabControl.AccentColour = colours.ForOverlayElement(ColourScheme, 1, 0.75f);
+ }
+
public class OverlayHeaderTabControl : OverlayTabControl
{
public OverlayHeaderTabControl()