Skip to content

a - #217

Merged
winnerspiros merged 10 commits into
winnerspiros:masterfrom
ppy:master
Apr 20, 2026
Merged

a#217
winnerspiros merged 10 commits into
winnerspiros:masterfrom
ppy:master

Conversation

@winnerspiros

@winnerspiros winnerspiros commented Apr 20, 2026

Copy link
Copy Markdown
Owner

Summary by Gitar

  • Audio management:
    • Added a call to StopAllSamples() in RankedResultsScreen to ensure audio stops immediately when exiting the screen.

This will update automatically on new commits.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added mod track adjustment configuration for ranked play
  • Bug Fixes

    • Fixed potential division issues in graph rendering
    • Improved beatmap display functionality
    • Enhanced multiplier value formatting
    • Fixed card ordering during removal operations
    • Added proper audio cleanup on screen exit
  • Tests

    • Added tests for card drag removal scenarios
    • Added interactive multiplier testing
    • Added audio cleanup verification tests
  • Refactor

    • Improved audio sample management architecture
  • Chores

    • Updated logging configuration

smoogipoo and others added 10 commits April 20, 2026 12:29
Best that can be done for the time being.
Previously the current stage overlay would not display the decimal part
of the damage multiplier.

Resolves #37357.
Feedback that this can be annoying when waiting for a match with the
game in the background for several minutes. Agree with this.
People doing stupid shit submitting stupid errors we don't care about.
Closes: #37402

Issue was `HandOfCards.CardContainer.Compare` working under the
assumption that the it would never be called with the same child for
both entries, which can happen when doing a `BinarySearch` (called in
`RemoveInternal`).
This lead to `IndexOf` returning a negative value despite the card being
present in the container, and the drawable getting disposed but not
actually removed.

I also included a precautionary `cardContainer.Sort()` call before the
removal as well, seemed to work without that from testing but better not
rely on that.

TLDR: card container child sorting was unstable due to poor assumptions
Exposed to be running by 48434dd which
caused test failures.

You'd think that the `IsDeployedBuild` check would catch it but it
doesn't. `IsDeployedBuild` is `AssemblyVersion.Major > 0`, and the
assembly version is taken from the entry assembly. In tests the entry
assembly is either resharper or nunit.
Closes #37345

Aside from
9f4b1c8,
this also tweaks the grid sizings on mobile which were the secondary
cause of the android crashes. I'm bothering because it looked awful even
with the primary crash fixed.

Only tested on android. I wanted to test visually on iOS but rider
doesn't want to talk to xcode *or* my iPhone anymore, so I give up.

| before | after |
| :-: | :-: |
| <img width="2400" height="1080"
alt="Screenshot_2026-04-20-12-04-17-44_25a1a32208bbcdc1d450b7aa854bb161"
src="https://github.com/user-attachments/assets/e9bac850-7256-4a0d-8358-992490e1381d"
/> | <img width="2400" height="1080"
alt="Screenshot_2026-04-20-12-07-35-26_25a1a32208bbcdc1d450b7aa854bb161"
src="https://github.com/user-attachments/assets/a525485e-f2b5-4252-ae50-dc84c29945ec"
/> |
Intends to close #37408.

I have got to say, the way ranked play apparently re-invents screen
sub-stacks *again* in a slightly different way to everything else before
had me *very* confused as to why things I would expect to get called
aren't getting called.
Copilot AI review requested due to automatic review settings April 20, 2026 14:23
@gitar-bot

gitar-bot Bot commented Apr 20, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

@winnerspiros
winnerspiros merged commit 14c0471 into winnerspiros:master Apr 20, 2026
7 of 10 checks passed
@coderabbitai

coderabbitai Bot commented Apr 20, 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: 2528036e-523e-4756-b46e-a73b587c87d9

📥 Commits

Reviewing files that changed from the base of the PR and between d44d76d and 8691004.

