Fix failing tests due to missing DI pieces

This commit is contained in:
Dean Herbert 2024-06-12 11:23:56 +08:00
parent e67d73be7d
commit 2a8bd8d968
No known key found for this signature in database
1 changed files with 7 additions and 4 deletions

View File

@ -26,10 +26,10 @@ public partial class ManiaDifficultySection : SetupSection
private LabelledSliderBar<double> tickRateSlider { get; set; } = null!;
[Resolved]
private Editor editor { get; set; } = null!;
private Editor? editor { get; set; }
[Resolved]
private IEditorChangeHandler changeHandler { get; set; } = null!;
private IEditorChangeHandler? changeHandler { get; set; }
[BackgroundDependencyLoader]
private void load()
@ -116,16 +116,19 @@ private void updateKeyCount(ValueChangedEvent<float> keyCount)
{
if (updatingKeyCount) return;
updateValues();
if (editor == null) return;
updatingKeyCount = true;
updateValues();
editor.Reload().ContinueWith(t =>
{
if (!t.GetResultSafely())
{
Schedule(() =>
{
changeHandler.RestoreState(-1);
changeHandler!.RestoreState(-1);
Beatmap.Difficulty.CircleSize = keyCountSlider.Current.Value = keyCount.OldValue;
updatingKeyCount = false;
});