mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 03:15:45 +08:00
Merge branch 'single-osu-logo' into intro-v2
This commit is contained in:
commit
cabb22b6d1
@ -1 +1 @@
|
||||
Subproject commit 3c074a0981844fbaa9f2ecbf879c542f07e2b94d
|
||||
Subproject commit ded020da31505c124fa0414e85816e6201f235ed
|
@ -17,9 +17,9 @@ namespace osu.Game.Screens
|
||||
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.Triangles = false;
|
||||
|
@ -326,8 +326,6 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
private bool trackingPosition;
|
||||
|
||||
public void SetLogoTracking(bool value) => trackingPosition = value;
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
//if (OsuGame.IdleTime > 6000 && State != MenuState.Exit)
|
||||
|
@ -111,9 +111,9 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
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;
|
||||
|
||||
|
@ -106,9 +106,9 @@ namespace osu.Game.Screens.Menu
|
||||
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);
|
||||
|
||||
@ -122,7 +122,7 @@ namespace osu.Game.Screens.Menu
|
||||
buttons.State = MenuState.TopLevel;
|
||||
}
|
||||
|
||||
protected override void LogoOnSuspending(OsuLogo logo)
|
||||
protected override void OnSuspendingLogo(OsuLogo logo)
|
||||
{
|
||||
logo.FadeOut(300, Easing.InSine)
|
||||
.ScaleTo(0.2f, 300, Easing.InSine)
|
||||
|
@ -230,27 +230,6 @@ namespace osu.Game.Screens.Menu
|
||||
ripple.Texture = textures.Get(@"Menu/logo");
|
||||
}
|
||||
|
||||
private double? reservationEndTime;
|
||||
private Action<OsuLogo> reservationCallback;
|
||||
|
||||
private bool canFulfillReservation => !reservationEndTime.HasValue || reservationEndTime <= Time.Current;
|
||||
|
||||
public void RequestUsage(Action<OsuLogo> callback)
|
||||
{
|
||||
reservationCallback = callback;
|
||||
}
|
||||
|
||||
private void fulfillReservation()
|
||||
{
|
||||
reservationCallback(this);
|
||||
reservationCallback = null;
|
||||
}
|
||||
|
||||
public void ReserveFor(float duration)
|
||||
{
|
||||
reservationEndTime = Time.Current + duration;
|
||||
}
|
||||
|
||||
private int lastBeatIndex;
|
||||
|
||||
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
|
||||
@ -328,9 +307,6 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
triangles.Velocity = paused_velocity;
|
||||
}
|
||||
|
||||
if (reservationCallback != null && canFulfillReservation)
|
||||
fulfillReservation();
|
||||
}
|
||||
|
||||
private bool interactive => Action != null && Alpha > 0.2f;
|
||||
|
@ -76,14 +76,14 @@ namespace osu.Game.Screens
|
||||
protected override void OnResuming(Screen last)
|
||||
{
|
||||
base.OnResuming(last);
|
||||
logo.DelayUntilTransformsFinished().Schedule(() => logoSetup(true));
|
||||
logo.DelayUntilTransformsFinished().Schedule(() => OnArrivedLogo(logo, true));
|
||||
sampleExit?.Play();
|
||||
}
|
||||
|
||||
protected override void OnSuspending(Screen next)
|
||||
{
|
||||
base.OnSuspending(next);
|
||||
logoOnSuspending();
|
||||
onSuspendingLogo();
|
||||
}
|
||||
|
||||
protected override void OnEntering(Screen last)
|
||||
@ -122,13 +122,13 @@ namespace osu.Game.Screens
|
||||
|
||||
base.OnEntering(last);
|
||||
|
||||
logo.DelayUntilTransformsFinished().Schedule(() => logoSetup(false));
|
||||
logo.DelayUntilTransformsFinished().Schedule(() => OnArrivedLogo(logo, false));
|
||||
}
|
||||
|
||||
protected override bool OnExiting(Screen next)
|
||||
{
|
||||
if (ValidForResume && logo != null)
|
||||
logoOnExiting();
|
||||
onExitingLogo();
|
||||
|
||||
OsuScreen nextOsu = next as OsuScreen;
|
||||
|
||||
@ -148,31 +148,38 @@ namespace osu.Game.Screens
|
||||
return false;
|
||||
}
|
||||
|
||||
private void logoSetup(bool resuming) => LogoSetup(logo, resuming);
|
||||
|
||||
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.FadeOut(300, Easing.OutQuint);
|
||||
}
|
||||
|
||||
private void logoOnExiting()
|
||||
private void onExitingLogo()
|
||||
{
|
||||
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();
|
||||
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)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -95,9 +95,9 @@ namespace osu.Game.Screens.Play
|
||||
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.RelativePositionAxes = Axes.Both;
|
||||
|
@ -311,9 +311,9 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
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.RelativePositionAxes = Axes.Both;
|
||||
@ -337,9 +337,9 @@ namespace osu.Game.Screens.Select
|
||||
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.FadeOut(logo_transition, Easing.OutQuint);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user