📒 Files selected for processing (12)
  • osu.Game.Tests/Visual/RankedPlay/TestScenePlayerCardHand.cs
  • osu.Game.Tests/Visual/RankedPlay/TestSceneRankedPlayStageOverlay.cs
  • osu.Game.Tests/Visual/RankedPlay/TestSceneResultsScreen.cs
  • osu.Game/Screens/OnlinePlay/Matchmaking/Queue/RatingDistributionGraph.cs
  • osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs
  • osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/Card/RankedPlayCardContent.cs
  • osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/Hand/HandOfCards.cs
  • osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/RankedPlayScreen.cs
  • osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/RankedPlayStageOverlay.cs
  • osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/ResultsScreen.MainPanel.cs
  • osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/ResultsScreen.cs
  • osu.Game/Utils/SentryLogger.cs

📝 Walkthrough

Walkthrough

This pull request introduces audio handling improvements, test enhancements, and targeted bug fixes across the osu game codebase. Changes include converting audio samples to drawable components, adding guards for division operations, modifying card removal logic, extending test coverage, and adjusting UI responsiveness for mobile platforms.

Changes

Cohort / File(s) Summary
Test Additions
osu.Game.Tests/Visual/RankedPlay/TestScenePlayerCardHand.cs, osu.Game.Tests/Visual/RankedPlay/TestSceneResultsScreen.cs
Added two new NUnit test methods: TestRemoveCardsWhileDragging to verify card removal during drag operations, and TestAllSamplesStopOnExit (marked [Explicit]) to exercise audio sample stopping behavior on screen exit.
Test Slider Enhancement
osu.Game.Tests/Visual/RankedPlay/TestSceneRankedPlayStageOverlay.cs
Modified TestBasic to drive the overlay's multiplier value from a slider control instead of a fixed constant, enabling manual testing of varying multiplier settings.
Audio Sample Refactoring
osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/ResultsScreen.MainPanel.cs, osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/ResultsScreen.cs
Converted audio sample storage from Sample to DrawableSample with an internal AudioContainer. Added StopAllSamples() method and integrated sample cleanup into the exit flow via OnExiting() override.
Waiting Loop Audio Handling
osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs
Changed waiting-loop audio from Sample field to DrawableSample in drawable tree. Updated playback logic with animated volume transitions and adjusted mobile grid row height responsiveness.
Card Removal & Ordering
osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/Hand/HandOfCards.cs
Ensured immediate sorting before card removal to maintain container consistency, and refactored CardContainer.Compare to use CompareTo on drag state with fallback to Order comparison.
Safe Division Guards
osu.Game/Screens/OnlinePlay/Matchmaking/Queue/RatingDistributionGraph.cs
Added conditional checks to prevent division by zero in VerticalLine and HorizontalLine size calculations when parent draw quad dimensions are non-positive.
Screen Configuration & Activity
osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/RankedPlayScreen.cs
Added overrides for mod track adjustment enablement and external beatmap ruleset change prevention. Initialized activity to UserActivity.InLobby and forwarded exit notifications to active sub-screens.
Beatmap Display & Multiplier Formatting
osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/RankedPlayCardContent.cs, osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/RankedPlayStageOverlay.cs
Changed card context menu to fetch beatmaps by online identifier instead of direct set display. Updated multiplier text formatting to use ToStandardFormattedString(maxDecimalDigits: 1) for decimal precision.
Debug & Testing Configuration
osu.Game/Utils/SentryLogger.cs
Added guard to skip Sentry initialization when running under NUnit. Changed Sentry DSN to localhost for testing purposes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • aa #137: Directly related to the new card removal test; the linked PR modifies HandOfCards drag state, ordering, and removal logic that the test exercises.
  • a #177: Directly related through RankedPlayStageOverlay modifications; both PRs adjust the same class initialization and multiplier handling behavior.

Poem

🐰 Cards shuffle, samples sing, and lines divide with care,
Audio flows through drawables in the testing air,
Guards prevent the zero curse, mobile layouts shine,
A ranked play grows stronger, one fix at a time! 🎮✨

✨ 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

This PR adjusts several matchmaking / ranked-play UI and audio behaviours, adds a couple of safety fixes, and updates/extends visual tests.

