1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 03:02:53 +08:00

Merge remote-tracking branch 'upstream/master' into leaderboard-scopes

This commit is contained in:
Unknown 2017-11-24 19:14:50 +05:30
commit e723e66850
73 changed files with 352 additions and 222 deletions

@ -1 +1 @@
Subproject commit c6fd2914926f2a6df23eda536c0310f072581b1b Subproject commit fe49ccb3c8f8661d653752d225ae1dc183944bb4

View File

@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
protected override IEnumerable<CatchBaseHit> ConvertHitObject(HitObject obj, Beatmap beatmap) protected override IEnumerable<CatchBaseHit> ConvertHitObject(HitObject obj, Beatmap beatmap)
{ {
var curveData = obj as IHasCurve; var curveData = obj as IHasCurve;
var positionData = obj as IHasPosition; var positionData = obj as IHasXPosition;
var comboData = obj as IHasCombo; var comboData = obj as IHasCombo;
if (positionData == null) if (positionData == null)

View File

@ -26,8 +26,6 @@ namespace osu.Game.Rulesets.Mania.Tests
private const double start_time = 500; private const double start_time = 500;
private const double duration = 500; private const double duration = 500;
public override string Description => @"Mania playfield";
protected override double TimePerAction => 200; protected override double TimePerAction => 200;
private RulesetInfo maniaRuleset; private RulesetInfo maniaRuleset;

View File

@ -30,8 +30,6 @@ namespace osu.Game.Rulesets.Taiko.Tests
private const double default_duration = 1000; private const double default_duration = 1000;
private const float scroll_time = 1000; private const float scroll_time = 1000;
public override string Description => "Taiko playfield";
protected override double TimePerAction => default_duration * 2; protected override double TimePerAction => default_duration * 2;
private readonly Random rng = new Random(1337); private readonly Random rng = new Random(1337);

View File

@ -5,6 +5,5 @@ namespace osu.Game.Tests.Visual
{ {
public class TestCaseAllPlayers : TestCasePlayer public class TestCaseAllPlayers : TestCasePlayer
{ {
public override string Description => @"Showing everything to play the game.";
} }
} }

View File

@ -19,8 +19,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseBeatSyncedContainer : OsuTestCase internal class TestCaseBeatSyncedContainer : OsuTestCase
{ {
public override string Description => @"Tests beat synced containers.";
private readonly MusicController mc; private readonly MusicController mc;
public TestCaseBeatSyncedContainer() public TestCaseBeatSyncedContainer()

View File

@ -9,10 +9,9 @@ using OpenTK;
namespace osu.Game.Tests.Visual namespace osu.Game.Tests.Visual
{ {
[TestFixture] [TestFixture]
[System.ComponentModel.Description("PlaySongSelect leaderboard/details area")]
internal class TestCaseBeatmapDetailArea : OsuTestCase internal class TestCaseBeatmapDetailArea : OsuTestCase
{ {
public override string Description => @"Beatmap details in song select";
public TestCaseBeatmapDetailArea() public TestCaseBeatmapDetailArea()
{ {
Add(new BeatmapDetailArea Add(new BeatmapDetailArea
@ -23,4 +22,4 @@ namespace osu.Game.Tests.Visual
}); });
} }
} }
} }

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.ComponentModel;
using System.Linq; using System.Linq;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
@ -8,10 +9,9 @@ using osu.Game.Screens.Select;
namespace osu.Game.Tests.Visual namespace osu.Game.Tests.Visual
{ {
[Description("PlaySongSelect beatmap details")]
internal class TestCaseBeatmapDetails : OsuTestCase internal class TestCaseBeatmapDetails : OsuTestCase
{ {
public override string Description => "BeatmapDetails tab of BeatmapDetailArea";
public TestCaseBeatmapDetails() public TestCaseBeatmapDetails()
{ {
BeatmapDetails details; BeatmapDetails details;

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.ComponentModel;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Screens.Select.Options; using osu.Game.Screens.Select.Options;
using OpenTK.Graphics; using OpenTK.Graphics;
@ -8,10 +9,9 @@ using OpenTK.Input;
namespace osu.Game.Tests.Visual namespace osu.Game.Tests.Visual
{ {
[Description("bottom beatmap details")]
internal class TestCaseBeatmapOptionsOverlay : OsuTestCase internal class TestCaseBeatmapOptionsOverlay : OsuTestCase
{ {
public override string Description => @"Beatmap options in song select";
public TestCaseBeatmapOptionsOverlay() public TestCaseBeatmapOptionsOverlay()
{ {
var overlay = new BeatmapOptionsOverlay(); var overlay = new BeatmapOptionsOverlay();

View File

@ -3,7 +3,6 @@
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.MathUtils; using osu.Framework.MathUtils;
using osu.Game.Graphics; using osu.Game.Graphics;
@ -14,13 +13,13 @@ using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring;
using osu.Game.Users; using osu.Game.Users;
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Tests.Visual namespace osu.Game.Tests.Visual
{ {
[System.ComponentModel.Description("in BeatmapOverlay")]
public class TestCaseBeatmapScoresContainer : OsuTestCase public class TestCaseBeatmapScoresContainer : OsuTestCase
{ {
public override string Description => "BeatmapOverlay scores container";
private readonly IEnumerable<OnlineScore> scores; private readonly IEnumerable<OnlineScore> scores;
private readonly IEnumerable<OnlineScore> anotherScores; private readonly IEnumerable<OnlineScore> anotherScores;
private readonly OnlineScore topScore; private readonly OnlineScore topScore;

View File

@ -14,8 +14,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseBeatmapSetOverlay : OsuTestCase internal class TestCaseBeatmapSetOverlay : OsuTestCase
{ {
public override string Description => @"view online beatmap sets";
private readonly BeatmapSetOverlay overlay; private readonly BeatmapSetOverlay overlay;
public TestCaseBeatmapSetOverlay() public TestCaseBeatmapSetOverlay()

View File

@ -8,8 +8,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseBreadcrumbs : OsuTestCase internal class TestCaseBreadcrumbs : OsuTestCase
{ {
public override string Description => @"breadcrumb > control";
public TestCaseBreadcrumbs() public TestCaseBreadcrumbs()
{ {
BreadcrumbControl<BreadcrumbTab> c; BreadcrumbControl<BreadcrumbTab> c;

View File

@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseBreakOverlay : OsuTestCase internal class TestCaseBreakOverlay : OsuTestCase
{ {
public override string Description => @"Tests breaks behavior";
private readonly BreakOverlay breakOverlay; private readonly BreakOverlay breakOverlay;
public TestCaseBreakOverlay() public TestCaseBreakOverlay()
@ -88,4 +86,4 @@ namespace osu.Game.Tests.Visual
}; };
} }
} }
} }

View File

@ -0,0 +1,33 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// 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);
}
}
}

View File

@ -1,15 +1,15 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.ComponentModel;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Game.Overlays; using osu.Game.Overlays;
namespace osu.Game.Tests.Visual namespace osu.Game.Tests.Visual
{ {
[Description("Testing chat api and overlay")]
internal class TestCaseChatDisplay : OsuTestCase internal class TestCaseChatDisplay : OsuTestCase
{ {
public override string Description => @"Testing chat api and overlay";
public TestCaseChatDisplay() public TestCaseChatDisplay()
{ {
Add(new ChatOverlay Add(new ChatOverlay

View File

@ -15,8 +15,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseContextMenu : OsuTestCase internal class TestCaseContextMenu : OsuTestCase
{ {
public override string Description => @"Menu visible on right click";
private const int start_time = 0; private const int start_time = 0;
private const int duration = 1000; private const int duration = 1000;

View File

@ -9,8 +9,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseDialogOverlay : OsuTestCase internal class TestCaseDialogOverlay : OsuTestCase
{ {
public override string Description => @"Display dialogs";
public TestCaseDialogOverlay() public TestCaseDialogOverlay()
{ {
DialogOverlay overlay; DialogOverlay overlay;

View File

@ -11,8 +11,6 @@ namespace osu.Game.Tests.Visual
{ {
public class TestCaseDirect : OsuTestCase public class TestCaseDirect : OsuTestCase
{ {
public override string Description => @"osu!direct overlay";
private DirectOverlay direct; private DirectOverlay direct;
private RulesetStore rulesets; private RulesetStore rulesets;

View File

@ -14,8 +14,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseDrawableRoom : OsuTestCase internal class TestCaseDrawableRoom : OsuTestCase
{ {
public override string Description => @"Select your favourite room";
private RulesetStore rulesets; private RulesetStore rulesets;
protected override void LoadComplete() protected override void LoadComplete()

View File

@ -2,15 +2,15 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using osu.Game.Screens.Tournament; using osu.Game.Screens.Tournament;
using osu.Game.Screens.Tournament.Teams; using osu.Game.Screens.Tournament.Teams;
namespace osu.Game.Tests.Visual namespace osu.Game.Tests.Visual
{ {
[Description("for tournament use")]
internal class TestCaseDrawings : OsuTestCase internal class TestCaseDrawings : OsuTestCase
{ {
public override string Description => "Tournament drawings";
public TestCaseDrawings() public TestCaseDrawings()
{ {
Add(new Drawings Add(new Drawings

View File

@ -7,8 +7,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseGamefield : OsuTestCase internal class TestCaseGamefield : OsuTestCase
{ {
public override string Description => @"Showing hitobjects and what not.";
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();

View File

@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseGraph : OsuTestCase internal class TestCaseGraph : OsuTestCase
{ {
public override string Description => "graph";
public TestCaseGraph() public TestCaseGraph()
{ {
BarGraph graph; BarGraph graph;
@ -36,4 +34,4 @@ namespace osu.Game.Tests.Visual
AddStep("Right to left", () => graph.Direction = BarDirection.RightToLeft); AddStep("Right to left", () => graph.Direction = BarDirection.RightToLeft);
} }
} }
} }

View File

@ -14,8 +14,6 @@ namespace osu.Game.Tests.Visual
{ {
public class TestCaseIconButton : OsuTestCase public class TestCaseIconButton : OsuTestCase
{ {
public override string Description => "Various display modes of icon buttons";
public TestCaseIconButton() public TestCaseIconButton()
{ {
Child = new FillFlowContainer Child = new FillFlowContainer

View File

@ -9,8 +9,6 @@ namespace osu.Game.Tests.Visual
{ {
private readonly KeyBindingOverlay overlay; private readonly KeyBindingOverlay overlay;
public override string Description => @"Key configuration";
public TestCaseKeyConfiguration() public TestCaseKeyConfiguration()
{ {
Child = overlay = new KeyBindingOverlay(); Child = overlay = new KeyBindingOverlay();

View File

@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseKeyCounter : OsuTestCase internal class TestCaseKeyCounter : OsuTestCase
{ {
public override string Description => @"Tests key counter";
public TestCaseKeyCounter() public TestCaseKeyCounter()
{ {
KeyCounterCollection kc = new KeyCounterCollection KeyCounterCollection kc = new KeyCounterCollection

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.ComponentModel;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring;
using osu.Game.Screens.Select.Leaderboards; using osu.Game.Screens.Select.Leaderboards;
@ -9,10 +10,9 @@ using OpenTK;
namespace osu.Game.Tests.Visual namespace osu.Game.Tests.Visual
{ {
[Description("PlaySongSelect leaderboard")]
internal class TestCaseLeaderboard : OsuTestCase internal class TestCaseLeaderboard : OsuTestCase
{ {
public override string Description => @"From song select";
private readonly Leaderboard leaderboard; private readonly Leaderboard leaderboard;
private void newScores() private void newScores()

View File

@ -11,8 +11,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseMedalOverlay : OsuTestCase internal class TestCaseMedalOverlay : OsuTestCase
{ {
public override string Description => @"medal get!";
public override IReadOnlyList<Type> RequiredTypes => new[] public override IReadOnlyList<Type> RequiredTypes => new[]
{ {
typeof(MedalOverlay), typeof(MedalOverlay),

View File

@ -1,25 +0,0 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// 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());
}
}
}

View File

@ -1,16 +1,16 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.ComponentModel;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Logging; using osu.Framework.Logging;
using osu.Game.Screens.Play; using osu.Game.Screens.Play;
namespace osu.Game.Tests.Visual namespace osu.Game.Tests.Visual
{ {
[Description("player pause/fail screens")]
internal class TestCaseMenuOverlays : OsuTestCase internal class TestCaseMenuOverlays : OsuTestCase
{ {
public override string Description => @"Tests pause and fail overlays";
public TestCaseMenuOverlays() public TestCaseMenuOverlays()
{ {
FailOverlay failOverlay; FailOverlay failOverlay;

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.ComponentModel;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Overlays.Mods; using osu.Game.Overlays.Mods;
@ -10,10 +11,9 @@ using OpenTK;
namespace osu.Game.Tests.Visual namespace osu.Game.Tests.Visual
{ {
[Description("mod select and icon display")]
internal class TestCaseMods : OsuTestCase internal class TestCaseMods : OsuTestCase
{ {
public override string Description => @"Mod select overlay and in-game display";
private ModSelectOverlay modSelect; private ModSelectOverlay modSelect;
private ModDisplay modDisplay; private ModDisplay modDisplay;

View File

@ -13,8 +13,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseMusicController : OsuTestCase internal class TestCaseMusicController : OsuTestCase
{ {
public override string Description => @"Tests music controller ui.";
private readonly Bindable<WorkingBeatmap> beatmapBacking = new Bindable<WorkingBeatmap>(); private readonly Bindable<WorkingBeatmap> beatmapBacking = new Bindable<WorkingBeatmap>();
public TestCaseMusicController() public TestCaseMusicController()

View File

@ -15,8 +15,6 @@ namespace osu.Game.Tests.Visual
[TestFixture] [TestFixture]
internal class TestCaseNotificationOverlay : OsuTestCase internal class TestCaseNotificationOverlay : OsuTestCase
{ {
public override string Description => @"I handle notifications";
private readonly NotificationOverlay manager; private readonly NotificationOverlay manager;
public TestCaseNotificationOverlay() public TestCaseNotificationOverlay()

View File

@ -12,8 +12,6 @@ namespace osu.Game.Tests.Visual
private FrameworkConfigManager config; private FrameworkConfigManager config;
private Bindable<FrameSync> frameSyncMode; private Bindable<FrameSync> frameSyncMode;
public override string Description => @"Make it easier to see setting changes";
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();

View File

@ -22,8 +22,6 @@ namespace osu.Game.Tests.Visual
{ {
private BeatmapManager manager; private BeatmapManager manager;
public override string Description => @"with fake data";
private RulesetStore rulesets; private RulesetStore rulesets;
private DependencyContainer dependencies; private DependencyContainer dependencies;

View File

@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseReplay : TestCasePlayer internal class TestCaseReplay : TestCasePlayer
{ {
public override string Description => @"Testing replay playback.";
protected override Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset) protected override Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset)
{ {
beatmap.Mods.Value = beatmap.Mods.Value.Concat(new[] { ruleset.GetAutoplayMod() }); beatmap.Mods.Value = beatmap.Mods.Value.Concat(new[] { ruleset.GetAutoplayMod() });

View File

@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseReplaySettingsOverlay : OsuTestCase internal class TestCaseReplaySettingsOverlay : OsuTestCase
{ {
public override string Description => @"Settings visible in replay/auto";
public TestCaseReplaySettingsOverlay() public TestCaseReplaySettingsOverlay()
{ {
ExampleContainer container; ExampleContainer container;

View File

@ -15,8 +15,6 @@ namespace osu.Game.Tests.Visual
{ {
private BeatmapManager beatmaps; private BeatmapManager beatmaps;
public override string Description => @"Results after playing.";
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(BeatmapManager beatmaps) private void load(BeatmapManager beatmaps)
{ {

View File

@ -13,8 +13,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseRoomInspector : OsuTestCase internal class TestCaseRoomInspector : OsuTestCase
{ {
public override string Description => @"from the multiplayer lobby";
private RulesetStore rulesets; private RulesetStore rulesets;
protected override void LoadComplete() protected override void LoadComplete()

View File

@ -12,8 +12,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseScoreCounter : OsuTestCase internal class TestCaseScoreCounter : OsuTestCase
{ {
public override string Description => @"Tests multiple counters";
public TestCaseScoreCounter() public TestCaseScoreCounter()
{ {
int numerator = 0, denominator = 0; int numerator = 0, denominator = 0;

View File

@ -7,8 +7,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseSettings : OsuTestCase internal class TestCaseSettings : OsuTestCase
{ {
public override string Description => @"Tests the settings overlay";
private readonly SettingsOverlay settings; private readonly SettingsOverlay settings;
public TestCaseSettings() public TestCaseSettings()

View File

@ -7,8 +7,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseSkipButton : OsuTestCase internal class TestCaseSkipButton : OsuTestCase
{ {
public override string Description => @"Skip skip skippediskip";
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();

View File

@ -8,8 +8,6 @@ namespace osu.Game.Tests.Visual
{ {
public class TestCaseSocial : OsuTestCase public class TestCaseSocial : OsuTestCase
{ {
public override string Description => @"social browser overlay";
public TestCaseSocial() public TestCaseSocial()
{ {
SocialOverlay s = new SocialOverlay SocialOverlay s = new SocialOverlay

View File

@ -12,8 +12,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseSongProgress : OsuTestCase internal class TestCaseSongProgress : OsuTestCase
{ {
public override string Description => @"With fake data";
private readonly SongProgress progress; private readonly SongProgress progress;
private readonly SongProgressGraph graph; private readonly SongProgressGraph graph;

View File

@ -16,8 +16,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseStoryboard : OsuTestCase internal class TestCaseStoryboard : OsuTestCase
{ {
public override string Description => @"Tests storyboards.";
private readonly Bindable<WorkingBeatmap> beatmapBacking = new Bindable<WorkingBeatmap>(); private readonly Bindable<WorkingBeatmap> beatmapBacking = new Bindable<WorkingBeatmap>();
private readonly Container<DrawableStoryboard> storyboardContainer; private readonly Container<DrawableStoryboard> storyboardContainer;

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.ComponentModel;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
@ -9,10 +10,9 @@ using OpenTK;
namespace osu.Game.Tests.Visual namespace osu.Game.Tests.Visual
{ {
[Description("SongSelect filter control")]
public class TestCaseTabControl : OsuTestCase public class TestCaseTabControl : OsuTestCase
{ {
public override string Description => @"Filter for song select";
public TestCaseTabControl() public TestCaseTabControl()
{ {
OsuSpriteText text; OsuSpriteText text;

View File

@ -12,8 +12,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseTextAwesome : OsuTestCase internal class TestCaseTextAwesome : OsuTestCase
{ {
public override string Description => @"Tests display of icons";
public TestCaseTextAwesome() public TestCaseTextAwesome()
{ {
FillFlowContainer flow; FillFlowContainer flow;

View File

@ -1,14 +1,14 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.ComponentModel;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
namespace osu.Game.Tests.Visual namespace osu.Game.Tests.Visual
{ {
[Description("mostly back button")]
internal class TestCaseTwoLayerButton : OsuTestCase internal class TestCaseTwoLayerButton : OsuTestCase
{ {
public override string Description => @"Mostly back button";
public TestCaseTwoLayerButton() public TestCaseTwoLayerButton()
{ {
Add(new BackButton()); Add(new BackButton());

View File

@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseUserPanel : OsuTestCase internal class TestCaseUserPanel : OsuTestCase
{ {
public override string Description => @"Panels for displaying a user's status";
public TestCaseUserPanel() public TestCaseUserPanel()
{ {
UserPanel flyte; UserPanel flyte;

View File

@ -10,8 +10,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseUserProfile : OsuTestCase internal class TestCaseUserProfile : OsuTestCase
{ {
public override string Description => "Tests user's profile page.";
public TestCaseUserProfile() public TestCaseUserProfile()
{ {
var profile = new UserProfileOverlay(); var profile = new UserProfileOverlay();

View File

@ -15,8 +15,6 @@ namespace osu.Game.Tests.Visual
{ {
internal class TestCaseUserRanks : OsuTestCase internal class TestCaseUserRanks : OsuTestCase
{ {
public override string Description => "showing your latest achievements";
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(DrawableScore), typeof(RanksSection) }; public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(DrawableScore), typeof(RanksSection) };
public TestCaseUserRanks() public TestCaseUserRanks()

View File

@ -116,7 +116,7 @@
<Compile Include="Visual\TestCaseKeyCounter.cs" /> <Compile Include="Visual\TestCaseKeyCounter.cs" />
<Compile Include="Visual\TestCaseLeaderboard.cs" /> <Compile Include="Visual\TestCaseLeaderboard.cs" />
<Compile Include="Visual\TestCaseMedalOverlay.cs" /> <Compile Include="Visual\TestCaseMedalOverlay.cs" />
<Compile Include="Visual\TestCaseMenuButtonSystem.cs" /> <Compile Include="Visual\TestCaseButtonSystem.cs" />
<Compile Include="Visual\TestCaseMenuOverlays.cs" /> <Compile Include="Visual\TestCaseMenuOverlays.cs" />
<Compile Include="Visual\TestCaseMods.cs" /> <Compile Include="Visual\TestCaseMods.cs" />
<Compile Include="Visual\TestCaseMusicController.cs" /> <Compile Include="Visual\TestCaseMusicController.cs" />

View File

@ -12,7 +12,7 @@ namespace osu.Game.Beatmaps
public class BeatmapMetrics public class BeatmapMetrics
{ {
/// <summary> /// <summary>
/// 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?).
/// </summary> /// </summary>
public IEnumerable<int> Ratings { get; set; } public IEnumerable<int> Ratings { get; set; }

View File

@ -64,11 +64,7 @@ namespace osu.Game.Beatmaps.Drawables
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
} }, 300),
)
{
TimeBeforeLoad = 300,
},
new FillFlowContainer new FillFlowContainer
{ {
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,

View File

@ -35,6 +35,7 @@ namespace osu.Game.Database
var id = obj.ID; var id = obj.ID;
obj = lookupSource?.SingleOrDefault(t => t.ID == id) ?? context.Find<T>(id); obj = lookupSource?.SingleOrDefault(t => t.ID == id) ?? context.Find<T>(id);
context.Entry(obj).Reload();
} }
/// <summary> /// <summary>

View File

@ -20,6 +20,7 @@ namespace osu.Game.Graphics.UserInterface
private const Easing easing = Easing.InOutCubic; private const Easing easing = Easing.InOutCubic;
private float length; private float length;
/// <summary> /// <summary>
/// Length of the bar, ranges from 0 to 1 /// Length of the bar, ranges from 0 to 1
/// </summary> /// </summary>
@ -134,4 +135,4 @@ namespace osu.Game.Graphics.UserInterface
Vertical = TopToBottom | BottomToTop, Vertical = TopToBottom | BottomToTop,
Horizontal = LeftToRight | RightToLeft, Horizontal = LeftToRight | RightToLeft,
} }
} }

View File

@ -56,20 +56,17 @@ namespace osu.Game.Overlays.BeatmapSet
videoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 1 : 0, transition_duration); videoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 1 : 0, transition_duration);
cover?.FadeOut(400, Easing.Out); cover?.FadeOut(400, Easing.Out);
coverContainer.Add(cover = new DelayedLoadWrapper(new BeatmapSetCover(BeatmapSet) 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); Anchor = Anchor.Centre,
}, Origin = Anchor.Centre,
}) RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fill,
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
}, 300)
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
TimeBeforeLoad = 300
}); });
} }
} }
@ -232,7 +229,7 @@ namespace osu.Game.Overlays.BeatmapSet
protected override void Dispose(bool isDisposing) protected override void Dispose(bool isDisposing)
{ {
base.Dispose(isDisposing); base.Dispose(isDisposing);
beatmaps.BeatmapSetAdded -= handleBeatmapAdd; if (beatmaps != null) beatmaps.BeatmapSetAdded -= handleBeatmapAdd;
} }
private void handleBeatmapAdd(BeatmapSetInfo beatmap) private void handleBeatmapAdd(BeatmapSetInfo beatmap)

View File

@ -212,21 +212,21 @@ namespace osu.Game.Overlays.Direct
return icons; return icons;
} }
protected Drawable CreateBackground() => new DelayedLoadWrapper(new BeatmapSetCover(SetInfo) 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); Anchor = Anchor.Centre,
BlackBackground.Delay(400).FadeOut(); Origin = Anchor.Centre,
}, RelativeSizeAxes = Axes.Both,
}) FillMode = FillMode.Fill,
OnLoadComplete = d =>
{
d.FadeInFromZero(400, Easing.Out);
BlackBackground.Delay(400).FadeOut();
},
}, 300)
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
TimeBeforeLoad = 300
}; };
public class Statistic : FillFlowContainer public class Statistic : FillFlowContainer

View File

@ -146,18 +146,17 @@ namespace osu.Game.Overlays.Direct
loading = true; loading = true;
Add(new AsyncLoadWrapper(trackLoader = new TrackLoader($"https://b.ppy.sh/preview/{BeatmapSet.OnlineBeatmapSetID}.mp3") LoadComponentAsync(trackLoader = new TrackLoader($"https://b.ppy.sh/preview/{BeatmapSet.OnlineBeatmapSetID}.mp3"),
{ d =>
OnLoadComplete = d =>
{ {
// we may have been replaced by another loader // We may have been replaced by another loader
if (trackLoader != d) return; if (trackLoader != d) return;
Preview = (d as TrackLoader)?.Preview; Preview = d?.Preview;
Playing.TriggerChange(); Playing.TriggerChange();
loading = false; loading = false;
}, Add(trackLoader);
})); });
} }
private class TrackLoader : Drawable private class TrackLoader : Drawable

View File

@ -316,19 +316,16 @@ namespace osu.Game.Overlays.Profile
private void loadUser() private void loadUser()
{ {
coverContainer.Add(new AsyncLoadWrapper(new UserCoverBackground(user) LoadComponentAsync(new UserCoverBackground(user)
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
FillMode = FillMode.Fill, FillMode = FillMode.Fill,
OnLoadComplete = d => d.FadeInFromZero(200) OnLoadComplete = d => d.FadeInFromZero(200),
}) Depth = float.MaxValue,
{ },
Masking = true, coverContainer.Add);
RelativeSizeAxes = Axes.Both,
Depth = float.MaxValue
});
if (user.IsSupporter) supporterTag.Show(); if (user.IsSupporter) supporterTag.Show();

View File

@ -0,0 +1,134 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// 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> user = new Bindable<User>();
public KudosuInfo(Bindable<User> 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
}
}
};
}
}
}
}

View File

@ -1,6 +1,8 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // 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 namespace osu.Game.Overlays.Profile.Sections
{ {
public class KudosuSection : ProfileSection public class KudosuSection : ProfileSection
@ -8,5 +10,13 @@ namespace osu.Game.Overlays.Profile.Sections
public override string Title => "Kudosu!"; public override string Title => "Kudosu!";
public override string Identifier => "kudosu"; public override string Identifier => "kudosu";
public KudosuSection()
{
Children = new[]
{
new KudosuInfo(User),
};
}
} }
} }

View File

@ -97,7 +97,7 @@ namespace osu.Game.Overlays
//new MedalsSection(), //new MedalsSection(),
new HistoricalSection(), new HistoricalSection(),
new BeatmapsSection(), new BeatmapsSection(),
//new KudosuSection() new KudosuSection()
}; };
tabs = new ProfileTabControl tabs = new ProfileTabControl
{ {

View File

@ -228,16 +228,16 @@ namespace osu.Game.Screens.Multiplayer
if (value != null) if (value != null)
{ {
coverContainer.FadeIn(transition_duration); coverContainer.FadeIn(transition_duration);
coverContainer.Children = new[]
LoadComponentAsync(new BeatmapSetCover(value.BeatmapSet)
{ {
new AsyncLoadWrapper(new BeatmapSetCover(value.BeatmapSet) Anchor = Anchor.Centre,
{ Origin = Anchor.Centre,
Anchor = Anchor.Centre, FillMode = FillMode.Fill,
Origin = Anchor.Centre, OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
FillMode = FillMode.Fill, },
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), coverContainer.Add);
}) { RelativeSizeAxes = Axes.Both },
};
beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title); beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title);
beatmapDash.Text = @" - "; beatmapDash.Text = @" - ";

View File

@ -329,17 +329,16 @@ namespace osu.Game.Screens.Multiplayer
if (value != null) if (value != null)
{ {
coverContainer.FadeIn(transition_duration); coverContainer.FadeIn(transition_duration);
coverContainer.Children = new[]
LoadComponentAsync(new BeatmapSetCover(value.BeatmapSet)
{ {
new AsyncLoadWrapper(new BeatmapSetCover(value.BeatmapSet) RelativeSizeAxes = Axes.Both,
{ Anchor = Anchor.Centre,
RelativeSizeAxes = Axes.Both, Origin = Anchor.Centre,
Anchor = Anchor.Centre, FillMode = FillMode.Fill,
Origin = Anchor.Centre, OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
FillMode = FillMode.Fill, },
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), coverContainer.Add);
}) { RelativeSizeAxes = Axes.Both },
};
beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title); beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title);
beatmapDash.Text = @" - "; beatmapDash.Text = @" - ";

View File

@ -46,6 +46,8 @@ namespace osu.Game.Screens.Play
public bool HasFailed { get; private set; } public bool HasFailed { get; private set; }
public bool AllowPause { get; set; } = true;
public int RestartCount; public int RestartCount;
private IAdjustableClock adjustableSourceClock; private IAdjustableClock adjustableSourceClock;
@ -158,7 +160,7 @@ namespace osu.Game.Screens.Play
FramedClock = offsetClock, FramedClock = offsetClock,
OnRetry = Restart, OnRetry = Restart,
OnQuit = Exit, OnQuit = Exit,
CheckCanPause = () => ValidForResume && !HasFailed && !RulesetContainer.HasReplayLoaded, CheckCanPause = () => AllowPause && ValidForResume && !HasFailed && !RulesetContainer.HasReplayLoaded,
Retries = RestartCount, Retries = RestartCount,
OnPause = () => { OnPause = () => {
hudOverlay.KeyCounter.IsCounting = pauseContainer.IsPaused; hudOverlay.KeyCounter.IsCounting = pauseContainer.IsPaused;
@ -248,7 +250,10 @@ namespace osu.Game.Screens.Play
storyboard = beatmap.Storyboard.CreateDrawable(Beatmap.Value); storyboard = beatmap.Storyboard.CreateDrawable(Beatmap.Value);
storyboard.Masking = true; 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() public void Restart()
@ -352,7 +357,7 @@ namespace osu.Game.Screens.Play
protected override bool OnExiting(Screen next) protected override bool OnExiting(Screen next)
{ {
if (HasFailed || !ValidForResume || pauseContainer?.AllowExit != false || RulesetContainer?.HasReplayLoaded != false) if (!AllowPause || HasFailed || !ValidForResume || pauseContainer?.AllowExit != false || RulesetContainer?.HasReplayLoaded != false)
{ {
// In the case of replays, we may have changed the playback rate. // In the case of replays, we may have changed the playback rate.
applyRateFromMods(); applyRateFromMods();

View File

@ -29,11 +29,17 @@ namespace osu.Game.Screens.Select.Details
if (value == metrics) return; if (value == metrics) return;
metrics = value; metrics = value;
var ratings = Metrics.Ratings.ToList(); const int rating_range = 10;
negativeRatings.Text = ratings.GetRange(0, ratings.Count / 2 + 1).Sum().ToString();
positiveRatings.Text = ratings.GetRange(ratings.Count / 2 + 1, ratings.Count / 2).Sum().ToString(); var ratings = Metrics.Ratings.ToList().GetRange(1, rating_range); // adjust for API returning weird empty data at 0.
ratingsBar.Length = (float)ratings.GetRange(0, ratings.Count / 2 + 1).Sum() / ratings.Sum();
graph.Values = Metrics.Ratings.Select(r => (float)r); var negativeCount = ratings.GetRange(0, 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.GetRange(0, rating_range).Select(r => (float)r);
} }
} }

View File

@ -33,7 +33,7 @@ namespace osu.Game.Screens.Select.Leaderboards
private Box background; private Box background;
private Container content; private Container content;
private Container avatar; private Drawable avatar;
private DrawableRank scoreRank; private DrawableRank scoreRank;
private OsuSpriteText nameLabel; private OsuSpriteText nameLabel;
private GlowingSpriteText scoreLabel; private GlowingSpriteText scoreLabel;
@ -97,7 +97,7 @@ namespace osu.Game.Screens.Select.Leaderboards
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding(edge_margin), Padding = new MarginPadding(edge_margin),
Children = new Drawable[] Children = new[]
{ {
avatar = new DelayedLoadWrapper( avatar = new DelayedLoadWrapper(
new Avatar(Score.User) new Avatar(Score.User)
@ -114,7 +114,6 @@ namespace osu.Game.Screens.Select.Leaderboards
}, },
}) })
{ {
TimeBeforeLoad = 500,
RelativeSizeAxes = Axes.None, RelativeSizeAxes = Axes.None,
Size = new Vector2(HEIGHT - edge_margin * 2, HEIGHT - edge_margin * 2), 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() 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(); d.FadeOut();
Alpha = 0; Alpha = 0;

View File

@ -203,8 +203,8 @@ namespace osu.Game.Screens.Select
Push(new Editor()); Push(new Editor());
} }
private void onBeatmapRestored(BeatmapInfo b) => carousel.UpdateBeatmap(b); private void onBeatmapRestored(BeatmapInfo b) => Schedule(() => carousel.UpdateBeatmap(b));
private void onBeatmapHidden(BeatmapInfo b) => carousel.UpdateBeatmap(b); private void onBeatmapHidden(BeatmapInfo b) => Schedule(() => carousel.UpdateBeatmap(b));
private void carouselBeatmapsLoaded() private void carouselBeatmapsLoaded()
{ {

View File

@ -0,0 +1,48 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// 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
{
/// <summary>
/// A test case which can be used to test a screen (that relies on OnEntering being called to execute startup instructions).
/// </summary>
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);
}
}
}
}

View File

@ -17,14 +17,12 @@ using OpenTK.Graphics;
namespace osu.Game.Tests.Visual namespace osu.Game.Tests.Visual
{ {
public abstract class TestCasePlayer : OsuTestCase public abstract class TestCasePlayer : ScreenTestCase
{ {
private readonly Type ruleset; private readonly Type ruleset;
protected Player Player; protected Player Player;
public override string Description => @"Showing everything to play the game.";
/// <summary> /// <summary>
/// Create a TestCase which runs through the Player screen. /// Create a TestCase which runs through the Player screen.
/// </summary> /// </summary>
@ -46,6 +44,7 @@ namespace osu.Game.Tests.Visual
{ {
RelativeSizeAxes = Framework.Graphics.Axes.Both, RelativeSizeAxes = Framework.Graphics.Axes.Both,
Colour = Color4.Black, Colour = Color4.Black,
Depth = int.MaxValue
}); });
string instantiation = ruleset?.AssemblyQualifiedName; string instantiation = ruleset?.AssemblyQualifiedName;
@ -79,19 +78,17 @@ namespace osu.Game.Tests.Visual
if (Player != null) if (Player != null)
Remove(Player); 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,
{ AllowPause = false
InitialBeatmap = beatmap };
};
}
private const string test_beatmap_data = private const string test_beatmap_data =
@"osu file format v14 @"osu file format v14
[General] [General]
AudioLeadIn: 500 AudioLeadIn: 500

View File

@ -11,7 +11,7 @@ namespace osu.Game.Users
/// </summary> /// </summary>
public class UpdateableAvatar : Container public class UpdateableAvatar : Container
{ {
private Container displayedAvatar; private Drawable displayedAvatar;
private User user; private User user;
@ -40,11 +40,13 @@ namespace osu.Game.Users
{ {
displayedAvatar?.FadeOut(300); displayedAvatar?.FadeOut(300);
displayedAvatar?.Expire(); displayedAvatar?.Expire();
Add(displayedAvatar = new DelayedLoadWrapper(new Avatar(user) Add(displayedAvatar = new DelayedLoadWrapper(
{ new Avatar(user)
RelativeSizeAxes = Axes.Both, {
OnLoadComplete = d => d.FadeInFromZero(200), RelativeSizeAxes = Axes.Both,
})); OnLoadComplete = d => d.FadeInFromZero(200),
})
);
} }
} }
} }

View File

@ -58,14 +58,14 @@ namespace osu.Game.Users
Children = new Drawable[] Children = new Drawable[]
{ {
new AsyncLoadWrapper(new UserCoverBackground(user) new DelayedLoadWrapper(new UserCoverBackground(user)
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
FillMode = FillMode.Fill, FillMode = FillMode.Fill,
OnLoadComplete = d => d.FadeInFromZero(200), OnLoadComplete = d => d.FadeInFromZero(200),
}) { RelativeSizeAxes = Axes.Both }, }, 0) { RelativeSizeAxes = Axes.Both },
new Box new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,

View File

@ -292,6 +292,7 @@
<Compile Include="Overlays\BeatmapSet\Scores\ScoresContainer.cs" /> <Compile Include="Overlays\BeatmapSet\Scores\ScoresContainer.cs" />
<Compile Include="Online\API\Requests\GetUserBeatmapsRequest.cs" /> <Compile Include="Online\API\Requests\GetUserBeatmapsRequest.cs" />
<Compile Include="Overlays\Profile\Sections\Beatmaps\PaginatedBeatmapContainer.cs" /> <Compile Include="Overlays\Profile\Sections\Beatmaps\PaginatedBeatmapContainer.cs" />
<Compile Include="Overlays\Profile\Sections\Kudosu\KudosuInfo.cs" />
<Compile Include="Overlays\Profile\Sections\PaginatedContainer.cs" /> <Compile Include="Overlays\Profile\Sections\PaginatedContainer.cs" />
<Compile Include="Overlays\Profile\Sections\Ranks\DrawablePerformanceScore.cs" /> <Compile Include="Overlays\Profile\Sections\Ranks\DrawablePerformanceScore.cs" />
<Compile Include="Overlays\Profile\Sections\Ranks\PaginatedScoreContainer.cs" /> <Compile Include="Overlays\Profile\Sections\Ranks\PaginatedScoreContainer.cs" />
@ -783,6 +784,7 @@
<Compile Include="Tests\Beatmaps\TestWorkingBeatmap.cs" /> <Compile Include="Tests\Beatmaps\TestWorkingBeatmap.cs" />
<Compile Include="Tests\Platform\TestStorage.cs" /> <Compile Include="Tests\Platform\TestStorage.cs" />
<Compile Include="Tests\Visual\OsuTestCase.cs" /> <Compile Include="Tests\Visual\OsuTestCase.cs" />
<Compile Include="Tests\Visual\ScreenTestCase.cs" />
<Compile Include="Tests\Visual\TestCasePlayer.cs" /> <Compile Include="Tests\Visual\TestCasePlayer.cs" />
<Compile Include="Users\Avatar.cs" /> <Compile Include="Users\Avatar.cs" />
<Compile Include="Users\Country.cs" /> <Compile Include="Users\Country.cs" />