diff --git a/osu.Android.props b/osu.Android.props
index 8c24df5c2e..90d131b117 100644
--- a/osu.Android.props
+++ b/osu.Android.props
@@ -52,6 +52,6 @@
-
+
diff --git a/osu.Game.Tests/Visual/Playlists/TestScenePlaylistsRoomSubScreen.cs b/osu.Game.Tests/Visual/Playlists/TestScenePlaylistsRoomSubScreen.cs
index 319c2bc6fd..264004b6c3 100644
--- a/osu.Game.Tests/Visual/Playlists/TestScenePlaylistsRoomSubScreen.cs
+++ b/osu.Game.Tests/Visual/Playlists/TestScenePlaylistsRoomSubScreen.cs
@@ -11,11 +11,13 @@ using osu.Framework.Platform;
using osu.Framework.Screens;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
+using osu.Game.Online.API;
using osu.Game.Online.Rooms;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Osu;
using osu.Game.Screens.OnlinePlay;
using osu.Game.Screens.OnlinePlay.Playlists;
+using osu.Game.Screens.Play;
using osu.Game.Tests.Beatmaps;
using osu.Game.Users;
using osuTK.Input;
@@ -24,8 +26,6 @@ namespace osu.Game.Tests.Visual.Playlists
{
public class TestScenePlaylistsRoomSubScreen : RoomTestScene
{
- protected override bool UseOnlineAPI => true;
-
[Cached(typeof(IRoomManager))]
private readonly TestRoomManager roomManager = new TestRoomManager();
@@ -41,6 +41,18 @@ namespace osu.Game.Tests.Visual.Playlists
Dependencies.Cache(manager = new BeatmapManager(LocalStorage, ContextFactory, rulesets, null, audio, host, Beatmap.Default));
manager.Import(new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo.BeatmapSet).Wait();
+
+ ((DummyAPIAccess)API).HandleRequest = req =>
+ {
+ switch (req)
+ {
+ case CreateRoomScoreRequest createRoomScoreRequest:
+ createRoomScoreRequest.TriggerSuccess(new APIScoreToken { ID = 1 });
+ return true;
+ }
+
+ return false;
+ };
}
[SetUpSteps]
@@ -59,12 +71,16 @@ namespace osu.Game.Tests.Visual.Playlists
Room.Name.Value = "my awesome room";
Room.Host.Value = new User { Id = 2, Username = "peppy" };
Room.RecentParticipants.Add(Room.Host.Value);
+ Room.EndDate.Value = DateTimeOffset.Now.AddMinutes(5);
Room.Playlist.Add(new PlaylistItem
{
Beatmap = { Value = new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo },
Ruleset = { Value = new OsuRuleset().RulesetInfo }
});
});
+
+ AddStep("start match", () => match.ChildrenOfType().First().Click());
+ AddUntilStep("player loader loaded", () => Stack.CurrentScreen is PlayerLoader);
}
[Test]
diff --git a/osu.Game/Screens/OnlinePlay/Match/RoomSubScreen.cs b/osu.Game/Screens/OnlinePlay/Match/RoomSubScreen.cs
index 68bdd9160e..375aac729d 100644
--- a/osu.Game/Screens/OnlinePlay/Match/RoomSubScreen.cs
+++ b/osu.Game/Screens/OnlinePlay/Match/RoomSubScreen.cs
@@ -150,7 +150,11 @@ namespace osu.Game.Screens.OnlinePlay.Match
protected void StartPlay()
{
sampleStart?.Play();
- ParentScreen?.Push(CreateGameplayScreen());
+
+ // fallback is to allow this class to operate when there is no parent OnlineScreen (testing purposes).
+ var targetScreen = (Screen)ParentScreen ?? this;
+
+ targetScreen.Push(CreateGameplayScreen());
}
///
diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs
index fa18b792c3..783b8b4bf2 100644
--- a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs
+++ b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs
@@ -27,6 +27,7 @@ using osu.Game.Screens.OnlinePlay.Match.Components;
using osu.Game.Screens.OnlinePlay.Multiplayer.Match;
using osu.Game.Screens.OnlinePlay.Multiplayer.Participants;
using osu.Game.Screens.OnlinePlay.Multiplayer.Spectate;
+using osu.Game.Screens.Play;
using osu.Game.Screens.Play.HUD;
using osu.Game.Users;
using osuTK;
@@ -452,7 +453,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
return new MultiSpectatorScreen(userIds);
default:
- return new MultiplayerPlayer(SelectedItem.Value, userIds);
+ return new PlayerLoader(() => new MultiplayerPlayer(SelectedItem.Value, userIds));
}
}
diff --git a/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsRoomSubScreen.cs b/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsRoomSubScreen.cs
index 11bc55823f..26ee21a2c3 100644
--- a/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsRoomSubScreen.cs
+++ b/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsRoomSubScreen.cs
@@ -13,6 +13,7 @@ using osu.Game.Online.Rooms;
using osu.Game.Screens.OnlinePlay.Components;
using osu.Game.Screens.OnlinePlay.Match;
using osu.Game.Screens.OnlinePlay.Match.Components;
+using osu.Game.Screens.Play;
using osu.Game.Screens.Play.HUD;
using osu.Game.Users;
using osuTK;
@@ -271,9 +272,9 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
}, true);
}
- protected override Screen CreateGameplayScreen() => new PlaylistsPlayer(SelectedItem.Value)
+ protected override Screen CreateGameplayScreen() => new PlayerLoader(() => new PlaylistsPlayer(SelectedItem.Value)
{
Exited = () => leaderboard.RefreshScores()
- };
+ });
}
}
diff --git a/osu.Game/Skinning/Editor/SkinComponentToolbox.cs b/osu.Game/Skinning/Editor/SkinComponentToolbox.cs
index 8536cba139..59420bfc87 100644
--- a/osu.Game/Skinning/Editor/SkinComponentToolbox.cs
+++ b/osu.Game/Skinning/Editor/SkinComponentToolbox.cs
@@ -10,6 +10,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;
using osu.Framework.Input.Events;
+using osu.Framework.Utils;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
@@ -29,8 +30,8 @@ namespace osu.Game.Skinning.Editor
[Cached]
private ScoreProcessor scoreProcessor = new ScoreProcessor
{
- Combo = { Value = 727 },
- TotalScore = { Value = 1337377 }
+ Combo = { Value = RNG.Next(1, 1000) },
+ TotalScore = { Value = RNG.Next(1000, 10000000) }
};
[Cached(typeof(HealthProcessor))]
diff --git a/osu.Game/Skinning/Editor/SkinEditor.cs b/osu.Game/Skinning/Editor/SkinEditor.cs
index 6427d6298b..f24b0c71c0 100644
--- a/osu.Game/Skinning/Editor/SkinEditor.cs
+++ b/osu.Game/Skinning/Editor/SkinEditor.cs
@@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System;
+using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
@@ -193,14 +194,16 @@ namespace osu.Game.Skinning.Editor
SelectedComponents.Add(component);
}
+ private IEnumerable availableTargets => targetScreen.ChildrenOfType();
+
private ISkinnableTarget getTarget(SkinnableTarget target)
{
- return targetScreen.ChildrenOfType().FirstOrDefault(c => c.Target == target);
+ return availableTargets.FirstOrDefault(c => c.Target == target);
}
private void revert()
{
- SkinnableTargetContainer[] targetContainers = targetScreen.ChildrenOfType().ToArray();
+ ISkinnableTarget[] targetContainers = availableTargets.ToArray();
foreach (var t in targetContainers)
{
@@ -216,7 +219,7 @@ namespace osu.Game.Skinning.Editor
if (!hasBegunMutating)
return;
- SkinnableTargetContainer[] targetContainers = targetScreen.ChildrenOfType().ToArray();
+ ISkinnableTarget[] targetContainers = availableTargets.ToArray();
foreach (var t in targetContainers)
currentSkin.Value.UpdateDrawableTarget(t);
@@ -237,5 +240,11 @@ namespace osu.Game.Skinning.Editor
{
this.FadeOut(TRANSITION_DURATION, Easing.OutQuint);
}
+
+ public void DeleteItems(ISkinnableDrawable[] items)
+ {
+ foreach (var item in items)
+ availableTargets.FirstOrDefault(t => t.Components.Contains(item))?.Remove(item);
+ }
}
}
diff --git a/osu.Game/Skinning/Editor/SkinSelectionHandler.cs b/osu.Game/Skinning/Editor/SkinSelectionHandler.cs
index 9bcdc6e08b..7931a5ec41 100644
--- a/osu.Game/Skinning/Editor/SkinSelectionHandler.cs
+++ b/osu.Game/Skinning/Editor/SkinSelectionHandler.cs
@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using osu.Framework.Allocation;
using osu.Framework.Extensions.EnumExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
@@ -17,6 +18,9 @@ namespace osu.Game.Skinning.Editor
{
public class SkinSelectionHandler : SelectionHandler
{
+ [Resolved]
+ private SkinEditor skinEditor { get; set; }
+
public override bool HandleRotation(float angle)
{
// TODO: this doesn't correctly account for origin/anchor specs being different in a multi-selection.
@@ -72,14 +76,8 @@ namespace osu.Game.Skinning.Editor
SelectionBox.CanReverse = false;
}
- protected override void DeleteItems(IEnumerable items)
- {
- foreach (var i in items)
- {
- ((Drawable)i).Expire();
- SelectedItems.Remove(i);
- }
- }
+ protected override void DeleteItems(IEnumerable items) =>
+ skinEditor.DeleteItems(items.ToArray());
protected override IEnumerable