mirror of
https://github.com/ppy/osu.git
synced 2026-05-30 14:10:32 +08:00
Update logo tracking operations to use IDisposable flow
This commit is contained in:
@@ -73,7 +73,8 @@ namespace osu.Game.Screens.Menu
|
||||
else
|
||||
{
|
||||
// We should stop tracking as the facade is now out of scope.
|
||||
logoTrackingContainer.StopTracking();
|
||||
logoTracking?.Dispose();
|
||||
logoTracking = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -390,6 +391,7 @@ namespace osu.Game.Screens.Menu
|
||||
}
|
||||
|
||||
private ScheduledDelegate? logoDelayedAction;
|
||||
private IDisposable? logoTracking;
|
||||
|
||||
private void updateLogoState(ButtonSystemState lastState = ButtonSystemState.Initial)
|
||||
{
|
||||
@@ -402,7 +404,8 @@ namespace osu.Game.Screens.Menu
|
||||
logoDelayedAction?.Cancel();
|
||||
logoDelayedAction = Scheduler.AddDelayed(() =>
|
||||
{
|
||||
logoTrackingContainer.StopTracking();
|
||||
logoTracking?.Dispose();
|
||||
logoTracking = null;
|
||||
|
||||
game?.Toolbar.Hide();
|
||||
|
||||
@@ -429,7 +432,7 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
logo.ScaleTo(0.5f, 200, Easing.In);
|
||||
|
||||
logoTrackingContainer.StartTracking(logo, 200, Easing.In);
|
||||
logoTracking = logoTrackingContainer.StartTracking(logo, 200, Easing.In);
|
||||
|
||||
logoDelayedAction?.Cancel();
|
||||
logoDelayedAction = Scheduler.AddDelayed(() =>
|
||||
@@ -451,7 +454,7 @@ namespace osu.Game.Screens.Menu
|
||||
break;
|
||||
|
||||
case ButtonSystemState.EnteringMode:
|
||||
logoTrackingContainer.StartTracking(logo, lastState == ButtonSystemState.Initial ? MainMenu.FADE_OUT_DURATION : 0, Easing.InSine);
|
||||
logoTracking = logoTrackingContainer.StartTracking(logo, lastState == ButtonSystemState.Initial ? MainMenu.FADE_OUT_DURATION : 0, Easing.InSine);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user