Use new bind method

This commit is contained in:
Dean Herbert 2018-06-07 16:46:54 +09:00
parent e6158bc348
commit 475fb06559
5 changed files with 7 additions and 15 deletions

View File

@ -237,11 +237,8 @@ namespace osu.Game.Overlays
protected override void LoadComplete()
{
beatmap.ValueChanged += beatmapChanged;
beatmap.DisabledChanged += beatmapDisabledChanged;
beatmapChanged(beatmap.Value);
beatmap.BindValueChanged(beatmapChanged, true);
beatmap.BindDisabledChanged(beatmapDisabledChanged, true);
base.LoadComplete();
}

View File

@ -47,9 +47,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
private void load(IBindableBeatmap beatmap)
{
this.beatmap.BindTo(beatmap);
beatmap.ValueChanged += beatmapChanged;
beatmapChanged(beatmap.Value);
this.beatmap.BindValueChanged(beatmapChanged, true);
}
private void beatmapChanged(WorkingBeatmap beatmap) => waveform.Beatmap = beatmap;

View File

@ -207,10 +207,8 @@ namespace osu.Game.Screens.Select
Carousel.BeatmapSets = this.beatmaps.GetAllUsableBeatmapSetsEnumerable();
Beatmap.DisabledChanged += disabled => Carousel.AllowSelection = !disabled;
Beatmap.ValueChanged += workingBeatmapChanged;
workingBeatmapChanged(Beatmap.Value);
Beatmap.BindDisabledChanged(disabled => Carousel.AllowSelection = !disabled, true);
Beatmap.BindValueChanged(workingBeatmapChanged);
}
public void Edit(BeatmapInfo beatmap)

View File

@ -32,8 +32,7 @@ namespace osu.Game.Tests.Visual
Dependencies.CacheAs<IFrameBasedClock>(Clock);
Dependencies.CacheAs<IAdjustableClock>(Clock);
Beatmap.ValueChanged += beatmapChanged;
beatmapChanged(Beatmap.Value);
Beatmap.BindValueChanged(beatmapChanged, true);
}
private void beatmapChanged(WorkingBeatmap working)

View File

@ -18,7 +18,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="ppy.osu.Framework" Version="2018.606.0" />
<PackageReference Include="ppy.osu.Framework" Version="2018.607.0" />
<PackageReference Include="SharpCompress" Version="0.18.1" />
<PackageReference Include="NUnit" Version="3.10.1" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.4.0" />