Skip to content

aa - #107

Merged
winnerspiros merged 2 commits into
winnerspiros:masterfrom
ppy:master
Mar 27, 2026
Merged

aa#107
winnerspiros merged 2 commits into
winnerspiros:masterfrom
ppy:master

Conversation

@winnerspiros

@winnerspiros winnerspiros commented Mar 27, 2026

Copy link
Copy Markdown
Owner

Summary by Gitar

  • Editor background fix:
    • Resolved editor displaying no background when storyboard without background replacement is disabled

This will update automatically on new commits.

Summary by CodeRabbit

  • New Features

    • Background music now plays during gameplay warmup countdown.
  • Bug Fixes

    • Background sprite visibility now correctly responds when the storyboard is toggled off in the editor.
  • Changes

    • Improved music playback handling across matchmaking screens.

smoogipoo and others added 2 commits March 27, 2026 14:18
- Simplifies track handling by not attaching to the global beatmap, not
looping, and moving into `GameplayWarmupScreen` where the beatmap is
set.
- The main idea here is that the transition period until gameplay is so
short (~10 seconds) that we don't need to account for the track ever
looping in the first place.
- Fixes the track not playing from its preview point (feedback item
mentioned in some meeting a while back).

This is definitely going to conflict with @nekodex 's work, sorry about
that. It's a bit of a much-of-a-muchness change (imo) if the conclusion
is to wait for ongoing work first.
…eplace background is disabled (#37112)

Man this "storyboard replaces background" baloney has taken hours of
bugfixing alone. So many forehead indentations from stepping onto this
stupid rake.

This still fails in one more case: when you download a no-video variant
of a beatmap that has video, but then edit it, all of the flags on
storyboard will claim that the beatmap has a storyboard that replaces a
background, but the video asset is missing, so the background will still
be black. There's currently no way to check for this and the simplest
way to address this as far as I can see would be reverting
#37038 and going with the non-refactor
route to fix #36875 instead. The
alternative is adding all sorts of weird jingles and checks in the
storyboard machinery that can be used to be able to tell that a video
was supposed to be present in the storyboard but is missing.

Also when entering editor on a map that has background video and
storyboard enabled the background will be black until you hit play.
Something to do with `Video` idiosyncrasies for sure.

Closes #37104 maybe? Kind of?
Partially? I don't know. This is all very low effort because I'm not
confident about digging this ditch any deeper, but just PRing a direct
revert would feel pretty offensive I guess?
Copilot AI review requested due to automatic review settings March 27, 2026 09:52
@winnerspiros
winnerspiros merged commit 92102f5 into winnerspiros:master Mar 27, 2026
3 of 11 checks passed
@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7cfc2216-b778-421e-930c-694f766510b2

📥 Commits

Reviewing files that changed from the base of the PR and between b63daf9 and 522d2bd.

📒 Files selected for processing (3)
  • osu.Game/Screens/Backgrounds/EditorBackgroundScreen.cs
  • osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/GameplayWarmupScreen.cs
  • osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/RankedPlayScreen.cs

📝 Walkthrough

Walkthrough

The changes refactor audio playback management in ranked play screens by removing complex music looping logic from RankedPlayScreen and centralizing playback control in GameplayWarmupScreen, while EditorBackgroundScreen gains background sprite opacity animation based on storyboard visibility state.

Changes

Cohort / File(s) Summary
Background Animation
osu.Game/Screens/Backgrounds/EditorBackgroundScreen.cs
Added sprite opacity animation that fades the background sprite to 0 when storyboard is shown, or to 1 otherwise, alongside existing storyboard fade behavior.
Audio Playback Refactoring
osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/RankedPlayScreen.cs, osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/GameplayWarmupScreen.cs
Removed music controller dependency and track looping logic from RankedPlayScreen (lifecycle methods now use previewTrackManager); GameplayWarmupScreen now assumes responsibility for audio playback by adding musicController dependency and triggering playback during LoadComplete().

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A sprite now fades when stories bloom,
While music's reins pass to a brighter room,
Old loops unwind, complexity shed,
The warmup takes the track ahead!
Cleaner paths for sound to spread. 🎵

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates audio preview handling for Ranked Play flow and adjusts editor background visibility when toggling storyboards.

Changes:

  • Remove RankedPlayScreen’s beatmap-track looping management and instead stop any preview playback on suspend/exit.
  • Start playback from the beatmap preview point during Ranked Play gameplay warmup.
  • Ensure the editor background sprite is shown when the storyboard is hidden.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/RankedPlayScreen.cs Removes looping/track-handling hooks and standardises preview stop on suspend/exit.
osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/GameplayWarmupScreen.cs Adds MusicController usage to start the selected beatmap’s track from its preview point.
osu.Game/Screens/Backgrounds/EditorBackgroundScreen.cs Adds sprite fade logic intended to prevent missing backgrounds when storyboards are disabled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +170 to +171
// Play the new track from its preview point.
globalBeatmap.Value.PrepareTrackForPreview(false);

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PrepareTrackForPreview(false) sets Track.Looping = false. If the warmup lasts long enough for the beatmap track to complete, MusicController will advance to the next track (see onTrackCompleted()), which would desync music from the selected beatmap. This should likely prepare the track with looping enabled (or otherwise ensure the track can’t complete while waiting).

Suggested change
// Play the new track from its preview point.
globalBeatmap.Value.PrepareTrackForPreview(false);
// Play the new track from its preview point, looping during warmup to avoid completion.
globalBeatmap.Value.PrepareTrackForPreview(true);

Copilot uses AI. Check for mistakes.
background?.Storyboard.FadeTo(showStoryboard.Value ? 1 : 0, withAnimation ? 500 : 0, Easing.OutQuint);
// if the storyboard is disabled, in some cases (e.g. involving `StoryboardReplacesBackground`)
// we still need to show the background sprite, because if we don't, then there will be no background shown at all
background?.Sprite.FadeTo(showStoryboard.Value ? 0 : 1, withAnimation ? 500 : 0, Easing.OutQuint);

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updateState() now fades the background sprite to 0 whenever showStoryboard is enabled. This hides the beatmap background even for storyboards that don’t replace the background, which can result in a blank/incorrect background. Consider only hiding background.Sprite when the loaded storyboard actually replaces the background (eg background.Beatmap.Storyboard.ReplacesBackground), and otherwise keep the sprite visible while the storyboard is shown.

Suggested change
background?.Sprite.FadeTo(showStoryboard.Value ? 0 : 1, withAnimation ? 500 : 0, Easing.OutQuint);
bool storyboardReplacesBackground = background?.Beatmap?.Storyboard?.ReplacesBackground ?? false;
float targetBackgroundAlpha = showStoryboard.Value && storyboardReplacesBackground ? 0 : 1;
background?.Sprite.FadeTo(targetBackgroundAlpha, withAnimation ? 500 : 0, Easing.OutQuint);

Copilot uses AI. Check for mistakes.
This was referenced Mar 31, 2026
Merged
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Apr 9, 2026
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants