1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 15:57:24 +08:00

Rename logo-related methods

This commit is contained in:
Dean Herbert 2017-11-08 16:34:03 +09:00
parent a8bacd1ed4
commit c2d4a213b1
6 changed files with 33 additions and 24 deletions

View File

@ -17,9 +17,9 @@ namespace osu.Game.Screens
ValidForResume = false; ValidForResume = false;
} }
protected override void LogoSetup(OsuLogo logo, bool resuming) protected override void OnArrivedLogo(OsuLogo logo, bool resuming)
{ {
base.LogoSetup(logo, resuming); base.OnArrivedLogo(logo, resuming);
logo.RelativePositionAxes = Axes.Both; logo.RelativePositionAxes = Axes.Both;
logo.Triangles = false; logo.Triangles = false;

View File

@ -109,9 +109,9 @@ namespace osu.Game.Screens.Menu
public const int EXIT_DELAY = 3000; public const int EXIT_DELAY = 3000;
protected override void LogoSetup(OsuLogo logo, bool resuming) protected override void OnArrivedLogo(OsuLogo logo, bool resuming)
{ {
base.LogoSetup(logo, resuming); base.OnArrivedLogo(logo, resuming);
logo.RelativePositionAxes = Axes.Both; logo.RelativePositionAxes = Axes.Both;

View File

@ -103,9 +103,9 @@ namespace osu.Game.Screens.Menu
Beatmap.ValueChanged += beatmap_ValueChanged; Beatmap.ValueChanged += beatmap_ValueChanged;
} }
protected override void LogoSetup(OsuLogo logo, bool resuming) protected override void OnArrivedLogo(OsuLogo logo, bool resuming)
{ {
base.LogoSetup(logo, resuming); base.OnArrivedLogo(logo, resuming);
buttons.SetOsuLogo(logo); buttons.SetOsuLogo(logo);
@ -119,7 +119,7 @@ namespace osu.Game.Screens.Menu
buttons.State = MenuState.TopLevel; buttons.State = MenuState.TopLevel;
} }
protected override void LogoOnSuspending(OsuLogo logo) protected override void OnSuspendingLogo(OsuLogo logo)
{ {
logo.FadeOut(300, Easing.InSine) logo.FadeOut(300, Easing.InSine)
.ScaleTo(0.2f, 300, Easing.InSine) .ScaleTo(0.2f, 300, Easing.InSine)

View File

@ -76,14 +76,14 @@ 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(() => LogoSetup(logo, true)); logo.DelayUntilTransformsFinished().Schedule(() => OnArrivedLogo(logo, true));
sampleExit?.Play(); sampleExit?.Play();
} }
protected override void OnSuspending(Screen next) protected override void OnSuspending(Screen next)
{ {
base.OnSuspending(next); base.OnSuspending(next);
logoOnSuspending(); onSuspendingLogo();
} }
protected override void OnEntering(Screen last) protected override void OnEntering(Screen last)
@ -122,13 +122,13 @@ namespace osu.Game.Screens
base.OnEntering(last); base.OnEntering(last);
logo.DelayUntilTransformsFinished().Schedule(() => LogoSetup(logo, false)); logo.DelayUntilTransformsFinished().Schedule(() => OnArrivedLogo(logo, false));
} }
protected override bool OnExiting(Screen next) protected override bool OnExiting(Screen next)
{ {
if (ValidForResume && logo != null) if (ValidForResume && logo != null)
logoOnExiting(); onExitingLogo();
OsuScreen nextOsu = next as OsuScreen; OsuScreen nextOsu = next as OsuScreen;
@ -148,29 +148,38 @@ namespace osu.Game.Screens
return false; return false;
} }
protected virtual void LogoSetup(OsuLogo logo, bool resuming) /// <summary>
/// Fired when this screen was entered or resumed and the logo state is required to be adjusted.
/// </summary>
protected virtual void OnArrivedLogo(OsuLogo logo, bool resuming)
{ {
logo.Action = null; logo.Action = null;
logo.FadeOut(300, Easing.OutQuint); logo.FadeOut(300, Easing.OutQuint);
} }
private void logoOnExiting() private void onExitingLogo()
{ {
logo.ClearTransforms(); logo.ClearTransforms();
LogoOnExiting(logo); OnExitingLogo(logo);
} }
protected virtual void LogoOnExiting(OsuLogo logo) /// <summary>
/// Fired when this screen was exited to add any outwards transition to the logo.
/// </summary>
protected virtual void OnExitingLogo(OsuLogo logo)
{ {
} }
private void logoOnSuspending() private void onSuspendingLogo()
{ {
logo.ClearTransforms(); logo.ClearTransforms();
LogoOnSuspending(logo); OnSuspendingLogo(logo);
} }
protected virtual void LogoOnSuspending(OsuLogo logo) /// <summary>
/// Fired when this screen was suspended to add any outwards transition to the logo.
/// </summary>
protected virtual void OnSuspendingLogo(OsuLogo logo)
{ {
} }
} }

View File

@ -95,9 +95,9 @@ namespace osu.Game.Screens.Play
this.Delay(2150).Schedule(pushWhenLoaded); this.Delay(2150).Schedule(pushWhenLoaded);
} }
protected override void LogoSetup(OsuLogo logo, bool resuming) protected override void OnArrivedLogo(OsuLogo logo, bool resuming)
{ {
base.LogoSetup(logo, resuming); base.OnArrivedLogo(logo, resuming);
logo.ClearTransforms(targetMember: nameof(Position)); logo.ClearTransforms(targetMember: nameof(Position));
logo.RelativePositionAxes = Axes.Both; logo.RelativePositionAxes = Axes.Both;

View File

@ -311,9 +311,9 @@ namespace osu.Game.Screens.Select
private const double logo_transition = 250; private const double logo_transition = 250;
protected override void LogoSetup(OsuLogo logo, bool resuming) protected override void OnArrivedLogo(OsuLogo logo, bool resuming)
{ {
base.LogoSetup(logo, resuming); base.OnArrivedLogo(logo, resuming);
logo.ClearTransforms(); logo.ClearTransforms();
logo.RelativePositionAxes = Axes.Both; logo.RelativePositionAxes = Axes.Both;
@ -337,9 +337,9 @@ namespace osu.Game.Screens.Select
logo.Action = () => carouselRaisedStart(); logo.Action = () => carouselRaisedStart();
} }
protected override void LogoOnExiting(OsuLogo logo) protected override void OnExitingLogo(OsuLogo logo)
{ {
base.LogoOnExiting(logo); base.OnExitingLogo(logo);
logo.ScaleTo(0.2f, logo_transition, Easing.OutQuint); logo.ScaleTo(0.2f, logo_transition, Easing.OutQuint);
logo.FadeOut(logo_transition, Easing.OutQuint); logo.FadeOut(logo_transition, Easing.OutQuint);
} }