1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 06:42:54 +08:00

Restore ruleset using current playlist item on resuming room sub screen

Ensures that the ruleset selected at the multiplayer song selection
screen does not overwrite the current playlist item's ruleset.
This commit is contained in:
Bartłomiej Dach 2022-01-08 14:55:40 +01:00
parent 446962446e
commit c5ac996e3f
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

View File

@ -300,6 +300,7 @@ namespace osu.Game.Screens.OnlinePlay.Match
updateWorkingBeatmap();
beginHandlingTrack();
Scheduler.AddOnce(UpdateMods);
Scheduler.AddOnce(updateRuleset);
}
public override bool OnExiting(IScreen next)
@ -353,8 +354,7 @@ namespace osu.Game.Screens.OnlinePlay.Match
.ToList();
UpdateMods();
Ruleset.Value = rulesets.GetRuleset(selected.RulesetID);
updateRuleset();
if (!selected.AllowedMods.Any())
{
@ -387,6 +387,14 @@ namespace osu.Game.Screens.OnlinePlay.Match
Mods.Value = UserMods.Value.Concat(SelectedItem.Value.RequiredMods).ToList();
}
private void updateRuleset()
{
if (SelectedItem.Value == null || !this.IsCurrentScreen())
return;
Ruleset.Value = rulesets.GetRuleset(SelectedItem.Value.RulesetID);
}
private void beginHandlingTrack()
{
Beatmap.BindValueChanged(applyLoopingToTrack, true);