1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 18:42:56 +08:00

Add the ability to override the user setting for hold-to-confirm containers

Sometimes the user is not right.
This commit is contained in:
Dean Herbert 2022-03-21 16:07:26 +09:00
parent d811a70f4b
commit 36868dbdb4

View File

@ -28,6 +28,14 @@ namespace osu.Game.Graphics.Containers
/// </summary>
protected virtual bool AllowMultipleFires => false;
/// <summary>
/// Specify a custom activation delay, overriding the game-wide user setting.
/// </summary>
/// <remarks>
/// This should be used in special cases where we want to be extra sure the user knows what they are doing. An example is when changes would be lost.
/// </remarks>
protected virtual double? HoldActivationDelay => null;
public Bindable<double> Progress = new BindableDouble();
private Bindable<double> holdActivationDelay;
@ -35,7 +43,9 @@ namespace osu.Game.Graphics.Containers
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
holdActivationDelay = config.GetBindable<double>(OsuSetting.UIHoldActivationDelay);
holdActivationDelay = HoldActivationDelay != null
? new Bindable<double>(HoldActivationDelay.Value)
: config.GetBindable<double>(OsuSetting.UIHoldActivationDelay);
}
protected void BeginConfirm()