1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 20:25:39 +08:00

Change interpreted difficulty from bindable to regular value

There's no reason for why checks would need this to be bindable. A 1-directional binding is more appropriate.
This commit is contained in:
Naxess 2021-05-13 09:00:30 +02:00
parent 4eeeaf6a1a
commit b37cb3bdbe
2 changed files with 7 additions and 9 deletions

View File

@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Bindables;
using osu.Game.Beatmaps;
namespace osu.Game.Rulesets.Edit
@ -20,12 +19,12 @@ namespace osu.Game.Rulesets.Edit
/// <summary>
/// The difficulty level which the current beatmap is considered to be.
/// </summary>
public readonly Bindable<DifficultyRating> InterpretedDifficulty;
public DifficultyRating InterpretedDifficulty;
public BeatmapVerifierContext(IWorkingBeatmap workingBeatmap, DifficultyRating difficultyRating = DifficultyRating.ExpertPlus)
{
WorkingBeatmap = workingBeatmap;
InterpretedDifficulty = new Bindable<DifficultyRating>(difficultyRating);
InterpretedDifficulty = difficultyRating;
}
}
}

View File

@ -35,8 +35,6 @@ namespace osu.Game.Screens.Edit.Verify
[Resolved]
private VerifyScreen verify { get; set; }
private Bindable<DifficultyRating> interpretedDifficulty;
private IBeatmapVerifier rulesetVerifier;
private BeatmapVerifier generalVerifier;
private BeatmapVerifierContext context;
@ -47,10 +45,11 @@ namespace osu.Game.Screens.Edit.Verify
generalVerifier = new BeatmapVerifier();
rulesetVerifier = beatmap.BeatmapInfo.Ruleset?.CreateInstance()?.CreateBeatmapVerifier();
interpretedDifficulty = verify.InterpretedDifficulty.GetBoundCopy();
context = new BeatmapVerifierContext(workingBeatmap.Value);
context.InterpretedDifficulty.BindTo(interpretedDifficulty);
context = new BeatmapVerifierContext(workingBeatmap.Value, verify.InterpretedDifficulty.Value);
verify.InterpretedDifficulty.BindValueChanged(change =>
{
context.InterpretedDifficulty = change.NewValue;
});
RelativeSizeAxes = Axes.Both;