1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-25 14:10:48 +08:00

Remove beat sync from skip / break overlay

This didn't end up feeling as good as I hoped. Will revise at a later
stage, adding beat sync in another way that isn't jank transforms on the
progress bars.

Also closes https://github.com/ppy/osu/issues/35972.
This commit is contained in:
Dean Herbert
2025-12-17 16:38:46 +09:00
Unverified
parent 3b635f6919
commit b07cd2daa4
2 changed files with 5 additions and 46 deletions
+3 -30
View File
@@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Audio.Track;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
@@ -10,10 +9,9 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Beatmaps.ControlPoints;
using osu.Framework.Utils;
using osu.Game.Beatmaps.Timing;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring;
using osu.Game.Screens.Play.Break;
@@ -21,7 +19,7 @@ using osu.Game.Utils;
namespace osu.Game.Screens.Play
{
public partial class BreakOverlay : BeatSyncedContainer
public partial class BreakOverlay : Container
{
/// <summary>
/// The duration of the break overlay fading.
@@ -51,12 +49,6 @@ namespace osu.Game.Screens.Play
this.scoreProcessor = scoreProcessor;
RelativeSizeAxes = Axes.Both;
MinimumBeatLength = 200;
// Doesn't play well with pause/unpause.
// This might mean that some beats don't animate if the user is running <60fps, but we'll deal with that if anyone notices.
AllowMistimedEventFiring = false;
Child = fadeContainer = new Container
{
Alpha = 0,
@@ -142,25 +134,8 @@ namespace osu.Game.Screens.Play
{
base.Update();
remainingTimeBox.Width = (float)Interpolation.DampContinuously(remainingTimeBox.Width, remainingTimeForCurrentPeriod, 40, Math.Abs(Time.Elapsed));
remainingTimeBox.Height = Math.Min(8, remainingTimeBox.DrawWidth);
// Keep things simple by resetting beat synced transforms on a rewind.
if (Clock.ElapsedFrameTime < 0)
{
remainingTimeBox.ClearTransforms(targetMember: nameof(Width));
remainingTimeBox.Width = remainingTimeForCurrentPeriod;
}
}
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
{
base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes);
if (currentPeriod.Value == null)
return;
float timeBoxTargetWidth = (float)Math.Max(0, remainingTimeForCurrentPeriod - timingPoint.BeatLength / currentPeriod.Value.Value.Duration);
remainingTimeBox.ResizeWidthTo(timeBoxTargetWidth, timingPoint.BeatLength * 3.5, Easing.OutQuint);
}
private void updateDisplay(ValueChangedEvent<Period?> period)
@@ -182,8 +157,6 @@ namespace osu.Game.Screens.Play
.Delay(b.Duration)
.ResizeWidthTo(0);
remainingTimeBox.ResizeWidthTo(remainingTimeForCurrentPeriod);
remainingTimeCounter.CountTo(b.Duration + BREAK_FADE_DURATION).CountTo(0, b.Duration + BREAK_FADE_DURATION);
remainingTimeCounter.MoveToX(-50)
+2 -16
View File
@@ -9,7 +9,6 @@ using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Audio.Track;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
@@ -20,7 +19,6 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Framework.Utils;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Containers;
@@ -32,7 +30,7 @@ using osuTK.Graphics;
namespace osu.Game.Screens.Play
{
public partial class SkipOverlay : BeatSyncedContainer, IKeyBindingHandler<GlobalAction>
public partial class SkipOverlay : Container, IKeyBindingHandler<GlobalAction>
{
/// <summary>
/// The total number of successful skips performed by this overlay.
@@ -191,7 +189,7 @@ namespace osu.Game.Screens.Play
double progress = Math.Max(0, 1 - (gameplayClock.CurrentTime - displayTime) / (fadeOutBeginTime - displayTime));
RemainingTimeBox.Width = (float)Interpolation.Lerp(RemainingTimeBox.Width, progress, Math.Clamp(Time.Elapsed / 40, 0, 1));
RemainingTimeBox.Width = (float)Interpolation.DampContinuously(RemainingTimeBox.Width, progress, 40, Math.Abs(Time.Elapsed));
inSkipPeriod.Value = progress > 0;
buttonContainer.State.Value = inSkipPeriod.Value ? Visibility.Visible : Visibility.Hidden;
@@ -227,18 +225,6 @@ namespace osu.Game.Screens.Play
{
}
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, ChannelAmplitudes amplitudes)
{
base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes);
if (fadeOutBeginTime <= gameplayClock.CurrentTime)
return;
float progress = (float)(gameplayClock.CurrentTime - displayTime) / (float)(fadeOutBeginTime - displayTime);
float newWidth = 1 - Math.Clamp(progress, 0, 1);
RemainingTimeBox.ResizeWidthTo(newWidth, timingPoint.BeatLength * 3.5, Easing.OutQuint);
}
public partial class FadeContainer : Container, IStateful<Visibility>
{
[CanBeNull]