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

Merge pull request #7372 from peppy/fix-replay-import

Fix replay import from main menu causing a hard crash
This commit is contained in:
Dan Balasescu 2019-12-27 23:10:23 +09:00 committed by GitHub
commit 6c5e25a13a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 20 deletions

View File

@ -118,8 +118,6 @@ namespace osu.Game.Screens.Play
}, },
idleTracker = new IdleTracker(750) idleTracker = new IdleTracker(750)
}); });
loadNewPlayer();
} }
protected override void LoadComplete() protected override void LoadComplete()
@ -127,6 +125,21 @@ namespace osu.Game.Screens.Play
base.LoadComplete(); base.LoadComplete();
inputManager = GetContainingInputManager(); inputManager = GetContainingInputManager();
}
public override void OnEntering(IScreen last)
{
base.OnEntering(last);
loadNewPlayer();
content.ScaleTo(0.7f);
Background?.FadeColour(Color4.White, 800, Easing.OutQuint);
contentIn();
info.Delay(750).FadeIn(500);
this.Delay(1800).Schedule(pushWhenLoaded);
if (!muteWarningShownOnce.Value) if (!muteWarningShownOnce.Value)
{ {
@ -179,19 +192,6 @@ namespace osu.Game.Screens.Play
content.FadeOut(250); content.FadeOut(250);
} }
public override void OnEntering(IScreen last)
{
base.OnEntering(last);
content.ScaleTo(0.7f);
Background?.FadeColour(Color4.White, 800, Easing.OutQuint);
contentIn();
info.Delay(750).FadeIn(500);
this.Delay(1800).Schedule(pushWhenLoaded);
}
protected override void LogoArriving(OsuLogo logo, bool resuming) protected override void LogoArriving(OsuLogo logo, bool resuming)
{ {
base.LogoArriving(logo, resuming); base.LogoArriving(logo, resuming);

View File

@ -2,7 +2,7 @@
// 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; using System;
using osu.Framework.Allocation; using osu.Framework.Screens;
using osu.Game.Scoring; using osu.Game.Scoring;
namespace osu.Game.Screens.Play namespace osu.Game.Screens.Play
@ -20,15 +20,13 @@ namespace osu.Game.Screens.Play
scoreInfo = score.ScoreInfo; scoreInfo = score.ScoreInfo;
} }
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) public override void OnEntering(IScreen last)
{ {
var dependencies = base.CreateChildDependencies(parent);
// these will be reverted thanks to PlayerLoader's lease. // these will be reverted thanks to PlayerLoader's lease.
Mods.Value = scoreInfo.Mods; Mods.Value = scoreInfo.Mods;
Ruleset.Value = scoreInfo.Ruleset; Ruleset.Value = scoreInfo.Ruleset;
return dependencies; base.OnEntering(last);
} }
} }
} }