Skip to content

Commit

Permalink
Rename FailAnimation to FailAnimationContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Oct 7, 2023
1 parent 7c7771a commit e520716
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
namespace osu.Game.Screens.Play
{
/// <summary>
/// Manage the animation to be applied when a player fails.
/// Manage the animation to be applied when a player fails. Applies the animation to children.
/// Single use and automatically disposed after use.
/// </summary>
public partial class FailAnimation : Container
public partial class FailAnimationContainer : Container
{
public Action? OnComplete;

Expand Down Expand Up @@ -66,7 +66,7 @@ public partial class FailAnimation : Container
/// </summary>
public BackgroundScreen? Background { private get; set; }

public FailAnimation(DrawableRuleset drawableRuleset)
public FailAnimationContainer(DrawableRuleset drawableRuleset)
{
this.drawableRuleset = drawableRuleset;

Expand Down
14 changes: 7 additions & 7 deletions osu.Game/Screens/Play/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ private void load(OsuConfigManager config, OsuGameBase game, CancellationToken c

rulesetSkinProvider.AddRange(new Drawable[]
{
failAnimationLayer = new FailAnimation(DrawableRuleset)
failAnimationContainer = new FailAnimationContainer(DrawableRuleset)
{
OnComplete = onFailComplete,
Children = new[]
Expand Down Expand Up @@ -310,7 +310,7 @@ private void load(OsuConfigManager config, OsuGameBase game, CancellationToken c
// add the overlay components as a separate step as they proxy some elements from the above underlay/gameplay components.
// also give the overlays the ruleset skin provider to allow rulesets to potentially override HUD elements (used to disable combo counters etc.)
// we may want to limit this in the future to disallow rulesets from outright replacing elements the user expects to be there.
failAnimationLayer.Add(createOverlayComponents(Beatmap.Value));
failAnimationContainer.Add(createOverlayComponents(Beatmap.Value));

if (!DrawableRuleset.AllowGameplayOverlays)
{
Expand Down Expand Up @@ -587,7 +587,7 @@ protected void PerformExit(bool showDialogFirst)
// if the fail animation is currently in progress, accelerate it (it will show the pause dialog on completion).
if (ValidForResume && GameplayState.HasFailed)
{
failAnimationLayer.FinishTransforms(true);
failAnimationContainer.FinishTransforms(true);
return;
}

Expand Down Expand Up @@ -888,7 +888,7 @@ private void updateLeaderboardExpandedState() =>

protected FailOverlay FailOverlay { get; private set; }

private FailAnimation failAnimationLayer;
private FailAnimationContainer failAnimationContainer;

private bool onFail()
{
Expand All @@ -913,7 +913,7 @@ private bool onFail()
if (PauseOverlay.State.Value == Visibility.Visible)
PauseOverlay.Hide();

failAnimationLayer.Start();
failAnimationContainer.Start();

if (GameplayState.Mods.OfType<IApplicableFailOverride>().Any(m => m.RestartOnFail))
Restart(true);
Expand Down Expand Up @@ -1044,7 +1044,7 @@ public override void OnEntering(ScreenTransitionEvent e)

b.StoryboardReplacesBackground.BindTo(storyboardReplacesBackground);

failAnimationLayer.Background = b;
failAnimationContainer.Background = b;
});

HUDOverlay.IsPlaying.BindTo(localUserPlaying);
Expand Down Expand Up @@ -1099,7 +1099,7 @@ public override bool OnExiting(ScreenExitEvent e)
screenSuspension?.RemoveAndDisposeImmediately();

// Eagerly clean these up as disposal of child components is asynchronous and may leave sounds playing beyond user expectations.
failAnimationLayer?.Stop();
failAnimationContainer?.Stop();
PauseOverlay?.StopAllSamples();

if (LoadedBeatmapSuccessfully)
Expand Down

0 comments on commit e520716

Please sign in to comment.