Merge pull request #11031 from peppy/editor-fix-beat-snapping-new-beatmap

Fix editor beat snapping not working correctly when starting with a new beatmap
This commit is contained in:
Dan Balasescu 2020-12-02 15:17:09 +09:00 committed by GitHub
commit 297283491a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -106,6 +106,12 @@ protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnl
[BackgroundDependencyLoader]
private void load(OsuColour colours, GameHost host, OsuConfigManager config)
{
if (Beatmap.Value is DummyWorkingBeatmap)
{
isNewBeatmap = true;
Beatmap.Value = beatmapManager.CreateNew(Ruleset.Value, api.LocalUser.Value);
}
beatDivisor.Value = Beatmap.Value.BeatmapInfo.BeatDivisor;
beatDivisor.BindValueChanged(divisor => Beatmap.Value.BeatmapInfo.BeatDivisor = divisor.NewValue);
@ -122,12 +128,6 @@ private void load(OsuColour colours, GameHost host, OsuConfigManager config)
// todo: remove caching of this and consume via editorBeatmap?
dependencies.Cache(beatDivisor);
if (Beatmap.Value is DummyWorkingBeatmap)
{
isNewBeatmap = true;
Beatmap.Value = beatmapManager.CreateNew(Ruleset.Value, api.LocalUser.Value);
}
try
{
playableBeatmap = Beatmap.Value.GetPlayableBeatmap(Beatmap.Value.BeatmapInfo.Ruleset);