Revert Availability to private

This commit is contained in:
Dean Herbert
2022-03-24 17:14:51 +09:00
parent 528ffea38d
commit e3f8bc0588

View File

@ -14,18 +14,20 @@ namespace osu.Game.Screens.OnlinePlay.Components
public abstract class ReadyButton : TriangleButton, IHasTooltip public abstract class ReadyButton : TriangleButton, IHasTooltip
{ {
public new readonly BindableBool Enabled = new BindableBool(); public new readonly BindableBool Enabled = new BindableBool();
protected readonly IBindable<BeatmapAvailability> Availability = new Bindable<BeatmapAvailability>();
private readonly IBindable<BeatmapAvailability> availability = new Bindable<BeatmapAvailability>();
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OnlinePlayBeatmapAvailabilityTracker beatmapTracker) private void load(OnlinePlayBeatmapAvailabilityTracker beatmapTracker)
{ {
Availability.BindTo(beatmapTracker.Availability); availability.BindTo(beatmapTracker.Availability);
Availability.BindValueChanged(_ => updateState());
availability.BindValueChanged(_ => updateState());
Enabled.BindValueChanged(_ => updateState(), true); Enabled.BindValueChanged(_ => updateState(), true);
} }
private void updateState() => private void updateState() =>
base.Enabled.Value = Availability.Value.State == DownloadState.LocallyAvailable && Enabled.Value; base.Enabled.Value = availability.Value.State == DownloadState.LocallyAvailable && Enabled.Value;
public virtual LocalisableString TooltipText public virtual LocalisableString TooltipText
{ {
@ -34,7 +36,7 @@ namespace osu.Game.Screens.OnlinePlay.Components
if (Enabled.Value) if (Enabled.Value)
return string.Empty; return string.Empty;
if (Availability.Value.State != DownloadState.LocallyAvailable) if (availability.Value.State != DownloadState.LocallyAvailable)
return "Beatmap not downloaded"; return "Beatmap not downloaded";
return string.Empty; return string.Empty;