Skip to content

Commit 55ae7e8

Browse files
authored
Fix timing of beatmap break overlay (#35566)
Issue was bisected to [this commit](6f1664f) This change in the commit outlined is what caused the issue: ```diff BreakOverlay = new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor) { Clock = DrawableRuleset.FrameStableClock, ProcessCustomClock = false, - Breaks = working.Beatmap.Breaks + BreakTracker = breakTracker, }, ``` `BreakTracker` always initializes breaks as `new Period(b.StartTime, b.EndTime - BreakOverlay.BREAK_FADE_DURATION);` leaving room at the end to account for the fade before resuming gameplay. Because of this, changing the `BreakOverlay` to use a `BreakTracker` instead of the original beatmap breaks caused each break to be `BREAK_FADE_DURATION` shorter than it was originally - which in this case is 325ms - leading to the discrepancy between the background fadeout and the overlay fadeout. Since the current behavior is 'correct', aligning the overlay with the rest of the beatmap such as background fadeout, I changed the timing to account for the shorter duration instead of revert the overlay initialization.
1 parent 4a22ef8 commit 55ae7e8

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

osu.Game/Screens/Play/BreakOverlay.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint,
165165

166166
private void updateDisplay(ValueChangedEvent<Period?> period)
167167
{
168-
FinishTransforms(true);
169168
Scheduler.CancelDelayedTasks();
170169

171170
if (period.NewValue == null)
@@ -180,20 +179,20 @@ private void updateDisplay(ValueChangedEvent<Period?> period)
180179

181180
remainingTimeAdjustmentBox
182181
.ResizeWidthTo(remaining_time_container_max_size, BREAK_FADE_DURATION, Easing.OutQuint)
183-
.Delay(b.Duration - BREAK_FADE_DURATION)
182+
.Delay(b.Duration)
184183
.ResizeWidthTo(0);
185184

186185
remainingTimeBox.ResizeWidthTo(remainingTimeForCurrentPeriod);
187186

188-
remainingTimeCounter.CountTo(b.Duration).CountTo(0, b.Duration);
187+
remainingTimeCounter.CountTo(b.Duration + BREAK_FADE_DURATION).CountTo(0, b.Duration + BREAK_FADE_DURATION);
189188

190189
remainingTimeCounter.MoveToX(-50)
191190
.MoveToX(0, BREAK_FADE_DURATION, Easing.OutQuint);
192191

193192
info.MoveToX(50)
194193
.MoveToX(0, BREAK_FADE_DURATION, Easing.OutQuint);
195194

196-
using (BeginDelayedSequence(b.Duration - BREAK_FADE_DURATION))
195+
using (BeginDelayedSequence(b.Duration))
197196
{
198197
fadeContainer.FadeOut(BREAK_FADE_DURATION);
199198
breakArrows.Hide(BREAK_FADE_DURATION);

osu.Game/Screens/Play/LetterboxOverlay.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ protected override void LoadComplete()
6161

6262
private void updateDisplay(ValueChangedEvent<Period?> period)
6363
{
64-
FinishTransforms(true);
65-
6664
if (period.NewValue == null)
6765
return;
6866

@@ -71,7 +69,7 @@ private void updateDisplay(ValueChangedEvent<Period?> period)
7169
using (BeginAbsoluteSequence(b.Start))
7270
{
7371
fadeContainer.FadeInFromZero(BreakOverlay.BREAK_FADE_DURATION);
74-
using (BeginDelayedSequence(b.Duration - BreakOverlay.BREAK_FADE_DURATION))
72+
using (BeginDelayedSequence(b.Duration))
7573
fadeContainer.FadeOut(BreakOverlay.BREAK_FADE_DURATION);
7674
}
7775
}

0 commit comments

Comments
 (0)