Merge remote-tracking branch 'upstream/master' into fix-replay-clock

This commit is contained in:
Dean Herbert 2017-11-13 20:03:29 +09:00
commit ae6d4aa38d
10 changed files with 41 additions and 24 deletions

View File

@ -51,7 +51,9 @@ namespace osu.Game.Input.Bindings
protected override void Dispose(bool isDisposing) protected override void Dispose(bool isDisposing)
{ {
base.Dispose(isDisposing); base.Dispose(isDisposing);
store.KeyBindingChanged -= ReloadMappings;
if (store != null)
store.KeyBindingChanged -= ReloadMappings;
} }
protected override void ReloadMappings() => KeyBindings = store.Query(ruleset?.ID, variant).ToList(); protected override void ReloadMappings() => KeyBindings = store.Query(ruleset?.ID, variant).ToList();

View File

@ -212,6 +212,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
nestedHitObjects = new List<DrawableHitObject<TObject>>(); nestedHitObjects = new List<DrawableHitObject<TObject>>();
h.OnJudgement += (d, j) => OnJudgement?.Invoke(d, j); h.OnJudgement += (d, j) => OnJudgement?.Invoke(d, j);
h.OnJudgementRemoved += (d, j) => OnJudgementRemoved?.Invoke(d, j);
nestedHitObjects.Add(h); nestedHitObjects.Add(h);
} }

View File

@ -242,7 +242,7 @@ namespace osu.Game.Rulesets.UI
OnJudgement?.Invoke(j); OnJudgement?.Invoke(j);
}; };
drawableObject.OnJudgementRemoved += (d, j) => { OnJudgementRemoved?.Invoke(j); }; drawableObject.OnJudgementRemoved += (d, j) => OnJudgementRemoved?.Invoke(j);
Playfield.Add(drawableObject); Playfield.Add(drawableObject);
} }

View File

@ -24,7 +24,6 @@ namespace osu.Game.Screens
{ {
base.LogoArriving(logo, resuming); base.LogoArriving(logo, resuming);
logo.RelativePositionAxes = Axes.None;
logo.Triangles = false; logo.Triangles = false;
logo.Origin = Anchor.BottomRight; logo.Origin = Anchor.BottomRight;
logo.Anchor = Anchor.BottomRight; logo.Anchor = Anchor.BottomRight;
@ -47,11 +46,7 @@ namespace osu.Game.Screens
protected override void LogoSuspending(OsuLogo logo) protected override void LogoSuspending(OsuLogo logo)
{ {
base.LogoSuspending(logo); base.LogoSuspending(logo);
logo.FadeOut(100).OnComplete(l => logo.FadeOut(100);
{
l.Anchor = Anchor.TopLeft;
l.Origin = Anchor.Centre;
});
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]

View File

@ -127,8 +127,6 @@ namespace osu.Game.Screens.Menu
if (!resuming) if (!resuming)
{ {
logo.Triangles = true;
logo.ScaleTo(1); logo.ScaleTo(1);
logo.FadeIn(); logo.FadeIn();
logo.PlayIntro(); logo.PlayIntro();

View File

@ -112,9 +112,6 @@ namespace osu.Game.Screens.Menu
buttons.SetOsuLogo(logo); buttons.SetOsuLogo(logo);
logo.Triangles = true;
logo.Ripple = false;
logo.FadeColour(Color4.White, 100, Easing.OutQuint); logo.FadeColour(Color4.White, 100, Easing.OutQuint);
logo.FadeIn(100, Easing.OutQuint); logo.FadeIn(100, Easing.OutQuint);

View File

@ -221,6 +221,30 @@ namespace osu.Game.Screens.Menu
}; };
} }
/// <summary>
/// Schedule a new extenral animation. Handled queueing and finishing previous animations in a sane way.
/// </summary>
/// <param name="action">The animation to be performed</param>
/// <param name="waitForPrevious">If true, the new animation is delayed until all previous transforms finish. If false, existing transformed are cleared.</param>
internal void AppendAnimatingAction(Action action, bool waitForPrevious)
{
Action runnableAction = () =>
{
if (waitForPrevious)
this.DelayUntilTransformsFinished().Schedule(action);
else
{
ClearTransforms();
action();
}
};
if (IsLoaded)
runnableAction();
else
Schedule(() => runnableAction());
}
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(TextureStore textures, AudioManager audio) private void load(TextureStore textures, AudioManager audio)
{ {

View File

@ -76,7 +76,7 @@ namespace osu.Game.Screens
protected override void OnResuming(Screen last) protected override void OnResuming(Screen last)
{ {
base.OnResuming(last); base.OnResuming(last);
logo.DelayUntilTransformsFinished().Schedule(() => LogoArriving(logo, true)); logo.AppendAnimatingAction(() => LogoArriving(logo, true), true);
sampleExit?.Play(); sampleExit?.Play();
} }
@ -118,11 +118,11 @@ namespace osu.Game.Screens
} }
if ((logo = lastOsu?.logo) == null) if ((logo = lastOsu?.logo) == null)
LoadComponentAsync(logo = new OsuLogo(), AddInternal); LoadComponentAsync(logo = new OsuLogo { Alpha = 0 }, AddInternal);
logo.AppendAnimatingAction(() => LogoArriving(logo, false), true);
base.OnEntering(last); base.OnEntering(last);
logo.DelayUntilTransformsFinished().Schedule(() => LogoArriving(logo, false));
} }
protected override bool OnExiting(Screen next) protected override bool OnExiting(Screen next)
@ -155,12 +155,16 @@ namespace osu.Game.Screens
{ {
logo.Action = null; logo.Action = null;
logo.FadeOut(300, Easing.OutQuint); logo.FadeOut(300, Easing.OutQuint);
logo.Anchor = Anchor.TopLeft;
logo.Origin = Anchor.Centre;
logo.RelativePositionAxes = Axes.None;
logo.Triangles = true;
logo.Ripple = true;
} }
private void onExitingLogo() private void onExitingLogo()
{ {
logo.ClearTransforms(); logo.AppendAnimatingAction(() => { LogoExiting(logo); }, false);
LogoExiting(logo);
} }
/// <summary> /// <summary>
@ -172,8 +176,7 @@ namespace osu.Game.Screens
private void onSuspendingLogo() private void onSuspendingLogo()
{ {
logo.ClearTransforms(); logo.AppendAnimatingAction(() => { LogoSuspending(logo); }, false);
LogoSuspending(logo);
} }
/// <summary> /// <summary>

View File

@ -99,7 +99,6 @@ namespace osu.Game.Screens.Play
{ {
base.LogoArriving(logo, resuming); base.LogoArriving(logo, resuming);
logo.ClearTransforms(targetMember: nameof(Position));
logo.RelativePositionAxes = Axes.Both; logo.RelativePositionAxes = Axes.Both;
logo.ScaleTo(new Vector2(0.15f), 300, Easing.In); logo.ScaleTo(new Vector2(0.15f), 300, Easing.In);

View File

@ -315,9 +315,7 @@ namespace osu.Game.Screens.Select
{ {
base.LogoArriving(logo, resuming); base.LogoArriving(logo, resuming);
logo.ClearTransforms();
logo.RelativePositionAxes = Axes.Both; logo.RelativePositionAxes = Axes.Both;
Vector2 position = new Vector2(0.95f, 0.96f); Vector2 position = new Vector2(0.95f, 0.96f);
if (logo.Alpha > 0.8f) if (logo.Alpha > 0.8f)