1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 14:17:26 +08:00
osu-lazer/osu.Game/Overlays/SkinEditor
Bartłomiej Dach f239d03d75
Forcibly change ruleset to correct one before entering gameplay from main menu
Closes #25663 (again).

As it turns out, in some scenarios it can be the case that the current
game-global `Beatmap` is not valid for the current game-global
`Ruleset`. The validity of one and the other in conjunction is only
really validated by the song select screen; elsewhere there is no
guarantee that the global beatmap is playable using the global ruleset.

However, this only comes up in very specific circumstances, namely one:
when trying to autoplay a catch beatmap with osu! ruleset globally
active via the skin editor flow.

`Player` is responsible for retrieving the beatmap to be played. It does
so by invoking the appropriate beatmap converter and asking it if the
beatmap can be converted:

	6d64538d7a/osu.Game/Beatmaps/WorkingBeatmap.cs (L262-L266)

If the code above throws, `Player` actually silently covers for this, by
trying the beatmap's default ruleset instead:

	6d64538d7a/osu.Game/Screens/Play/Player.cs (L529-L536)

However, for the pairing of osu! ruleset and catch beatmap, this fails,
as `OsuBeatmapConverter`'s condition necessary for permitting conversion
is that the objects have a defined position:

	6d64538d7a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs (L25)

which they will do, due to the fact that all catch beatmaps are really
just osu! beatmaps but with conversion steps applied, and thus `Player`
succeeds to load the catch beatmap in osu! ruleset.

In the skin editor scenario, this would lead to the secondary failure
of the skin editor trying to apply `CatchModAutoplay` on top of all
of that, which would fail at the hard-cast of the beatmap
to `CatchBeatmap`.
2023-12-06 10:35:41 +01:00
..
NonSkinnableScreenPlaceholder.cs Move NonSkinnableScreenPlaceholder to outer scope 2023-03-04 13:22:43 +01:00
SkinBlueprint.cs Bypass Parent nullability checks for now 2023-10-17 17:48:45 +09:00
SkinBlueprintContainer.cs Fix double-click handling when cyclic selection is enabled 2023-07-19 17:21:20 +09:00
SkinComponentToolbox.cs Fix skin component toolbox not working correctly for ruleset matching 2023-07-28 15:50:44 +09:00
SkinEditor.cs Fix skin editor crashing when pasting with nothing in clipboard 2023-11-23 09:55:27 +09:00
SkinEditorChangeHandler.cs Trim comments 2023-05-03 19:22:52 +02:00
SkinEditorOverlay.cs Forcibly change ruleset to correct one before entering gameplay from main menu 2023-12-06 10:35:41 +01:00
SkinEditorSceneLibrary.cs Make skin editor overlay dependency nullable to fix tests 2023-11-27 12:09:13 +09:00
SkinSelectionHandler.cs Allow context menus to have visible spacers 2023-11-21 14:24:10 +09:00
SkinSelectionRotationHandler.cs Make SelectionRotationHandler a Component 2023-07-30 20:18:33 +02:00
SkinSettingsToolbox.cs Handle changes to SettingSource skin element settings 2023-02-06 14:42:59 +09:00