diff --git a/osu-framework b/osu-framework
index c6fd291492..fe49ccb3c8 160000
--- a/osu-framework
+++ b/osu-framework
@@ -1 +1 @@
-Subproject commit c6fd2914926f2a6df23eda536c0310f072581b1b
+Subproject commit fe49ccb3c8f8661d653752d225ae1dc183944bb4
diff --git a/osu.Desktop.Deploy/App.config b/osu.Desktop.Deploy/App.config
index 2fae7a5e1c..2fbea810f6 100644
--- a/osu.Desktop.Deploy/App.config
+++ b/osu.Desktop.Deploy/App.config
@@ -13,7 +13,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
-
+
diff --git a/osu.Desktop.Deploy/Program.cs b/osu.Desktop.Deploy/Program.cs
index 54fb50d0f8..e90fb1e567 100644
--- a/osu.Desktop.Deploy/Program.cs
+++ b/osu.Desktop.Deploy/Program.cs
@@ -145,6 +145,8 @@ namespace osu.Desktop.Deploy
///
private static void checkReleaseFiles()
{
+ if (!canGitHub) return;
+
var releaseLines = getReleaseLines();
//ensure we have all files necessary
@@ -157,6 +159,8 @@ namespace osu.Desktop.Deploy
private static void pruneReleases()
{
+ if (!canGitHub) return;
+
write("Pruning RELEASES...");
var releaseLines = getReleaseLines().ToList();
@@ -190,7 +194,7 @@ namespace osu.Desktop.Deploy
private static void uploadBuild(string version)
{
- if (string.IsNullOrEmpty(GitHubAccessToken) || string.IsNullOrEmpty(codeSigningCertPath))
+ if (!canGitHub || string.IsNullOrEmpty(CodeSigningCertificate))
return;
write("Publishing to GitHub...");
@@ -228,8 +232,12 @@ namespace osu.Desktop.Deploy
private static void openGitHubReleasePage() => Process.Start(GitHubReleasePage);
+ private static bool canGitHub => !string.IsNullOrEmpty(GitHubAccessToken);
+
private static void checkGitHubReleases()
{
+ if (!canGitHub) return;
+
write("Checking GitHub releases...");
var req = new JsonWebRequest>($"{GitHubApiEndpoint}");
req.AuthenticatedBlockingPerform();
diff --git a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs
index 0e4935aa7a..7126b6586d 100644
--- a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs
+++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs
@@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
protected override IEnumerable ConvertHitObject(HitObject obj, Beatmap beatmap)
{
var curveData = obj as IHasCurve;
- var positionData = obj as IHasPosition;
+ var positionData = obj as IHasXPosition;
var comboData = obj as IHasCombo;
if (positionData == null)
diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs
index 802d4cc99d..aab784f177 100644
--- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs
+++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs
@@ -26,8 +26,6 @@ namespace osu.Game.Rulesets.Mania.Tests
private const double start_time = 500;
private const double duration = 500;
- public override string Description => @"Mania playfield";
-
protected override double TimePerAction => 200;
private RulesetInfo maniaRuleset;
diff --git a/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs
index 059d297401..555f9bb0da 100644
--- a/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs
+++ b/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs
@@ -30,8 +30,6 @@ namespace osu.Game.Rulesets.Taiko.Tests
private const double default_duration = 1000;
private const float scroll_time = 1000;
- public override string Description => "Taiko playfield";
-
protected override double TimePerAction => default_duration * 2;
private readonly Random rng = new Random(1337);
diff --git a/osu.Game.Tests/Visual/TestCaseAllPlayers.cs b/osu.Game.Tests/Visual/TestCaseAllPlayers.cs
index 8c63e1a274..62b99487a9 100644
--- a/osu.Game.Tests/Visual/TestCaseAllPlayers.cs
+++ b/osu.Game.Tests/Visual/TestCaseAllPlayers.cs
@@ -5,6 +5,5 @@ namespace osu.Game.Tests.Visual
{
public class TestCaseAllPlayers : TestCasePlayer
{
- public override string Description => @"Showing everything to play the game.";
}
}
diff --git a/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs b/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs
index a5156c155b..18555574ba 100644
--- a/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs
+++ b/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs
@@ -19,8 +19,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseBeatSyncedContainer : OsuTestCase
{
- public override string Description => @"Tests beat synced containers.";
-
private readonly MusicController mc;
public TestCaseBeatSyncedContainer()
diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs b/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs
index 7dffa6d590..1a64994d0e 100644
--- a/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs
+++ b/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs
@@ -9,10 +9,9 @@ using OpenTK;
namespace osu.Game.Tests.Visual
{
[TestFixture]
+ [System.ComponentModel.Description("PlaySongSelect leaderboard/details area")]
internal class TestCaseBeatmapDetailArea : OsuTestCase
{
- public override string Description => @"Beatmap details in song select";
-
public TestCaseBeatmapDetailArea()
{
Add(new BeatmapDetailArea
@@ -23,4 +22,4 @@ namespace osu.Game.Tests.Visual
});
}
}
-}
\ No newline at end of file
+}
diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs b/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs
index b31eded9a0..248ec6d43d 100644
--- a/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs
+++ b/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs
@@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using System.ComponentModel;
using System.Linq;
using osu.Framework.Graphics;
using osu.Game.Beatmaps;
@@ -8,10 +9,9 @@ using osu.Game.Screens.Select;
namespace osu.Game.Tests.Visual
{
+ [Description("PlaySongSelect beatmap details")]
internal class TestCaseBeatmapDetails : OsuTestCase
{
- public override string Description => "BeatmapDetails tab of BeatmapDetailArea";
-
public TestCaseBeatmapDetails()
{
BeatmapDetails details;
diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs b/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs
index bdc2e0e105..e114fac96e 100644
--- a/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs
+++ b/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs
@@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using System.ComponentModel;
using osu.Game.Graphics;
using osu.Game.Screens.Select.Options;
using OpenTK.Graphics;
@@ -8,10 +9,9 @@ using OpenTK.Input;
namespace osu.Game.Tests.Visual
{
+ [Description("bottom beatmap details")]
internal class TestCaseBeatmapOptionsOverlay : OsuTestCase
{
- public override string Description => @"Beatmap options in song select";
-
public TestCaseBeatmapOptionsOverlay()
{
var overlay = new BeatmapOptionsOverlay();
diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs
index 8cae3feae2..cef8797f20 100644
--- a/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs
+++ b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs
@@ -3,7 +3,6 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics;
-using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.MathUtils;
using osu.Game.Graphics;
@@ -14,13 +13,13 @@ using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Rulesets.Scoring;
using osu.Game.Users;
using System.Collections.Generic;
+using osu.Framework.Graphics.Containers;
namespace osu.Game.Tests.Visual
{
+ [System.ComponentModel.Description("in BeatmapOverlay")]
public class TestCaseBeatmapScoresContainer : OsuTestCase
{
- public override string Description => "BeatmapOverlay scores container";
-
private readonly IEnumerable scores;
private readonly IEnumerable anotherScores;
private readonly OnlineScore topScore;
diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs b/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs
index c2de4ec05d..c24e13b7fb 100644
--- a/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs
+++ b/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs
@@ -14,8 +14,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseBeatmapSetOverlay : OsuTestCase
{
- public override string Description => @"view online beatmap sets";
-
private readonly BeatmapSetOverlay overlay;
public TestCaseBeatmapSetOverlay()
diff --git a/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs b/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs
index 97c343f8ac..50abd11e79 100644
--- a/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs
+++ b/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs
@@ -8,8 +8,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseBreadcrumbs : OsuTestCase
{
- public override string Description => @"breadcrumb > control";
-
public TestCaseBreadcrumbs()
{
BreadcrumbControl c;
diff --git a/osu.Game.Tests/Visual/TestCaseBreakOverlay.cs b/osu.Game.Tests/Visual/TestCaseBreakOverlay.cs
index 206ca308cf..dcb3b74654 100644
--- a/osu.Game.Tests/Visual/TestCaseBreakOverlay.cs
+++ b/osu.Game.Tests/Visual/TestCaseBreakOverlay.cs
@@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseBreakOverlay : OsuTestCase
{
- public override string Description => @"Tests breaks behavior";
-
private readonly BreakOverlay breakOverlay;
public TestCaseBreakOverlay()
@@ -88,4 +86,4 @@ namespace osu.Game.Tests.Visual
};
}
}
-}
\ No newline at end of file
+}
diff --git a/osu.Game.Tests/Visual/TestCaseButtonSystem.cs b/osu.Game.Tests/Visual/TestCaseButtonSystem.cs
new file mode 100644
index 0000000000..d260de69f1
--- /dev/null
+++ b/osu.Game.Tests/Visual/TestCaseButtonSystem.cs
@@ -0,0 +1,33 @@
+// Copyright (c) 2007-2017 ppy Pty Ltd .
+// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Colour;
+using osu.Framework.Graphics.Shapes;
+using osu.Game.Screens.Menu;
+using OpenTK.Graphics;
+
+namespace osu.Game.Tests.Visual
+{
+ internal class TestCaseButtonSystem : OsuTestCase
+ {
+ public TestCaseButtonSystem()
+ {
+ OsuLogo logo;
+ ButtonSystem buttons;
+
+ Children = new Drawable[]
+ {
+ new Box
+ {
+ Colour = ColourInfo.GradientVertical(Color4.Gray, Color4.WhiteSmoke),
+ RelativeSizeAxes = Axes.Both,
+ },
+ buttons = new ButtonSystem(),
+ logo = new OsuLogo()
+ };
+
+ buttons.SetOsuLogo(logo);
+ }
+ }
+}
diff --git a/osu.Game.Tests/Visual/TestCaseChatDisplay.cs b/osu.Game.Tests/Visual/TestCaseChatDisplay.cs
index 847593fcec..85ee224a5e 100644
--- a/osu.Game.Tests/Visual/TestCaseChatDisplay.cs
+++ b/osu.Game.Tests/Visual/TestCaseChatDisplay.cs
@@ -1,15 +1,15 @@
// Copyright (c) 2007-2017 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using System.ComponentModel;
using osu.Framework.Graphics.Containers;
using osu.Game.Overlays;
namespace osu.Game.Tests.Visual
{
+ [Description("Testing chat api and overlay")]
internal class TestCaseChatDisplay : OsuTestCase
{
- public override string Description => @"Testing chat api and overlay";
-
public TestCaseChatDisplay()
{
Add(new ChatOverlay
diff --git a/osu.Game.Tests/Visual/TestCaseContextMenu.cs b/osu.Game.Tests/Visual/TestCaseContextMenu.cs
index 91a766f8c7..6f5cb398d7 100644
--- a/osu.Game.Tests/Visual/TestCaseContextMenu.cs
+++ b/osu.Game.Tests/Visual/TestCaseContextMenu.cs
@@ -15,8 +15,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseContextMenu : OsuTestCase
{
- public override string Description => @"Menu visible on right click";
-
private const int start_time = 0;
private const int duration = 1000;
diff --git a/osu.Game.Tests/Visual/TestCaseDialogOverlay.cs b/osu.Game.Tests/Visual/TestCaseDialogOverlay.cs
index a031125b3a..f1aba908f0 100644
--- a/osu.Game.Tests/Visual/TestCaseDialogOverlay.cs
+++ b/osu.Game.Tests/Visual/TestCaseDialogOverlay.cs
@@ -9,8 +9,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseDialogOverlay : OsuTestCase
{
- public override string Description => @"Display dialogs";
-
public TestCaseDialogOverlay()
{
DialogOverlay overlay;
diff --git a/osu.Game.Tests/Visual/TestCaseDirect.cs b/osu.Game.Tests/Visual/TestCaseDirect.cs
index 2d8677c391..ede17fa775 100644
--- a/osu.Game.Tests/Visual/TestCaseDirect.cs
+++ b/osu.Game.Tests/Visual/TestCaseDirect.cs
@@ -11,8 +11,6 @@ namespace osu.Game.Tests.Visual
{
public class TestCaseDirect : OsuTestCase
{
- public override string Description => @"osu!direct overlay";
-
private DirectOverlay direct;
private RulesetStore rulesets;
diff --git a/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs b/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs
index 7113bcbff5..a51cf8ca95 100644
--- a/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs
+++ b/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs
@@ -14,8 +14,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseDrawableRoom : OsuTestCase
{
- public override string Description => @"Select your favourite room";
-
private RulesetStore rulesets;
protected override void LoadComplete()
diff --git a/osu.Game.Tests/Visual/TestCaseDrawings.cs b/osu.Game.Tests/Visual/TestCaseDrawings.cs
index c805d88cb4..e5692b29de 100644
--- a/osu.Game.Tests/Visual/TestCaseDrawings.cs
+++ b/osu.Game.Tests/Visual/TestCaseDrawings.cs
@@ -2,15 +2,15 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
+using System.ComponentModel;
using osu.Game.Screens.Tournament;
using osu.Game.Screens.Tournament.Teams;
namespace osu.Game.Tests.Visual
{
+ [Description("for tournament use")]
internal class TestCaseDrawings : OsuTestCase
{
- public override string Description => "Tournament drawings";
-
public TestCaseDrawings()
{
Add(new Drawings
diff --git a/osu.Game.Tests/Visual/TestCaseGamefield.cs b/osu.Game.Tests/Visual/TestCaseGamefield.cs
index af86b6ec06..0d8f4cb5f7 100644
--- a/osu.Game.Tests/Visual/TestCaseGamefield.cs
+++ b/osu.Game.Tests/Visual/TestCaseGamefield.cs
@@ -7,8 +7,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseGamefield : OsuTestCase
{
- public override string Description => @"Showing hitobjects and what not.";
-
protected override void LoadComplete()
{
base.LoadComplete();
diff --git a/osu.Game.Tests/Visual/TestCaseGraph.cs b/osu.Game.Tests/Visual/TestCaseGraph.cs
index 714f284879..fb1a3ef3f6 100644
--- a/osu.Game.Tests/Visual/TestCaseGraph.cs
+++ b/osu.Game.Tests/Visual/TestCaseGraph.cs
@@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseGraph : OsuTestCase
{
- public override string Description => "graph";
-
public TestCaseGraph()
{
BarGraph graph;
@@ -36,4 +34,4 @@ namespace osu.Game.Tests.Visual
AddStep("Right to left", () => graph.Direction = BarDirection.RightToLeft);
}
}
-}
\ No newline at end of file
+}
diff --git a/osu.Game.Tests/Visual/TestCaseIconButton.cs b/osu.Game.Tests/Visual/TestCaseIconButton.cs
index acde9df4a9..345316708e 100644
--- a/osu.Game.Tests/Visual/TestCaseIconButton.cs
+++ b/osu.Game.Tests/Visual/TestCaseIconButton.cs
@@ -14,8 +14,6 @@ namespace osu.Game.Tests.Visual
{
public class TestCaseIconButton : OsuTestCase
{
- public override string Description => "Various display modes of icon buttons";
-
public TestCaseIconButton()
{
Child = new FillFlowContainer
diff --git a/osu.Game.Tests/Visual/TestCaseKeyConfiguration.cs b/osu.Game.Tests/Visual/TestCaseKeyConfiguration.cs
index e473ce8778..d39ac12a60 100644
--- a/osu.Game.Tests/Visual/TestCaseKeyConfiguration.cs
+++ b/osu.Game.Tests/Visual/TestCaseKeyConfiguration.cs
@@ -9,8 +9,6 @@ namespace osu.Game.Tests.Visual
{
private readonly KeyBindingOverlay overlay;
- public override string Description => @"Key configuration";
-
public TestCaseKeyConfiguration()
{
Child = overlay = new KeyBindingOverlay();
diff --git a/osu.Game.Tests/Visual/TestCaseKeyCounter.cs b/osu.Game.Tests/Visual/TestCaseKeyCounter.cs
index 622fb15f4f..df122b7132 100644
--- a/osu.Game.Tests/Visual/TestCaseKeyCounter.cs
+++ b/osu.Game.Tests/Visual/TestCaseKeyCounter.cs
@@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseKeyCounter : OsuTestCase
{
- public override string Description => @"Tests key counter";
-
public TestCaseKeyCounter()
{
KeyCounterCollection kc = new KeyCounterCollection
diff --git a/osu.Game.Tests/Visual/TestCaseLeaderboard.cs b/osu.Game.Tests/Visual/TestCaseLeaderboard.cs
index 832003e6ab..9d6fb3a4ec 100644
--- a/osu.Game.Tests/Visual/TestCaseLeaderboard.cs
+++ b/osu.Game.Tests/Visual/TestCaseLeaderboard.cs
@@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using System.ComponentModel;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Scoring;
using osu.Game.Screens.Select.Leaderboards;
@@ -9,10 +10,9 @@ using OpenTK;
namespace osu.Game.Tests.Visual
{
+ [Description("PlaySongSelect leaderboard")]
internal class TestCaseLeaderboard : OsuTestCase
{
- public override string Description => @"From song select";
-
private readonly Leaderboard leaderboard;
private void newScores()
diff --git a/osu.Game.Tests/Visual/TestCaseMedalOverlay.cs b/osu.Game.Tests/Visual/TestCaseMedalOverlay.cs
index 9a26eefd63..fbee27668c 100644
--- a/osu.Game.Tests/Visual/TestCaseMedalOverlay.cs
+++ b/osu.Game.Tests/Visual/TestCaseMedalOverlay.cs
@@ -11,8 +11,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseMedalOverlay : OsuTestCase
{
- public override string Description => @"medal get!";
-
public override IReadOnlyList RequiredTypes => new[]
{
typeof(MedalOverlay),
diff --git a/osu.Game.Tests/Visual/TestCaseMenuButtonSystem.cs b/osu.Game.Tests/Visual/TestCaseMenuButtonSystem.cs
deleted file mode 100644
index 0b50c9cf47..0000000000
--- a/osu.Game.Tests/Visual/TestCaseMenuButtonSystem.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (c) 2007-2017 ppy Pty Ltd .
-// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-
-using osu.Framework.Graphics.Colour;
-using osu.Framework.Graphics.Shapes;
-using osu.Game.Screens.Menu;
-using OpenTK.Graphics;
-
-namespace osu.Game.Tests.Visual
-{
- internal class TestCaseMenuButtonSystem : OsuTestCase
- {
- public override string Description => @"Main menu button system";
-
- public TestCaseMenuButtonSystem()
- {
- Add(new Box
- {
- Colour = ColourInfo.GradientVertical(Color4.Gray, Color4.WhiteSmoke),
- RelativeSizeAxes = Framework.Graphics.Axes.Both,
- });
- Add(new ButtonSystem());
- }
- }
-}
diff --git a/osu.Game.Tests/Visual/TestCaseMenuOverlays.cs b/osu.Game.Tests/Visual/TestCaseMenuOverlays.cs
index e27de96bee..94a69f0029 100644
--- a/osu.Game.Tests/Visual/TestCaseMenuOverlays.cs
+++ b/osu.Game.Tests/Visual/TestCaseMenuOverlays.cs
@@ -1,16 +1,16 @@
// Copyright (c) 2007-2017 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using System.ComponentModel;
using osu.Framework.Graphics.Containers;
using osu.Framework.Logging;
using osu.Game.Screens.Play;
namespace osu.Game.Tests.Visual
{
+ [Description("player pause/fail screens")]
internal class TestCaseMenuOverlays : OsuTestCase
{
- public override string Description => @"Tests pause and fail overlays";
-
public TestCaseMenuOverlays()
{
FailOverlay failOverlay;
diff --git a/osu.Game.Tests/Visual/TestCaseMods.cs b/osu.Game.Tests/Visual/TestCaseMods.cs
index 0447d6582d..5270ac0dc9 100644
--- a/osu.Game.Tests/Visual/TestCaseMods.cs
+++ b/osu.Game.Tests/Visual/TestCaseMods.cs
@@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using System.ComponentModel;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Overlays.Mods;
@@ -10,10 +11,9 @@ using OpenTK;
namespace osu.Game.Tests.Visual
{
+ [Description("mod select and icon display")]
internal class TestCaseMods : OsuTestCase
{
- public override string Description => @"Mod select overlay and in-game display";
-
private ModSelectOverlay modSelect;
private ModDisplay modDisplay;
diff --git a/osu.Game.Tests/Visual/TestCaseMusicController.cs b/osu.Game.Tests/Visual/TestCaseMusicController.cs
index 323c32bf10..3c544bb968 100644
--- a/osu.Game.Tests/Visual/TestCaseMusicController.cs
+++ b/osu.Game.Tests/Visual/TestCaseMusicController.cs
@@ -13,8 +13,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseMusicController : OsuTestCase
{
- public override string Description => @"Tests music controller ui.";
-
private readonly Bindable beatmapBacking = new Bindable();
public TestCaseMusicController()
diff --git a/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs b/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs
index ed331076b2..3dca860909 100644
--- a/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs
+++ b/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs
@@ -15,8 +15,6 @@ namespace osu.Game.Tests.Visual
[TestFixture]
internal class TestCaseNotificationOverlay : OsuTestCase
{
- public override string Description => @"I handle notifications";
-
private readonly NotificationOverlay manager;
public TestCaseNotificationOverlay()
diff --git a/osu.Game.Tests/Visual/TestCaseOnScreenDisplay.cs b/osu.Game.Tests/Visual/TestCaseOnScreenDisplay.cs
index 8749d240f8..c3a755f3ca 100644
--- a/osu.Game.Tests/Visual/TestCaseOnScreenDisplay.cs
+++ b/osu.Game.Tests/Visual/TestCaseOnScreenDisplay.cs
@@ -12,8 +12,6 @@ namespace osu.Game.Tests.Visual
private FrameworkConfigManager config;
private Bindable frameSyncMode;
- public override string Description => @"Make it easier to see setting changes";
-
protected override void LoadComplete()
{
base.LoadComplete();
diff --git a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs
index 37dd60a25c..7c070fd3df 100644
--- a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs
+++ b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs
@@ -22,8 +22,6 @@ namespace osu.Game.Tests.Visual
{
private BeatmapManager manager;
- public override string Description => @"with fake data";
-
private RulesetStore rulesets;
private DependencyContainer dependencies;
diff --git a/osu.Game.Tests/Visual/TestCaseReplay.cs b/osu.Game.Tests/Visual/TestCaseReplay.cs
index 2e56daccfc..62c8a64916 100644
--- a/osu.Game.Tests/Visual/TestCaseReplay.cs
+++ b/osu.Game.Tests/Visual/TestCaseReplay.cs
@@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseReplay : TestCasePlayer
{
- public override string Description => @"Testing replay playback.";
-
protected override Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset)
{
beatmap.Mods.Value = beatmap.Mods.Value.Concat(new[] { ruleset.GetAutoplayMod() });
diff --git a/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs b/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs
index 3105a7d588..22a2d717e4 100644
--- a/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs
+++ b/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs
@@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseReplaySettingsOverlay : OsuTestCase
{
- public override string Description => @"Settings visible in replay/auto";
-
public TestCaseReplaySettingsOverlay()
{
ExampleContainer container;
diff --git a/osu.Game.Tests/Visual/TestCaseResults.cs b/osu.Game.Tests/Visual/TestCaseResults.cs
index 62154a535a..f1bbb8fed6 100644
--- a/osu.Game.Tests/Visual/TestCaseResults.cs
+++ b/osu.Game.Tests/Visual/TestCaseResults.cs
@@ -15,8 +15,6 @@ namespace osu.Game.Tests.Visual
{
private BeatmapManager beatmaps;
- public override string Description => @"Results after playing.";
-
[BackgroundDependencyLoader]
private void load(BeatmapManager beatmaps)
{
diff --git a/osu.Game.Tests/Visual/TestCaseRoomInspector.cs b/osu.Game.Tests/Visual/TestCaseRoomInspector.cs
index e6b57c970b..51b6ae8e50 100644
--- a/osu.Game.Tests/Visual/TestCaseRoomInspector.cs
+++ b/osu.Game.Tests/Visual/TestCaseRoomInspector.cs
@@ -13,8 +13,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseRoomInspector : OsuTestCase
{
- public override string Description => @"from the multiplayer lobby";
-
private RulesetStore rulesets;
protected override void LoadComplete()
diff --git a/osu.Game.Tests/Visual/TestCaseScoreCounter.cs b/osu.Game.Tests/Visual/TestCaseScoreCounter.cs
index 543ff12fcb..5a04000900 100644
--- a/osu.Game.Tests/Visual/TestCaseScoreCounter.cs
+++ b/osu.Game.Tests/Visual/TestCaseScoreCounter.cs
@@ -12,8 +12,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseScoreCounter : OsuTestCase
{
- public override string Description => @"Tests multiple counters";
-
public TestCaseScoreCounter()
{
int numerator = 0, denominator = 0;
diff --git a/osu.Game.Tests/Visual/TestCaseSettings.cs b/osu.Game.Tests/Visual/TestCaseSettings.cs
index dfc0b66e21..63d798cd53 100644
--- a/osu.Game.Tests/Visual/TestCaseSettings.cs
+++ b/osu.Game.Tests/Visual/TestCaseSettings.cs
@@ -7,8 +7,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseSettings : OsuTestCase
{
- public override string Description => @"Tests the settings overlay";
-
private readonly SettingsOverlay settings;
public TestCaseSettings()
diff --git a/osu.Game.Tests/Visual/TestCaseSkipButton.cs b/osu.Game.Tests/Visual/TestCaseSkipButton.cs
index 49be015adf..40c8baaac8 100644
--- a/osu.Game.Tests/Visual/TestCaseSkipButton.cs
+++ b/osu.Game.Tests/Visual/TestCaseSkipButton.cs
@@ -7,8 +7,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseSkipButton : OsuTestCase
{
- public override string Description => @"Skip skip skippediskip";
-
protected override void LoadComplete()
{
base.LoadComplete();
diff --git a/osu.Game.Tests/Visual/TestCaseSocial.cs b/osu.Game.Tests/Visual/TestCaseSocial.cs
index 4f90e4ceff..ff0707c8ab 100644
--- a/osu.Game.Tests/Visual/TestCaseSocial.cs
+++ b/osu.Game.Tests/Visual/TestCaseSocial.cs
@@ -8,8 +8,6 @@ namespace osu.Game.Tests.Visual
{
public class TestCaseSocial : OsuTestCase
{
- public override string Description => @"social browser overlay";
-
public TestCaseSocial()
{
SocialOverlay s = new SocialOverlay
diff --git a/osu.Game.Tests/Visual/TestCaseSongProgress.cs b/osu.Game.Tests/Visual/TestCaseSongProgress.cs
index 96ff76e9c6..1e6886cda9 100644
--- a/osu.Game.Tests/Visual/TestCaseSongProgress.cs
+++ b/osu.Game.Tests/Visual/TestCaseSongProgress.cs
@@ -12,8 +12,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseSongProgress : OsuTestCase
{
- public override string Description => @"With fake data";
-
private readonly SongProgress progress;
private readonly SongProgressGraph graph;
diff --git a/osu.Game.Tests/Visual/TestCaseStoryboard.cs b/osu.Game.Tests/Visual/TestCaseStoryboard.cs
index c6ef3f4ecf..1dad106cbe 100644
--- a/osu.Game.Tests/Visual/TestCaseStoryboard.cs
+++ b/osu.Game.Tests/Visual/TestCaseStoryboard.cs
@@ -16,8 +16,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseStoryboard : OsuTestCase
{
- public override string Description => @"Tests storyboards.";
-
private readonly Bindable beatmapBacking = new Bindable();
private readonly Container storyboardContainer;
diff --git a/osu.Game.Tests/Visual/TestCaseTabControl.cs b/osu.Game.Tests/Visual/TestCaseTabControl.cs
index 6db74f2cfb..44a1732e16 100644
--- a/osu.Game.Tests/Visual/TestCaseTabControl.cs
+++ b/osu.Game.Tests/Visual/TestCaseTabControl.cs
@@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using System.ComponentModel;
using osu.Framework.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
@@ -9,10 +10,9 @@ using OpenTK;
namespace osu.Game.Tests.Visual
{
+ [Description("SongSelect filter control")]
public class TestCaseTabControl : OsuTestCase
{
- public override string Description => @"Filter for song select";
-
public TestCaseTabControl()
{
OsuSpriteText text;
diff --git a/osu.Game.Tests/Visual/TestCaseTextAwesome.cs b/osu.Game.Tests/Visual/TestCaseTextAwesome.cs
index beec5ab271..37905a1883 100644
--- a/osu.Game.Tests/Visual/TestCaseTextAwesome.cs
+++ b/osu.Game.Tests/Visual/TestCaseTextAwesome.cs
@@ -12,8 +12,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseTextAwesome : OsuTestCase
{
- public override string Description => @"Tests display of icons";
-
public TestCaseTextAwesome()
{
FillFlowContainer flow;
diff --git a/osu.Game.Tests/Visual/TestCaseTwoLayerButton.cs b/osu.Game.Tests/Visual/TestCaseTwoLayerButton.cs
index 83e0e4b442..bd5c10d147 100644
--- a/osu.Game.Tests/Visual/TestCaseTwoLayerButton.cs
+++ b/osu.Game.Tests/Visual/TestCaseTwoLayerButton.cs
@@ -1,14 +1,14 @@
// Copyright (c) 2007-2017 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using System.ComponentModel;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Tests.Visual
{
+ [Description("mostly back button")]
internal class TestCaseTwoLayerButton : OsuTestCase
{
- public override string Description => @"Mostly back button";
-
public TestCaseTwoLayerButton()
{
Add(new BackButton());
diff --git a/osu.Game.Tests/Visual/TestCaseUserPanel.cs b/osu.Game.Tests/Visual/TestCaseUserPanel.cs
index 8523a754f8..8d94a0c90f 100644
--- a/osu.Game.Tests/Visual/TestCaseUserPanel.cs
+++ b/osu.Game.Tests/Visual/TestCaseUserPanel.cs
@@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseUserPanel : OsuTestCase
{
- public override string Description => @"Panels for displaying a user's status";
-
public TestCaseUserPanel()
{
UserPanel flyte;
diff --git a/osu.Game.Tests/Visual/TestCaseUserProfile.cs b/osu.Game.Tests/Visual/TestCaseUserProfile.cs
index f5fced2915..90daf1e996 100644
--- a/osu.Game.Tests/Visual/TestCaseUserProfile.cs
+++ b/osu.Game.Tests/Visual/TestCaseUserProfile.cs
@@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseUserProfile : OsuTestCase
{
- public override string Description => "Tests user's profile page.";
-
public TestCaseUserProfile()
{
var profile = new UserProfileOverlay();
diff --git a/osu.Game.Tests/Visual/TestCaseUserRanks.cs b/osu.Game.Tests/Visual/TestCaseUserRanks.cs
index e17f0e1a46..eb0678203c 100644
--- a/osu.Game.Tests/Visual/TestCaseUserRanks.cs
+++ b/osu.Game.Tests/Visual/TestCaseUserRanks.cs
@@ -15,8 +15,6 @@ namespace osu.Game.Tests.Visual
{
internal class TestCaseUserRanks : OsuTestCase
{
- public override string Description => "showing your latest achievements";
-
public override IReadOnlyList RequiredTypes => new[] { typeof(DrawableScore), typeof(RanksSection) };
public TestCaseUserRanks()
diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj
index 9bba09b1a7..312a564f71 100644
--- a/osu.Game.Tests/osu.Game.Tests.csproj
+++ b/osu.Game.Tests/osu.Game.Tests.csproj
@@ -116,7 +116,7 @@
-
+
diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs
index ca715b8d1e..517b15cd26 100644
--- a/osu.Game/Beatmaps/BeatmapManager.cs
+++ b/osu.Game/Beatmaps/BeatmapManager.cs
@@ -18,6 +18,7 @@ using osu.Framework.Platform;
using osu.Game.Beatmaps.Formats;
using osu.Game.Beatmaps.IO;
using osu.Game.Database;
+using osu.Game.Graphics;
using osu.Game.IO;
using osu.Game.IPC;
using osu.Game.Online.API;
@@ -52,6 +53,11 @@ namespace osu.Game.Beatmaps
///
public event Action BeatmapRestored;
+ ///
+ /// Fired when a beatmap download begins.
+ ///
+ public event Action BeatmapDownloadBegan;
+
///
/// A default representation of a WorkingBeatmap to use when no beatmap is available.
///
@@ -221,21 +227,29 @@ namespace osu.Game.Beatmaps
/// Downloads a beatmap.
///
/// The to be downloaded.
- /// A new , or an existing one if a download is already in progress.
- public DownloadBeatmapSetRequest Download(BeatmapSetInfo beatmapSetInfo)
+ /// Whether the beatmap should be downloaded without video. Defaults to false.
+ public void Download(BeatmapSetInfo beatmapSetInfo, bool noVideo = false)
{
var existing = GetExistingDownload(beatmapSetInfo);
- if (existing != null) return existing;
+ if (existing != null || api == null) return;
- if (api == null) return null;
+ if (!api.LocalUser.Value.IsSupporter)
+ {
+ PostNotification?.Invoke(new SimpleNotification
+ {
+ Icon = FontAwesome.fa_superpowers,
+ Text = "You gotta be a supporter to download for now 'yo"
+ });
+ return;
+ }
ProgressNotification downloadNotification = new ProgressNotification
{
Text = $"Downloading {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}",
};
- var request = new DownloadBeatmapSetRequest(beatmapSetInfo);
+ var request = new DownloadBeatmapSetRequest(beatmapSetInfo, noVideo);
request.DownloadProgressed += progress =>
{
@@ -280,8 +294,7 @@ namespace osu.Game.Beatmaps
// don't run in the main api queue as this is a long-running task.
Task.Factory.StartNew(() => request.Perform(api), TaskCreationOptions.LongRunning);
-
- return request;
+ BeatmapDownloadBegan?.Invoke(request);
}
///
diff --git a/osu.Game/Beatmaps/BeatmapMetrics.cs b/osu.Game/Beatmaps/BeatmapMetrics.cs
index 730cf635da..e0cd5f10e7 100644
--- a/osu.Game/Beatmaps/BeatmapMetrics.cs
+++ b/osu.Game/Beatmaps/BeatmapMetrics.cs
@@ -12,7 +12,7 @@ namespace osu.Game.Beatmaps
public class BeatmapMetrics
{
///
- /// Total vote counts of user ratings on a scale of 0..length.
+ /// Total vote counts of user ratings on a scale of 0..10 where 0 is unused (probably will be fixed at API?).
///
public IEnumerable Ratings { get; set; }
diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs
index 917376969b..85daefea57 100644
--- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs
+++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs
@@ -64,11 +64,7 @@ namespace osu.Game.Beatmaps.Drawables
{
RelativeSizeAxes = Axes.Both,
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
- }
- )
- {
- TimeBeforeLoad = 300,
- },
+ }, 300),
new FillFlowContainer
{
Direction = FillDirection.Vertical,
diff --git a/osu.Game/Beatmaps/Drawables/Panel.cs b/osu.Game/Beatmaps/Drawables/Panel.cs
index d6ed306b39..e4b7e55012 100644
--- a/osu.Game/Beatmaps/Drawables/Panel.cs
+++ b/osu.Game/Beatmaps/Drawables/Panel.cs
@@ -3,12 +3,15 @@
using System;
using osu.Framework;
+using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input;
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
+using osu.Framework.Graphics.Shapes;
+using osu.Game.Graphics;
namespace osu.Game.Beatmaps.Drawables
{
@@ -22,6 +25,10 @@ namespace osu.Game.Beatmaps.Drawables
private readonly Container nestedContainer;
+ private readonly Container borderContainer;
+
+ private readonly Box hoverLayer;
+
protected override Container Content => nestedContainer;
protected Panel()
@@ -29,20 +36,53 @@ namespace osu.Game.Beatmaps.Drawables
Height = MAX_HEIGHT;
RelativeSizeAxes = Axes.X;
- AddInternal(nestedContainer = new Container
+ AddInternal(borderContainer = new Container
{
RelativeSizeAxes = Axes.Both,
Masking = true,
CornerRadius = 10,
BorderColour = new Color4(221, 255, 255, 255),
+ Children = new Drawable[]
+ {
+ nestedContainer = new Container
+ {
+ RelativeSizeAxes = Axes.Both,
+ },
+ hoverLayer = new Box
+ {
+ RelativeSizeAxes = Axes.Both,
+ Alpha = 0,
+ Blending = BlendingMode.Additive,
+ },
+ }
});
Alpha = 0;
}
+
+ protected override bool OnHover(InputState state)
+ {
+ hoverLayer.FadeIn(100, Easing.OutQuint);
+
+ return base.OnHover(state);
+ }
+
+ protected override void OnHoverLost(InputState state)
+ {
+ hoverLayer.FadeOut(1000, Easing.OutQuint);
+ base.OnHoverLost(state);
+ }
+
+ [BackgroundDependencyLoader]
+ private void load(OsuColour colours)
+ {
+ hoverLayer.Colour = colours.Blue.Opacity(0.1f);
+ }
+
public void SetMultiplicativeAlpha(float alpha)
{
- nestedContainer.Alpha = alpha;
+ borderContainer.Alpha = alpha;
}
protected override void LoadComplete()
@@ -94,8 +134,8 @@ namespace osu.Game.Beatmaps.Drawables
protected virtual void Selected()
{
- nestedContainer.BorderThickness = 2.5f;
- nestedContainer.EdgeEffect = new EdgeEffectParameters
+ borderContainer.BorderThickness = 2.5f;
+ borderContainer.EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Glow,
Colour = new Color4(130, 204, 255, 150),
@@ -106,8 +146,8 @@ namespace osu.Game.Beatmaps.Drawables
protected virtual void Deselected()
{
- nestedContainer.BorderThickness = 0;
- nestedContainer.EdgeEffect = new EdgeEffectParameters
+ borderContainer.BorderThickness = 0;
+ borderContainer.EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Shadow,
Offset = new Vector2(1),
diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs
index b3e99fce06..c087a5afb7 100644
--- a/osu.Game/Configuration/OsuConfigManager.cs
+++ b/osu.Game/Configuration/OsuConfigManager.cs
@@ -16,6 +16,7 @@ namespace osu.Game.Configuration
Set(OsuSetting.Ruleset, 0, 0, int.MaxValue);
Set(OsuSetting.BeatmapDetailTab, BeatmapDetailTab.Details);
+ Set(OsuSetting.ShowConvertedBeatmaps, true);
Set(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10, 0.1);
Set(OsuSetting.DisplayStarsMaximum, 10.0, 0, 10, 0.1);
@@ -112,6 +113,7 @@ namespace osu.Game.Configuration
SnakingOutSliders,
ShowFpsDisplay,
ChatDisplayHeight,
- Version
+ Version,
+ ShowConvertedBeatmaps
}
}
diff --git a/osu.Game/Database/DatabaseBackedStore.cs b/osu.Game/Database/DatabaseBackedStore.cs
index bc1b7132eb..d8c3ce6694 100644
--- a/osu.Game/Database/DatabaseBackedStore.cs
+++ b/osu.Game/Database/DatabaseBackedStore.cs
@@ -35,6 +35,7 @@ namespace osu.Game.Database
var id = obj.ID;
obj = lookupSource?.SingleOrDefault(t => t.ID == id) ?? context.Find(id);
+ context.Entry(obj).Reload();
}
///
diff --git a/osu.Game/Graphics/SpriteIcon.cs b/osu.Game/Graphics/SpriteIcon.cs
index ca108bfa7a..e752b1d91a 100644
--- a/osu.Game/Graphics/SpriteIcon.cs
+++ b/osu.Game/Graphics/SpriteIcon.cs
@@ -57,19 +57,31 @@ namespace osu.Game.Graphics
private void load(FontStore store)
{
this.store = store;
-
updateTexture();
}
+ protected override void LoadComplete()
+ {
+ base.LoadComplete();
+ updateTexture();
+ }
+
+ private FontAwesome loadedIcon;
private void updateTexture()
{
- var texture = store?.Get(((char)icon).ToString());
+ var loadableIcon = icon;
+
+ if (loadableIcon == loadedIcon) return;
+
+ var texture = store?.Get(((char)loadableIcon).ToString());
spriteMain.Texture = texture;
spriteShadow.Texture = texture;
if (Size == Vector2.Zero)
Size = new Vector2(texture?.DisplayWidth ?? 0, texture?.DisplayHeight ?? 0);
+
+ loadedIcon = loadableIcon;
}
public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true)
diff --git a/osu.Game/Graphics/UserInterface/Bar.cs b/osu.Game/Graphics/UserInterface/Bar.cs
index 20df553142..c25a9bf5e9 100644
--- a/osu.Game/Graphics/UserInterface/Bar.cs
+++ b/osu.Game/Graphics/UserInterface/Bar.cs
@@ -20,6 +20,7 @@ namespace osu.Game.Graphics.UserInterface
private const Easing easing = Easing.InOutCubic;
private float length;
+
///
/// Length of the bar, ranges from 0 to 1
///
@@ -134,4 +135,4 @@ namespace osu.Game.Graphics.UserInterface
Vertical = TopToBottom | BottomToTop,
Horizontal = LeftToRight | RightToLeft,
}
-}
\ No newline at end of file
+}
diff --git a/osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs b/osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs
index 5a9f609bca..cdcc06a65c 100644
--- a/osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs
+++ b/osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs
@@ -12,13 +12,16 @@ namespace osu.Game.Online.API.Requests
public Action DownloadProgressed;
- public DownloadBeatmapSetRequest(BeatmapSetInfo set)
+ private readonly bool noVideo;
+
+ public DownloadBeatmapSetRequest(BeatmapSetInfo set, bool noVideo)
{
+ this.noVideo = noVideo;
BeatmapSet = set;
Progress += (current, total) => DownloadProgressed?.Invoke((float) current / total);
}
- protected override string Target => $@"beatmapsets/{BeatmapSet.OnlineBeatmapSetID}/download";
+ protected override string Target => $@"beatmapsets/{BeatmapSet.OnlineBeatmapSetID}/download{(noVideo ? "?noVideo=1" : "")}";
}
}
diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs
index 96bb613f9f..4135aef268 100644
--- a/osu.Game/Overlays/BeatmapSet/Header.cs
+++ b/osu.Game/Overlays/BeatmapSet/Header.cs
@@ -29,8 +29,11 @@ namespace osu.Game.Overlays.BeatmapSet
private readonly Container noVideoButtons;
private readonly FillFlowContainer videoButtons;
private readonly AuthorInfo author;
+ private readonly Container downloadButtonsContainer;
public Details Details;
+ private BeatmapManager beatmaps;
+
private DelayedLoadWrapper cover;
public readonly BeatmapPicker Picker;
@@ -48,24 +51,22 @@ namespace osu.Game.Overlays.BeatmapSet
title.Text = BeatmapSet.Metadata.Title;
artist.Text = BeatmapSet.Metadata.Artist;
+ downloadButtonsContainer.FadeIn();
noVideoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 0 : 1, transition_duration);
videoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 1 : 0, transition_duration);
cover?.FadeOut(400, Easing.Out);
- coverContainer.Add(cover = new DelayedLoadWrapper(new BeatmapSetCover(BeatmapSet)
- {
- Anchor = Anchor.Centre,
- Origin = Anchor.Centre,
- RelativeSizeAxes = Axes.Both,
- FillMode = FillMode.Fill,
- OnLoadComplete = d =>
+ coverContainer.Add(cover = new DelayedLoadWrapper(
+ new BeatmapSetCover(BeatmapSet)
{
- d.FadeInFromZero(400, Easing.Out);
- },
- })
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both,
+ FillMode = FillMode.Fill,
+ OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
+ }, 300)
{
RelativeSizeAxes = Axes.Both,
- TimeBeforeLoad = 300
});
}
}
@@ -164,7 +165,7 @@ namespace osu.Game.Overlays.BeatmapSet
Children = new Drawable[]
{
new FavouriteButton(),
- new Container
+ downloadButtonsContainer = new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Left = buttons_height + buttons_spacing },
@@ -174,7 +175,10 @@ namespace osu.Game.Overlays.BeatmapSet
{
RelativeSizeAxes = Axes.Both,
Alpha = 0f,
- Child = new DownloadButton("Download", @""),
+ Child = new DownloadButton("Download", @"")
+ {
+ Action = () => download(false),
+ },
},
videoButtons = new FillFlowContainer
{
@@ -183,8 +187,14 @@ namespace osu.Game.Overlays.BeatmapSet
Alpha = 0f,
Children = new[]
{
- new DownloadButton("Download", "with Video"),
- new DownloadButton("Download", "without Video"),
+ new DownloadButton("Download", "with Video")
+ {
+ Action = () => download(false),
+ },
+ new DownloadButton("Download", "without Video")
+ {
+ Action = () => download(true),
+ },
},
},
},
@@ -208,9 +218,39 @@ namespace osu.Game.Overlays.BeatmapSet
}
[BackgroundDependencyLoader]
- private void load(OsuColour colours)
+ private void load(OsuColour colours, BeatmapManager beatmaps)
{
tabsBg.Colour = colours.Gray3;
+ this.beatmaps = beatmaps;
+
+ beatmaps.BeatmapSetAdded += handleBeatmapAdd;
+ }
+
+ protected override void Dispose(bool isDisposing)
+ {
+ base.Dispose(isDisposing);
+ if (beatmaps != null) beatmaps.BeatmapSetAdded -= handleBeatmapAdd;
+ }
+
+ private void handleBeatmapAdd(BeatmapSetInfo beatmap)
+ {
+ if (beatmap.OnlineBeatmapSetID == BeatmapSet?.OnlineBeatmapSetID)
+ downloadButtonsContainer.FadeOut(transition_duration);
+ }
+
+ private void download(bool noVideo)
+ {
+ if (beatmaps.GetExistingDownload(BeatmapSet) != null)
+ {
+ downloadButtonsContainer.MoveToX(-5, 50, Easing.OutSine).Then()
+ .MoveToX(5, 100, Easing.InOutSine).Then()
+ .MoveToX(-5, 100, Easing.InOutSine).Then()
+ .MoveToX(0, 50, Easing.InSine).Then();
+
+ return;
+ }
+
+ beatmaps.Download(BeatmapSet, noVideo);
}
}
}
diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs
index ef89c0022b..a55de951f1 100644
--- a/osu.Game/Overlays/Direct/DirectPanel.cs
+++ b/osu.Game/Overlays/Direct/DirectPanel.cs
@@ -16,9 +16,7 @@ using osu.Game.Graphics.Sprites;
using OpenTK.Graphics;
using osu.Framework.Input;
using osu.Game.Graphics.UserInterface;
-using osu.Game.Online.API;
using osu.Framework.Logging;
-using osu.Game.Overlays.Notifications;
using osu.Game.Online.API.Requests;
using osu.Framework.Configuration;
using osu.Framework.Audio.Track;
@@ -35,10 +33,8 @@ namespace osu.Game.Overlays.Direct
private Container content;
- private APIAccess api;
private ProgressBar progressBar;
private BeatmapManager beatmaps;
- private NotificationOverlay notifications;
private BeatmapSetOverlay beatmapSetOverlay;
public Track Preview => PlayButton.Preview;
@@ -71,11 +67,9 @@ namespace osu.Game.Overlays.Direct
[BackgroundDependencyLoader(permitNulls: true)]
- private void load(APIAccess api, BeatmapManager beatmaps, OsuColour colours, NotificationOverlay notifications, BeatmapSetOverlay beatmapSetOverlay)
+ private void load(BeatmapManager beatmaps, OsuColour colours, BeatmapSetOverlay beatmapSetOverlay)
{
- this.api = api;
this.beatmaps = beatmaps;
- this.notifications = notifications;
this.beatmapSetOverlay = beatmapSetOverlay;
AddInternal(content = new Container
@@ -109,6 +103,14 @@ namespace osu.Game.Overlays.Direct
if (downloadRequest != null)
attachDownload(downloadRequest);
+
+ beatmaps.BeatmapDownloadBegan += attachDownload;
+ }
+
+ protected override void Dispose(bool isDisposing)
+ {
+ base.Dispose(isDisposing);
+ beatmaps.BeatmapDownloadBegan -= attachDownload;
}
protected override void Update()
@@ -151,16 +153,6 @@ namespace osu.Game.Overlays.Direct
protected void StartDownload()
{
- if (!api.LocalUser.Value.IsSupporter)
- {
- notifications.Post(new SimpleNotification
- {
- Icon = FontAwesome.fa_superpowers,
- Text = "You gotta be a supporter to download for now 'yo"
- });
- return;
- }
-
if (beatmaps.GetExistingDownload(SetInfo) != null)
{
// we already have an active download running.
@@ -172,13 +164,14 @@ namespace osu.Game.Overlays.Direct
return;
}
- var request = beatmaps.Download(SetInfo);
-
- attachDownload(request);
+ beatmaps.Download(SetInfo);
}
private void attachDownload(DownloadBeatmapSetRequest request)
{
+ if (request.BeatmapSet.OnlineBeatmapSetID != SetInfo.OnlineBeatmapSetID)
+ return;
+
progressBar.FadeIn(400, Easing.OutQuint);
progressBar.ResizeHeightTo(4, 400, Easing.OutQuint);
@@ -219,21 +212,21 @@ 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 =>
+ protected Drawable CreateBackground() => new DelayedLoadWrapper(
+ new BeatmapSetCover(SetInfo)
{
- d.FadeInFromZero(400, Easing.Out);
- BlackBackground.Delay(400).FadeOut();
- },
- })
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ RelativeSizeAxes = Axes.Both,
+ FillMode = FillMode.Fill,
+ OnLoadComplete = d =>
+ {
+ d.FadeInFromZero(400, Easing.Out);
+ BlackBackground.Delay(400).FadeOut();
+ },
+ }, 300)
{
RelativeSizeAxes = Axes.Both,
- TimeBeforeLoad = 300
};
public class Statistic : FillFlowContainer
diff --git a/osu.Game/Overlays/Direct/PlayButton.cs b/osu.Game/Overlays/Direct/PlayButton.cs
index 9317bc06cf..75a3358d51 100644
--- a/osu.Game/Overlays/Direct/PlayButton.cs
+++ b/osu.Game/Overlays/Direct/PlayButton.cs
@@ -146,18 +146,17 @@ namespace osu.Game.Overlays.Direct
loading = true;
- Add(new AsyncLoadWrapper(trackLoader = new TrackLoader($"https://b.ppy.sh/preview/{BeatmapSet.OnlineBeatmapSetID}.mp3")
- {
- OnLoadComplete = d =>
+ LoadComponentAsync(trackLoader = new TrackLoader($"https://b.ppy.sh/preview/{BeatmapSet.OnlineBeatmapSetID}.mp3"),
+ d =>
{
- // we may have been replaced by another loader
+ // We may have been replaced by another loader
if (trackLoader != d) return;
- Preview = (d as TrackLoader)?.Preview;
+ Preview = d?.Preview;
Playing.TriggerChange();
loading = false;
- },
- }));
+ Add(trackLoader);
+ });
}
private class TrackLoader : Drawable
diff --git a/osu.Game/Overlays/DirectOverlay.cs b/osu.Game/Overlays/DirectOverlay.cs
index 6f7fabb910..b49ac269a9 100644
--- a/osu.Game/Overlays/DirectOverlay.cs
+++ b/osu.Game/Overlays/DirectOverlay.cs
@@ -50,7 +50,7 @@ namespace osu.Game.Overlays
{
if (beatmapSets?.Equals(value) ?? false) return;
- beatmapSets = value;
+ beatmapSets = value?.ToList();
if (beatmapSets == null) return;
@@ -65,8 +65,6 @@ namespace osu.Game.Overlays
}
ResultAmounts = new ResultCounts(distinctCount(artists), distinctCount(songs), distinctCount(tags));
-
- recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value);
}
}
@@ -282,7 +280,11 @@ namespace osu.Game.Overlays
var sets = response.Select(r => r.ToBeatmapSet(rulesets)).Where(b => !presentOnlineIds.Contains(b.OnlineBeatmapSetID)).ToList();
// may not need scheduling; loads async internally.
- Schedule(() => BeatmapSets = sets);
+ Schedule(() =>
+ {
+ BeatmapSets = sets;
+ recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value);
+ });
});
};
diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs
index 22e34be34c..c7bc5c1d93 100644
--- a/osu.Game/Overlays/Profile/ProfileHeader.cs
+++ b/osu.Game/Overlays/Profile/ProfileHeader.cs
@@ -316,19 +316,16 @@ namespace osu.Game.Overlays.Profile
private void loadUser()
{
- coverContainer.Add(new AsyncLoadWrapper(new UserCoverBackground(user)
+ LoadComponentAsync(new UserCoverBackground(user)
{
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
FillMode = FillMode.Fill,
- OnLoadComplete = d => d.FadeInFromZero(200)
- })
- {
- Masking = true,
- RelativeSizeAxes = Axes.Both,
- Depth = float.MaxValue
- });
+ OnLoadComplete = d => d.FadeInFromZero(200),
+ Depth = float.MaxValue,
+ },
+ coverContainer.Add);
if (user.IsSupporter) supporterTag.Show();
diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs
new file mode 100644
index 0000000000..8a835634b8
--- /dev/null
+++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs
@@ -0,0 +1,134 @@
+// Copyright (c) 2007-2017 ppy Pty Ltd .
+// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+
+using OpenTK;
+using OpenTK.Graphics;
+using osu.Framework.Configuration;
+using osu.Framework.Extensions.Color4Extensions;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Shapes;
+using osu.Framework.Input;
+using osu.Game.Graphics;
+using osu.Game.Graphics.Sprites;
+using osu.Game.Users;
+
+namespace osu.Game.Overlays.Profile.Sections.Kudosu
+{
+ public class KudosuInfo : Container
+ {
+ private readonly Bindable user = new Bindable();
+
+ public KudosuInfo(Bindable user)
+ {
+ this.user.BindTo(user);
+
+ CountSection total;
+ CountSection avaliable;
+
+ RelativeSizeAxes = Axes.X;
+ AutoSizeAxes = Axes.Y;
+ Masking = true;
+ CornerRadius = 3;
+ EdgeEffect = new EdgeEffectParameters
+ {
+ Type = EdgeEffectType.Shadow,
+ Offset = new Vector2(0f, 1f),
+ Radius = 3f,
+ Colour = Color4.Black.Opacity(0.2f),
+ };
+ Children = new Drawable[]
+ {
+ new Box
+ {
+ RelativeSizeAxes = Axes.Both,
+ Colour = OsuColour.Gray(0.2f)
+ },
+ new FillFlowContainer
+ {
+ RelativeSizeAxes = Axes.X,
+ AutoSizeAxes = Axes.Y,
+ Children = new[]
+ {
+ total = new CountSection(
+ "Total Kudosu Earned",
+ "Based on how much of a contribution the user has made to beatmap moderation. See this link for more information."
+ ),
+ avaliable = new CountSection(
+ "Kudosu Avaliable",
+ "Kudosu can be traded for kudosu stars, which will help your beatmap get more attention. This is the number of kudosu you haven't traded in yet."
+ ),
+ }
+ }
+ };
+
+ this.user.ValueChanged += newUser =>
+ {
+ total.Count = newUser?.Kudosu.Total ?? 0;
+ avaliable.Count = newUser?.Kudosu.Available ?? 0;
+ };
+ }
+
+ protected override bool OnClick(InputState state) => true;
+
+ private class CountSection : Container
+ {
+ private readonly OsuSpriteText valueText;
+
+ public int Count
+ {
+ set { valueText.Text = value.ToString(); }
+ }
+
+ public CountSection(string header, string description)
+ {
+ RelativeSizeAxes = Axes.X;
+ Width = 0.5f;
+ AutoSizeAxes = Axes.Y;
+ Padding = new MarginPadding { Horizontal = 10, Top = 10, Bottom = 20 };
+ Child = new FillFlowContainer
+ {
+ AutoSizeAxes = Axes.Y,
+ RelativeSizeAxes = Axes.X,
+ Direction = FillDirection.Vertical,
+ Spacing = new Vector2(0, 5),
+ Children = new Drawable[]
+ {
+ new FillFlowContainer
+ {
+ AutoSizeAxes = Axes.Both,
+ Direction = FillDirection.Horizontal,
+ Spacing = new Vector2(5, 0),
+ Children = new Drawable[]
+ {
+ new OsuSpriteText
+ {
+ Anchor = Anchor.BottomLeft,
+ Origin = Anchor.BottomLeft,
+ Text = header + ":",
+ TextSize = 20,
+ Font = @"Exo2.0-RegularItalic",
+ },
+ valueText = new OsuSpriteText
+ {
+ Anchor = Anchor.BottomLeft,
+ Origin = Anchor.BottomLeft,
+ Text = "0",
+ TextSize = 40,
+ UseFullGlyphHeight = false,
+ Font = @"Exo2.0-RegularItalic"
+ }
+ }
+ },
+ new TextFlowContainer(t => { t.TextSize = 19; })
+ {
+ RelativeSizeAxes = Axes.X,
+ AutoSizeAxes = Axes.Y,
+ Text = description
+ }
+ }
+ };
+ }
+ }
+ }
+}
diff --git a/osu.Game/Overlays/Profile/Sections/KudosuSection.cs b/osu.Game/Overlays/Profile/Sections/KudosuSection.cs
index 3c36368fd7..907c26e5e8 100644
--- a/osu.Game/Overlays/Profile/Sections/KudosuSection.cs
+++ b/osu.Game/Overlays/Profile/Sections/KudosuSection.cs
@@ -1,6 +1,8 @@
// Copyright (c) 2007-2017 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using osu.Game.Overlays.Profile.Sections.Kudosu;
+
namespace osu.Game.Overlays.Profile.Sections
{
public class KudosuSection : ProfileSection
@@ -8,5 +10,13 @@ namespace osu.Game.Overlays.Profile.Sections
public override string Title => "Kudosu!";
public override string Identifier => "kudosu";
+
+ public KudosuSection()
+ {
+ Children = new[]
+ {
+ new KudosuInfo(User),
+ };
+ }
}
}
diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs
index 07a8e7464a..9875ee8004 100644
--- a/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs
+++ b/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs
@@ -17,6 +17,11 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
{
Children = new Drawable[]
{
+ new SettingsCheckbox
+ {
+ LabelText = "Show converted beatmaps",
+ Bindable = config.GetBindable(OsuSetting.ShowConvertedBeatmaps),
+ },
new SettingsSlider
{
LabelText = "Display beatmaps from",
@@ -33,7 +38,7 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
{
LabelText = "Random beatmap selection",
Bindable = config.GetBindable(OsuSetting.SelectionRandomType),
- },
+ }
};
}
diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs
index dd31a43290..7374a9aa44 100644
--- a/osu.Game/Overlays/UserProfileOverlay.cs
+++ b/osu.Game/Overlays/UserProfileOverlay.cs
@@ -97,7 +97,7 @@ namespace osu.Game.Overlays
//new MedalsSection(),
new HistoricalSection(),
new BeatmapsSection(),
- //new KudosuSection()
+ new KudosuSection()
};
tabs = new ProfileTabControl
{
diff --git a/osu.Game/Screens/Multiplayer/DrawableRoom.cs b/osu.Game/Screens/Multiplayer/DrawableRoom.cs
index d2f88224c2..0ba4aaa364 100644
--- a/osu.Game/Screens/Multiplayer/DrawableRoom.cs
+++ b/osu.Game/Screens/Multiplayer/DrawableRoom.cs
@@ -228,16 +228,16 @@ namespace osu.Game.Screens.Multiplayer
if (value != null)
{
coverContainer.FadeIn(transition_duration);
- coverContainer.Children = new[]
+
+
+ LoadComponentAsync(new BeatmapSetCover(value.BeatmapSet)
{
- new AsyncLoadWrapper(new BeatmapSetCover(value.BeatmapSet)
- {
- Anchor = Anchor.Centre,
- Origin = Anchor.Centre,
- FillMode = FillMode.Fill,
- OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
- }) { RelativeSizeAxes = Axes.Both },
- };
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ FillMode = FillMode.Fill,
+ OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
+ },
+ coverContainer.Add);
beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title);
beatmapDash.Text = @" - ";
diff --git a/osu.Game/Screens/Multiplayer/RoomInspector.cs b/osu.Game/Screens/Multiplayer/RoomInspector.cs
index 66ce51b428..8d7401500f 100644
--- a/osu.Game/Screens/Multiplayer/RoomInspector.cs
+++ b/osu.Game/Screens/Multiplayer/RoomInspector.cs
@@ -329,17 +329,16 @@ namespace osu.Game.Screens.Multiplayer
if (value != null)
{
coverContainer.FadeIn(transition_duration);
- coverContainer.Children = new[]
+
+ LoadComponentAsync(new BeatmapSetCover(value.BeatmapSet)
{
- new AsyncLoadWrapper(new BeatmapSetCover(value.BeatmapSet)
- {
- RelativeSizeAxes = Axes.Both,
- Anchor = Anchor.Centre,
- Origin = Anchor.Centre,
- FillMode = FillMode.Fill,
- OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
- }) { RelativeSizeAxes = Axes.Both },
- };
+ RelativeSizeAxes = Axes.Both,
+ Anchor = Anchor.Centre,
+ Origin = Anchor.Centre,
+ FillMode = FillMode.Fill,
+ OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
+ },
+ coverContainer.Add);
beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title);
beatmapDash.Text = @" - ";
diff --git a/osu.Game/Screens/Play/PauseContainer.cs b/osu.Game/Screens/Play/PauseContainer.cs
index eed5cd1c20..5f5eeb63a0 100644
--- a/osu.Game/Screens/Play/PauseContainer.cs
+++ b/osu.Game/Screens/Play/PauseContainer.cs
@@ -22,8 +22,6 @@ namespace osu.Game.Screens.Play
{
public bool IsPaused { get; private set; }
- public bool AllowExit => IsPaused && pauseOverlay.Alpha == 1;
-
public Func CheckCanPause;
private const double pause_cooldown = 1000;
diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs
index cd2818398d..dc746b305c 100644
--- a/osu.Game/Screens/Play/Player.cs
+++ b/osu.Game/Screens/Play/Player.cs
@@ -46,6 +46,8 @@ namespace osu.Game.Screens.Play
public bool HasFailed { get; private set; }
+ public bool AllowPause { get; set; } = true;
+
public int RestartCount;
private IAdjustableClock adjustableSourceClock;
@@ -158,7 +160,7 @@ namespace osu.Game.Screens.Play
FramedClock = offsetClock,
OnRetry = Restart,
OnQuit = Exit,
- CheckCanPause = () => ValidForResume && !HasFailed && !RulesetContainer.HasReplayLoaded,
+ CheckCanPause = () => AllowPause && ValidForResume && !HasFailed && !RulesetContainer.HasReplayLoaded,
Retries = RestartCount,
OnPause = () => {
hudOverlay.KeyCounter.IsCounting = pauseContainer.IsPaused;
@@ -248,7 +250,10 @@ namespace osu.Game.Screens.Play
storyboard = beatmap.Storyboard.CreateDrawable(Beatmap.Value);
storyboard.Masking = true;
- storyboardContainer.Add(asyncLoad ? new AsyncLoadWrapper(storyboard) { RelativeSizeAxes = Axes.Both } : (Drawable)storyboard);
+ if (asyncLoad)
+ LoadComponentAsync(storyboard, storyboardContainer.Add);
+ else
+ storyboardContainer.Add(storyboard);
}
public void Restart()
@@ -305,7 +310,7 @@ namespace osu.Game.Screens.Play
if (!loadedSuccessfully)
return;
- (Background as BackgroundScreenBeatmap)?.BlurTo(Vector2.Zero, 1500, Easing.OutQuint);
+ (Background as BackgroundScreenBeatmap)?.BlurTo(Vector2.Zero, 1000, Easing.OutQuint);
dimLevel.ValueChanged += dimLevel_ValueChanged;
showStoryboard.ValueChanged += showStoryboard_ValueChanged;
@@ -352,7 +357,7 @@ namespace osu.Game.Screens.Play
protected override bool OnExiting(Screen next)
{
- if (HasFailed || !ValidForResume || pauseContainer?.AllowExit != false || RulesetContainer?.HasReplayLoaded != false)
+ if (!AllowPause || HasFailed || !ValidForResume || pauseContainer?.IsPaused != false || RulesetContainer?.HasReplayLoaded != false)
{
// In the case of replays, we may have changed the playback rate.
applyRateFromMods();
diff --git a/osu.Game/Screens/Select/Details/UserRatings.cs b/osu.Game/Screens/Select/Details/UserRatings.cs
index 2153eb150c..19bcad367e 100644
--- a/osu.Game/Screens/Select/Details/UserRatings.cs
+++ b/osu.Game/Screens/Select/Details/UserRatings.cs
@@ -29,11 +29,17 @@ namespace osu.Game.Screens.Select.Details
if (value == metrics) return;
metrics = value;
- var ratings = Metrics.Ratings.ToList();
- negativeRatings.Text = ratings.GetRange(0, ratings.Count / 2 + 1).Sum().ToString();
- positiveRatings.Text = ratings.GetRange(ratings.Count / 2 + 1, ratings.Count / 2).Sum().ToString();
- ratingsBar.Length = (float)ratings.GetRange(0, ratings.Count / 2 + 1).Sum() / ratings.Sum();
- graph.Values = Metrics.Ratings.Select(r => (float)r);
+ const int rating_range = 10;
+
+ var ratings = Metrics.Ratings.Skip(1).Take(rating_range); // adjust for API returning weird empty data at 0.
+
+ var negativeCount = ratings.Take(rating_range / 2).Sum();
+ var totalCount = ratings.Sum();
+
+ negativeRatings.Text = negativeCount.ToString();
+ positiveRatings.Text = (totalCount - negativeCount).ToString();
+ ratingsBar.Length = totalCount == 0 ? 0 : (float)negativeCount / totalCount;
+ graph.Values = ratings.Take(rating_range).Select(r => (float)r);
}
}
diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs
index e83613125b..1b86cec613 100644
--- a/osu.Game/Screens/Select/FilterControl.cs
+++ b/osu.Game/Screens/Select/FilterControl.cs
@@ -15,6 +15,7 @@ using osu.Game.Screens.Select.Filter;
using Container = osu.Framework.Graphics.Containers.Container;
using osu.Framework.Input;
using osu.Framework.Graphics.Shapes;
+using osu.Game.Configuration;
using osu.Game.Rulesets;
namespace osu.Game.Screens.Select
@@ -60,6 +61,7 @@ namespace osu.Game.Screens.Select
Group = group,
Sort = sort,
SearchText = searchTextBox.Text,
+ AllowConvertedBeatmaps = showConverted,
Ruleset = ruleset
};
@@ -163,17 +165,24 @@ namespace osu.Game.Screens.Select
private readonly Bindable ruleset = new Bindable();
+ private Bindable showConverted;
+
[BackgroundDependencyLoader(permitNulls: true)]
- private void load(OsuColour colours, OsuGame osu)
+ private void load(OsuColour colours, OsuGame osu, OsuConfigManager config)
{
sortTabs.AccentColour = colours.GreenLight;
+ showConverted = config.GetBindable(OsuSetting.ShowConvertedBeatmaps);
+ showConverted.ValueChanged += val => updateCriteria();
+
if (osu != null)
ruleset.BindTo(osu.Ruleset);
- ruleset.ValueChanged += val => FilterChanged?.Invoke(CreateCriteria());
+ ruleset.ValueChanged += val => updateCriteria();
ruleset.TriggerChange();
}
+ private void updateCriteria() => FilterChanged?.Invoke(CreateCriteria());
+
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
protected override bool OnMouseMove(InputState state) => true;
@@ -182,4 +191,4 @@ namespace osu.Game.Screens.Select
protected override bool OnDragStart(InputState state) => true;
}
-}
\ No newline at end of file
+}
diff --git a/osu.Game/Screens/Select/FilterCriteria.cs b/osu.Game/Screens/Select/FilterCriteria.cs
index 6c1fb1703d..c1355bfa63 100644
--- a/osu.Game/Screens/Select/FilterCriteria.cs
+++ b/osu.Game/Screens/Select/FilterCriteria.cs
@@ -16,6 +16,7 @@ namespace osu.Game.Screens.Select
public SortMode Sort;
public string SearchText;
public RulesetInfo Ruleset;
+ public bool AllowConvertedBeatmaps;
public void Filter(List groups)
{
@@ -23,7 +24,7 @@ namespace osu.Game.Screens.Select
{
var set = g.BeatmapSet;
- bool hasCurrentMode = set.Beatmaps.Any(bm => bm.RulesetID == (Ruleset?.ID ?? 0));
+ bool hasCurrentMode = AllowConvertedBeatmaps || set.Beatmaps.Any(bm => bm.RulesetID == (Ruleset?.ID ?? 0));
bool match = hasCurrentMode;
diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs
index 7b50d36b44..03466439ad 100644
--- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs
+++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs
@@ -33,7 +33,7 @@ namespace osu.Game.Screens.Select.Leaderboards
private Box background;
private Container content;
- private Container avatar;
+ private Drawable avatar;
private DrawableRank scoreRank;
private OsuSpriteText nameLabel;
private GlowingSpriteText scoreLabel;
@@ -97,7 +97,7 @@ namespace osu.Game.Screens.Select.Leaderboards
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding(edge_margin),
- Children = new Drawable[]
+ Children = new[]
{
avatar = new DelayedLoadWrapper(
new Avatar(Score.User)
@@ -114,7 +114,6 @@ namespace osu.Game.Screens.Select.Leaderboards
},
})
{
- TimeBeforeLoad = 500,
RelativeSizeAxes = Axes.None,
Size = new Vector2(HEIGHT - edge_margin * 2, HEIGHT - edge_margin * 2),
},
@@ -211,7 +210,7 @@ namespace osu.Game.Screens.Select.Leaderboards
public override void Show()
{
- foreach (var d in new Drawable[] { avatar, nameLabel, scoreLabel, scoreRank, flagBadgeContainer, maxCombo, accuracy, modsContainer })
+ foreach (var d in new[] { avatar, nameLabel, scoreLabel, scoreRank, flagBadgeContainer, maxCombo, accuracy, modsContainer })
d.FadeOut();
Alpha = 0;
diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs
index 5500d06136..68437180ac 100644
--- a/osu.Game/Screens/Select/SongSelect.cs
+++ b/osu.Game/Screens/Select/SongSelect.cs
@@ -203,8 +203,8 @@ namespace osu.Game.Screens.Select
Push(new Editor());
}
- private void onBeatmapRestored(BeatmapInfo b) => carousel.UpdateBeatmap(b);
- private void onBeatmapHidden(BeatmapInfo b) => carousel.UpdateBeatmap(b);
+ private void onBeatmapRestored(BeatmapInfo b) => Schedule(() => carousel.UpdateBeatmap(b));
+ private void onBeatmapHidden(BeatmapInfo b) => Schedule(() => carousel.UpdateBeatmap(b));
private void carouselBeatmapsLoaded()
{
@@ -413,7 +413,7 @@ namespace osu.Game.Screens.Select
if (backgroundModeBeatmap != null)
{
backgroundModeBeatmap.Beatmap = beatmap;
- backgroundModeBeatmap.BlurTo(background_blur, 1000);
+ backgroundModeBeatmap.BlurTo(background_blur, 750, Easing.OutQuint);
backgroundModeBeatmap.FadeTo(1, 250);
}
diff --git a/osu.Game/Tests/Visual/ScreenTestCase.cs b/osu.Game/Tests/Visual/ScreenTestCase.cs
new file mode 100644
index 0000000000..2f0831d84a
--- /dev/null
+++ b/osu.Game/Tests/Visual/ScreenTestCase.cs
@@ -0,0 +1,48 @@
+// Copyright (c) 2007-2017 ppy Pty Ltd .
+// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+
+using osu.Framework.Screens;
+using osu.Game.Screens;
+
+namespace osu.Game.Tests.Visual
+{
+ ///
+ /// A test case which can be used to test a screen (that relies on OnEntering being called to execute startup instructions).
+ ///
+ public abstract class ScreenTestCase : OsuTestCase
+ {
+ private readonly TestOsuScreen baseScreen;
+
+ protected ScreenTestCase()
+ {
+ Add(baseScreen = new TestOsuScreen());
+ }
+
+ protected void LoadScreen(OsuScreen screen) => baseScreen.LoadScreen(screen);
+
+ public class TestOsuScreen : OsuScreen
+ {
+ private OsuScreen nextScreen;
+
+ public void LoadScreen(OsuScreen screen) => Schedule(() =>
+ {
+ nextScreen = screen;
+
+ if (IsCurrentScreen)
+ {
+ Push(screen);
+ nextScreen = null;
+ }
+ else
+ MakeCurrent();
+ });
+
+ protected override void OnResuming(Screen last)
+ {
+ base.OnResuming(last);
+ if (nextScreen != null)
+ LoadScreen(nextScreen);
+ }
+ }
+ }
+}
diff --git a/osu.Game/Tests/Visual/TestCasePlayer.cs b/osu.Game/Tests/Visual/TestCasePlayer.cs
index 5965be9717..f3a6d1efc3 100644
--- a/osu.Game/Tests/Visual/TestCasePlayer.cs
+++ b/osu.Game/Tests/Visual/TestCasePlayer.cs
@@ -17,14 +17,12 @@ using OpenTK.Graphics;
namespace osu.Game.Tests.Visual
{
- public abstract class TestCasePlayer : OsuTestCase
+ public abstract class TestCasePlayer : ScreenTestCase
{
private readonly Type ruleset;
protected Player Player;
- public override string Description => @"Showing everything to play the game.";
-
///
/// Create a TestCase which runs through the Player screen.
///
@@ -46,6 +44,7 @@ namespace osu.Game.Tests.Visual
{
RelativeSizeAxes = Framework.Graphics.Axes.Both,
Colour = Color4.Black,
+ Depth = int.MaxValue
});
string instantiation = ruleset?.AssemblyQualifiedName;
@@ -79,19 +78,17 @@ namespace osu.Game.Tests.Visual
if (Player != null)
Remove(Player);
- Add(Player = CreatePlayer(working, instance));
+ LoadScreen(CreatePlayer(working, instance));
}
- protected virtual Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset)
+ protected virtual Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset) => new Player
{
- return new Player
- {
- InitialBeatmap = beatmap
- };
- }
+ InitialBeatmap = beatmap,
+ AllowPause = false
+ };
private const string test_beatmap_data =
-@"osu file format v14
+ @"osu file format v14
[General]
AudioLeadIn: 500
diff --git a/osu.Game/Users/UpdateableAvatar.cs b/osu.Game/Users/UpdateableAvatar.cs
index 7c020fce91..d55c0caad7 100644
--- a/osu.Game/Users/UpdateableAvatar.cs
+++ b/osu.Game/Users/UpdateableAvatar.cs
@@ -11,7 +11,7 @@ namespace osu.Game.Users
///
public class UpdateableAvatar : Container
{
- private Container displayedAvatar;
+ private Drawable displayedAvatar;
private User user;
@@ -40,11 +40,13 @@ namespace osu.Game.Users
{
displayedAvatar?.FadeOut(300);
displayedAvatar?.Expire();
- Add(displayedAvatar = new DelayedLoadWrapper(new Avatar(user)
- {
- RelativeSizeAxes = Axes.Both,
- OnLoadComplete = d => d.FadeInFromZero(200),
- }));
+ Add(displayedAvatar = new DelayedLoadWrapper(
+ new Avatar(user)
+ {
+ RelativeSizeAxes = Axes.Both,
+ OnLoadComplete = d => d.FadeInFromZero(200),
+ })
+ );
}
}
}
diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs
index ab4d55027d..1f235e3893 100644
--- a/osu.Game/Users/UserPanel.cs
+++ b/osu.Game/Users/UserPanel.cs
@@ -58,14 +58,14 @@ namespace osu.Game.Users
Children = new Drawable[]
{
- new AsyncLoadWrapper(new UserCoverBackground(user)
+ new DelayedLoadWrapper(new UserCoverBackground(user)
{
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
FillMode = FillMode.Fill,
OnLoadComplete = d => d.FadeInFromZero(200),
- }) { RelativeSizeAxes = Axes.Both },
+ }, 0) { RelativeSizeAxes = Axes.Both },
new Box
{
RelativeSizeAxes = Axes.Both,
diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj
index 0752b31495..2aefde2916 100644
--- a/osu.Game/osu.Game.csproj
+++ b/osu.Game/osu.Game.csproj
@@ -292,6 +292,7 @@
+
@@ -783,6 +784,7 @@
+