mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:28:00 +08:00
Always use beatmap ruleset in editor gameplay test mode
Fixes cases where opening a convertible beatmap (so any osu! beatmap) with the game-global ruleset being set to anything but osu! would result in opening the editor gameplay test mode with the game-global ruleset rather than the beatmap's.
This commit is contained in:
parent
def87ed782
commit
93b3ede2a0
@ -65,6 +65,7 @@ namespace osu.Game.Screens.Edit
|
||||
base.LoadComplete();
|
||||
|
||||
// will be restored via lease, see `DisallowExternalBeatmapRulesetChanges`.
|
||||
Ruleset.Value = Beatmap.Value.BeatmapInfo.Ruleset;
|
||||
Mods.Value = Array.Empty<Mod>();
|
||||
}
|
||||
|
||||
|
@ -786,7 +786,17 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
Ruleset.ValueChanged += r => updateSelectedRuleset(r.NewValue);
|
||||
|
||||
decoupledRuleset.ValueChanged += r => Ruleset.Value = r.NewValue;
|
||||
decoupledRuleset.ValueChanged += r =>
|
||||
{
|
||||
bool wasDisabled = Ruleset.Disabled;
|
||||
|
||||
// a sub-screen may have taken a lease on this decoupled ruleset bindable,
|
||||
// which would indirectly propagate to the game-global bindable via the `DisabledChanged` callback below.
|
||||
// to make sure changes sync without crashes, lift the disable for a short while to sync, and then restore the old value.
|
||||
Ruleset.Disabled = false;
|
||||
Ruleset.Value = r.NewValue;
|
||||
Ruleset.Disabled = wasDisabled;
|
||||
};
|
||||
decoupledRuleset.DisabledChanged += r => Ruleset.Disabled = r;
|
||||
|
||||
Beatmap.BindValueChanged(workingBeatmapChanged);
|
||||
|
Loading…
Reference in New Issue
Block a user