Skip to content

Switch multiplayer to use song select v2#36747

Open
peppy wants to merge 7 commits intoppy:masterfrom
peppy:multiplayer-select-update
Open

Switch multiplayer to use song select v2#36747
peppy wants to merge 7 commits intoppy:masterfrom
peppy:multiplayer-select-update

Conversation

@peppy
Copy link
Member

@peppy peppy commented Feb 24, 2026

Tests pass and seems to work. Need to do a bit more self-testing for higher confidence, but in theory..

Closes #34035.

Free mod button doesn't have this behaviour anymore. Should it?
Probably. Was it forgotten? Maybe.

But with the default being freestyle now, maybe it's also less
important. Can still be accessed with one more click
@peppy peppy force-pushed the multiplayer-select-update branch from f1c0279 to d03a6d3 Compare February 25, 2026 04:39
beginLooping();
}

Beatmap.BindValueChanged(updateVariousState, true);
Copy link
Member Author

Choose a reason for hiding this comment

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

Moving this from LoadComplete was triggered by attempting to resolve the fact that ApplyToBackground in updateBackgroundDim was being called before the background was set previously.

I took one step further because I found that every one of the state update calls was already reapplied in onArrivingAtScreen, so it made most sense to move everything to happen at one place.

@peppy peppy moved this to Pending Review in osu! team task tracker Feb 25, 2026
Comment on lines 137 to 153
Mods.BindValueChanged(_ => updateValidMods());
Ruleset.BindValueChanged(onRulesetChanged);
freestyle.BindValueChanged(onFreestyleChanged);

freeModSelectOverlayRegistration = OverlayManager?.RegisterBlockingOverlay(freeModSelect);

updateFooterButtons();
updateValidMods();

operationInProgress.BindTo(operationTracker.InProgress);
operationInProgress.BindValueChanged(operation =>
{
if (operation.NewValue)
loadingLayer.Show();
else
loadingLayer.Hide();
}, true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why was this chunk of code reordered?

The reason I ask is that this reordering breaks the free mod selection overlay. If a pre-existing playlist item has free mods selected, they will not appear as selected when re-entering the screen.

Screen.Recording.2026-02-25.at.11.28.53.mov

As far as I can tell reordering this chunk causes this because moving the change callbacks to here makes it so

  1. FreeMods.Value = initialItem.AllowedMods.Select(m => m.ToMod(rulesetInstance)).ToArray();
    executes and assigns the correct mods.
  2. freestyle.Value = initialItem.Freestyle;
    executes. Because of the logic reordering, this fires the value change callback for freestyle.
  3. In the aforementioned value change callback,
    // When disabling freestyle, enable freemods by default.
    FreeMods.Value = freeModSelect.AllAvailableMods.Where(state => state.ValidForSelection.Value).Select(state => state.Mod).ToArray();
    executes. However at this point freeModSelect is in LoadState.Ready rather than Loaded, meaning that AllAvailableMods are empty, meaning that all of the mods are discarded.

Copy link
Member Author

Choose a reason for hiding this comment

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

I will... check on this with a fresh brain because that all sounds like things which need to be very well documented.

A quick answer would be that I either reordered for style purposes, or because tests were failing with the old ordering (although I think I later resolved such failures in a better way).

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the explanation here. I've reverted the ordering changes and added test coverage in 93d12d5.

@bdach
Copy link
Collaborator

bdach commented Feb 25, 2026

Side note, if you enable all free mods, then select some required mods and deselect them, some free mods get deselected as a byproduct:

Screen.Recording.2026-02-25.at.11.51.11.mov

But the old song select did this too, so it's probably whatever.

@peppy
Copy link
Member Author

peppy commented Feb 27, 2026

Investigating failing test (of course it didn't fail locally)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Pending Review

Development

Successfully merging this pull request may close these issues.

Update playlist and multiplayer to use Song Select V2

2 participants