Changes:

  • Add exit-time audio silencing/stopping hooks for ranked-play results and queue waiting loop, plus a manual visual test for results audio.
  • Fix card-hand removal ordering edge case during dragging, tweak stage overlay multiplier formatting, and adjust queue layout for mobile.
  • Guard against division-by-zero in rating distribution graph line sizing.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
osu.Game/Utils/SentryLogger.cs Skips Sentry initialisation under NUnit; modifies Sentry DSN initialisation.
osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/ResultsScreen.cs Tracks the loaded results MainPanel and stops/mutes samples on exit.
osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/ResultsScreen.MainPanel.cs Refactors samples to DrawableSample under an AudioContainer; adds StopAllSamples().
osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/RankedPlayStageOverlay.cs Formats multiplier text via standard formatting (1 decimal).
osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/RankedPlayScreen.cs Sets lobby activity and ensures subscreen exit hook is called during screen exit.
osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/Hand/HandOfCards.cs Forces a sort before removal to avoid binary-search/remove issues during per-frame reordering.
osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/Card/RankedPlayCardContent.cs Updates context menu action to fetch/show beatmap by online ID.
osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs Moves waiting-loop to DrawableSample, adds fade-out behaviour, and adjusts layout sizing on mobile.
osu.Game/Screens/OnlinePlay/Matchmaking/Queue/RatingDistributionGraph.cs Adds zero-size guards to prevent divide-by-zero when computing 1px line thickness.
osu.Game.Tests/Visual/RankedPlay/TestSceneResultsScreen.cs Adds an explicit manual test for verifying results audio stops on exit.
osu.Game.Tests/Visual/RankedPlay/TestSceneRankedPlayStageOverlay.cs Adds a multiplier slider to the stage overlay visual test.
osu.Game.Tests/Visual/RankedPlay/TestScenePlayerCardHand.cs Adds a test covering removal while dragging.
Comments suppressed due to low confidence (1)

osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs:663

  • stopWaitingLoopPlayback() disposes waitingLoopChannel but never clears the field. Because stopWaitingLoopPlayback() is called from multiple places (state transitions, start, Dispose), this can lead to repeated Stop/Dispose calls on the same channel instance. Set waitingLoopChannel = null after disposing (and consider resetting waitingLoop volume state) so subsequent calls are idempotent and safe.
        private void stopWaitingLoopPlayback()
        {
            waitingLoopChannel?.Stop();
            waitingLoopChannel?.Dispose();
        }

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

Comment on lines +570 to +572
sampleContainer.Volume.Value = 0;
playerScoreTickChannel?.Stop();
opponentScoreTickChannel?.Stop();
Comment on lines 59 to 62
sentrySession = SentrySdk.Init(options =>
{
options.Dsn = "https://ad9f78529cef40ac874afb95a9aca04e@sentry.ppy.sh/2";
options.Dsn = "https://localhost";
options.AutoSessionTracking = true;
Comment on lines 643 to 657
private void startWaitingLoopPlayback()
{
stopWaitingLoopPlayback();

waitingLoopChannel = waitingLoopSample?.GetChannel();
waitingLoopChannel = waitingLoop.GetChannel();
if (waitingLoopChannel == null)
return;

waitingLoopChannel.Looping = true;
waitingLoopChannel?.Play();

waitingLoop.VolumeTo(1)
.Delay(2000)
.VolumeTo(0, 12000);
}
Comment on lines +525 to 527
if (Precision.DefinitelyBigger(Parent!.ScreenSpaceDrawQuad.Width, 0))
Width = Parent.DrawWidth / Parent.ScreenSpaceDrawQuad.Width;
}
base.Update();
Height = Parent!.DrawHeight / Parent.ScreenSpaceDrawQuad.Height;
if (Precision.DefinitelyBigger(Parent!.ScreenSpaceDrawQuad.Height, 0))
Height = Parent!.DrawHeight / Parent.ScreenSpaceDrawQuad.Height;
@coderabbitai coderabbitai Bot mentioned this pull request Apr 23, 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.

7 participants