1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 02:32:55 +08:00

Add final osu! resume screen implementation

This commit is contained in:
Dean Herbert 2019-03-25 19:21:25 +09:00
parent 38e481686f
commit c79d187a89
2 changed files with 13 additions and 3 deletions

View File

@ -1,8 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.Linq; using System.Linq;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Input.Handlers; using osu.Game.Input.Handlers;
@ -15,6 +14,7 @@ using osu.Game.Rulesets.Osu.Replays;
using osu.Game.Rulesets.Osu.Scoring; using osu.Game.Rulesets.Osu.Scoring;
using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI; using osu.Game.Rulesets.UI;
using osu.Game.Screens.Play;
namespace osu.Game.Rulesets.Osu.UI namespace osu.Game.Rulesets.Osu.UI
{ {
@ -35,6 +35,8 @@ namespace osu.Game.Rulesets.Osu.UI
protected override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new OsuPlayfieldAdjustmentContainer(); protected override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new OsuPlayfieldAdjustmentContainer();
protected override ResumeOverlay CreateResumeOverlay() => new OsuResumeOverlay();
public override DrawableHitObject<OsuHitObject> GetVisualRepresentation(OsuHitObject h) public override DrawableHitObject<OsuHitObject> GetVisualRepresentation(OsuHitObject h)
{ {
switch (h) switch (h)

View File

@ -1,4 +1,4 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation; using osu.Framework.Allocation;
@ -150,6 +150,13 @@ namespace osu.Game.Rulesets.UI
Overlays = new Container { RelativeSizeAxes = Axes.Both } Overlays = new Container { RelativeSizeAxes = Axes.Both }
}; };
if ((ResumeOverlay = CreateResumeOverlay()) != null)
{
AddInternal(CreateInputManager()
.WithChild(CreatePlayfieldAdjustmentContainer()
.WithChild(ResumeOverlay)));
}
applyRulesetMods(mods, config); applyRulesetMods(mods, config);
loadObjects(); loadObjects();
@ -173,6 +180,7 @@ namespace osu.Game.Rulesets.UI
{ {
if (ResumeOverlay != null && (Cursor == null || Contains(Cursor.ActiveCursor.ScreenSpaceDrawQuad.Centre))) if (ResumeOverlay != null && (Cursor == null || Contains(Cursor.ActiveCursor.ScreenSpaceDrawQuad.Centre)))
{ {
ResumeOverlay.GameplayCursor = Cursor;
ResumeOverlay.ResumeAction = continueResume; ResumeOverlay.ResumeAction = continueResume;
ResumeOverlay.Show(); ResumeOverlay.Show();
} }