1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 06:03:08 +08:00

Change type from BindableBool to IBindable<bool>

This commit is contained in:
BlauFx 2022-08-08 13:38:52 +02:00
parent cd68134565
commit fac2596eee
No known key found for this signature in database
GPG Key ID: BB73374479D2AA97

View File

@ -41,7 +41,7 @@ namespace osu.Game.Screens.Play
private bool isClickable;
public BindableBool IsSkippable = new BindableBool()!;
public IBindable<bool> IsSkippable = new Bindable<bool>();
[Resolved]
private GameplayClock gameplayClock { get; set; }
@ -92,6 +92,8 @@ namespace osu.Game.Screens.Play
}
}
};
IsSkippable.BindTo(button.Enabled);
}
private const double fade_time = 300;
@ -137,7 +139,6 @@ namespace osu.Game.Screens.Play
remainingTimeBox.Width = (float)Interpolation.Lerp(remainingTimeBox.Width, progress, Math.Clamp(Time.Elapsed / 40, 0, 1));
isClickable = progress > 0;
IsSkippable.Value = isClickable;
button.Enabled.Value = isClickable;
buttonContainer.State.Value = isClickable ? Visibility.Visible : Visibility.Hidden;
}